@ones-editor/editor 2.1.1-beta.11 → 2.1.1-beta.14
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/block-padding/src/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/index.d.ts +0 -3
- 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 +1 -2
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +7 -2
- 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 +5 -2
- package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +14 -4
- package/@ones-editor/core/src/core/command-providers/index.d.ts +1 -3
- 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 +0 -3
- package/@ones-editor/core/src/core/doc/rich-text/text-style.d.ts +0 -2
- package/@ones-editor/core/src/core/editor/actions/clear-selected-contents.d.ts +2 -2
- 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 +28 -36
- 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/mention/src/locale/en-us.d.ts +0 -1
- package/@ones-editor/mention/src/locale/ja-jp.d.ts +0 -1
- package/@ones-editor/mention/src/locale/zh-cn.d.ts +0 -1
- package/@ones-editor/mention/src/mention.d.ts +0 -14
- package/@ones-editor/mobile-helper/src/index.d.ts +0 -6
- package/@ones-editor/sharedb-doc/src/index.d.ts +0 -3
- 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 +8 -29
- package/@ones-editor/ui/src/locale/en-us.d.ts +0 -1
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +0 -1
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +0 -1
- 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 +19 -7
- 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-base → ui}/src/text-button/index.d.ts +1 -1
- 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/merge-commands.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +1 -2
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +0 -1
- package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -3
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -3
- package/@ones-editor/ui-base/src/index.d.ts +0 -2
- package/@ones-editor/ui-base/src/input/create-input.d.ts +3 -23
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/dist/comments/local-doc-comments-provider.d.ts +1 -2
- package/dist/index.js +20534 -23155
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/@ones-editor/comments/src/comments-helper/old-version-comment.d.ts +0 -16
- package/@ones-editor/core/src/core/command-providers/abstract-providers.d.ts +0 -25
- 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 -6
- 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 -15
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/insert.d.ts +0 -8
- package/@ones-editor/mobile-helper/src/fixed-toolbar/providers/paragraph.d.ts +0 -9
- 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/ui/src/block-menu/block-command-providers.d.ts +0 -8
- 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/clipboard-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/color-provider.d.ts +0 -18
- package/@ones-editor/ui/src/providers/edit-link-provider.d.ts +0 -6
- package/@ones-editor/ui/src/providers/heading.d.ts +0 -13
- package/@ones-editor/ui/src/providers/inline-code-provider.d.ts +0 -10
- 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 -12
- package/@ones-editor/ui/src/providers/list.d.ts +0 -13
- package/@ones-editor/ui/src/providers/mobile-link-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/paragraph.d.ts +0 -9
- package/@ones-editor/ui/src/providers/proxy-provider.d.ts +0 -9
- package/@ones-editor/ui/src/providers/quoted.d.ts +0 -10
- package/@ones-editor/ui/src/providers/script-with-dropdown.d.ts +0 -9
- package/@ones-editor/ui/src/providers/tab-provider.d.ts +0 -10
- package/@ones-editor/ui/src/providers/text-command-provider.d.ts +0 -15
- 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/utils/add-section.d.ts +0 -2
- package/@ones-editor/ui/src/providers/utils/clipboard.d.ts +0 -6
- package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +0 -5
- 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 -8
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +0 -22
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +0 -30
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +0 -12
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +0 -11
- package/@ones-editor/ui/src/utils/hide-toolbar.d.ts +0 -2
- package/@ones-editor/ui-base/src/mobile-command-bar/init-menu-item.d.ts +0 -3
- package/@ones-editor/ui-base/src/mobile-command-bar/mobile-bottom-menu.d.ts +0 -22
- /package/@ones-editor/{ui → block-menu}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
|
@@ -1,39 +1,18 @@
|
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import TextScriptProvider from './providers/text-script-provider';
|
|
20
|
-
import HeadingProvider from './providers/heading';
|
|
21
|
-
import { ProxyProvider } from './providers/proxy-provider';
|
|
22
|
-
import ParagraphProvider from './providers/paragraph';
|
|
23
|
-
import AlignProvider from './providers/align';
|
|
24
|
-
import { InlineBoxCommandProvider } from './providers/insert-box-provider';
|
|
25
|
-
import { LinkProvider } from './providers/link';
|
|
26
|
-
import TabProvider from './providers/tab-provider';
|
|
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
|
-
import { MobileLinkProvider } from './providers/mobile-link-provider';
|
|
31
|
-
import ListProvider from './providers/list';
|
|
32
|
-
import QuotedProvider from './providers/quoted';
|
|
33
|
-
import { ReadonlyToolbar } from './readonly-toolbar';
|
|
34
|
-
import { ReadonlyToolbarCommandProvider, ReadonlyCommandOptions } from './readonly-toolbar/types';
|
|
35
|
-
import { AddCommentToOldDocCommandProvider } from './readonly-toolbar/add-comment-to-old-doc';
|
|
36
|
-
export { TabProvider, ListProvider, QuotedProvider, TextCommandProvider, injectBlockOptions, LinkProvider, InlineBoxCommandProvider, AlignProvider, ParagraphProvider, ProxyProvider, InlineCodeProvider, InlineStyleProvider, ColorStyleProvider, ScriptDropdownProvider, TextScriptProvider, HeadingProvider, MobileLinkProvider, };
|
|
37
|
-
export type { QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, OnesEditorToolbarBase, QuickMenuItem, QuickMenuOptions, ReadonlyToolbarCommandProvider, ReadonlyCommandOptions, };
|
|
38
|
-
export { BlockMenu, BlockCommandProviders, OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, editLink, TextStyleShortcuts, getToolbar, BasicCommands, isSelectBoxOnly, getReferenceClientRect, ReadonlyToolbar, AddCommentToOldDocCommandProvider, };
|
|
39
|
-
export * from './utils/hide-toolbar';
|
|
14
|
+
import type { QuickMenuItem } from './quick-menu';
|
|
15
|
+
export type { QuickMenuItemFilter, QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, GetAllQuickMenuItemsOptions, OnesEditorToolbarBase, };
|
|
16
|
+
export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions, BasicCommands, GroupOrder, isSelectBoxOnly, InlineBoxCommandProvider, getReferenceClientRect, };
|
|
17
|
+
export { createTextButton } from './text-button';
|
|
18
|
+
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
|
-
get menu(): import("@ones-editor/ui-base").ManualMenu
|
|
13
|
-
addFilter(id:
|
|
23
|
+
get menu(): import("@ones-editor/ui-base").ManualMenu;
|
|
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[];
|
|
@@ -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
|
+
}
|
|
@@ -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[];
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
5
4
|
export interface AutoSuggestMenuOptions {
|
|
6
5
|
id: string;
|
|
7
6
|
showLoading?: boolean;
|
|
@@ -22,7 +21,7 @@ export interface AutoSuggestMenuOptions {
|
|
|
22
21
|
}
|
|
23
22
|
export default class AutoSuggestMenu {
|
|
24
23
|
protected options: AutoSuggestMenuOptions;
|
|
25
|
-
menu: ManualMenu
|
|
24
|
+
menu: ManualMenu;
|
|
26
25
|
private currentText;
|
|
27
26
|
handleSearchText: (text: string) => void;
|
|
28
27
|
constructor(options: AutoSuggestMenuOptions);
|
|
@@ -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;
|
|
@@ -14,5 +14,5 @@ export default class ColorPalette extends TypedEmitter<ColorPaletteEvents> {
|
|
|
14
14
|
constructor(options?: ColorPaletteOptions);
|
|
15
15
|
destroy(): void;
|
|
16
16
|
setColor(type: ColorType, value: number | null): void;
|
|
17
|
-
handleClick: (event: MouseEvent
|
|
17
|
+
handleClick: (event: MouseEvent) => void;
|
|
18
18
|
}
|
|
@@ -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;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { CommandItem } from '../../../../@ones-editor/core';
|
|
2
2
|
import CommandBar from './command-bar';
|
|
3
|
-
import {
|
|
3
|
+
import { CommandBarOptions, CommandItemElement } 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
|
-
onShown: (instance: AbstractManualCommandBar) => void;
|
|
10
|
-
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
11
9
|
destroy(): void;
|
|
12
10
|
protected getCommandBarRoot(): HTMLElement | null;
|
|
13
11
|
get isVisible(): boolean;
|
|
@@ -19,7 +19,6 @@ export interface ManualShowCommandBarOptions {
|
|
|
19
19
|
getReferenceClientRect?: GetReferenceClientRect | null | undefined;
|
|
20
20
|
offset?: [number, number];
|
|
21
21
|
arrow?: boolean;
|
|
22
|
-
onShown?(instance: AbstractManualCommandBar): void;
|
|
23
22
|
}
|
|
24
23
|
export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
|
|
25
24
|
readonly isVisible: boolean;
|
|
@@ -29,7 +28,6 @@ export interface AbstractCommandBar extends TypedEmitter<CommandBarEvents> {
|
|
|
29
28
|
isInCommandBar: (target: EventTarget | null) => boolean;
|
|
30
29
|
handleDocumentKeydown: (event: KeyboardEvent) => void;
|
|
31
30
|
getSubBarOptions: (item: CommandItem) => ManualShowCommandBarOptions;
|
|
32
|
-
updateItems: (items: CommandItem[]) => void;
|
|
33
31
|
}
|
|
34
32
|
export interface ShowCommandBarOptions {
|
|
35
33
|
placement?: Placement;
|
|
@@ -63,7 +61,7 @@ export interface CommandBarOptions {
|
|
|
63
61
|
header?: HTMLElement | (() => HTMLElement | null);
|
|
64
62
|
footer?: HTMLElement | (() => HTMLElement | null);
|
|
65
63
|
padding?: number;
|
|
66
|
-
beforeClose?: (event?: MouseEvent
|
|
64
|
+
beforeClose?: (event?: MouseEvent) => boolean;
|
|
67
65
|
}
|
|
68
66
|
export type CreateManualCommandBarFunction = (parentItem: CommandItem, closeable: Closeable, options?: CommandBarOptions) => AbstractManualCommandBar;
|
|
69
67
|
export type PopoverOptions = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './input.scss';
|
|
2
|
-
export
|
|
2
|
+
export declare function createInput(parent: HTMLElement, options: {
|
|
3
3
|
label?: string;
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
required?: boolean;
|
|
@@ -9,29 +9,9 @@ export type EditorInputOptions = {
|
|
|
9
9
|
onKeyDown?: (e: KeyboardEvent, composing: boolean) => void;
|
|
10
10
|
maxLength?: number;
|
|
11
11
|
prefix?: Element;
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
declare class EditorInput {
|
|
15
|
-
private parent;
|
|
16
|
-
private options;
|
|
17
|
-
private unbindKeyDownEvent;
|
|
18
|
-
constructor(parent: HTMLElement, options: EditorInputOptions);
|
|
19
|
-
private get container();
|
|
20
|
-
private get errorContent();
|
|
21
|
-
private get input();
|
|
22
|
-
private get suffix();
|
|
23
|
-
private get prefix();
|
|
12
|
+
}): {
|
|
24
13
|
getField: () => HTMLInputElement;
|
|
25
14
|
getInputValue: () => string;
|
|
26
15
|
setFieldError: (error: string) => void;
|
|
27
16
|
focus: () => void;
|
|
28
|
-
|
|
29
|
-
showSuffix: () => void;
|
|
30
|
-
hideSuffix: () => void;
|
|
31
|
-
handleInput: (e: Event) => void;
|
|
32
|
-
handleClose: (e: Event) => void;
|
|
33
|
-
init(): HTMLInputElement;
|
|
34
|
-
destroy(): void;
|
|
35
|
-
}
|
|
36
|
-
export declare function createInput(parent: HTMLElement, options: EditorInputOptions): EditorInput;
|
|
37
|
-
export {};
|
|
17
|
+
};
|
|
@@ -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,8 +3,7 @@ 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
|
|
7
|
-
private _doc;
|
|
6
|
+
private listeners;
|
|
8
7
|
constructor(editor: OnesEditor, localDoc: OnesEditorDoc);
|
|
9
8
|
get doc(): DocObject;
|
|
10
9
|
getComments(): OnesEditorComment[];
|