@ones-editor/editor 2.1.0-beta.6 → 2.1.0-beta.8
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/{ui → block-menu}/src/block-menu/index.d.ts +1 -3
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +3 -0
- package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +5 -0
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +5 -0
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +30 -0
- package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +5 -0
- package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +1 -1
- package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +4 -3
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +16 -0
- package/@ones-editor/comments/src/index.d.ts +3 -0
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +3 -4
- 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 +2 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +2 -7
- package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +0 -2
- package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +3 -3
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +3 -4
- package/@ones-editor/core/src/core/command-providers/index.d.ts +1 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/root-container.d.ts +4 -4
- package/@ones-editor/core/src/core/doc/doc.d.ts +3 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +1 -2
- package/@ones-editor/core/src/core/selection/index.d.ts +0 -1
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +35 -29
- package/@ones-editor/core/src/utils/dom.d.ts +0 -3
- package/@ones-editor/core/src/utils/drag-drop.d.ts +3 -8
- package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
- package/@ones-editor/mobile-helper/src/index.d.ts +0 -6
- package/@ones-editor/sharedb-doc/src/index.d.ts +3 -0
- package/@ones-editor/table-block/src/commands/index.d.ts +0 -2
- package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +3 -4
- package/@ones-editor/table-block/src/index.d.ts +1 -4
- package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +0 -6
- 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 +2 -1
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +24 -0
- package/@ones-editor/text-commands/src/text-commands.d.ts +4 -0
- package/@ones-editor/{ui/src/providers/utils → text-commands/src}/text-styles.d.ts +1 -3
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +10 -22
- package/@ones-editor/ui/src/{providers/utils → quick-menu}/basic-commands.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +16 -0
- package/@ones-editor/ui/src/quick-menu/index.d.ts +18 -6
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +8 -0
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -0
- package/@ones-editor/ui/src/quick-menu/order.d.ts +1 -0
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +9 -0
- package/@ones-editor/ui/src/quick-menu/types.d.ts +4 -0
- 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 +30 -0
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +12 -0
- package/@ones-editor/ui/src/{providers → toolbar/commands}/align.d.ts +4 -4
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +11 -0
- package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +10 -0
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +7 -0
- package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +0 -1
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -2
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/dist/comments/local-doc-comments-provider.d.ts +2 -1
- package/dist/index.js +18775 -19597
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/@ones-editor/core/src/core/command-providers/block-attributes.d.ts +0 -14
- package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +0 -3
- package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +0 -3
- package/@ones-editor/layout-block/src/command-filter.d.ts +0 -7
- package/@ones-editor/mobile-helper/src/fixed-toolbar/fixed-providers.d.ts +0 -7
- package/@ones-editor/mobile-helper/src/fixed-toolbar/index.d.ts +0 -18
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/align-dropdown.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/group.d.ts +0 -7
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert-menu.d.ts +0 -13
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +0 -8
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/text-dropdown.d.ts +0 -9
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/turn-into.d.ts +0 -8
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +0 -11
- package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +0 -19
- package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +0 -3
- package/@ones-editor/mobile-helper/src/ui/init-menu-item.d.ts +0 -3
- package/@ones-editor/mobile-helper/src/ui/mobile-bottom-menu.d.ts +0 -22
- package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +0 -10
- package/@ones-editor/ui/src/providers/abstract-providers.d.ts +0 -27
- package/@ones-editor/ui/src/providers/align-dropdown.d.ts +0 -10
- package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +0 -16
- package/@ones-editor/ui/src/providers/color-provider.d.ts +0 -16
- package/@ones-editor/ui/src/providers/heading.d.ts +0 -13
- package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +0 -12
- package/@ones-editor/ui/src/providers/inline-style-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/insert-above.d.ts +0 -9
- package/@ones-editor/ui/src/providers/insert-after.d.ts +0 -9
- package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +0 -12
- package/@ones-editor/ui/src/providers/insert-group.d.ts +0 -7
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +0 -16
- package/@ones-editor/ui/src/providers/link.d.ts +0 -17
- package/@ones-editor/ui/src/providers/list.d.ts +0 -14
- package/@ones-editor/ui/src/providers/paragraph.d.ts +0 -8
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/quoted.d.ts +0 -12
- package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +0 -9
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +0 -18
- package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +0 -16
- package/@ones-editor/ui/src/providers/text-script-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/text-styles.d.ts +0 -9
- package/@ones-editor/ui/src/providers/turn-into.d.ts +0 -9
- package/@ones-editor/ui/src/providers/types.d.ts +0 -3
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +0 -2
- package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +0 -5
- package/@ones-editor/ui/src/providers/utils/range-commands.d.ts +0 -2
- package/@ones-editor/ui/src/providers/utils/text-commands.d.ts +0 -3
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +0 -10
- package/@ones-editor/ui-base/src/command-bar/mobile-bottom-menu.d.ts +0 -18
- /package/@ones-editor/{ui → block-menu}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
import OnesEditorToolbar from './toolbar/toolbar-handler';
|
|
3
|
-
import { QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, QuickMenuCommandParams, AddMenuCommand,
|
|
4
|
-
import OnesEditorQuickMenu from './quick-menu';
|
|
5
|
-
import * as BasicCommands from './providers/utils/basic-commands';
|
|
3
|
+
import OnesEditorQuickMenu, { getAllQuickMenuItems, getHeadingMenuOptions, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider, BasicCommands, GetAllQuickMenuItemsOptions, QuickMenuCommandParams, AddMenuCommand, QuickMenuItemFilter } from './quick-menu';
|
|
6
4
|
import OnesEditorTooltip from './tooltips';
|
|
7
5
|
import TextStyleShortcuts from './shortcuts';
|
|
8
6
|
import { editLink } from './link-popup';
|
|
9
7
|
import { getToolbar } from './toolbar/helper';
|
|
8
|
+
import { GroupOrder } from './quick-menu/order';
|
|
10
9
|
import { getReferenceClientRect } from './toolbar/get-reference-client-rect';
|
|
11
10
|
import { isSelectBoxOnly } from './toolbar/box-only';
|
|
11
|
+
import { InlineBoxCommandProvider } from './quick-menu/inline-box-items';
|
|
12
12
|
import './locale';
|
|
13
13
|
import type { OnesEditorToolbarBase } from './toolbar/types';
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { AbstractProvider } from './providers/abstract-providers';
|
|
21
|
-
import HeadingProvider from './providers/heading';
|
|
22
|
-
import { ProxyProvider } from './providers/proxy-provider';
|
|
23
|
-
import ParagraphProvider from './providers/paragraph';
|
|
24
|
-
import AlignProvider from './providers/align';
|
|
25
|
-
import { InlineBoxCommandProvider } from './providers/insert-box-provider';
|
|
26
|
-
import { LinkProvider } from './providers/link';
|
|
27
|
-
import { injectBlockOptions } from './providers/utils/inject-block-options';
|
|
28
|
-
import TextCommandProvider from './providers/text-command-provider';
|
|
29
|
-
import InlineCodeProvider from './providers/inline-code-provider';
|
|
30
|
-
export { TextCommandProvider, injectBlockOptions, LinkProvider, InlineBoxCommandProvider, AlignProvider, ParagraphProvider, ProxyProvider, InlineCodeProvider, InlineStyleProvider, ColorStyleProvider, ScriptDropdownProvider, TextScriptProvider, AbstractProvider, HeadingProvider, };
|
|
31
|
-
export type { QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, OnesEditorToolbarBase, QuickMenuItem, QuickMenuOptions, };
|
|
32
|
-
export { BlockMenu, BlockCommandProviders, OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, editLink, TextStyleShortcuts, getToolbar, BasicCommands, isSelectBoxOnly, getReferenceClientRect, };
|
|
14
|
+
import type { QuickMenuItem } from './quick-menu';
|
|
15
|
+
import { ReadonlyToolbar } from './readonly-toolbar';
|
|
16
|
+
import { ReadonlyToolbarCommandProvider, ReadonlyCommandOptions } from './readonly-toolbar/types';
|
|
17
|
+
import { AddCommentToOldDocCommandProvider } from './readonly-toolbar/add-comment-to-old-doc';
|
|
18
|
+
export type { QuickMenuItemFilter, QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, GetAllQuickMenuItemsOptions, OnesEditorToolbarBase, ReadonlyToolbarCommandProvider, ReadonlyCommandOptions, };
|
|
19
|
+
export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions, BasicCommands, GroupOrder, isSelectBoxOnly, InlineBoxCommandProvider, getReferenceClientRect, ReadonlyToolbar, AddCommentToOldDocCommandProvider, };
|
|
33
20
|
export { createTextButton } from './text-button';
|
|
21
|
+
export { mergeCommands } from './toolbar/merge-commands';
|
|
@@ -1,4 +1,5 @@
|
|
|
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,16 @@
|
|
|
1
|
+
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { BlockOptions, CommandItem, OnesEditor, InsertEmptyBlockOptions } from '../../../../@ones-editor/core';
|
|
3
|
+
import type { AddMenuCommand, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider } from './types';
|
|
4
|
+
export declare function addQuickMenuItemFields(item: CommandItem, options: BlockOptions, blockType: string): void;
|
|
5
|
+
export declare function getPlainTextMenuOptions(): BlockOptions;
|
|
6
|
+
export declare function getHeadingMenuOptions(start?: number): BlockOptions;
|
|
7
|
+
export declare function getCompleteHeadingMenuOptions(): CommandItem[];
|
|
8
|
+
export declare class BasicCommandProvider implements QuickMenuCommandProvider {
|
|
9
|
+
private withPlainText?;
|
|
10
|
+
constructor(withPlainText?: boolean | undefined);
|
|
11
|
+
getCommands(): CommandItem[];
|
|
12
|
+
updateBlock(editor: OnesEditor, containerId: string, block: BlockElement, item: CommandItem): null;
|
|
13
|
+
handleUpdateBlockCore(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<null>;
|
|
14
|
+
handleInsertEmptyBlockCore(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<null>;
|
|
15
|
+
executeCommand(editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween | AddMenuCommand): Promise<BlockElement | null>;
|
|
16
|
+
}
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import { OnesEditor, CommandItem
|
|
1
|
+
import { OnesEditor, CommandItem } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorAutoSuggest } from '../../../../@ones-editor/ui-base';
|
|
3
|
-
import { QuickMenuOptions } from './types';
|
|
3
|
+
import { QuickMenuItemFilter, QuickMenuItemFilterId, QuickMenuItem, QuickMenuOptions } from './types';
|
|
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 };
|
|
4
9
|
export default class OnesEditorQuickMenu {
|
|
5
10
|
protected editor: OnesEditor;
|
|
6
11
|
private options;
|
|
7
12
|
protected suggest: OnesEditorAutoSuggest;
|
|
8
|
-
private
|
|
13
|
+
private _items;
|
|
14
|
+
private maxHeading;
|
|
9
15
|
private firstEmptyOffset;
|
|
10
|
-
private
|
|
16
|
+
private commandFilters;
|
|
17
|
+
private currentContainerId;
|
|
18
|
+
private currentBlockIndex;
|
|
19
|
+
private get selectedBlock();
|
|
20
|
+
private get items();
|
|
21
|
+
private set items(value);
|
|
11
22
|
constructor(editor: OnesEditor, options?: QuickMenuOptions);
|
|
12
23
|
get menu(): import("@ones-editor/ui-base").ManualMenu;
|
|
13
|
-
addFilter(id:
|
|
24
|
+
addFilter(id: QuickMenuItemFilterId, filter: QuickMenuItemFilter): void;
|
|
14
25
|
destroy(): void;
|
|
15
|
-
queryItems: (suggest: unknown, text: string) => Promise<
|
|
26
|
+
queryItems: (suggest: unknown, text: string) => Promise<QuickMenuItem[]>;
|
|
16
27
|
onClose: () => void;
|
|
17
28
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
18
29
|
onClickItem: (suggest: unknown, item: CommandItem) => void;
|
|
19
30
|
private initMenuItems;
|
|
31
|
+
private refreshMenuItems;
|
|
20
32
|
private handleEmptySearch;
|
|
21
33
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InsertEmptyBlockOptions, OnesEditor, BlockElement, CommandItem } from '../../../../@ones-editor/core';
|
|
2
|
+
import { AddMenuCommand, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider } from './types';
|
|
3
|
+
export declare class InlineBoxCommandProvider implements QuickMenuCommandProvider {
|
|
4
|
+
getCommands(): CommandItem[];
|
|
5
|
+
handleUpdateBlockCore(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<void | BlockElement | null>;
|
|
6
|
+
handleInsertEmptyBlockCore(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<BlockElement | null>;
|
|
7
|
+
executeCommand(editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween | AddMenuCommand): Promise<BlockElement | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GroupOrder: Record<string, number>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BlockElement, CommandItemMenuType, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { QuickMenuCommandParams, QuickMenuItem } from './types';
|
|
3
|
+
export interface GetAllQuickMenuItemsOptions {
|
|
4
|
+
withPlainText: boolean;
|
|
5
|
+
from: QuickMenuCommandParams['from'];
|
|
6
|
+
type: CommandItemMenuType;
|
|
7
|
+
ignoreFilter?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function getAllQuickMenuItems(editor: OnesEditor, block: BlockElement | undefined, options: GetAllQuickMenuItemsOptions): QuickMenuItem[];
|
|
@@ -27,6 +27,10 @@ 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
29
|
}
|
|
30
|
+
export interface QuickMenuItemFilter {
|
|
31
|
+
filter: (editor: OnesEditor, items: QuickMenuItem[], from: QuickMenuCommandParams['from']) => QuickMenuItem[];
|
|
32
|
+
}
|
|
33
|
+
export type QuickMenuItemFilterId = keyof any;
|
|
30
34
|
export interface QuickMenuOptions {
|
|
31
35
|
id?: string;
|
|
32
36
|
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,30 @@
|
|
|
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) => 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
|
+
showObjectToolbar(event: MouseEvent | null): void;
|
|
30
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockCommandItem, BlockElement, DocBlock, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
2
|
export default class AlignProvider implements OnesEditorCommandProvider {
|
|
3
3
|
private editor;
|
|
4
4
|
id: string;
|
|
5
5
|
constructor(editor: OnesEditor);
|
|
6
|
+
applyAlignStyle(editor: OnesEditor, block: BlockElement, align: string): void;
|
|
6
7
|
isChecked(blockData: DocBlock, id: string): boolean;
|
|
7
|
-
getAvailableCommands(editor: OnesEditor, block: BlockElement):
|
|
8
|
-
|
|
9
|
-
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem): boolean;
|
|
8
|
+
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
|
|
9
|
+
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: BlockCommandItem): boolean;
|
|
10
10
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlockCommandItem, BlockElement, DocBlock, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
export default class ParagraphProvider implements OnesEditorCommandProvider {
|
|
3
|
+
private editor;
|
|
4
|
+
id: string;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
isChecked(blockData: DocBlock, id: string): boolean;
|
|
7
|
+
getAvailableCommands(editor: OnesEditor, block: BlockElement): BlockCommandItem[];
|
|
8
|
+
convertLink(editor: OnesEditor, range: SelectionRange, block: BlockElement): void;
|
|
9
|
+
convertToList(editor: OnesEditor, block: BlockElement, listType: 'unordered' | 'ordered' | 'unchecked'): void;
|
|
10
|
+
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: BlockCommandItem): boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlockCommandItem, BlockElement, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../../@ones-editor/core';
|
|
2
|
+
export default class BlockTurnIntoCommandProvider implements OnesEditorCommandProvider {
|
|
3
|
+
private editor;
|
|
4
|
+
id: string;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
getHeadingIndex(): number;
|
|
7
|
+
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
|
|
8
|
+
applyHeadingStyle(editor: OnesEditor, block: BlockElement, heading: number | null): void;
|
|
9
|
+
executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: BlockCommandItem): boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class LinkCommands implements OnesEditorBlockHook {
|
|
3
|
+
private editor;
|
|
4
|
+
constructor(editor: OnesEditor);
|
|
5
|
+
commands(editor: OnesEditor, block: BlockElement, child: TextBlockContentChild | null): BlockCommands | undefined;
|
|
6
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function getTextCommands(editor: OnesEditor, blockCommands:
|
|
1
|
+
import { BlockCommandItem, CommandItem, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function getTextCommands(editor: OnesEditor, blockCommands: BlockCommandItem[]): CommandItem[];
|
|
@@ -8,7 +8,6 @@ export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> impl
|
|
|
8
8
|
name: string;
|
|
9
9
|
dropdown: boolean;
|
|
10
10
|
manualShowChildren: boolean;
|
|
11
|
-
childrenType: "mobile-bottom-menu" | undefined;
|
|
12
11
|
children: CommandItem[];
|
|
13
12
|
element: HTMLButtonElement;
|
|
14
13
|
colorPaletteItem: ColorPaletteItem;
|
|
@@ -35,7 +35,7 @@ export default abstract class CommandBar extends TypedEmitter<CommandBarEvents>
|
|
|
35
35
|
private startPauseMouseEnter;
|
|
36
36
|
private handleItemMouseEnter;
|
|
37
37
|
private handleItemMouseLeave;
|
|
38
|
-
protected handleItemClick: (event: MouseEvent
|
|
38
|
+
protected handleItemClick: (event: MouseEvent) => void;
|
|
39
39
|
private showSubCommandBar;
|
|
40
40
|
isInCommandBar(target: EventTarget | null): boolean;
|
|
41
41
|
createCommandItem(item: CommandItem): CommandItemElement;
|
|
@@ -28,7 +28,6 @@ export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
|
|
|
28
28
|
isInCommandBar: (target: EventTarget | null) => boolean;
|
|
29
29
|
handleDocumentKeydown: (event: KeyboardEvent) => void;
|
|
30
30
|
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
31
|
-
updateItems: (items: CommandItem[]) => void;
|
|
32
31
|
}
|
|
33
32
|
export interface ShowCommandBarOptions {
|
|
34
33
|
placement?: Placement;
|
|
@@ -62,7 +61,7 @@ export interface CommandBarOptions {
|
|
|
62
61
|
header?: HTMLElement | (() => HTMLElement | null);
|
|
63
62
|
footer?: HTMLElement | (() => HTMLElement | null);
|
|
64
63
|
padding?: number;
|
|
65
|
-
beforeClose?: (event?: MouseEvent
|
|
64
|
+
beforeClose?: (event?: MouseEvent) => boolean;
|
|
66
65
|
}
|
|
67
66
|
export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable: Closeable, options?: CommandBarOptions) => AbstractManualCommandBar;
|
|
68
67
|
export type PopoverOptions = {
|
|
@@ -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
|
|
6
|
+
beforeClose?: (event?: MouseEvent) => 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[];
|