@ones-editor/editor 2.1.7-beta.2 → 2.1.7-beta.4
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/index.d.ts +1 -0
- package/@ones-editor/main-toolbar/package.json +7 -0
- package/@ones-editor/main-toolbar/src/index.d.ts +16 -0
- package/@ones-editor/main-toolbar/src/items/font-style.d.ts +28 -0
- package/@ones-editor/main-toolbar/src/items/image.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/index.d.ts +12 -0
- package/@ones-editor/main-toolbar/src/items/link.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/items/list.d.ts +29 -0
- package/@ones-editor/main-toolbar/src/items/paragraph.d.ts +14 -0
- package/@ones-editor/main-toolbar/src/items/quote.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/items/separator.d.ts +7 -0
- package/@ones-editor/main-toolbar/src/items/text-align.d.ts +21 -0
- package/@ones-editor/main-toolbar/src/items/text-color.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/types.d.ts +5 -0
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/color-button/color-button.d.ts +1 -0
- package/@ones-editor/ui-base/src/color-button/text-color-item.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +555 -34
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommandItem, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
|
+
import { AbstractCommandBar, FixedToolbar } from '../../../@ones-editor/ui-base';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './items';
|
|
6
|
+
export declare class MainToolbar implements OnesEditorCustom {
|
|
7
|
+
private editor;
|
|
8
|
+
toolbar: FixedToolbar;
|
|
9
|
+
constructor(editor: OnesEditor, parent: HTMLElement);
|
|
10
|
+
destroy(): void;
|
|
11
|
+
setItems(items: ToolbarItem[]): void;
|
|
12
|
+
getItems(): ToolbarItem[];
|
|
13
|
+
handleClick: (bar: AbstractCommandBar, item: CommandItem) => void;
|
|
14
|
+
handleSelectionChanged: () => void;
|
|
15
|
+
updateState(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
declare class FontStyleBaseItem implements ToolbarItem {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
states: CommandItemState[];
|
|
7
|
+
constructor(name: string, id: string);
|
|
8
|
+
getCommand(editor: OnesEditor): import("@ones-editor/core").BlockCommandItemWithSource | undefined;
|
|
9
|
+
onClick(editor: OnesEditor): void;
|
|
10
|
+
updateState(editor: OnesEditor): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class FontBoldItem extends FontStyleBaseItem {
|
|
13
|
+
icon: string;
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
export declare class FontItalicItem extends FontStyleBaseItem {
|
|
17
|
+
icon: string;
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
20
|
+
export declare class FontUnderlineItem extends FontStyleBaseItem {
|
|
21
|
+
icon: string;
|
|
22
|
+
constructor();
|
|
23
|
+
}
|
|
24
|
+
export declare class FontStrikethroughItem extends FontStyleBaseItem {
|
|
25
|
+
icon: string;
|
|
26
|
+
constructor();
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class InsertImageItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextColorItem } from '../../../../@ones-editor/ui-base';
|
|
2
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
3
|
+
import { FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem } from './font-style';
|
|
4
|
+
import { InsertImageItem } from './image';
|
|
5
|
+
import { InsertLinkItem } from './link';
|
|
6
|
+
import { OrderedListItem, UnorderedListItem, CheckListItem } from './list';
|
|
7
|
+
import { ParagraphItem } from './paragraph';
|
|
8
|
+
import { QuoteItem } from './quote';
|
|
9
|
+
import { SeparatorItem } from './separator';
|
|
10
|
+
import { AlignLeftItem, AlignCenterItem, AlignRightItem } from './text-align';
|
|
11
|
+
export declare function getToolbarDefaultItems(editor: OnesEditor): (TextColorItem | FontBoldItem | FontItalicItem | FontUnderlineItem | FontStrikethroughItem | AlignLeftItem | AlignCenterItem | AlignRightItem | ParagraphItem | SeparatorItem | OrderedListItem | UnorderedListItem | CheckListItem | InsertImageItem | InsertLinkItem | QuoteItem)[];
|
|
12
|
+
export { FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem, TextColorItem, AlignLeftItem, AlignCenterItem, AlignRightItem, ParagraphItem, SeparatorItem, OrderedListItem, UnorderedListItem, CheckListItem, InsertImageItem, InsertLinkItem, QuoteItem, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class InsertLinkItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
states: CommandItemState[];
|
|
8
|
+
getCommand(editor: OnesEditor): import("@ones-editor/core").BlockCommandItemWithSource | undefined;
|
|
9
|
+
updateState(editor: OnesEditor): void;
|
|
10
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BlockCommandItemWithSource, CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class OrderedListItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
states: CommandItemState[];
|
|
8
|
+
getCommand(editor: OnesEditor): BlockCommandItemWithSource | undefined;
|
|
9
|
+
updateState(editor: OnesEditor): void;
|
|
10
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class UnorderedListItem implements ToolbarItem {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
states: CommandItemState[];
|
|
17
|
+
getCommand(editor: OnesEditor): BlockCommandItemWithSource | undefined;
|
|
18
|
+
updateState(editor: OnesEditor): void;
|
|
19
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class CheckListItem implements ToolbarItem {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
states: CommandItemState[];
|
|
26
|
+
getCommand(editor: OnesEditor): BlockCommandItemWithSource | undefined;
|
|
27
|
+
updateState(editor: OnesEditor): void;
|
|
28
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandItemChildrenPlacement, CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class ParagraphItem implements ToolbarItem {
|
|
4
|
+
children: ToolbarItem[];
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
states: CommandItemState[];
|
|
8
|
+
dropdown: boolean;
|
|
9
|
+
manualShowChildren: boolean;
|
|
10
|
+
childrenPlacement: CommandItemChildrenPlacement;
|
|
11
|
+
constructor();
|
|
12
|
+
updateState(editor: OnesEditor): void;
|
|
13
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class QuoteItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
states: CommandItemState[];
|
|
8
|
+
getCommand(editor: OnesEditor): import("@ones-editor/core").BlockCommandItemWithSource | undefined;
|
|
9
|
+
updateState(editor: OnesEditor): void;
|
|
10
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class AlignBaseItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
states: CommandItemState[];
|
|
8
|
+
constructor(id: string, name: string, icon: string);
|
|
9
|
+
getCommand(editor: OnesEditor): import("@ones-editor/core").CommandItem | null;
|
|
10
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
11
|
+
updateState(editor: OnesEditor): void;
|
|
12
|
+
}
|
|
13
|
+
export declare class AlignLeftItem extends AlignBaseItem {
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
export declare class AlignCenterItem extends AlignBaseItem {
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
export declare class AlignRightItem extends AlignBaseItem {
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandItemChildrenPlacement, CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { TextColorItem as ColorItem } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
import { ToolbarItem } from '../types';
|
|
4
|
+
export declare class TextColorItem extends ColorItem implements ToolbarItem {
|
|
5
|
+
childrenPlacement: CommandItemChildrenPlacement;
|
|
6
|
+
states?: CommandItemState[] | undefined;
|
|
7
|
+
constructor(editor: OnesEditor);
|
|
8
|
+
handleChangeColor(type: 'color' | 'backgroundColor' | 'clearColor', value: number): void;
|
|
9
|
+
handleMousedown: (event: MouseEvent) => void;
|
|
10
|
+
updateState(editor: OnesEditor): void;
|
|
11
|
+
}
|
|
@@ -13,7 +13,7 @@ export default class TextCommandProvider implements OnesEditorCommandProvider {
|
|
|
13
13
|
private getCommandsOnEmptyText;
|
|
14
14
|
private setCommandsStates;
|
|
15
15
|
getEmptyBlockTextAttributes(editor: OnesEditor, blockId: string): DocBlockTextAttributes | undefined;
|
|
16
|
-
|
|
16
|
+
handleChangeColor: (type: 'color' | 'backgroundColor' | 'clearColor', value: number) => void;
|
|
17
17
|
private getEmptyTextBlockColor;
|
|
18
18
|
private setEmptyTextBlockColor;
|
|
19
19
|
private static toTextCommand;
|