@ones-editor/editor 2.1.8-beta.6 → 2.1.8-beta.7
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-menu/src/block-menu-button/menu-button/index.d.ts +1 -1
- package/@ones-editor/block-padding/src/index.d.ts +1 -1
- package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +3 -4
- package/@ones-editor/callout-block/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +16 -0
- package/@ones-editor/comments/src/index.d.ts +5 -1
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +4 -3
- package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +9 -9
- package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
- package/@ones-editor/core/src/core/blocks/complex-blocks/child-blocks.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +3 -5
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +1 -7
- package/@ones-editor/core/src/core/blocks/text-blocks/base/line-breaks.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/range.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/text-offset.d.ts +1 -2
- package/@ones-editor/core/src/core/command-providers/abstract-providers.d.ts +25 -0
- package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +16 -0
- package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +2 -0
- package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +3 -0
- package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +4 -0
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +2 -5
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +5 -14
- package/@ones-editor/core/src/core/command-providers/index.d.ts +3 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +3 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +3 -0
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/actions/clear-selected-contents.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/index.d.ts +1 -1
- package/@ones-editor/core/src/core/insertions/editor-insertions.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -1
- package/@ones-editor/core/src/core/selection/adjust-selection-pos.d.ts +5 -1
- package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +51 -28
- 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/helper/hovering-block.d.ts +3 -4
- package/@ones-editor/core/src/utils/animate-scroll.d.ts +2 -0
- package/@ones-editor/core/src/utils/dom.d.ts +4 -1
- package/@ones-editor/core/src/utils/drag-drop.d.ts +8 -3
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +6 -5
- package/@ones-editor/excalidraw/package.json +4 -0
- package/@ones-editor/file/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/file/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/file/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +5 -19
- package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +12 -1
- package/@ones-editor/image-embed/src/image-object.d.ts +1 -0
- package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/layout-block/src/command-filter.d.ts +6 -0
- package/@ones-editor/layout-block/src/index.d.ts +1 -0
- package/@ones-editor/list-block/src/index.d.ts +2 -1
- package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +12 -1
- package/@ones-editor/media-embed/src/utils/dom.d.ts +2 -0
- package/@ones-editor/mention/src/locale/en-us.d.ts +3 -0
- package/@ones-editor/mention/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/mention/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/mention/src/mention.d.ts +24 -1
- package/@ones-editor/mobile-helper/src/cursor-toolbar.d.ts +15 -0
- package/@ones-editor/mobile-helper/src/embed-mask.d.ts +10 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/active-observer.d.ts +11 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/fixed-providers.d.ts +6 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +18 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/align-dropdown.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/group.d.ts +7 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +13 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +8 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/paragraph.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/tab-provider.d.ts +10 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/text-dropdown.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/turn-into.d.ts +8 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +15 -0
- package/@ones-editor/mobile-helper/src/index.d.ts +14 -2
- package/@ones-editor/mobile-helper/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +19 -0
- package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +3 -0
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -1
- package/@ones-editor/sharedb-doc/src/index.d.ts +3 -0
- package/@ones-editor/table-block/src/commands/index.d.ts +2 -0
- package/@ones-editor/table-block/src/commands/mobile-command-provider.d.ts +12 -0
- package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +4 -3
- package/@ones-editor/table-block/src/index.d.ts +2 -1
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/ja-jp.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +6 -0
- package/@ones-editor/table-block/src/table-block/table-resize/resize-drag-drop.d.ts +4 -4
- package/@ones-editor/text-commands/src/index.d.ts +1 -3
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/table.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +8 -0
- package/@ones-editor/{block-menu → ui}/src/block-menu/index.d.ts +3 -1
- package/@ones-editor/ui/src/box-helper/standard-box-commands.d.ts +10 -0
- package/@ones-editor/ui/src/box-helper/standard-box-provider.d.ts +9 -0
- package/@ones-editor/ui/src/index.d.ts +34 -9
- 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/locale/en-us.d.ts +14 -0
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +14 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +14 -0
- package/@ones-editor/ui/src/providers/align-dropdown.d.ts +10 -0
- package/@ones-editor/ui/src/providers/align.d.ts +11 -0
- package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/clipboard-provider.d.ts +20 -0
- package/@ones-editor/ui/src/providers/color-provider.d.ts +18 -0
- package/@ones-editor/ui/src/providers/edit-link-provider.d.ts +6 -0
- package/@ones-editor/ui/src/providers/heading.d.ts +13 -0
- package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/inline-style-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/insert-above.d.ts +9 -0
- package/@ones-editor/ui/src/providers/insert-after.d.ts +9 -0
- package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +12 -0
- package/@ones-editor/ui/src/providers/insert-group.d.ts +7 -0
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +16 -0
- package/@ones-editor/ui/src/providers/link.d.ts +12 -0
- package/@ones-editor/ui/src/providers/list.d.ts +13 -0
- package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +13 -0
- package/@ones-editor/ui/src/providers/paragraph.d.ts +9 -0
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +9 -0
- package/@ones-editor/ui/src/providers/quoted.d.ts +10 -0
- package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +9 -0
- package/@ones-editor/ui/src/providers/selection-provider.d.ts +9 -0
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +16 -0
- package/@ones-editor/ui/src/providers/text-script-provider.d.ts +10 -0
- package/@ones-editor/ui/src/providers/text-styles.d.ts +9 -0
- package/@ones-editor/ui/src/providers/turn-into.d.ts +9 -0
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +2 -0
- package/@ones-editor/ui/src/{quick-menu → providers/utils}/basic-commands.d.ts +1 -2
- package/@ones-editor/ui/src/providers/utils/clipboard.d.ts +6 -0
- package/@ones-editor/ui/src/providers/utils/index.d.ts +2 -0
- package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +8 -0
- package/@ones-editor/ui/src/providers/utils/text-styles.d.ts +6 -0
- package/@ones-editor/ui/src/quick-menu/index.d.ts +7 -19
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +8 -0
- package/@ones-editor/ui/src/quick-menu/types.d.ts +2 -5
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +22 -0
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +29 -0
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +12 -0
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +11 -0
- package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -1
- package/@ones-editor/ui/src/utils/hide-toolbar.d.ts +2 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +4 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +3 -1
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +14 -7
- package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +7 -1
- package/@ones-editor/ui-base/src/color-palette/index.d.ts +3 -3
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +4 -2
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/init-toolbar-item.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +7 -2
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +5 -1
- package/@ones-editor/ui-base/src/index.d.ts +3 -0
- package/@ones-editor/ui-base/src/input/create-input.d.ts +24 -3
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/init-menu-item.d.ts +3 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +21 -0
- package/@ones-editor/ui-base/src/mobile-command-bar/scroll-into-view.d.ts +3 -0
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/@ones-editor/{ui → ui-base}/src/text-button/index.d.ts +1 -1
- package/dist/auto-new-line.d.ts +7 -0
- package/dist/comments/local-doc-comments-provider.d.ts +2 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +26884 -22871
- 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/dist/types.d.ts +5 -2
- package/package.json +1 -1
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +0 -3
- package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +0 -5
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +0 -5
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +0 -30
- package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +0 -5
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +0 -13
- package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +0 -13
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +0 -13
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +0 -24
- package/@ones-editor/text-commands/src/text-commands.d.ts +0 -4
- package/@ones-editor/text-commands/src/text-styles.d.ts +0 -4
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +0 -16
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +0 -8
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +0 -4
- package/@ones-editor/ui/src/quick-menu/order.d.ts +0 -1
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +0 -9
- package/@ones-editor/ui/src/toolbar/commands/align.d.ts +0 -10
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +0 -11
- package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +0 -10
- package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +0 -2
- /package/@ones-editor/{text-commands → mobile-helper}/src/locale/index.d.ts +0 -0
- /package/@ones-editor/{block-menu → ui}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor } from '
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
2
|
export declare function applyHeadingStyle(editor: OnesEditor, block: BlockElement, heading: number | null): void;
|
|
3
3
|
export declare function applyAlignStyle(editor: OnesEditor, block: BlockElement, align: string): void;
|
|
4
4
|
export declare function applyQuoteStyle(editor: OnesEditor, block: BlockElement): void;
|
|
5
|
-
export declare function applyList(editor: OnesEditor, block: BlockElement, id: 'unordered-list' | 'ordered-list' | 'check-list'): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function blobToString(blob: Blob): Promise<string>;
|
|
2
|
+
export declare function isClipboardEmpty(): Promise<boolean>;
|
|
3
|
+
export declare function saveAs(resourceUrl: string, resourceId: string): void;
|
|
4
|
+
export declare function blob2String(blob: Blob): Promise<string>;
|
|
5
|
+
export declare function getRandomFileName(mimeType: string, length?: number): string;
|
|
6
|
+
export declare function getClipboardData(): Promise<DataTransfer>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BlockOptions, CommandItem } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { QuickMenuCommandProvider } from '../../quick-menu/types';
|
|
3
|
+
export interface QuickMenuItem extends CommandItem {
|
|
4
|
+
blockOptions?: BlockOptions;
|
|
5
|
+
commandProvider?: QuickMenuCommandProvider;
|
|
6
|
+
}
|
|
7
|
+
export declare const injectBlockOptions: (commands: QuickMenuItem[], blockOptions: BlockOptions) => void;
|
|
8
|
+
export declare const injectCommandProvider: (commands: QuickMenuItem[], commandProvider: QuickMenuCommandProvider) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, DocBlockText, OnesEditor, SelectionRange, TextStyles } from '../../../../../@ones-editor/core';
|
|
2
|
+
export declare function getIntersectionStyles(text: DocBlockText): Map<any, any>;
|
|
3
|
+
export declare function getTextStyles(editor: OnesEditor, block: BlockElement, range: SelectionRange): TextStyles;
|
|
4
|
+
export declare function applyTextStyle(editor: OnesEditor, block: BlockElement, range: SelectionRange, style: string, value?: boolean | string | number): DocBlockText;
|
|
5
|
+
export declare function getStandardTextStyles(editor: OnesEditor, textStyles: CommandItem[], text: DocBlockText): CommandItem[];
|
|
6
|
+
export declare function getSubText(editor: OnesEditor, block: BlockElement, range: SelectionRange): DocBlockText;
|
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
import { OnesEditor, CommandItem } from '../../../../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, CommandItem, CommandFilterId, CommandFilter } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorAutoSuggest } from '../../../../@ones-editor/ui-base';
|
|
3
|
-
import {
|
|
4
|
-
import { getHeadingMenuOptions } from './basic-menu-items';
|
|
5
|
-
import * as BasicCommands from './basic-commands';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './quick-menu-items';
|
|
8
|
-
export { getHeadingMenuOptions, BasicCommands };
|
|
3
|
+
import { QuickMenuOptions } from './types';
|
|
9
4
|
export default class OnesEditorQuickMenu {
|
|
10
5
|
protected editor: OnesEditor;
|
|
11
6
|
private options;
|
|
12
7
|
protected suggest: OnesEditorAutoSuggest;
|
|
13
|
-
private
|
|
14
|
-
private maxHeading;
|
|
8
|
+
private items;
|
|
15
9
|
private firstEmptyOffset;
|
|
16
|
-
private
|
|
17
|
-
private currentContainerId;
|
|
18
|
-
private currentBlockIndex;
|
|
19
|
-
private get selectedBlock();
|
|
20
|
-
private get items();
|
|
21
|
-
private set items(value);
|
|
10
|
+
private quickCommandProviders;
|
|
22
11
|
constructor(editor: OnesEditor, options?: QuickMenuOptions);
|
|
23
|
-
get menu(): import("@ones-editor/ui-base").ManualMenu;
|
|
24
|
-
addFilter(id:
|
|
12
|
+
get menu(): import("@ones-editor/ui-base").ManualMenu | import("@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu").MobileBottomMenu;
|
|
13
|
+
addFilter(id: CommandFilterId, filter: CommandFilter): void;
|
|
25
14
|
destroy(): void;
|
|
26
|
-
queryItems: (suggest: unknown, text: string) => Promise<
|
|
15
|
+
queryItems: (suggest: unknown, text: string) => Promise<CommandItem[]>;
|
|
27
16
|
onClose: () => void;
|
|
28
17
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
29
18
|
onClickItem: (suggest: unknown, item: CommandItem) => void;
|
|
30
19
|
private initMenuItems;
|
|
31
|
-
private refreshMenuItems;
|
|
32
20
|
private handleEmptySearch;
|
|
33
21
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractProvider, CommandItemWithSource, OnesEditor, OnesEditorCommandProviders, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class QuickCommandProviders extends AbstractProvider implements OnesEditorCommandProviders {
|
|
3
|
+
protected editor: OnesEditor;
|
|
4
|
+
id: string;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
getCommands(range: SelectionRange): CommandItemWithSource[];
|
|
7
|
+
executeCommand: (range: SelectionRange, item: CommandItemWithSource) => {};
|
|
8
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandItem, BlockOptions, OnesEditor, BlockElement } from '../../../../@ones-editor/core';
|
|
1
|
+
import { CommandItem, BlockOptions, OnesEditor, BlockElement, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
export interface QuickMenuItem extends CommandItem {
|
|
3
3
|
itemType: 'insert-block';
|
|
4
4
|
blockType?: string;
|
|
@@ -26,11 +26,8 @@ export interface QuickMenuCommandBetween extends QuickMenuCommandParams {
|
|
|
26
26
|
export interface QuickMenuCommandProvider {
|
|
27
27
|
getCommands: (editor: OnesEditor, params: QuickMenuCommandParams) => CommandItem[];
|
|
28
28
|
executeCommand: (editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween | AddMenuCommand) => Promise<BlockElement | null>;
|
|
29
|
+
filterCommands?: (editor: OnesEditor, items: CommandItem[], range: SelectionRange) => CommandItem[];
|
|
29
30
|
}
|
|
30
|
-
export interface QuickMenuItemFilter {
|
|
31
|
-
filter: (editor: OnesEditor, items: QuickMenuItem[], from: QuickMenuCommandParams['from']) => QuickMenuItem[];
|
|
32
|
-
}
|
|
33
|
-
export type QuickMenuItemFilterId = keyof any;
|
|
34
31
|
export interface QuickMenuOptions {
|
|
35
32
|
id?: string;
|
|
36
33
|
trigger: string[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ReadonlyCommandOptions, ReadonlyToolbarCommandProvider } from './types';
|
|
3
|
+
export declare class AddCommentToOldDocCommandProvider implements ReadonlyToolbarCommandProvider, OnesEditorBlockHook {
|
|
4
|
+
private editor;
|
|
5
|
+
private version;
|
|
6
|
+
private localCreatedComments;
|
|
7
|
+
constructor(editor: OnesEditor, version: number);
|
|
8
|
+
onCreateComment(commentId: string, local: boolean): Promise<void>;
|
|
9
|
+
onDeleteComment(commentId: string, local: boolean): Promise<void>;
|
|
10
|
+
onUpdateComment(commentId: string, local: boolean): Promise<void>;
|
|
11
|
+
hideToolbar(editor: OnesEditor): void;
|
|
12
|
+
commands(editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null): {
|
|
13
|
+
group: string;
|
|
14
|
+
commands: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}[];
|
|
18
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
|
|
19
|
+
} | undefined;
|
|
20
|
+
getTextCommands(editor: OnesEditor, range: SelectionRange): CommandItem[];
|
|
21
|
+
executeCommand(editor: OnesEditor, command: CommandItem, options: ReadonlyCommandOptions): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCustom, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
3
|
+
import { AbstractCommandBar, ManualToolbar } from '../../../../@ones-editor/ui-base';
|
|
4
|
+
import type { ReadonlyToolbarCommandProvider } from './types';
|
|
5
|
+
export declare class ReadonlyToolbar implements OnesEditorCustom {
|
|
6
|
+
private editor;
|
|
7
|
+
toolbar: ManualToolbar;
|
|
8
|
+
toolbarType: 'text' | 'object';
|
|
9
|
+
mouseDown: boolean;
|
|
10
|
+
hoveringBlock: BlockElement | null;
|
|
11
|
+
hoveringTextChild: TextBlockContentChild | null;
|
|
12
|
+
oldRange: SelectionRange | null;
|
|
13
|
+
providers: ReadonlyToolbarCommandProvider[];
|
|
14
|
+
constructor(editor: OnesEditor);
|
|
15
|
+
destroy(): void;
|
|
16
|
+
addProvider(provider: ReadonlyToolbarCommandProvider): void;
|
|
17
|
+
isInBlock(block: BlockElement, event: MouseEvent): boolean;
|
|
18
|
+
handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
|
|
19
|
+
handleClose: () => void;
|
|
20
|
+
handleClosing: (bar: unknown, event: MouseEvent | TouchEvent) => boolean;
|
|
21
|
+
bindEvents(): void;
|
|
22
|
+
unbindEvents(): void;
|
|
23
|
+
handleDocumentMouseDown: (event: MouseEvent) => void;
|
|
24
|
+
handleDocumentMouseUp: () => void;
|
|
25
|
+
handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
|
|
26
|
+
private handleHoveringBlockChildChange;
|
|
27
|
+
groupCommands: (allCommands: CommandItem[]) => CommandItem[];
|
|
28
|
+
showTextToolbar(reason: string): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
import { CommandBar } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
export interface ReadonlyCommandOptions {
|
|
4
|
+
hoveringBlock: BlockElement | null;
|
|
5
|
+
hoveringTextChild: TextBlockContentChild | null;
|
|
6
|
+
bar: CommandBar;
|
|
7
|
+
}
|
|
8
|
+
export interface ReadonlyToolbarCommandProvider {
|
|
9
|
+
getTextCommands?: (editor: OnesEditor, range: SelectionRange) => CommandItem[];
|
|
10
|
+
destroy?: () => void;
|
|
11
|
+
executeCommand: (editor: OnesEditor, command: CommandItem, options: ReadonlyCommandOptions) => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
import { EditLinkProvider } from '../providers/edit-link-provider';
|
|
3
|
+
import ClipboardProvider from '../providers/clipboard-provider';
|
|
4
|
+
export declare class LinkCommands implements OnesEditorBlockHook {
|
|
5
|
+
private editor;
|
|
6
|
+
provider: EditLinkProvider;
|
|
7
|
+
clipboardProvider: ClipboardProvider;
|
|
8
|
+
constructor(editor: OnesEditor);
|
|
9
|
+
commands(editor: OnesEditor, block: BlockElement, child: TextBlockContentChild | null): BlockCommands | undefined;
|
|
10
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
|
|
11
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getTextCommands(editor: OnesEditor, blockCommands:
|
|
1
|
+
import { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function getTextCommands(editor: OnesEditor, blockCommands: CommandItem[]): CommandItem[];
|
|
@@ -23,11 +23,12 @@ export default class OnesEditorToolbar implements OnesEditorHoveringBlockFilter,
|
|
|
23
23
|
isInBlock(block: BlockElement, event: MouseEvent): boolean;
|
|
24
24
|
handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
|
|
25
25
|
handleClose: () => void;
|
|
26
|
-
handleClosing: (bar: unknown, event: MouseEvent) => boolean;
|
|
26
|
+
handleClosing: (bar: unknown, event: MouseEvent | TouchEvent) => boolean;
|
|
27
27
|
bindEvents(): void;
|
|
28
28
|
unbindEvents(): void;
|
|
29
29
|
handleDocumentMouseDown: (event: MouseEvent) => void;
|
|
30
30
|
handleDocumentMouseUp: () => void;
|
|
31
|
+
isHoveringBlockContent(block: BlockElement): boolean;
|
|
31
32
|
private handleHoveringBlockChildChange;
|
|
32
33
|
handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
|
|
33
34
|
updateItems(updater: (items: CommandItem[]) => CommandItem[]): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { CommandItem } from '../../../../@ones-editor/core';
|
|
3
3
|
import { AbstractCommandBar, ManualMenu } from '../command-bar';
|
|
4
|
+
import { MobileBottomMenu } from '../mobile-command-bar/mobile-bottom-menu';
|
|
4
5
|
export interface AutoSuggestMenuOptions {
|
|
5
6
|
id: string;
|
|
6
7
|
showLoading?: boolean;
|
|
@@ -15,13 +16,14 @@ export interface AutoSuggestMenuOptions {
|
|
|
15
16
|
disableSelectedScroll?: boolean;
|
|
16
17
|
onClose?: () => void;
|
|
17
18
|
onShow?: (menu: AutoSuggestMenu) => boolean | undefined;
|
|
19
|
+
onShown?: (menu: AutoSuggestMenu) => void;
|
|
18
20
|
onClickItem: (menu: AutoSuggestMenu, item: CommandItem) => void;
|
|
19
21
|
queryItems: (menu: AutoSuggestMenu, text: string) => Promise<CommandItem[]>;
|
|
20
22
|
renderMenuItem?: (menu: AutoSuggestMenu, item: CommandItem) => HTMLElement | undefined;
|
|
21
23
|
}
|
|
22
24
|
export default class AutoSuggestMenu {
|
|
23
25
|
protected options: AutoSuggestMenuOptions;
|
|
24
|
-
menu: ManualMenu;
|
|
26
|
+
menu: ManualMenu | MobileBottomMenu;
|
|
25
27
|
private currentText;
|
|
26
28
|
handleSearchText: (text: string) => void;
|
|
27
29
|
constructor(options: AutoSuggestMenuOptions);
|
|
@@ -39,6 +41,7 @@ export default class AutoSuggestMenu {
|
|
|
39
41
|
handleSearchTextPure(text: string): Promise<void>;
|
|
40
42
|
handleClick: import("lodash").DebouncedFuncLeading<(menu: AbstractCommandBar, item: CommandItem) => void>;
|
|
41
43
|
handleShow: (menu: AbstractCommandBar) => void;
|
|
44
|
+
handleShown: () => void;
|
|
42
45
|
handleClose: () => void;
|
|
43
46
|
handleKeydown: (event: KeyboardEvent) => boolean;
|
|
44
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;
|
|
@@ -43,9 +44,10 @@ declare class OnesEditorAutoSuggest implements OnesEditorInputHandler {
|
|
|
43
44
|
handleUpdateCompositionText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, end: boolean): boolean;
|
|
44
45
|
handleSelectionChanged: (editor: OnesEditor) => void;
|
|
45
46
|
private resetItems;
|
|
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;
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
3
|
import { ColorPaletteItem } from '../color-palette';
|
|
4
|
-
import { ColorPaletteEvents } from '../color-palette/color-palette';
|
|
4
|
+
import { ColorPaletteEvents, ColorAction } from '../color-palette/color-palette';
|
|
5
|
+
import './text-color-item.scss';
|
|
5
6
|
export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> implements CommandItem {
|
|
6
|
-
|
|
7
|
+
editor: OnesEditor;
|
|
8
|
+
private storageName;
|
|
7
9
|
id: string;
|
|
8
10
|
name: string;
|
|
9
11
|
dropdown: boolean;
|
|
12
|
+
dropSplit: boolean;
|
|
13
|
+
splitTooltip: string;
|
|
10
14
|
manualShowChildren: boolean;
|
|
15
|
+
childrenType: "mobile-bottom-menu" | undefined;
|
|
11
16
|
children: CommandItem[];
|
|
12
17
|
element: HTMLButtonElement;
|
|
13
18
|
colorPaletteItem: ColorPaletteItem;
|
|
14
19
|
latestColors: [number | null, number | null];
|
|
15
|
-
|
|
20
|
+
private currentTextColors;
|
|
21
|
+
constructor(editor: OnesEditor, storageName?: string);
|
|
16
22
|
destroy(): void;
|
|
17
|
-
handlePaletteClick: (type:
|
|
18
|
-
|
|
23
|
+
handlePaletteClick: (type: ColorAction, value: number) => void;
|
|
24
|
+
handleButtonClick: (event: MouseEvent) => void;
|
|
25
|
+
private setLatestColors;
|
|
19
26
|
beforePopup: () => void;
|
|
20
|
-
updatePaletteColor(
|
|
21
|
-
|
|
27
|
+
updatePaletteColor(): void;
|
|
28
|
+
setCurrentTextColors(colors: [number | null, number | null]): void;
|
|
22
29
|
}
|
|
@@ -3,7 +3,13 @@ import type { ColorPaletteOptions } from './create-palette';
|
|
|
3
3
|
import './palette.scss';
|
|
4
4
|
export { ColorPaletteOptions };
|
|
5
5
|
export type ColorType = 'color' | 'backgroundColor';
|
|
6
|
-
export type
|
|
6
|
+
export type ColorAction = ColorType | 'clearColor';
|
|
7
|
+
export declare enum ColorClearActions {
|
|
8
|
+
clearAll = 0,
|
|
9
|
+
clearColor = 1,
|
|
10
|
+
clearBackground = 2
|
|
11
|
+
}
|
|
12
|
+
export type PaletteClickHandler = (type: ColorAction, value: number) => void;
|
|
7
13
|
export interface ColorPaletteEvents {
|
|
8
14
|
onClick: PaletteClickHandler;
|
|
9
15
|
beforePopup: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColorPaletteOptions, PaletteClickHandler } from './color-palette';
|
|
2
|
-
import ColorPalette from './color-palette';
|
|
1
|
+
import type { ColorPaletteOptions, PaletteClickHandler, ColorAction } from './color-palette';
|
|
2
|
+
import ColorPalette, { ColorClearActions } from './color-palette';
|
|
3
3
|
import ColorPaletteItem from './color-palette-item';
|
|
4
|
-
export { ColorPalette, ColorPaletteOptions, ColorPaletteItem, PaletteClickHandler };
|
|
4
|
+
export { ColorPalette, ColorPaletteOptions, ColorPaletteItem, PaletteClickHandler, ColorClearActions, ColorAction };
|
|
@@ -22,20 +22,22 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
22
22
|
get isSubCommandBar(): boolean;
|
|
23
23
|
updateItems(items: CommandItem[]): void;
|
|
24
24
|
handleDocumentKeydown: (event: KeyboardEvent) => boolean;
|
|
25
|
-
protected handleDocumentMouseDown: (event: MouseEvent) => void;
|
|
25
|
+
protected handleDocumentMouseDown: (event: MouseEvent | TouchEvent) => void;
|
|
26
26
|
protected handleHidden: () => void;
|
|
27
|
+
protected handleShown: () => void;
|
|
27
28
|
protected handleShow: () => void;
|
|
28
29
|
get popper(): Element | null;
|
|
29
30
|
private getSelectedItemIndex;
|
|
30
31
|
private getPrevItemIndex;
|
|
31
32
|
private getNextItemIndex;
|
|
32
33
|
protected clearSelectedItem(): void;
|
|
34
|
+
private debounceClearSelectedItem;
|
|
33
35
|
selectItem(id: string, from?: SelectItemFrom): void;
|
|
34
36
|
private lastEnterPauseTime;
|
|
35
37
|
private startPauseMouseEnter;
|
|
36
38
|
private handleItemMouseEnter;
|
|
37
39
|
private handleItemMouseLeave;
|
|
38
|
-
protected handleItemClick: (event: MouseEvent) => void;
|
|
40
|
+
protected handleItemClick: (event: MouseEvent | TouchEvent) => void;
|
|
39
41
|
private showSubCommandBar;
|
|
40
42
|
isInCommandBar(target: EventTarget | null): boolean;
|
|
41
43
|
createCommandItem(item: CommandItem): CommandItemElement;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CommandItem } from '../../../../@ones-editor/core';
|
|
2
2
|
import CommandBar from './command-bar';
|
|
3
|
-
import { CommandBarOptions, CommandItemElement } from './types';
|
|
3
|
+
import { CommandBarOptions, CommandItemElement, ManualShowCommandBarOptions } from './types';
|
|
4
4
|
export default class FixedToolbar extends CommandBar {
|
|
5
5
|
constructor(parent: HTMLElement, items: CommandItem[], options?: CommandBarOptions);
|
|
6
6
|
protected initCommandBarElement(elem: HTMLElement): void;
|
|
7
7
|
protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
|
|
8
8
|
close(): void;
|
|
9
|
+
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
9
10
|
destroy(): void;
|
|
10
11
|
protected getCommandBarRoot(): HTMLElement | null;
|
|
11
12
|
get isVisible(): boolean;
|
|
@@ -2,5 +2,6 @@ import { CommandItem } from '../../../../@ones-editor/core';
|
|
|
2
2
|
import { CommandItemElement } from './types';
|
|
3
3
|
export type InitToolbarItemOptions = {
|
|
4
4
|
tooltipId?: string;
|
|
5
|
+
showName?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare function initToolbarItem(item: CommandItem, elem: CommandItemElement, options: InitToolbarItemOptions): void;
|
|
@@ -4,6 +4,7 @@ import CommandBar from './command-bar';
|
|
|
4
4
|
import { AbstractManualCommandBar, ManualShowCommandBarOptions } from './types';
|
|
5
5
|
export default abstract class ManualCommandBar extends CommandBar implements AbstractManualCommandBar {
|
|
6
6
|
tippyInstance: Instance | null;
|
|
7
|
+
setProps: (props: ManualShowCommandBarOptions) => void;
|
|
7
8
|
manualShow(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
|
|
8
9
|
close(reason: CloseReason): void;
|
|
9
10
|
destroy(): void;
|
|
@@ -4,10 +4,12 @@ import type { GetReferenceClientRect, Placement } from 'tippy.js';
|
|
|
4
4
|
export { Placement };
|
|
5
5
|
export interface CommandBarEvents {
|
|
6
6
|
'show': (bar: AbstractCommandBar) => void;
|
|
7
|
+
'shown': (bar: AbstractCommandBar) => void;
|
|
7
8
|
'click': (bar: AbstractCommandBar, item: CommandItem, elem: HTMLElement) => void;
|
|
8
9
|
'close': (bar: AbstractCommandBar) => void;
|
|
9
10
|
'selectionChange': (bar: AbstractCommandBar, id: string) => void;
|
|
10
|
-
'closing': (bar: AbstractCommandBar, event: MouseEvent) => boolean | undefined;
|
|
11
|
+
'closing': (bar: AbstractCommandBar, event: MouseEvent | TouchEvent) => boolean | undefined;
|
|
12
|
+
'subBarShown': (bar: AbstractCommandBar, subBar: AbstractCommandBar) => void;
|
|
11
13
|
}
|
|
12
14
|
export interface ManualShowCommandBarOptions {
|
|
13
15
|
placement?: Placement;
|
|
@@ -28,6 +30,8 @@ export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
|
|
|
28
30
|
isInCommandBar: (target: EventTarget | null) => boolean;
|
|
29
31
|
handleDocumentKeydown: (event: KeyboardEvent) => boolean;
|
|
30
32
|
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
33
|
+
updateItems: (items: CommandItem[]) => void;
|
|
34
|
+
setProps?: (props: ManualShowCommandBarOptions) => void;
|
|
31
35
|
}
|
|
32
36
|
export interface ShowCommandBarOptions {
|
|
33
37
|
placement?: Placement;
|
|
@@ -61,7 +65,8 @@ export interface CommandBarOptions {
|
|
|
61
65
|
header?: HTMLElement | (() => HTMLElement | null);
|
|
62
66
|
footer?: HTMLElement | (() => HTMLElement | null);
|
|
63
67
|
padding?: number;
|
|
64
|
-
beforeClose?: (event?: MouseEvent) => boolean;
|
|
68
|
+
beforeClose?: (event?: MouseEvent | TouchEvent) => boolean;
|
|
69
|
+
showName?: boolean;
|
|
65
70
|
}
|
|
66
71
|
export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable: Closeable, options?: CommandBarOptions) => AbstractManualCommandBar;
|
|
67
72
|
export type PopoverOptions = {
|
|
@@ -20,6 +20,6 @@ export default class ManualCloseDialog extends ManualCommandBar {
|
|
|
20
20
|
getReferenceClientRect?: GetReferenceClientRect | null | undefined;
|
|
21
21
|
}): void;
|
|
22
22
|
get dialogContent(): HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
23
|
-
handleDocumentMouseDown: (
|
|
23
|
+
handleDocumentMouseDown: () => void;
|
|
24
24
|
static getCommandItems(content: HTMLElement, options?: ManualCloseDialogOptions): CommandItem[];
|
|
25
25
|
}
|
|
@@ -120,4 +120,8 @@ import SymbolIcon from './symbol.svg?raw';
|
|
|
120
120
|
import TreeIcon from './tree.svg?raw';
|
|
121
121
|
import TimeIcon from './time.svg?raw';
|
|
122
122
|
import SearchIcon from './search.svg?raw';
|
|
123
|
-
|
|
123
|
+
import TextGroupIcon from './text-group.svg?raw';
|
|
124
|
+
import TabIcon from './tab.svg?raw';
|
|
125
|
+
import ShiftTabIcon from './shift-tab.svg?raw';
|
|
126
|
+
import TableEditIcon from './table-edit.svg?raw';
|
|
127
|
+
export { TableEditIcon, TabIcon, ShiftTabIcon, DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, 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, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, 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, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, TextGroupIcon, };
|
|
@@ -15,4 +15,7 @@ export * from './input/create-input';
|
|
|
15
15
|
export * from './auto-suggest';
|
|
16
16
|
export * from './item-shortcuts';
|
|
17
17
|
export * from './emoji-item';
|
|
18
|
+
export * from './mobile-command-bar/mobile-bottom-menu';
|
|
19
|
+
export * from './text-button';
|
|
20
|
+
export { scrollBarIntoView } from './mobile-command-bar/scroll-into-view';
|
|
18
21
|
export { tippy, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './input.scss';
|
|
2
|
-
export
|
|
2
|
+
export type EditorInputOptions = {
|
|
3
3
|
label?: string;
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
required?: boolean;
|
|
@@ -9,9 +9,30 @@ export declare function createInput(parent: HTMLElement, options: {
|
|
|
9
9
|
onKeyDown?: (e: KeyboardEvent, composing: boolean) => void;
|
|
10
10
|
maxLength?: number;
|
|
11
11
|
prefix?: Element;
|
|
12
|
-
|
|
12
|
+
suffixClose?: boolean;
|
|
13
|
+
mode?: 'textarea' | 'input';
|
|
14
|
+
};
|
|
15
|
+
export declare class EditorInput {
|
|
16
|
+
private parent;
|
|
17
|
+
private options;
|
|
18
|
+
private unbindKeyDownEvent;
|
|
19
|
+
constructor(parent: HTMLElement, options: EditorInputOptions);
|
|
20
|
+
private container;
|
|
21
|
+
private get errorContent();
|
|
22
|
+
private get input();
|
|
23
|
+
private get suffix();
|
|
24
|
+
private get prefix();
|
|
13
25
|
getField: () => HTMLInputElement;
|
|
14
26
|
getInputValue: () => string;
|
|
15
27
|
setFieldError: (error: string) => void;
|
|
16
28
|
focus: () => void;
|
|
17
|
-
|
|
29
|
+
handleKeyDown: (e: KeyboardEvent, composing: boolean) => void;
|
|
30
|
+
showSuffix: () => void;
|
|
31
|
+
hideSuffix: () => void;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
handleInput: (e: Event) => void;
|
|
34
|
+
handleClose: (e: Event | TouchEvent) => void;
|
|
35
|
+
init(): HTMLDivElement;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
}
|
|
38
|
+
export declare function createInput(parent: HTMLElement, options: EditorInputOptions): EditorInput;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Closeable, CloseReason, CommandItem } from '../../../../@ones-editor/core';
|
|
2
|
+
import { Instance } from 'tippy.js';
|
|
3
|
+
import './mobile-bottom-menu.scss';
|
|
4
|
+
import { AbstractManualCommandBar, CommandBar, CommandBarContentElement, CommandBarOptions, CommandItemElement, ManualShowCommandBarOptions } from '../command-bar';
|
|
5
|
+
declare class MobileBottomMenu extends CommandBar implements AbstractManualCommandBar {
|
|
6
|
+
tippyInstance: Instance | null;
|
|
7
|
+
constructor(items: CommandItem[], closeable?: Closeable, options?: CommandBarOptions);
|
|
8
|
+
createContentWithHeader: () => HTMLDivElement;
|
|
9
|
+
handleClose: () => void;
|
|
10
|
+
oldActiveElement: HTMLElement | null;
|
|
11
|
+
manualShow: (target: HTMLElement, options?: ManualShowCommandBarOptions) => void;
|
|
12
|
+
close(reason: CloseReason): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
get isVisible(): boolean;
|
|
15
|
+
get popper(): Element | null;
|
|
16
|
+
protected initCommandBarElement(elem: CommandBarContentElement): void;
|
|
17
|
+
protected getCommandBarRoot(): HTMLElement | null;
|
|
18
|
+
protected initItemElement(item: CommandItem, elem: CommandItemElement): void;
|
|
19
|
+
}
|
|
20
|
+
declare function createMobileBottomMenu(): void;
|
|
21
|
+
export { createMobileBottomMenu, MobileBottomMenu, };
|
|
@@ -3,7 +3,7 @@ import ManualCommandBar from '../command-bar/manual-command-bar';
|
|
|
3
3
|
import { CommandBarContentElement, CommandItemElement } from '../command-bar/types';
|
|
4
4
|
export type PopupOptions = {
|
|
5
5
|
id?: string;
|
|
6
|
-
beforeClose?: (event?: MouseEvent) => boolean;
|
|
6
|
+
beforeClose?: (event?: MouseEvent | TouchEvent) => boolean;
|
|
7
7
|
};
|
|
8
8
|
export default class Popup extends ManualCommandBar {
|
|
9
9
|
constructor(content: HTMLElement, options?: PopupOptions);
|
|
@@ -3,7 +3,8 @@ import { DocObject, LocalDoc, OnesEditor, OnesEditorComment, OnesEditorDoc } fro
|
|
|
3
3
|
export default class LocalDocCommentsProvider implements OnesEditorCommentsProvider {
|
|
4
4
|
private editor;
|
|
5
5
|
private localDoc;
|
|
6
|
-
private
|
|
6
|
+
private _listeners;
|
|
7
|
+
private _doc;
|
|
7
8
|
constructor(editor: OnesEditor, localDoc: OnesEditorDoc);
|
|
8
9
|
get doc(): DocObject;
|
|
9
10
|
getComments(): OnesEditorComment[];
|