@ones-editor/editor 0.0.3-beta.5 → 0.0.3-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/index.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/rich-text/insert-text.d.ts +2 -1
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +2 -2
- package/@ones-editor/core/src/core/types.d.ts +11 -1
- package/@ones-editor/core/src/utils/file.d.ts +2 -0
- package/@ones-editor/e2e/cypress/support/commands.d.ts +19 -0
- package/@ones-editor/e2e/cypress/support/e2e.d.ts +1 -0
- package/@ones-editor/e2e/cypress.config.d.ts +3 -0
- package/@ones-editor/e2e/package.json +13 -0
- package/@ones-editor/e2e/src/block-menu/menu-list.cy.d.ts +0 -0
- package/@ones-editor/e2e/src/data.d.ts +106 -0
- package/@ones-editor/e2e/src/input-handlers/case.d.ts +10 -0
- package/@ones-editor/e2e/src/input-handlers/shortcut.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/list-block/case.d.ts +8 -0
- package/@ones-editor/e2e/src/list-block/list.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/toc/case.d.ts +5 -0
- package/@ones-editor/e2e/src/toc/toc.cy.d.ts +1 -0
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +1 -0
- package/@ones-editor/file/package.json +8 -0
- package/@ones-editor/file/src/file-box/index.d.ts +4 -0
- package/@ones-editor/file/src/file-embed/card/file-icon.d.ts +1 -0
- package/@ones-editor/file/src/file-embed/card/index.d.ts +6 -0
- package/@ones-editor/file/src/file-embed/download-file.d.ts +2 -0
- package/@ones-editor/file/src/file-embed/index.d.ts +4 -0
- package/@ones-editor/file/src/index.d.ts +3 -0
- package/@ones-editor/file/src/types.d.ts +22 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +0 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +2 -4
- package/@ones-editor/ui/src/quick-menu/index.d.ts +1 -6
- package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -2
- package/@ones-editor/ui/src/quick-menu/types.d.ts +24 -1
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +0 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +1 -0
- package/dist/index.js +227 -152
- package/dist/types.d.ts +5 -2
- package/package.json +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './style.scss';
|
|
2
2
|
import OnesEditorToolbar from './toolbar/toolbar-handler';
|
|
3
|
-
import OnesEditorQuickMenu, { getAllQuickMenuItems } from './quick-menu';
|
|
3
|
+
import OnesEditorQuickMenu, { getAllQuickMenuItems, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandProvider } from './quick-menu';
|
|
4
4
|
import { getHeadingMenuOptions } from './quick-menu/basic-menu-items';
|
|
5
5
|
import OnesEditorTooltip from './tooltips';
|
|
6
6
|
import TextStyleShortcuts from './shortcuts';
|
|
@@ -8,5 +8,6 @@ import { editLink } from './link-popup';
|
|
|
8
8
|
import { getToolbar } from './toolbar/helper';
|
|
9
9
|
import './locale';
|
|
10
10
|
import type { QuickMenuItem } from './quick-menu';
|
|
11
|
+
export type { QuickMenuCommandProvider, QuickMenuCommandBetween, QuickMenuCommandInline };
|
|
11
12
|
export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions };
|
|
12
13
|
export { createTextButton } from './text-button';
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { BlockOptions, CommandItem, OnesEditor, InsertEmptyBlockOptions } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function addQuickMenuItemFields(item: CommandItem, options: BlockOptions): void;
|
|
3
|
-
declare function handleInsertEmptyBlock(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<null>;
|
|
4
3
|
export declare function getHeadingMenuOptions(start?: number): BlockOptions;
|
|
5
4
|
export declare function getCompleteHeadingMenuOptions(): {
|
|
6
5
|
name: string;
|
|
7
6
|
insertBlockCommandItems: CommandItem[];
|
|
8
|
-
handleInsertEmptyBlock:
|
|
7
|
+
handleInsertEmptyBlock: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<null>;
|
|
9
8
|
};
|
|
10
9
|
export declare function getBasicMenuItems(): {
|
|
11
10
|
name: string;
|
|
12
11
|
insertBlockCommandItems: CommandItem[];
|
|
13
|
-
handleInsertEmptyBlock:
|
|
12
|
+
handleInsertEmptyBlock: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<null>;
|
|
14
13
|
};
|
|
15
|
-
export {};
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { OnesEditor, CommandItem } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorAutoSuggest } from '../../../../@ones-editor/ui-base';
|
|
3
|
-
import { QuickMenuItem } from './types';
|
|
3
|
+
import { QuickMenuItem, QuickMenuOptions } from './types';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export * from './quick-menu-items';
|
|
6
|
-
export interface QuickMenuOptions {
|
|
7
|
-
id?: string;
|
|
8
|
-
trigger: string[];
|
|
9
|
-
}
|
|
10
6
|
export default class OnesEditorQuickMenu {
|
|
11
7
|
protected editor: OnesEditor;
|
|
12
8
|
private options;
|
|
@@ -19,7 +15,6 @@ export default class OnesEditorQuickMenu {
|
|
|
19
15
|
queryItems: (suggest: unknown, text: string) => Promise<QuickMenuItem[]>;
|
|
20
16
|
onShow: (suggest: OnesEditorAutoSuggest, containerId: string, blockIndex: number, offset: number) => boolean;
|
|
21
17
|
onClickItem: (suggest: unknown, item: CommandItem) => void;
|
|
22
|
-
private renderMenuItem;
|
|
23
18
|
private initMenuItems;
|
|
24
19
|
private refreshMenuItems;
|
|
25
20
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { OnesEditor
|
|
2
|
-
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { AutoSuggestAnchor } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
import { QuickMenuItem } from './types';
|
|
4
|
+
export declare function insertEmptyBlock(editor: OnesEditor, quickItem: QuickMenuItem, anchor: AutoSuggestAnchor): void;
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import { CommandItem, BlockOptions } from '../../../../@ones-editor/core';
|
|
1
|
+
import { CommandItem, BlockOptions, OnesEditor, BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
export interface QuickMenuItem extends CommandItem {
|
|
3
3
|
itemType: 'insert-block';
|
|
4
4
|
blockOptions?: BlockOptions;
|
|
5
|
+
commandProvider?: QuickMenuCommandProvider;
|
|
6
|
+
}
|
|
7
|
+
export interface QuickMenuCommandParams {
|
|
8
|
+
from: 'block-menu' | 'quick-menu';
|
|
9
|
+
}
|
|
10
|
+
export interface QuickMenuCommandInline extends QuickMenuCommandParams {
|
|
11
|
+
from: 'quick-menu';
|
|
12
|
+
blockId: string;
|
|
13
|
+
offset: number;
|
|
14
|
+
}
|
|
15
|
+
export interface QuickMenuCommandBetween extends QuickMenuCommandParams {
|
|
16
|
+
from: 'block-menu';
|
|
17
|
+
containerId: string;
|
|
18
|
+
blockIndex: number;
|
|
19
|
+
}
|
|
20
|
+
export interface QuickMenuCommandProvider {
|
|
21
|
+
getCommands: (editor: OnesEditor) => CommandItem[];
|
|
22
|
+
executeCommand: (editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween) => Promise<BlockElement | null>;
|
|
23
|
+
}
|
|
24
|
+
export interface QuickMenuOptions {
|
|
25
|
+
id?: string;
|
|
26
|
+
trigger: string[];
|
|
27
|
+
commandProviders?: QuickMenuCommandProvider[];
|
|
5
28
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import { BlockElement, CommandItem, OnesEditor, OnesEditorHoveringBlockFilter } from '../../../../@ones-editor/core';
|
|
3
2
|
import { AbstractCommandBar } from '../../../../@ones-editor/ui-base';
|
|
4
3
|
import { OnesEditorToolbarBase } from './types';
|
|
@@ -28,6 +28,7 @@ export default class AutoSuggestMenu {
|
|
|
28
28
|
destroy(): void;
|
|
29
29
|
handleSearchText(text: string): Promise<void>;
|
|
30
30
|
handleClick: (menu: AbstractCommandBar, item: CommandItem) => void;
|
|
31
|
+
handleClose: () => void;
|
|
31
32
|
handleKeydown: (event: KeyboardEvent) => void;
|
|
32
33
|
private highlightText;
|
|
33
34
|
}
|