@ones-editor/editor 0.0.3-beta.4 → 0.0.3-beta.41
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/block-locker/src/i18n/en-US.d.ts +8 -0
- package/@ones-editor/block-locker/src/i18n/index.d.ts +1 -0
- package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +8 -0
- package/@ones-editor/block-locker/src/index.d.ts +2 -0
- package/@ones-editor/block-menu/src/block-menu/index.d.ts +1 -0
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +4 -3
- package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +3 -2
- package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +2 -1
- package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +2 -0
- package/@ones-editor/comments/src/block-hook/index.d.ts +3 -1
- package/@ones-editor/comments/src/comment-editor/index.d.ts +3 -5
- package/@ones-editor/comments/src/comment-input-handler/index.d.ts +2 -10
- package/@ones-editor/comments/src/comment-input-handler/input-handler.d.ts +11 -0
- package/@ones-editor/comments/src/comment-input-handler/quick-reply-input-handler.d.ts +7 -0
- package/@ones-editor/comments/src/comment-item/comment-item.d.ts +2 -0
- package/@ones-editor/comments/src/comment-item/index.d.ts +1 -0
- package/@ones-editor/comments/src/comment-item/mobile-comment-item/index.d.ts +1 -0
- package/@ones-editor/comments/src/comment-item/mobile-comment-item/mobile-comment-item.d.ts +18 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +11 -7
- package/@ones-editor/comments/src/comments-button/index.d.ts +3 -1
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +2 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -9
- package/@ones-editor/comments/src/comments-list/group-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +0 -1
- package/@ones-editor/comments/src/comments-list/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -5
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/children-list.d.ts +17 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/group-item.d.ts +30 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/group-list.d.ts +29 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +28 -0
- package/@ones-editor/comments/src/constant/index.d.ts +1 -1
- package/@ones-editor/comments/src/index.d.ts +1 -1
- package/@ones-editor/comments/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/comments/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/comments/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +3 -1
- package/@ones-editor/comments/src/types.d.ts +11 -17
- package/@ones-editor/core/src/core/converter/block-to-doc.d.ts +1 -1
- package/@ones-editor/core/src/core/converter/selected-block-to-doc.d.ts +3 -1
- package/@ones-editor/core/src/core/doc/doc.d.ts +6 -2
- package/@ones-editor/core/src/core/doc/rich-text/insert-text.d.ts +2 -1
- package/@ones-editor/core/src/core/editor/actions/auto-insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/actions/delete-block-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +3 -3
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +4 -3
- package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/editor-selection.d.ts +2 -2
- package/@ones-editor/core/src/core/types.d.ts +28 -12
- package/@ones-editor/core/src/i18n/i18n.d.ts +36 -0
- package/@ones-editor/core/src/local-doc/index.d.ts +6 -2
- package/@ones-editor/core/src/utils/file.d.ts +3 -0
- package/@ones-editor/core/src/utils/logger/index.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/helper/default-style.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-target.d.ts +1 -1
- package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +8 -0
- package/@ones-editor/e2e/cypress/support/commands.d.ts +25 -0
- package/@ones-editor/e2e/cypress/support/e2e.d.ts +1 -0
- package/@ones-editor/e2e/cypress.config.d.ts +3 -0
- package/@ones-editor/e2e/package.json +13 -0
- package/@ones-editor/e2e/src/block-menu/case.d.ts +17 -0
- package/@ones-editor/e2e/src/block-menu/menu.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/data.d.ts +131 -0
- package/@ones-editor/e2e/src/input-handlers/case.d.ts +10 -0
- package/@ones-editor/e2e/src/input-handlers/shortcut.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/list-block/case.d.ts +8 -0
- package/@ones-editor/e2e/src/list-block/list.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/toc/case.d.ts +5 -0
- package/@ones-editor/e2e/src/toc/toc.cy.d.ts +1 -0
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +1 -0
- package/@ones-editor/file/package.json +8 -0
- package/@ones-editor/file/src/file-box/index.d.ts +4 -0
- package/@ones-editor/file/src/file-embed/card/file-icon.d.ts +1 -0
- package/@ones-editor/file/src/file-embed/card/index.d.ts +6 -0
- package/@ones-editor/file/src/file-embed/download-file.d.ts +2 -0
- package/@ones-editor/file/src/file-embed/index.d.ts +4 -0
- package/@ones-editor/file/src/index.d.ts +3 -0
- package/@ones-editor/file/src/types.d.ts +22 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +0 -1
- package/@ones-editor/heading-collapse/src/doc-event/index.d.ts +1 -1
- package/@ones-editor/heading-collapse/src/heading-collapse-button/drop-handler.d.ts +1 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +5 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -1
- package/@ones-editor/image-embed/src/empty-image-converter.d.ts +5 -0
- package/@ones-editor/image-embed/src/index.d.ts +2 -1
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/table-converter.d.ts +2 -0
- package/@ones-editor/list-block/src/drop/index.d.ts +1 -1
- package/@ones-editor/list-block/src/lang/en-us.d.ts +3 -0
- package/@ones-editor/list-block/src/lang/zh-cn.d.ts +3 -0
- package/@ones-editor/mathjax/package.json +3 -0
- package/@ones-editor/mathjax/src/index.d.ts +2 -1
- package/@ones-editor/mathjax/src/mathjax-box/convert-mathjax.d.ts +5 -0
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +2 -2
- package/@ones-editor/mention/src/block-mention.d.ts +10 -0
- package/@ones-editor/mention/src/dom/mention-button.d.ts +2 -0
- package/@ones-editor/mention/src/index.d.ts +2 -1
- package/@ones-editor/scroll-container/src/index.d.ts +6 -18
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +12 -0
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +6 -1
- package/@ones-editor/sharedb-doc/src/index.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/types.d.ts +3 -2
- package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-resize/resize-gripper.d.ts +1 -1
- package/@ones-editor/templates/package.json +9 -0
- package/@ones-editor/templates/src/index.d.ts +4 -0
- package/@ones-editor/templates/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/templates/src/locale/index.d.ts +1 -0
- package/@ones-editor/templates/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/templates/src/templates/select-template.d.ts +7 -0
- package/@ones-editor/templates/src/templates/types.d.ts +14 -0
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +22 -0
- package/@ones-editor/toc/src/heading-scroll/utils.d.ts +7 -0
- package/@ones-editor/toc/src/index.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +3 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +2 -4
- package/@ones-editor/ui/src/quick-menu/index.d.ts +1 -6
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -2
- package/@ones-editor/ui/src/quick-menu/types.d.ts +24 -1
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +0 -1
- package/@ones-editor/ui/src/tooltips/index.d.ts +4 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +1 -0
- package/@ones-editor/ui-base/src/auto-suggest/should-focus-to-editor.d.ts +2 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +5 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +2 -1
- package/@ones-editor/ui-base/src/dialog/types.d.ts +4 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
- package/@ones-editor/versions/src/types.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/index.d.ts +3 -1
- package/dist/comments/create-comment-editor.d.ts +4 -10
- package/dist/comments/local-doc-comments-provider.d.ts +18 -0
- package/dist/comments/{comments-provider.d.ts → sharedb-doc-comments-provider.d.ts} +4 -7
- package/dist/index.d.ts +12 -3
- package/dist/index.js +338 -219
- package/dist/lang/en-us.d.ts +13 -0
- package/dist/lang/index.d.ts +1 -0
- package/dist/lang/zh-cn.d.ts +13 -0
- package/dist/types.d.ts +23 -4
- package/package.json +5 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
import OnesEditorToolbar from './toolbar/toolbar-handler';
|
|
3
|
-
import OnesEditorQuickMenu, { getAllQuickMenuItems } from './quick-menu';
|
|
3
|
+
import OnesEditorQuickMenu, { getAllQuickMenuItems, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider } from './quick-menu';
|
|
4
4
|
import { getHeadingMenuOptions } from './quick-menu/basic-menu-items';
|
|
5
5
|
import OnesEditorTooltip from './tooltips';
|
|
6
6
|
import TextStyleShortcuts from './shortcuts';
|
|
@@ -8,5 +8,7 @@ import { editLink } from './link-popup';
|
|
|
8
8
|
import { getToolbar } from './toolbar/helper';
|
|
9
9
|
import './locale';
|
|
10
10
|
import type { QuickMenuItem } from './quick-menu';
|
|
11
|
+
export type { QuickMenuCommandProvider, QuickMenuCommandBetween, QuickMenuCommandInline };
|
|
11
12
|
export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions };
|
|
12
13
|
export { createTextButton } from './text-button';
|
|
14
|
+
export { mergeCommands } from './toolbar/merge-commands';
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { BlockOptions, CommandItem, OnesEditor, InsertEmptyBlockOptions } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function addQuickMenuItemFields(item: CommandItem, options: BlockOptions): void;
|
|
3
|
-
declare function handleInsertEmptyBlock(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<null>;
|
|
4
3
|
export declare function getHeadingMenuOptions(start?: number): BlockOptions;
|
|
5
4
|
export declare function getCompleteHeadingMenuOptions(): {
|
|
6
5
|
name: string;
|
|
7
6
|
insertBlockCommandItems: CommandItem[];
|
|
8
|
-
handleInsertEmptyBlock:
|
|
7
|
+
handleInsertEmptyBlock: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<null>;
|
|
9
8
|
};
|
|
10
9
|
export declare function getBasicMenuItems(): {
|
|
11
10
|
name: string;
|
|
12
11
|
insertBlockCommandItems: CommandItem[];
|
|
13
|
-
handleInsertEmptyBlock:
|
|
12
|
+
handleInsertEmptyBlock: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<null>;
|
|
14
13
|
};
|
|
15
|
-
export {};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { OnesEditor, CommandItem } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorAutoSuggest } from '../../../../@ones-editor/ui-base';
|
|
3
|
-
import { QuickMenuItem } from './types';
|
|
3
|
+
import { QuickMenuItem, QuickMenuOptions } from './types';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export * from './quick-menu-items';
|
|
6
|
-
export interface QuickMenuOptions {
|
|
7
|
-
id?: string;
|
|
8
|
-
trigger: string[];
|
|
9
|
-
}
|
|
10
6
|
export default class OnesEditorQuickMenu {
|
|
11
7
|
protected editor: OnesEditor;
|
|
12
8
|
private options;
|
|
@@ -19,7 +15,6 @@ export default class OnesEditorQuickMenu {
|
|
|
19
15
|
queryItems: (suggest: unknown, text: string) => Promise<QuickMenuItem[]>;
|
|
20
16
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
21
17
|
onClickItem: (suggest: unknown, item: CommandItem) => void;
|
|
22
|
-
private renderMenuItem;
|
|
23
18
|
private initMenuItems;
|
|
24
19
|
private refreshMenuItems;
|
|
25
20
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { OnesEditor
|
|
2
|
-
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { AutoSuggestAnchor } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
import { QuickMenuItem } from './types';
|
|
4
|
+
export declare function insertEmptyBlock(editor: OnesEditor, quickItem: QuickMenuItem, anchor: AutoSuggestAnchor): void;
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import { CommandItem, BlockOptions } from '../../../../@ones-editor/core';
|
|
1
|
+
import { CommandItem, BlockOptions, OnesEditor, BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
export interface QuickMenuItem extends CommandItem {
|
|
3
3
|
itemType: 'insert-block';
|
|
4
4
|
blockOptions?: BlockOptions;
|
|
5
|
+
commandProvider?: QuickMenuCommandProvider;
|
|
6
|
+
}
|
|
7
|
+
export interface QuickMenuCommandParams {
|
|
8
|
+
from: 'block-menu' | 'quick-menu';
|
|
9
|
+
}
|
|
10
|
+
export interface QuickMenuCommandInline extends QuickMenuCommandParams {
|
|
11
|
+
from: 'quick-menu';
|
|
12
|
+
blockId: string;
|
|
13
|
+
offset: number;
|
|
14
|
+
}
|
|
15
|
+
export interface QuickMenuCommandBetween extends QuickMenuCommandParams {
|
|
16
|
+
from: 'block-menu';
|
|
17
|
+
containerId: string;
|
|
18
|
+
blockIndex: number;
|
|
19
|
+
}
|
|
20
|
+
export interface QuickMenuCommandProvider {
|
|
21
|
+
getCommands: (editor: OnesEditor) => CommandItem[];
|
|
22
|
+
executeCommand: (editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween) => Promise<BlockElement | null>;
|
|
23
|
+
}
|
|
24
|
+
export interface QuickMenuOptions {
|
|
25
|
+
id?: string;
|
|
26
|
+
trigger: string[];
|
|
27
|
+
commandProviders?: QuickMenuCommandProvider[];
|
|
5
28
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { BlockElement, CommandItem, OnesEditor, OnesEditorHoveringBlockFilter } from '../../../../@ones-editor/core';
|
|
3
2
|
import { AbstractCommandBar } from '../../../../@ones-editor/ui-base';
|
|
4
3
|
import { OnesEditorToolbarBase } from './types';
|
|
@@ -7,11 +7,15 @@ export default class OnesEditorTooltip {
|
|
|
7
7
|
currentInstance: Instance | null;
|
|
8
8
|
attributeName: string;
|
|
9
9
|
attributeDesc: string;
|
|
10
|
+
private observer;
|
|
11
|
+
private observerCallback;
|
|
10
12
|
constructor(editor: OnesEditor);
|
|
11
13
|
createContent: (reference: Element) => string | HTMLDivElement;
|
|
12
14
|
visible(): boolean | undefined;
|
|
13
15
|
hide(): void;
|
|
14
16
|
destroy(): void;
|
|
17
|
+
private createObserver;
|
|
18
|
+
private destroyObserver;
|
|
15
19
|
handleDocumentMouseDown: () => void;
|
|
16
20
|
handleDocumentMouseUp: () => void;
|
|
17
21
|
handleShown: (a: Instance) => void;
|
|
@@ -28,6 +28,7 @@ export default class AutoSuggestMenu {
|
|
|
28
28
|
destroy(): void;
|
|
29
29
|
handleSearchText(text: string): Promise<void>;
|
|
30
30
|
handleClick: (menu: AbstractCommandBar, item: CommandItem) => void;
|
|
31
|
+
handleClose: () => void;
|
|
31
32
|
handleKeydown: (event: KeyboardEvent) => void;
|
|
32
33
|
private highlightText;
|
|
33
34
|
}
|
|
@@ -13,6 +13,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
13
13
|
constructor(items: CommandItem[], closeable?: Closeable, options?: CommandBarOptions);
|
|
14
14
|
close(): void;
|
|
15
15
|
click(item: CommandItem, target: HTMLElement): void;
|
|
16
|
+
createPopperOptions(): Partial<import("@popperjs/core").Options>;
|
|
16
17
|
destroy(): void;
|
|
17
18
|
abstract readonly isVisible: boolean;
|
|
18
19
|
get isSubCommandBar(): boolean;
|
|
@@ -26,7 +27,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
26
27
|
private getPrevItemIndex;
|
|
27
28
|
private getNextItemIndex;
|
|
28
29
|
protected clearSelectedItem(): void;
|
|
29
|
-
|
|
30
|
+
selectItem(id: string): void;
|
|
30
31
|
private handleItemMouseEnter;
|
|
31
32
|
private handleItemMouseLeave;
|
|
32
33
|
protected handleItemClick: (event: MouseEvent) => void;
|
|
@@ -52,5 +52,10 @@ export interface CommandBarOptions {
|
|
|
52
52
|
autoClose?: boolean;
|
|
53
53
|
classes?: string[];
|
|
54
54
|
disablePageScroll?: boolean;
|
|
55
|
+
refuseOverflow?: boolean;
|
|
56
|
+
overflowBoundary?: Element;
|
|
55
57
|
}
|
|
56
58
|
export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable: Closeable, options?: CommandBarOptions) => AbstractManualCommandBar;
|
|
59
|
+
export type PopoverOptions = {
|
|
60
|
+
overflowBoundary?: Element;
|
|
61
|
+
};
|
|
@@ -5,6 +5,7 @@ import { CommandBarContentElement, CommandItemElement } from '../command-bar/typ
|
|
|
5
5
|
import 'tippy.js/themes/light.css';
|
|
6
6
|
export type ManualCloseDialogOptions = {
|
|
7
7
|
id?: string;
|
|
8
|
+
disablePageScroll?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export default class ManualCloseDialog extends ManualCommandBar {
|
|
10
11
|
constructor(content: HTMLElement, options?: ManualCloseDialogOptions);
|
|
@@ -18,7 +19,7 @@ export default class ManualCloseDialog extends ManualCommandBar {
|
|
|
18
19
|
};
|
|
19
20
|
getReferenceClientRect?: GetReferenceClientRect | null | undefined;
|
|
20
21
|
}): void;
|
|
21
|
-
get dialogContent(): HTMLElement;
|
|
22
|
+
get dialogContent(): HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
22
23
|
handleDocumentMouseDown: (event: MouseEvent) => void;
|
|
23
24
|
static getCommandItems(content: HTMLElement, options?: ManualCloseDialogOptions): CommandItem[];
|
|
24
25
|
}
|
|
@@ -83,4 +83,5 @@ import LockBlockIcon from './lock-block.svg?raw';
|
|
|
83
83
|
import UnLockBlockIcon from './unlocked-block.svg?raw';
|
|
84
84
|
import CollapseUpIcon from './collapse-up.svg?raw';
|
|
85
85
|
import CollapseDownIcon from './collapse-down.svg?raw';
|
|
86
|
-
|
|
86
|
+
import MentionIcon from './mention-icon.svg?raw';
|
|
87
|
+
export { CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, LineIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, WebIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, CollapseUpIcon, CollapseDownIcon, MentionIcon, };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { OnesEditorVersionsProvider, VersionDialogOptions } from '../types';
|
|
3
|
-
export declare function showVersionDialog(editor: OnesEditor, versionProvider: OnesEditorVersionsProvider, options: VersionDialogOptions):
|
|
3
|
+
export declare function showVersionDialog(editor: OnesEditor, versionProvider: OnesEditorVersionsProvider, options: VersionDialogOptions): {
|
|
4
|
+
setShowOps: (showOps: boolean) => void;
|
|
5
|
+
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LocalDoc, OnesEditor, OnesEditorUser } from '../../@ones-editor/core';
|
|
3
|
-
import { OnesEditorCommentsProvider, CreateCommentEditorOption } from '../../@ones-editor/comments';
|
|
4
|
-
import { CreateOnesEditorOptions } from '../types';
|
|
1
|
+
import { LocalDoc, OnesEditor, OnesEditorUser, OnesEditorDoc } from '../../@ones-editor/core';
|
|
5
2
|
export interface RemoteCaretsOptions {
|
|
6
3
|
onUserChanged?: (editor: OnesEditor, users: OnesEditorUser[]) => void;
|
|
7
4
|
}
|
|
8
5
|
interface EditorOptions {
|
|
9
6
|
root: HTMLElement;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
shareDBDoc: ShareDBDoc;
|
|
13
|
-
commentProvider: OnesEditorCommentsProvider;
|
|
14
|
-
createOptions: CreateCommentEditorOption;
|
|
7
|
+
childDoc: LocalDoc;
|
|
8
|
+
doc: OnesEditorDoc;
|
|
15
9
|
}
|
|
16
|
-
export declare function createCommentEditor({ root,
|
|
10
|
+
export declare function createCommentEditor({ root, childDoc, doc }: EditorOptions): OnesEditor;
|
|
17
11
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../@ones-editor/comments';
|
|
2
|
+
import { DocObject, LocalDoc, OnesEditor, OnesEditorComment, OnesEditorDoc } from '../../@ones-editor/core';
|
|
3
|
+
export default class LocalDocCommentsProvider implements OnesEditorCommentsProvider {
|
|
4
|
+
private editor;
|
|
5
|
+
private localDoc;
|
|
6
|
+
private listeners;
|
|
7
|
+
constructor(editor: OnesEditor, localDoc: OnesEditorDoc);
|
|
8
|
+
get doc(): DocObject;
|
|
9
|
+
getComments(): OnesEditorComment[];
|
|
10
|
+
getComment(commentId: string): OnesEditorComment;
|
|
11
|
+
getCommentDoc(commentId: string): DocObject;
|
|
12
|
+
addListener(callback: OnesEditorCommentsEvents): void;
|
|
13
|
+
removeListener(callback: OnesEditorCommentsEvents): void;
|
|
14
|
+
localCreateComment(comment: OnesEditorComment, doc: DocObject): void;
|
|
15
|
+
localDeleteComment(commentId: string): void;
|
|
16
|
+
localUpdateComment(comment: OnesEditorComment, doc: DocObject): void;
|
|
17
|
+
createCommentEditor(parent: HTMLElement, childDoc: LocalDoc): OnesEditor;
|
|
18
|
+
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../@ones-editor/comments';
|
|
2
2
|
import { DocObject, LocalDoc, OnesEditor, OnesEditorComment } from '../../@ones-editor/core';
|
|
3
|
-
import {
|
|
4
|
-
import { CreateOnesEditorOptions } from '../types';
|
|
3
|
+
import { ShareDBDocCallbacks } from '../../@ones-editor/sharedb-doc';
|
|
5
4
|
export default class ShareDBDocCommentsProvider implements OnesEditorCommentsProvider, ShareDBDocCallbacks {
|
|
6
5
|
private editor;
|
|
7
|
-
private rootEditorCreateOptions;
|
|
8
6
|
private listeners;
|
|
9
7
|
private doc;
|
|
10
|
-
constructor(editor: OnesEditor
|
|
11
|
-
getAuth(): AuthMessage;
|
|
8
|
+
constructor(editor: OnesEditor);
|
|
12
9
|
getComments(): OnesEditorComment[];
|
|
13
10
|
getComment(id: string): OnesEditorComment;
|
|
14
11
|
getCommentDoc(commentId: string): DocObject;
|
|
@@ -20,5 +17,5 @@ export default class ShareDBDocCommentsProvider implements OnesEditorCommentsPro
|
|
|
20
17
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
21
18
|
addListener(callback: OnesEditorCommentsEvents): void;
|
|
22
19
|
removeListener(callback: OnesEditorCommentsEvents): void;
|
|
23
|
-
createCommentEditor(parent: HTMLElement,
|
|
20
|
+
createCommentEditor(parent: HTMLElement, childDoc: LocalDoc): OnesEditor;
|
|
24
21
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { OnesEditor, DocObject } from '../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, DocObject, OnesEditorDoc } from '../@ones-editor/core';
|
|
2
2
|
import { VersionDialogOptions } from '../@ones-editor/versions';
|
|
3
3
|
import { CreateLocalEditorOptions, CreateOnesEditorOptions } from './types';
|
|
4
|
+
import './lang';
|
|
4
5
|
export * from '../@ones-editor/core';
|
|
5
6
|
export * from '../@ones-editor/sharedb-doc';
|
|
6
7
|
export * from '../@ones-editor/table-block';
|
|
7
8
|
export * from '../@ones-editor/code-block';
|
|
8
9
|
export * from '../@ones-editor/input-handlers';
|
|
9
10
|
export * from '../@ones-editor/ui';
|
|
11
|
+
export { Popup, ManualMenu, OnesEditorAutoSuggest } from '../@ones-editor/ui-base';
|
|
10
12
|
export * from '../@ones-editor/drawio-embed';
|
|
13
|
+
export * from '../@ones-editor/block-resizer';
|
|
14
|
+
export { editorAddComment } from '../@ones-editor/comments';
|
|
15
|
+
export { editorShowFindDialog } from '../@ones-editor/find-dialog';
|
|
16
|
+
export * from '../@ones-editor/toc';
|
|
17
|
+
export * from '../@ones-editor/embed-block-helper';
|
|
11
18
|
export * from './types';
|
|
12
19
|
export declare function createOnesEditor(root: HTMLElement, options: CreateOnesEditorOptions): Promise<OnesEditor>;
|
|
13
|
-
export declare function createLocalEditor(root: HTMLElement, docData: DocObject, options: CreateLocalEditorOptions): Promise<OnesEditor>;
|
|
14
|
-
export declare function showDocVersions(editor: OnesEditor, options: VersionDialogOptions):
|
|
20
|
+
export declare function createLocalEditor(root: HTMLElement, docData: DocObject | OnesEditorDoc, options: CreateLocalEditorOptions): Promise<OnesEditor>;
|
|
21
|
+
export declare function showDocVersions(editor: OnesEditor, options: VersionDialogOptions): {
|
|
22
|
+
setShowOps: (showOps: boolean) => void;
|
|
23
|
+
};
|