@ones-editor/editor 2.3.4 → 2.4.1
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/callout-block/src/callout-block/callout-block-content.d.ts +3 -2
- package/@ones-editor/callout-block/src/callout-block/callout-icon.d.ts +13 -0
- package/@ones-editor/callout-block/src/callout-block/helper.d.ts +4 -2
- package/@ones-editor/callout-block/src/locale/en-us.d.ts +3 -0
- package/@ones-editor/callout-block/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/callout-block/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +5 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +0 -1
- package/@ones-editor/core/src/core/types.d.ts +12 -3
- package/@ones-editor/core/src/utils/dom.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +5 -0
- package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +5 -0
- package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +5 -0
- package/@ones-editor/embed-block-helper/src/block-resizer/index.d.ts +6 -1
- package/@ones-editor/exclusive-block/src/index.d.ts +2 -0
- package/@ones-editor/graph-embed/src/command.d.ts +9 -0
- package/@ones-editor/graph-embed/src/config/index.d.ts +9 -1
- package/@ones-editor/graph-embed/src/flowchart/flowchart-embed.d.ts +1 -1
- package/@ones-editor/graph-embed/src/flowchart/flowchart-helper.d.ts +2 -1
- package/@ones-editor/graph-embed/src/flowchart/flowchart.d.ts +11 -3
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +29 -23
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +3 -4
- package/@ones-editor/graph-embed/src/helper/graph-dom/code-editor.d.ts +4 -0
- package/@ones-editor/graph-embed/src/helper/graph-dom/draw-dom.d.ts +16 -0
- package/@ones-editor/graph-embed/src/helper/graph-dom/layout-dom.d.ts +25 -0
- package/@ones-editor/graph-embed/src/helper/graph-dom/view-select.d.ts +22 -0
- package/@ones-editor/graph-embed/src/helper/graph-exclusive-handler.d.ts +13 -0
- package/@ones-editor/graph-embed/src/helper/graph-quick-commands.d.ts +3 -0
- package/@ones-editor/graph-embed/src/helper/utils.d.ts +4 -0
- package/@ones-editor/graph-embed/src/index.d.ts +3 -2
- package/@ones-editor/graph-embed/src/lang/en-us.d.ts +11 -6
- package/@ones-editor/graph-embed/src/lang/ja-jp.d.ts +11 -6
- package/@ones-editor/graph-embed/src/lang/zh-cn.d.ts +11 -6
- package/@ones-editor/graph-embed/src/mermaid/mermaid-embed.d.ts +1 -1
- package/@ones-editor/graph-embed/src/mermaid/mermaid-helper.d.ts +1 -0
- package/@ones-editor/graph-embed/src/mermaid/mermaid.d.ts +12 -4
- package/@ones-editor/graph-embed/src/plantuml/plantuml-embed.d.ts +1 -1
- package/@ones-editor/graph-embed/src/plantuml/plantuml-helper.d.ts +2 -1
- package/@ones-editor/graph-embed/src/plantuml/plantuml.d.ts +11 -3
- package/@ones-editor/graph-embed/src/types.d.ts +41 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/figcaption.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/font-size.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/text-color.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/underline.d.ts +1 -0
- package/@ones-editor/image-embed/src/types.d.ts +0 -1
- package/@ones-editor/main-toolbar/package.json +7 -0
- package/@ones-editor/main-toolbar/src/index.d.ts +18 -0
- package/@ones-editor/main-toolbar/src/items/comment.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/find.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/font-style.d.ts +40 -0
- package/@ones-editor/main-toolbar/src/items/image.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/index.d.ts +17 -0
- package/@ones-editor/main-toolbar/src/items/insert.d.ts +12 -0
- package/@ones-editor/main-toolbar/src/items/link.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/items/list.d.ts +29 -0
- package/@ones-editor/main-toolbar/src/items/more-item.d.ts +20 -0
- package/@ones-editor/main-toolbar/src/items/paragraph.d.ts +14 -0
- package/@ones-editor/main-toolbar/src/items/quote.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/items/separator.d.ts +7 -0
- package/@ones-editor/main-toolbar/src/items/text-align.d.ts +21 -0
- package/@ones-editor/main-toolbar/src/items/text-color.d.ts +49 -0
- package/@ones-editor/main-toolbar/src/items/undo.d.ts +18 -0
- package/@ones-editor/main-toolbar/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/locale/index.d.ts +1 -0
- package/@ones-editor/main-toolbar/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/types.d.ts +5 -0
- package/@ones-editor/markdown-to-doc/src/custom/tag.d.ts +8 -0
- package/@ones-editor/markdown-to-doc/src/index.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/custom-tag.d.ts +4 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/font-size.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/html.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/text-color.d.ts +2 -0
- package/@ones-editor/misc/src/index.d.ts +0 -1
- package/@ones-editor/misc/src/re-auth/index.d.ts +0 -23
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +41 -31
- package/@ones-editor/sharedb-doc/src/doc/auto-renew-token.d.ts +16 -0
- package/@ones-editor/sharedb-doc/src/doc/connection-status.d.ts +19 -0
- package/@ones-editor/sharedb-doc/src/doc/edit-status.d.ts +13 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +6 -13
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +4 -4
- package/@ones-editor/sharedb-doc/src/types.d.ts +20 -5
- package/@ones-editor/toc/src/toc-embed/render-toc.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/emoji-popup/emoji-popup.d.ts +21 -0
- package/@ones-editor/ui/src/emoji-popup/index.d.ts +8 -0
- package/@ones-editor/ui/src/index.d.ts +1 -0
- package/@ones-editor/ui/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/ui/src/providers/emoji.d.ts +12 -0
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +2 -2
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +9 -0
- package/@ones-editor/ui/src/providers/utils/index.d.ts +2 -0
- package/@ones-editor/ui/src/quick-menu/index.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +3 -3
- package/@ones-editor/ui/src/quick-menu/types.d.ts +2 -2
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +3 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +2 -0
- package/@ones-editor/ui-base/src/color-button/color-button.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -0
- package/@ones-editor/ui-base/src/dialog/alert-dialog.d.ts +19 -0
- package/@ones-editor/ui-base/src/dialog/confirm-dialog.d.ts +20 -0
- package/@ones-editor/ui-base/src/dialog/dialog-button.d.ts +10 -0
- package/@ones-editor/ui-base/src/dialog/dialog-check.d.ts +15 -0
- package/@ones-editor/ui-base/src/dialog/dialog-input.d.ts +9 -0
- package/@ones-editor/ui-base/src/dialog/dialog-radio.d.ts +12 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +15 -0
- package/@ones-editor/ui-base/src/dialog/modal-dialog.d.ts +21 -0
- package/@ones-editor/ui-base/src/dialog/popup-dialog.d.ts +31 -0
- package/@ones-editor/ui-base/src/dialog/standard-dialog.d.ts +25 -0
- package/@ones-editor/ui-base/src/dialog/standard-modal-dialog.d.ts +7 -0
- package/@ones-editor/ui-base/src/dialog/standard-popup-dialog.d.ts +17 -0
- package/@ones-editor/ui-base/src/dialog/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/dropdown/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/emoji-item/emoji-item.d.ts +1 -2
- package/@ones-editor/ui-base/src/emoji-palette/default-emoji-palette.d.ts +3 -0
- package/@ones-editor/ui-base/src/emoji-palette/index.d.ts +10 -13
- package/@ones-editor/ui-base/src/emoji-palette/types.d.ts +10 -0
- package/@ones-editor/ui-base/src/index.d.ts +2 -0
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +5 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/versions/src/types.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +2 -0
- package/dist/custom/image-preview-handler.d.ts +11 -0
- package/dist/error-handler/error-info-bar.d.ts +18 -0
- package/dist/error-handler/index.d.ts +37 -0
- package/dist/index.d.ts +63 -2
- package/dist/index.js +7986 -4215
- package/dist/lang/en-us.d.ts +9 -0
- package/dist/lang/ja-jp.d.ts +9 -0
- package/dist/lang/zh-cn.d.ts +9 -0
- package/dist/types.d.ts +32 -6
- package/package.json +1 -2
- package/@ones-editor/graph-embed/assets/index.d.ts +0 -2
- package/@ones-editor/graph-embed/types/index.d.ts +0 -16
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
+
import { EmojiPalette } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
export interface EmojiPopupCallbacks {
|
|
4
|
+
onSelectEmoji: (emoji: string, closePopup: VoidFunction) => void;
|
|
5
|
+
onClose: VoidFunction;
|
|
6
|
+
}
|
|
7
|
+
export declare class EmojiPopup implements OnesEditorCustom {
|
|
8
|
+
private editor;
|
|
9
|
+
private popup;
|
|
10
|
+
private popupContent;
|
|
11
|
+
emojiPalette: EmojiPalette;
|
|
12
|
+
private latestPopupCallbacks;
|
|
13
|
+
constructor(editor: OnesEditor);
|
|
14
|
+
private closePopup;
|
|
15
|
+
private handleEmojiSelect;
|
|
16
|
+
private handlePopupClose;
|
|
17
|
+
private populateEmojiPopupContent;
|
|
18
|
+
setCallbacks(callbacks: EmojiPopupCallbacks): void;
|
|
19
|
+
show(rect: DOMRect): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { EmojiPopupCallbacks } from './emoji-popup';
|
|
3
|
+
export interface ShowEmojiPopupOptions extends EmojiPopupCallbacks {
|
|
4
|
+
currentEmoji?: string;
|
|
5
|
+
anchor: HTMLElement;
|
|
6
|
+
}
|
|
7
|
+
declare function showEmojiPopup(editor: OnesEditor, options: ShowEmojiPopupOptions): void;
|
|
8
|
+
export { showEmojiPopup, };
|
|
@@ -36,6 +36,7 @@ import { ReadonlyToolbar } from './readonly-toolbar';
|
|
|
36
36
|
import { ReadonlyToolbarCommandProvider, ReadonlyCommandOptions } from './readonly-toolbar/types';
|
|
37
37
|
import { AddCommentToOldDocCommandProvider } from './readonly-toolbar/add-comment-to-old-doc';
|
|
38
38
|
import ClipboardProvider from './providers/clipboard-provider';
|
|
39
|
+
export { showEmojiPopup } from './emoji-popup';
|
|
39
40
|
export * from './providers/utils/clipboard';
|
|
40
41
|
export * from './providers/utils';
|
|
41
42
|
export * from './box-helper/standard-box-commands';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, CommandParams, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class EmojiProvider implements OnesEditorCommandProvider {
|
|
3
|
+
private editor;
|
|
4
|
+
id: string;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
create(): CommandItem[];
|
|
7
|
+
isDisabled: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => boolean;
|
|
8
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
9
|
+
getInsertCommands: () => CommandItem[];
|
|
10
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem) => boolean;
|
|
11
|
+
executeInsertCommand(editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItem): boolean;
|
|
12
|
+
}
|
|
@@ -9,8 +9,8 @@ export default class InsertMenuProvider extends ProxyProvider {
|
|
|
9
9
|
providers: OnesEditorCommandProvider[];
|
|
10
10
|
quickProviders: QuickMenuCommandProvider[];
|
|
11
11
|
constructor(editor: OnesEditor, options?: CommandParams | undefined);
|
|
12
|
-
getInsertCommands: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
13
|
-
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => CommandItem[];
|
|
12
|
+
getInsertCommands: (editor: OnesEditor, containerId: string, params?: CommandParams) => CommandItem[];
|
|
13
|
+
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
14
14
|
executeInsertCommand: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
15
15
|
executeCommand: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => boolean;
|
|
16
16
|
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { CommandItem } from '../../../../../@ones-editor/core';
|
|
2
|
+
declare const GroupOrder: {
|
|
3
|
+
basics: number;
|
|
4
|
+
system: number;
|
|
5
|
+
common: number;
|
|
6
|
+
thirdParty: number;
|
|
7
|
+
};
|
|
8
|
+
type GroupType = keyof typeof GroupOrder;
|
|
2
9
|
export declare const addSection: (items: CommandItem[]) => CommandItem[];
|
|
10
|
+
export declare const createSectionByGroup: (item: CommandItem, before: GroupType) => CommandItem;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnesEditor, CommandItem, CommandFilterId, CommandFilter } from '../../../../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, CommandItem, CommandItemWithSource, CommandFilterId, CommandFilter } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorAutoSuggest } from '../../../../@ones-editor/ui-base';
|
|
3
3
|
import { QuickMenuOptions } from './types';
|
|
4
4
|
export default class OnesEditorQuickMenu {
|
|
@@ -12,6 +12,7 @@ export default class OnesEditorQuickMenu {
|
|
|
12
12
|
get menu(): import("@ones-editor/ui-base").ManualMenu | import("@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu").MobileBottomMenu;
|
|
13
13
|
addFilter(id: CommandFilterId, filter: CommandFilter): void;
|
|
14
14
|
destroy(): void;
|
|
15
|
+
filterItems: (items: CommandItemWithSource[], search: string) => CommandItemWithSource[];
|
|
15
16
|
queryItems: (suggest: unknown, text: string) => Promise<CommandItem[]>;
|
|
16
17
|
onClose: () => void;
|
|
17
18
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AbstractProvider, CommandItemWithSource, OnesEditor, OnesEditorCommandProviders, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { AbstractProvider, CommandItemWithSource, CommandParams, OnesEditor, OnesEditorCommandProviders, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare class QuickCommandProviders extends AbstractProvider implements OnesEditorCommandProviders {
|
|
3
3
|
protected editor: OnesEditor;
|
|
4
4
|
id: string;
|
|
5
5
|
constructor(editor: OnesEditor);
|
|
6
|
-
getCommands(range: SelectionRange): CommandItemWithSource[];
|
|
7
|
-
executeCommand: (range: SelectionRange, item: CommandItemWithSource) => {};
|
|
6
|
+
getCommands(range: SelectionRange, params?: CommandParams): CommandItemWithSource[];
|
|
7
|
+
executeCommand: (range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => {};
|
|
8
8
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CommandItem, BlockOptions, OnesEditor, BlockElement, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { CommandItem, BlockOptions, OnesEditor, BlockElement, SelectionRange, CommandParams } from '../../../../@ones-editor/core';
|
|
2
2
|
export interface QuickMenuItem extends CommandItem {
|
|
3
3
|
itemType: 'insert-block';
|
|
4
4
|
blockType?: string;
|
|
5
5
|
blockOptions?: BlockOptions;
|
|
6
6
|
commandProvider?: QuickMenuCommandProvider;
|
|
7
7
|
}
|
|
8
|
-
export interface QuickMenuCommandParams {
|
|
8
|
+
export interface QuickMenuCommandParams extends CommandParams {
|
|
9
9
|
from: 'block-menu' | 'quick-menu' | 'add-block-menu';
|
|
10
10
|
}
|
|
11
11
|
export interface QuickMenuCommandInline extends QuickMenuCommandParams {
|
|
@@ -14,6 +14,7 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
|
|
|
14
14
|
private hoveringTextChild;
|
|
15
15
|
private _disableTextToolbar;
|
|
16
16
|
private _lastClickTime;
|
|
17
|
+
private _disabled;
|
|
17
18
|
constructor(editor: OnesEditor);
|
|
18
19
|
disableTextToolbar(): void;
|
|
19
20
|
enableTextToolbar(): void;
|
|
@@ -33,6 +34,7 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
|
|
|
33
34
|
handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
|
|
34
35
|
updateItems(updater: (items: CommandItem[]) => CommandItem[]): void;
|
|
35
36
|
updateItemStates(id: CommandItem['id'], states: Required<CommandItem>['states']): void;
|
|
37
|
+
disable(value: boolean): void;
|
|
36
38
|
update(reason: ShowToolbarReason): void;
|
|
37
39
|
private showTextToolbar;
|
|
38
40
|
private showObjectToolbar;
|
|
@@ -17,6 +17,7 @@ export interface AutoSuggestMenuOptions {
|
|
|
17
17
|
onClose?: () => void;
|
|
18
18
|
onShow?: (menu: AutoSuggestMenu) => boolean | undefined;
|
|
19
19
|
onShown?: (menu: AutoSuggestMenu) => void;
|
|
20
|
+
onSubBarShown?: (menu: AutoSuggestMenu) => void;
|
|
20
21
|
onClickItem: (menu: AutoSuggestMenu, item: CommandItem) => void;
|
|
21
22
|
queryItems: (menu: AutoSuggestMenu, text: string) => Promise<CommandItem[]>;
|
|
22
23
|
renderMenuItem?: (menu: AutoSuggestMenu, item: CommandItem) => HTMLElement | undefined;
|
|
@@ -26,6 +27,7 @@ export default class AutoSuggestMenu {
|
|
|
26
27
|
menu: ManualMenu | MobileBottomMenu;
|
|
27
28
|
private currentText;
|
|
28
29
|
handleSearchText: (text: string) => void;
|
|
30
|
+
get searchText(): string;
|
|
29
31
|
constructor(options: AutoSuggestMenuOptions);
|
|
30
32
|
private setItems;
|
|
31
33
|
popup(anchor: HTMLElement, options?: {
|
|
@@ -45,4 +47,5 @@ export default class AutoSuggestMenu {
|
|
|
45
47
|
handleClose: () => void;
|
|
46
48
|
handleKeydown: (event: KeyboardEvent) => boolean;
|
|
47
49
|
protected highlightText(search: string, items?: CommandItem[]): void;
|
|
50
|
+
handleSubBarShown: () => void;
|
|
48
51
|
}
|
|
@@ -27,6 +27,7 @@ export interface AutoSuggestOptions {
|
|
|
27
27
|
queryItems: (menu: OnesEditorAutoSuggest, text: string) => Promise<CommandItem[]>;
|
|
28
28
|
renderMenuItem?: (menu: OnesEditorAutoSuggest, item: CommandItem) => HTMLElement | undefined;
|
|
29
29
|
onShown?: (menu: OnesEditorAutoSuggest) => void;
|
|
30
|
+
onSubBarShown?: (menu: OnesEditorAutoSuggest) => void;
|
|
30
31
|
}
|
|
31
32
|
declare class OnesEditorAutoSuggest implements OnesEditorInputHandler {
|
|
32
33
|
private editor;
|
|
@@ -48,6 +49,7 @@ declare class OnesEditorAutoSuggest implements OnesEditorInputHandler {
|
|
|
48
49
|
private onClose;
|
|
49
50
|
private onShow;
|
|
50
51
|
private onShown;
|
|
52
|
+
private onSubBarShown;
|
|
51
53
|
private onClickItem;
|
|
52
54
|
private queryItems;
|
|
53
55
|
private renderMenuItem;
|
|
@@ -39,12 +39,13 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
39
39
|
private handleItemMouseLeave;
|
|
40
40
|
protected handleItemClick: (event: MouseEvent | TouchEvent) => void;
|
|
41
41
|
private showSubCommandBar;
|
|
42
|
+
getSubBarCreateOptions(item: CommandItem): CommandBarOptions;
|
|
42
43
|
isInCommandBar(target: EventTarget | null): boolean;
|
|
43
44
|
createCommandItem(item: CommandItem): CommandItemElement;
|
|
44
45
|
getItemById(id: string): CommandItem;
|
|
45
46
|
getSelectedItem(): CommandItem | null;
|
|
46
47
|
protected getItemElementId(elem: CommandItemElement): string;
|
|
47
|
-
|
|
48
|
+
getItemElementById(id: string): CommandItemElement;
|
|
48
49
|
protected getParentCommandItemElement(target: EventTarget | null): CommandItemElement | null;
|
|
49
50
|
protected createCommandBarContent(items: CommandItem[]): HTMLElement;
|
|
50
51
|
handleWheel: (e: WheelEvent) => void;
|
|
@@ -7,6 +7,7 @@ export default class FixedToolbar extends CommandBar {
|
|
|
7
7
|
protected initCommandBarElement(elem: HTMLElement): void;
|
|
8
8
|
protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
|
|
9
9
|
close(): void;
|
|
10
|
+
getSubBarCreateOptions: (item: CommandItem) => CommandBarOptions;
|
|
10
11
|
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
11
12
|
destroy(): void;
|
|
12
13
|
protected getCommandBarRoot(): HTMLElement | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import StandardDialog from './standard-dialog';
|
|
2
|
+
import { ButtonType } from './types';
|
|
3
|
+
import './alert-dialog.scss';
|
|
4
|
+
export interface AlertDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
content: string | HTMLElement;
|
|
8
|
+
icon?: string;
|
|
9
|
+
buttons?: ButtonType[] | HTMLElement[];
|
|
10
|
+
okButtonTitle?: string;
|
|
11
|
+
onOk?: (dialog: AlertDialog) => Promise<void> | void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
type?: 'warning' | 'info' | 'danger';
|
|
14
|
+
}
|
|
15
|
+
export default class AlertDialog extends StandardDialog {
|
|
16
|
+
private alertOptions;
|
|
17
|
+
constructor(alertOptions: AlertDialogOptions);
|
|
18
|
+
static showAlert(options: AlertDialogOptions): AlertDialog | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import StandardDialog from './standard-dialog';
|
|
2
|
+
import './confirm-dialog.scss';
|
|
3
|
+
import { ButtonType } from './types';
|
|
4
|
+
export interface ConfirmDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
buttons?: ButtonType[] | HTMLElement[];
|
|
7
|
+
title?: string;
|
|
8
|
+
content: string | HTMLElement;
|
|
9
|
+
icon?: string;
|
|
10
|
+
hideClose?: boolean;
|
|
11
|
+
bodyClasses?: string[];
|
|
12
|
+
okButtonTitle?: string;
|
|
13
|
+
onClickButton?: (dialog: StandardDialog, button: HTMLElement) => Promise<boolean> | undefined;
|
|
14
|
+
onOk?: (dialog: ConfirmDialog) => Promise<boolean>;
|
|
15
|
+
onCancel?: (dialog: ConfirmDialog) => Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
export default class ConfirmDialog extends StandardDialog {
|
|
18
|
+
private askOptions;
|
|
19
|
+
constructor(askOptions: ConfirmDialogOptions);
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './dialog-buttons.scss';
|
|
2
|
+
export interface StandardButtonOptions {
|
|
3
|
+
icon?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
primary?: boolean;
|
|
7
|
+
noBackground?: boolean;
|
|
8
|
+
noBorder?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStandardButton(parent: HTMLElement, options: StandardButtonOptions): HTMLButtonElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './dialog-check.scss';
|
|
2
|
+
export interface StandardCheckOptions {
|
|
3
|
+
label: string;
|
|
4
|
+
classes?: string[];
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
labelId?: string;
|
|
8
|
+
extra?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStandardCheck(parent: HTMLElement, options: StandardCheckOptions): {
|
|
11
|
+
root: HTMLLabelElement;
|
|
12
|
+
check: HTMLInputElement;
|
|
13
|
+
label: HTMLSpanElement;
|
|
14
|
+
};
|
|
15
|
+
export declare function updateStandardCheckExtra(check: HTMLInputElement, extra: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function setInputError(input: HTMLInputElement, message: string): void;
|
|
2
|
+
export declare function clearInputError(input: HTMLInputElement): void;
|
|
3
|
+
export interface StandardInputOptions {
|
|
4
|
+
classes?: string[];
|
|
5
|
+
inputClasses?: string[];
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createStandardInput(parent: HTMLElement, options?: StandardInputOptions): HTMLInputElement;
|
|
9
|
+
export declare function updateInputPlaceholder(input: HTMLInputElement, placeholder: string): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './dialog-radio.scss';
|
|
2
|
+
export interface StandardRadioOptions {
|
|
3
|
+
label: string;
|
|
4
|
+
classes?: string[];
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createStandardRadio(parent: HTMLElement, options: StandardRadioOptions): {
|
|
9
|
+
root: HTMLLabelElement;
|
|
10
|
+
radio: HTMLInputElement;
|
|
11
|
+
label: HTMLSpanElement;
|
|
12
|
+
};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import ManualCloseDialog from './manual-close-dialog';
|
|
2
2
|
import type { ManualCloseDialogOptions } from './manual-close-dialog';
|
|
3
|
+
import AlertDialog from './alert-dialog';
|
|
4
|
+
import type { AlertDialogOptions } from './alert-dialog';
|
|
5
|
+
import ConfirmDialog from './confirm-dialog';
|
|
6
|
+
import type { ConfirmDialogOptions } from './confirm-dialog';
|
|
7
|
+
import StandardDialog from './standard-dialog';
|
|
8
|
+
import type { StandardDialogOptions } from './standard-dialog';
|
|
9
|
+
import StandardModalDialog from './standard-modal-dialog';
|
|
10
|
+
import type { StandardModalDialogOptions } from './standard-modal-dialog';
|
|
11
|
+
import StandardPopupDialog from './standard-popup-dialog';
|
|
12
|
+
import type { StandardPopupDialogOptions } from './standard-popup-dialog';
|
|
3
13
|
export * from './types';
|
|
4
14
|
export { ManualCloseDialog, ManualCloseDialogOptions };
|
|
15
|
+
export { AlertDialog, AlertDialogOptions };
|
|
16
|
+
export { ConfirmDialog, ConfirmDialogOptions };
|
|
17
|
+
export { StandardDialog, StandardDialogOptions };
|
|
18
|
+
export { StandardModalDialog, StandardModalDialogOptions };
|
|
19
|
+
export { StandardPopupDialog, StandardPopupDialogOptions };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './modal-dialog.scss';
|
|
2
|
+
import './dialog-buttons.scss';
|
|
3
|
+
import './dialog-input.scss';
|
|
4
|
+
export type ManualCloseDialogOptions = {
|
|
5
|
+
id?: string;
|
|
6
|
+
bodyClasses?: string[];
|
|
7
|
+
dialogClasses?: string[];
|
|
8
|
+
disableBackdropClose?: boolean;
|
|
9
|
+
onClose?: (dialog: ModalDialog) => void;
|
|
10
|
+
};
|
|
11
|
+
export default class ModalDialog {
|
|
12
|
+
protected content: HTMLElement;
|
|
13
|
+
protected options?: ManualCloseDialogOptions | undefined;
|
|
14
|
+
protected root: HTMLElement | null;
|
|
15
|
+
protected static zIndex: number;
|
|
16
|
+
constructor(content: HTMLElement, options?: ManualCloseDialogOptions | undefined);
|
|
17
|
+
show(): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
protected handleWindowMouseDown: (event: MouseEvent) => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import './popup-dialog.scss';
|
|
2
|
+
import { GetReferenceClientRect } from 'tippy.js';
|
|
3
|
+
import { Placement } from '../command-bar/types';
|
|
4
|
+
export interface PopupDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
content: HTMLElement;
|
|
7
|
+
target?: HTMLElement;
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
point?: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
theme?: string;
|
|
14
|
+
getReferenceClientRect?: GetReferenceClientRect | null | undefined;
|
|
15
|
+
offset?: [number, number];
|
|
16
|
+
arrow?: boolean;
|
|
17
|
+
disablePageScroll?: boolean;
|
|
18
|
+
onClose?: (dialog: PopupDialog) => void;
|
|
19
|
+
onShow?: (dialog: PopupDialog) => void;
|
|
20
|
+
}
|
|
21
|
+
export default class PopupDialog {
|
|
22
|
+
private options;
|
|
23
|
+
private popup;
|
|
24
|
+
constructor(options: PopupDialogOptions);
|
|
25
|
+
destroy(): void;
|
|
26
|
+
show(target?: HTMLElement): void;
|
|
27
|
+
close(): void;
|
|
28
|
+
handlePopupClose: () => void;
|
|
29
|
+
handlePopupShow: () => void;
|
|
30
|
+
popupContent(): HTMLElement;
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ModalDialog from './modal-dialog';
|
|
2
|
+
import { ButtonType } from './types';
|
|
3
|
+
import './standard-dialog.scss';
|
|
4
|
+
export interface StandardDialogOptions {
|
|
5
|
+
id?: string;
|
|
6
|
+
buttons: ButtonType[] | HTMLElement[];
|
|
7
|
+
title?: string;
|
|
8
|
+
content: string | HTMLElement;
|
|
9
|
+
icon?: string;
|
|
10
|
+
hideClose?: boolean;
|
|
11
|
+
bodyClasses?: string[];
|
|
12
|
+
okButtonTitle?: string;
|
|
13
|
+
dialogClasses?: string[];
|
|
14
|
+
onClose?: (dialog: ModalDialog) => void;
|
|
15
|
+
onClickButton?: (dialog: StandardDialog, button: HTMLElement) => Promise<boolean> | undefined;
|
|
16
|
+
onClickClose?: (dialog: StandardDialog) => Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
export default class StandardDialog extends ModalDialog {
|
|
19
|
+
protected dialogOptions: StandardDialogOptions;
|
|
20
|
+
constructor(dialogOptions: StandardDialogOptions);
|
|
21
|
+
destroy(): void;
|
|
22
|
+
private handleContentClick;
|
|
23
|
+
show(): void;
|
|
24
|
+
static createDialogContent(options: StandardDialogOptions): HTMLElement;
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import StandardDialog, { StandardDialogOptions } from './standard-dialog';
|
|
2
|
+
import './standard-modal-dialog.scss';
|
|
3
|
+
export type StandardModalDialogOptions = StandardDialogOptions;
|
|
4
|
+
export default class StandardModalDialog extends StandardDialog {
|
|
5
|
+
constructor(dialogOptions: StandardModalDialogOptions);
|
|
6
|
+
destroy(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonType } from './types';
|
|
2
|
+
import PopupDialog, { PopupDialogOptions } from './popup-dialog';
|
|
3
|
+
import './standard-popup-dialog.scss';
|
|
4
|
+
export interface StandardPopupDialogOptions extends PopupDialogOptions {
|
|
5
|
+
buttons: ButtonType[] | HTMLElement[];
|
|
6
|
+
bodyClasses?: string[];
|
|
7
|
+
onClickButton?: (dialog: StandardPopupDialog, button: HTMLElement) => Promise<boolean> | undefined;
|
|
8
|
+
}
|
|
9
|
+
export default class StandardPopupDialog extends PopupDialog {
|
|
10
|
+
protected dialogOptions: StandardPopupDialogOptions;
|
|
11
|
+
private dialogContent;
|
|
12
|
+
constructor(dialogOptions: StandardPopupDialogOptions);
|
|
13
|
+
destroy(): void;
|
|
14
|
+
private handleContentClick;
|
|
15
|
+
show(): void;
|
|
16
|
+
static createDialogContent(options: StandardPopupDialogOptions): HTMLElement;
|
|
17
|
+
}
|
|
@@ -11,9 +11,8 @@ export declare class EmojiItem implements CommandItem, OnesEditorCustom {
|
|
|
11
11
|
childrenPlacement: "bottom-start";
|
|
12
12
|
childrenMenuId: string;
|
|
13
13
|
closeable: Closeable;
|
|
14
|
-
constructor();
|
|
14
|
+
constructor(editor: OnesEditor);
|
|
15
15
|
beforePopup(): void;
|
|
16
16
|
setCloseable(closeable: Closeable): void;
|
|
17
17
|
destroy(): void;
|
|
18
|
-
static get(editor: OnesEditor): EmojiItem;
|
|
19
18
|
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { CommandItem } from '../../../../@ones-editor/core';
|
|
1
|
+
import { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
3
|
import './index.scss';
|
|
4
|
-
export
|
|
4
|
+
export type { OnesEditorEmojiPaletteOptions, EmojiSelectedHandler } from './types';
|
|
5
|
+
interface EmojiPaletteEvents {
|
|
5
6
|
onSelectEmoji: (emoji: string) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare class EmojiPalette extends TypedEmitter<EmojiPaletteEvents> implements CommandItem {
|
|
9
|
+
private editor;
|
|
8
10
|
id: string;
|
|
9
11
|
name: string;
|
|
10
12
|
element: HTMLDivElement;
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
private handleSearch;
|
|
18
|
-
private handleEmojiSelect;
|
|
19
|
-
private handleSelectCategory;
|
|
20
|
-
private handleCategoryReach;
|
|
21
|
-
updateComponents(): void;
|
|
13
|
+
private currentEmoji;
|
|
14
|
+
private unmountPalette;
|
|
15
|
+
constructor(editor: OnesEditor);
|
|
16
|
+
private renderPalette;
|
|
17
|
+
render(): Promise<void>;
|
|
18
|
+
setCurrentEmoji(emoji: string): void;
|
|
22
19
|
destroy(): void;
|
|
23
20
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type EmojiSelectedHandler = (emoji: string) => void;
|
|
2
|
+
export type EmojiPaletteOptions = {
|
|
3
|
+
emoji: string;
|
|
4
|
+
onSelectEmoji: EmojiSelectedHandler;
|
|
5
|
+
};
|
|
6
|
+
export type UnmountPalette = () => void;
|
|
7
|
+
export type EmojiPaletteRenderer = (parent: HTMLDivElement, options: EmojiPaletteOptions) => UnmountPalette;
|
|
8
|
+
export type OnesEditorEmojiPaletteOptions = {
|
|
9
|
+
emojiPaletteRenderer: EmojiPaletteRenderer;
|
|
10
|
+
};
|
|
@@ -18,4 +18,6 @@ export * from './emoji-item';
|
|
|
18
18
|
export * from './mobile-command-bar/mobile-bottom-menu';
|
|
19
19
|
export * from './text-button';
|
|
20
20
|
export { scrollBarIntoView } from './mobile-command-bar/scroll-into-view';
|
|
21
|
+
export { EmojiPalette } from './emoji-palette';
|
|
22
|
+
export type { OnesEditorEmojiPaletteOptions, EmojiSelectedHandler } from './emoji-palette';
|
|
21
23
|
export { tippy, };
|
|
@@ -6,6 +6,7 @@ export interface VersionDialogOptions {
|
|
|
6
6
|
useCreatedBy?: boolean;
|
|
7
7
|
enableEdit?: boolean;
|
|
8
8
|
textRenders?: OnesEditorBlockRenderer[];
|
|
9
|
+
autoCompareWithLastVersion?: boolean;
|
|
9
10
|
getDisabledTip?: () => string | undefined;
|
|
10
11
|
onMemoChanged?: (version: DocVersion) => void;
|
|
11
12
|
onBeforeEditMemo?: () => Promise<boolean>;
|
|
@@ -18,8 +18,10 @@ export default class VersionsDropdown {
|
|
|
18
18
|
createFilterMemoedFilterItem: (hasLastVersion: boolean) => HTMLDivElement;
|
|
19
19
|
setVersions(versions: DocVersion[]): void;
|
|
20
20
|
setCurrentVersion(ver: DocVersion, compareWithVersion?: DocVersion): void;
|
|
21
|
+
setCompareWithVersion(compareWithVersion: DocVersion | null): void;
|
|
21
22
|
resetItems(): void;
|
|
22
23
|
filterItems: (item: CommandItem, keywords: string) => boolean;
|
|
24
|
+
getLastVersion(): DocVersion | null;
|
|
23
25
|
handleClose: () => void;
|
|
24
26
|
handleClear: () => void;
|
|
25
27
|
handleClickItem: (item: CommandItem) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom } from '../../@ones-editor/core';
|
|
2
|
+
export declare class ImagePreviewHandler implements OnesEditorCustom {
|
|
3
|
+
private editor;
|
|
4
|
+
private onPreview;
|
|
5
|
+
private lastClickPosition;
|
|
6
|
+
constructor(editor: OnesEditor, onPreview: (editor: OnesEditor, img: HTMLImageElement) => void);
|
|
7
|
+
handleImagePreview: (e: MouseEvent) => void;
|
|
8
|
+
handleMouseUp: (e: MouseEvent) => void;
|
|
9
|
+
handleMouseDown: (e: MouseEvent) => void;
|
|
10
|
+
destroy: () => void;
|
|
11
|
+
}
|