@ones-editor/editor 2.2.15-beta.2 → 2.3.0-beta.1
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/callout-block/src/callout-block/callout-block-content.d.ts +2 -3
- package/@ones-editor/callout-block/src/callout-block/helper.d.ts +2 -4
- package/@ones-editor/callout-block/src/locale/en-us.d.ts +0 -3
- package/@ones-editor/callout-block/src/locale/ja-jp.d.ts +0 -3
- package/@ones-editor/callout-block/src/locale/zh-cn.d.ts +0 -3
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/base/text-range.d.ts +1 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/editor-dom/editor-dom.d.ts +2 -3
- package/@ones-editor/core/src/core/selection/range-from-point.d.ts +1 -1
- package/@ones-editor/core/src/core/types.d.ts +2 -1
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/figcaption.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/font-size.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/text-color.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/underline.d.ts +1 -0
- package/@ones-editor/main-toolbar/package.json +7 -0
- package/@ones-editor/main-toolbar/src/index.d.ts +18 -0
- package/@ones-editor/main-toolbar/src/items/comment.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/find.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/font-style.d.ts +40 -0
- package/@ones-editor/main-toolbar/src/items/image.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/index.d.ts +17 -0
- package/@ones-editor/main-toolbar/src/items/insert.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/more-item.d.ts +20 -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 +49 -0
- package/@ones-editor/main-toolbar/src/items/undo.d.ts +18 -0
- package/@ones-editor/main-toolbar/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/locale/index.d.ts +1 -0
- package/@ones-editor/main-toolbar/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/types.d.ts +5 -0
- package/@ones-editor/markdown-to-doc/src/custom/tag.d.ts +8 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/custom-tag.d.ts +4 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/font-size.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/html.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/text-color.d.ts +2 -0
- package/@ones-editor/sharedb-doc/src/types.d.ts +3 -3
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/box-helper/standard-box-commands.d.ts +6 -2
- package/@ones-editor/ui/src/index.d.ts +1 -0
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
- package/@ones-editor/ui-base/src/color-button/color-button.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +3 -2
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/dropdown/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/emoji-item/emoji-item.d.ts +2 -1
- package/@ones-editor/ui-base/src/emoji-palette/index.d.ts +12 -9
- package/@ones-editor/ui-base/src/emoji-palette/types.d.ts +0 -9
- package/@ones-editor/ui-base/src/index.d.ts +0 -2
- 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/versions/src/types.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +2 -0
- package/dist/index.d.ts +60 -1
- package/dist/index.js +3562 -2264
- package/dist/types.d.ts +13 -6
- package/package.json +1 -1
- package/@ones-editor/callout-block/src/callout-block/callout-icon.d.ts +0 -14
- package/@ones-editor/ui-base/src/emoji-palette/default-emoji-palette.d.ts +0 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { OnesEditor, BlockPath, BlockElement
|
|
1
|
+
import type { OnesEditor, BlockPath, BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { DocCalloutBlockData } from './types';
|
|
3
|
-
export declare function createCalloutBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocCalloutBlockData): BlockContentElement;
|
|
4
|
-
export declare function handleUpdateCalloutBlock(editor: OnesEditor, block: BlockElement, blockData: DocBlock): boolean;
|
|
3
|
+
export declare function createCalloutBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocCalloutBlockData): import("@ones-editor/core").BlockContentElement;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DocBlock } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ColorId } from './types';
|
|
3
3
|
export declare function checkBlockAllowInCallout(block: DocBlock): boolean;
|
|
4
4
|
export declare function getHexBackgroundColor(backgroundColor: ColorId): string;
|
|
5
|
-
export declare function getCalloutBlockData(editor: OnesEditor, block: BlockElement): import("./types").DocCalloutBlockData;
|
|
6
|
-
export declare function updateCalloutBlockData(editor: OnesEditor, block: BlockElement, blockPayload: Partial<CalloutBlockPayload>): void;
|
|
@@ -15,7 +15,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
|
|
|
15
15
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
16
16
|
destroy(): void;
|
|
17
17
|
dispatchScroll: import("lodash").DebouncedFunc<() => void>;
|
|
18
|
-
updateItemsLayout(): void;
|
|
18
|
+
updateItemsLayout(dispatchScroll?: boolean): void;
|
|
19
19
|
private bindEvents;
|
|
20
20
|
private unbindEvents;
|
|
21
21
|
protected createItem(data: CommentWithChildren, reason: 'init' | 'insert'): CommentGroupItem;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../types';
|
|
2
2
|
import EditorSimpleSelectionRange from '../../../selection/range/simple-range';
|
|
3
|
-
export declare function getTextBlockRangeFromPoint(editor: OnesEditor, block: BlockElement, xOrign: number, yOrign: number): EditorSimpleSelectionRange | null;
|
|
3
|
+
export declare function getTextBlockRangeFromPoint(editor: OnesEditor, block: BlockElement, xOrign: number, yOrign: number, dragging?: boolean): EditorSimpleSelectionRange | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocBlock, DocObject } from '../../../doc';
|
|
2
2
|
import { OnesEditor } from '../../../types';
|
|
3
|
-
export declare function textBlockToHtml(editor: OnesEditor,
|
|
3
|
+
export declare function textBlockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IUserOptions } from '../../../utils/animate-scroll';
|
|
1
2
|
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
3
|
export declare function editorGetClientHeight(editor: OnesEditor): number;
|
|
3
4
|
export declare function editorGetClientTop(editor: OnesEditor): number;
|
|
@@ -6,7 +7,5 @@ export declare function editorGetVisibleRect(editor: OnesEditor): DOMRect;
|
|
|
6
7
|
export declare function isBlockPositionVisible(editor: OnesEditor, pos: SimpleBlockPosition): boolean;
|
|
7
8
|
export declare function scrollIntoView(editor: OnesEditor, target: HTMLElement, options?: {
|
|
8
9
|
animation?: boolean;
|
|
9
|
-
|
|
10
|
-
elementToScroll?: HTMLElement;
|
|
11
|
-
}): void;
|
|
10
|
+
} & Pick<IUserOptions, 'elementToScroll' | 'verticalOffset' | 'speed'>): void;
|
|
12
11
|
export declare function editorScrollIntoView(editor: OnesEditor): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SelectionRange, OnesEditor } from '../types';
|
|
2
2
|
import EditorSimpleSelectionRange from './range/simple-range';
|
|
3
|
-
export declare function getBlockRangeFromPoint(editor: OnesEditor, pointX: number, pointY: number): SelectionRange | null;
|
|
3
|
+
export declare function getBlockRangeFromPoint(editor: OnesEditor, pointX: number, pointY: number, dragging?: boolean): SelectionRange | null;
|
|
4
4
|
export declare function getBlockNearestRangeFromPoint(editor: OnesEditor, x: number, y: number): EditorSimpleSelectionRange | null;
|
|
@@ -158,6 +158,7 @@ export interface CommandItem {
|
|
|
158
158
|
setCloseable?: (closeable: Closeable) => void;
|
|
159
159
|
beforePopup?: (parent: unknown) => void;
|
|
160
160
|
switchable?: boolean;
|
|
161
|
+
hidden?: boolean;
|
|
161
162
|
/**
|
|
162
163
|
* defaults to true
|
|
163
164
|
*/
|
|
@@ -261,7 +262,7 @@ export interface Block {
|
|
|
261
262
|
blockKind: BlockKind;
|
|
262
263
|
createBlockContent: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => BlockContentElement;
|
|
263
264
|
getBlockTextLength: (block: BlockElement) => number;
|
|
264
|
-
getRangeFromPoint: (editor: OnesEditor, block: BlockElement, x: number, y: number) => SelectionRange | null;
|
|
265
|
+
getRangeFromPoint: (editor: OnesEditor, block: BlockElement, x: number, y: number, dragging?: boolean) => SelectionRange | null;
|
|
265
266
|
moveCaret: (editor: OnesEditor, block: BlockElement, position: SimpleBlockPosition, direction: MoveDirection) => SimpleBlockPosition | null;
|
|
266
267
|
getCaretRect: (block: BlockElement, pos: SimpleBlockPosition) => DOMRect;
|
|
267
268
|
updateSelection: (editor: OnesEditor, block: BlockElement, from: BlockPosition, to: BlockPosition) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function figcaptionToTextBlock(ts: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fontSize(ts: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function textColor(ts: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function underline(ts: any): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CommandItem, OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
|
+
import { AbstractCommandBar, FixedToolbar } from '../../../@ones-editor/ui-base';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
|
+
import './locale';
|
|
5
|
+
import './style.scss';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './items';
|
|
8
|
+
export declare class MainToolbar implements OnesEditorCustom {
|
|
9
|
+
private editor;
|
|
10
|
+
toolbar: FixedToolbar;
|
|
11
|
+
constructor(editor: OnesEditor, parent: HTMLElement);
|
|
12
|
+
destroy(): void;
|
|
13
|
+
setItems(items: ToolbarItem[]): void;
|
|
14
|
+
getItems(): ToolbarItem[];
|
|
15
|
+
handleClick: (bar: AbstractCommandBar, item: CommandItem) => void;
|
|
16
|
+
handleSelectionChanged: () => void;
|
|
17
|
+
updateState(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class CommentItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class FindReplaceItem implements ToolbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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").CommandItemWithSource | 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 declare class InlineCodeItem extends FontStyleBaseItem {
|
|
29
|
+
icon: string;
|
|
30
|
+
constructor();
|
|
31
|
+
}
|
|
32
|
+
export declare class SuperscriptItem extends FontStyleBaseItem {
|
|
33
|
+
icon: string;
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
36
|
+
export declare class SubscriptItem extends FontStyleBaseItem {
|
|
37
|
+
icon: string;
|
|
38
|
+
constructor();
|
|
39
|
+
}
|
|
40
|
+
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,17 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem, InlineCodeItem, SubscriptItem, SuperscriptItem } from './font-style';
|
|
3
|
+
import { InsertImageItem } from './image';
|
|
4
|
+
import { InsertLinkItem } from './link';
|
|
5
|
+
import { OrderedListItem, UnorderedListItem, CheckListItem } from './list';
|
|
6
|
+
import { ParagraphItem } from './paragraph';
|
|
7
|
+
import { QuoteItem } from './quote';
|
|
8
|
+
import { SeparatorItem } from './separator';
|
|
9
|
+
import { AlignLeftItem, AlignCenterItem, AlignRightItem } from './text-align';
|
|
10
|
+
import { RedoItem, UndoItem } from './undo';
|
|
11
|
+
import { InsertItem } from './insert';
|
|
12
|
+
import { FindReplaceItem } from './find';
|
|
13
|
+
import { CommentItem } from './comment';
|
|
14
|
+
import { ColorItem } from './text-color';
|
|
15
|
+
import { MoreItem } from './more-item';
|
|
16
|
+
export declare function getToolbarDefaultItems(editor: OnesEditor): (FontBoldItem | FontItalicItem | FontUnderlineItem | FontStrikethroughItem | InlineCodeItem | SuperscriptItem | SubscriptItem | InsertImageItem | InsertLinkItem | OrderedListItem | UnorderedListItem | CheckListItem | ParagraphItem | QuoteItem | SeparatorItem | AlignLeftItem | AlignCenterItem | AlignRightItem | UndoItem | RedoItem | InsertItem | FindReplaceItem | CommentItem | ColorItem | MoreItem)[];
|
|
17
|
+
export { UndoItem, RedoItem, FontBoldItem, FontItalicItem, FontUnderlineItem, FontStrikethroughItem, ColorItem, InlineCodeItem, SuperscriptItem, SubscriptItem, AlignLeftItem, AlignCenterItem, AlignRightItem, ParagraphItem, SeparatorItem, OrderedListItem, UnorderedListItem, CheckListItem, InsertImageItem, InsertLinkItem, QuoteItem, InsertItem, FindReplaceItem, CommentItem, MoreItem, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommandItem, CommandItemChildrenPlacement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class InsertItem implements ToolbarItem {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
dropdown: boolean;
|
|
7
|
+
manualShowChildren: boolean;
|
|
8
|
+
childrenPlacement: CommandItemChildrenPlacement;
|
|
9
|
+
children: CommandItem[];
|
|
10
|
+
constructor(editor: OnesEditor);
|
|
11
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
12
|
+
}
|
|
@@ -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").CommandItemWithSource | undefined;
|
|
9
|
+
updateState(editor: OnesEditor): void;
|
|
10
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CommandItemWithSource, 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): CommandItemWithSource | 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): CommandItemWithSource | 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): CommandItemWithSource | undefined;
|
|
27
|
+
updateState(editor: OnesEditor): void;
|
|
28
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommandItem, CommandItemChildrenPlacement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { FixedToolbar } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
import { ToolbarItem } from '../types';
|
|
4
|
+
export declare class MoreItem implements ToolbarItem {
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
manualShowChildren: boolean;
|
|
8
|
+
childrenPlacement: CommandItemChildrenPlacement;
|
|
9
|
+
children: CommandItem[];
|
|
10
|
+
hidden?: boolean | undefined;
|
|
11
|
+
fixedToolbar: FixedToolbar | undefined;
|
|
12
|
+
observer?: ResizeObserver;
|
|
13
|
+
icon: string;
|
|
14
|
+
childrenType: 'menu' | 'toolbar' | 'mobile-bottom-menu';
|
|
15
|
+
childrenMenuId: string;
|
|
16
|
+
constructor(editor: OnesEditor);
|
|
17
|
+
destroy(): void;
|
|
18
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
19
|
+
updateItems(): void;
|
|
20
|
+
}
|
|
@@ -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").CommandItemWithSource | 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,49 @@
|
|
|
1
|
+
import { CommandItemChildrenPlacement, CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { TextColorItem } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
import { ColorStyleProvider } from '../../../../@ones-editor/ui';
|
|
4
|
+
import { ToolbarItem } from '../types';
|
|
5
|
+
export declare class ColorItem extends TextColorItem implements ToolbarItem {
|
|
6
|
+
childrenPlacement: CommandItemChildrenPlacement;
|
|
7
|
+
states?: CommandItemState[] | undefined;
|
|
8
|
+
provider: ColorStyleProvider;
|
|
9
|
+
constructor(editor: OnesEditor);
|
|
10
|
+
getCommand(): {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
desc?: string | undefined;
|
|
14
|
+
states?: CommandItemState[] | undefined;
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
order?: number | undefined;
|
|
17
|
+
type?: import("@ones-editor/core").CommandItemType | undefined;
|
|
18
|
+
element?: HTMLElement | ((item: import("@ones-editor/core").CommandItem) => HTMLElement) | undefined;
|
|
19
|
+
icon?: string | undefined;
|
|
20
|
+
childrenType?: "menu" | "toolbar" | "mobile-bottom-menu" | undefined;
|
|
21
|
+
children?: import("@ones-editor/core").CommandItem[] | undefined;
|
|
22
|
+
childrenMenuId?: string | undefined;
|
|
23
|
+
data?: unknown;
|
|
24
|
+
group?: string | undefined;
|
|
25
|
+
groupOrder?: number | undefined;
|
|
26
|
+
dropdown?: boolean | undefined;
|
|
27
|
+
dropSplit?: boolean | undefined;
|
|
28
|
+
splitTooltip?: string | undefined;
|
|
29
|
+
manualShowChildren?: boolean | undefined;
|
|
30
|
+
childrenPlacement?: CommandItemChildrenPlacement | undefined;
|
|
31
|
+
childrenOffset?: [number, number] | undefined;
|
|
32
|
+
childArrow?: boolean | undefined;
|
|
33
|
+
subText?: string | undefined;
|
|
34
|
+
defaultCheckedChildren?: string[] | undefined;
|
|
35
|
+
ellipsisTooltip?: string | undefined;
|
|
36
|
+
disableTooltip?: boolean | undefined;
|
|
37
|
+
tooltipPlacement?: CommandItemChildrenPlacement | undefined;
|
|
38
|
+
disableReason?: string | undefined;
|
|
39
|
+
hideGroupItem?: boolean | undefined;
|
|
40
|
+
setCloseable?: ((closeable: import("@ones-editor/core").Closeable) => void) | undefined;
|
|
41
|
+
beforePopup?: ((parent: unknown) => void) | undefined;
|
|
42
|
+
switchable?: boolean | undefined;
|
|
43
|
+
hidden?: boolean | undefined;
|
|
44
|
+
clickToClose?: boolean | undefined;
|
|
45
|
+
} | null;
|
|
46
|
+
handleChangeColor(type: 'color' | 'backgroundColor' | 'clearColor', value: number): void;
|
|
47
|
+
handleMousedown: (event: MouseEvent) => void;
|
|
48
|
+
updateState(editor: OnesEditor): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CommandItemState, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ToolbarItem } from '../types';
|
|
3
|
+
export declare class UndoItem implements ToolbarItem {
|
|
4
|
+
icon: string;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
states: CommandItemState[];
|
|
8
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
9
|
+
updateState(editor: OnesEditor): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class RedoItem implements ToolbarItem {
|
|
12
|
+
icon: string;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
states: CommandItemState[];
|
|
16
|
+
onClick(editor: OnesEditor, item: ToolbarItem): void;
|
|
17
|
+
updateState(editor: OnesEditor): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DocBlockText, DocBlockTextAttributes } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { TokenToBlockOptions } from '../base';
|
|
3
|
+
import { CustomTagToken } from '../../custom/tag';
|
|
4
|
+
export declare function customTagToText(token: CustomTagToken, attributes: DocBlockTextAttributes, options: TokenToBlockOptions): DocBlockText;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildResourceUrlOptions, DocBlock, DocComment, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorUser, OnesEditorUserPermission, UploadResourceOptions, UploadResourceResult } from '../../../@ones-editor/core';
|
|
1
|
+
import { BuildResourceUrlOptions, DocBlock, DocComment, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorUser, OnesEditorUserPermission, UploadResourceOptions, UploadResourceResult } from '../../../@ones-editor/core';
|
|
2
2
|
import { Op } from 'sharedb';
|
|
3
3
|
export type { Op } from 'sharedb/lib/client';
|
|
4
4
|
export type BlocksType = DocBlock[];
|
|
@@ -72,8 +72,8 @@ export interface ShareDBDocOptions {
|
|
|
72
72
|
templateData?: EditorDoc;
|
|
73
73
|
disableLogout?: boolean;
|
|
74
74
|
onMaxUsersError?: () => void;
|
|
75
|
-
buildResourceUrl?: (resourceId: string, options?: BuildResourceUrlOptions) => string;
|
|
76
|
-
uploadResource?: (file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
|
|
75
|
+
buildResourceUrl?: (doc: OnesEditorDoc, resourceId: string, options?: BuildResourceUrlOptions) => string;
|
|
76
|
+
uploadResource?: (doc: OnesEditorDoc, file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
|
|
77
77
|
}
|
|
78
78
|
export interface EditorOp {
|
|
79
79
|
c: string;
|