@ones-editor/editor 0.0.3-beta.4 → 0.0.3
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/items/text-styles/text-style-item.d.ts +4 -3
- package/@ones-editor/comments/src/block-hook/index.d.ts +3 -1
- package/@ones-editor/comments/src/comment-editor/index.d.ts +3 -5
- package/@ones-editor/comments/src/comment-input-handler/index.d.ts +2 -10
- package/@ones-editor/comments/src/comment-input-handler/input-handler.d.ts +11 -0
- package/@ones-editor/comments/src/comment-input-handler/quick-reply-input-handler.d.ts +7 -0
- package/@ones-editor/comments/src/comment-item/comment-item.d.ts +1 -0
- package/@ones-editor/comments/src/comment-item/index.d.ts +1 -0
- package/@ones-editor/comments/src/comment-item/mobile-comment-item/index.d.ts +1 -0
- package/@ones-editor/comments/src/comment-item/mobile-comment-item/mobile-comment-item.d.ts +18 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +10 -7
- package/@ones-editor/comments/src/comments-button/index.d.ts +3 -1
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -2
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/children-list.d.ts +17 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/group-item.d.ts +30 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/group-list.d.ts +29 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/index.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +28 -0
- package/@ones-editor/comments/src/constant/index.d.ts +1 -1
- package/@ones-editor/comments/src/index.d.ts +0 -1
- package/@ones-editor/comments/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/comments/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/comments/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +3 -1
- package/@ones-editor/comments/src/types.d.ts +2 -14
- package/@ones-editor/drawio-embed/src/helper/default-style.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/doc-event/index.d.ts +1 -1
- package/@ones-editor/list-block/src/lang/en-us.d.ts +3 -0
- package/@ones-editor/list-block/src/lang/zh-cn.d.ts +3 -0
- package/@ones-editor/mention/src/block-mention.d.ts +10 -0
- package/@ones-editor/mention/src/dom/mention-button.d.ts +2 -0
- package/@ones-editor/mention/src/index.d.ts +2 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
- package/dist/comments/comments-provider.d.ts +2 -2
- package/dist/comments/create-comment-editor.d.ts +1 -4
- package/dist/index.js +257 -137
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor, DocBlock } from '../../../../../../@ones-editor/core';
|
|
2
2
|
import { BlockMenuItem } from '../types';
|
|
3
|
-
export interface
|
|
4
|
-
'
|
|
5
|
-
|
|
3
|
+
export interface ParagraphBlockAttribute extends DocBlock {
|
|
4
|
+
'heading'?: number;
|
|
5
|
+
quoted?: boolean;
|
|
6
6
|
align?: 'left' | 'center' | 'right';
|
|
7
7
|
checkbox?: 'checked' | 'unchecked';
|
|
8
8
|
ordered?: boolean;
|
|
@@ -11,6 +11,7 @@ export type TextStyleItemOptions = {
|
|
|
11
11
|
onAfterStyleItemClick?: () => void;
|
|
12
12
|
};
|
|
13
13
|
export default class TextStyleItem implements BlockMenuItem {
|
|
14
|
+
private editor;
|
|
14
15
|
private block;
|
|
15
16
|
private options;
|
|
16
17
|
source: string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { OnesEditorComments } from '../comments';
|
|
2
3
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
4
|
export default class CommentBlockHook implements OnesEditorBlockHook {
|
|
4
5
|
private provider;
|
|
5
|
-
|
|
6
|
+
private editorComments;
|
|
7
|
+
constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
|
|
6
8
|
commands(editor: OnesEditor, blockElement: BlockElement): BlockCommands;
|
|
7
9
|
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem) => void;
|
|
8
10
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { OnesEditor, DocObject } from '../../../../@ones-editor/core';
|
|
2
|
-
import {
|
|
2
|
+
import { OnesEditorCommentsProvider } from '../types';
|
|
3
3
|
import './index.scss';
|
|
4
4
|
export declare class CommentEditor {
|
|
5
5
|
private mainEditor;
|
|
6
6
|
private commentsProvider;
|
|
7
|
-
private
|
|
7
|
+
private doc;
|
|
8
8
|
root: HTMLDivElement;
|
|
9
9
|
private components;
|
|
10
|
-
constructor(mainEditor: OnesEditor, commentsProvider: OnesEditorCommentsProvider,
|
|
11
|
-
private get editorDoc();
|
|
10
|
+
constructor(mainEditor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, doc: DocObject);
|
|
12
11
|
private createEditor;
|
|
13
12
|
get editor(): OnesEditor;
|
|
14
13
|
private handleEditorBlur;
|
|
@@ -17,7 +16,6 @@ export declare class CommentEditor {
|
|
|
17
16
|
private inactiveEditor;
|
|
18
17
|
handleInsertImg: () => Promise<void>;
|
|
19
18
|
handleReadonlyChange: (editor: OnesEditor) => void;
|
|
20
|
-
reloadDoc: () => void;
|
|
21
19
|
setDoc: (doc: DocObject) => void;
|
|
22
20
|
getDoc: () => DocObject;
|
|
23
21
|
isEmpty: () => boolean;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare class OnesEditorCommentInputHandler implements OnesEditorInputHandler {
|
|
4
|
-
private commentsProvider;
|
|
5
|
-
private createCommentEditorOptions;
|
|
6
|
-
constructor(commentsProvider: OnesEditorCommentsProvider, createCommentEditorOptions: CreateCommentEditorOption);
|
|
7
|
-
private handleQuickReplyEnter;
|
|
8
|
-
private handleCommentItemEnter;
|
|
9
|
-
handleBeforeKeyDown: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
10
|
-
}
|
|
1
|
+
export { QuickReplyEditorInputHandler } from './quick-reply-input-handler';
|
|
2
|
+
export { CommentEditorInputHandler } from './input-handler';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
+
import type { CommentGroupItem } from '../comments-list/group-item';
|
|
4
|
+
import type { CommentItem } from '../comment-item';
|
|
5
|
+
export declare class CommentEditorInputHandler implements OnesEditorInputHandler {
|
|
6
|
+
private commentsProvider;
|
|
7
|
+
private groupItem;
|
|
8
|
+
private commentItem;
|
|
9
|
+
constructor(commentsProvider: OnesEditorCommentsProvider, groupItem: CommentGroupItem, commentItem: CommentItem);
|
|
10
|
+
handleBeforeKeyDown: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { CommentGroupItem } from '../comments-list/group-item';
|
|
3
|
+
export declare class QuickReplyEditorInputHandler implements OnesEditorInputHandler {
|
|
4
|
+
private groupItem;
|
|
5
|
+
constructor(groupItem: CommentGroupItem);
|
|
6
|
+
handleBeforeKeyDown: (editor: OnesEditor, event: KeyboardEvent) => boolean;
|
|
7
|
+
}
|
|
@@ -20,6 +20,7 @@ export declare class CommentItem {
|
|
|
20
20
|
constructor(options: CommentItemOptions);
|
|
21
21
|
private get commentOptions();
|
|
22
22
|
get comment(): OnesEditorComment;
|
|
23
|
+
get doc(): import("@ones-editor/core").DocObject;
|
|
23
24
|
private createRoot;
|
|
24
25
|
private createMoreMenu;
|
|
25
26
|
private createItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MobileCommentItem } from './mobile-comment-item';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OnesEditorComment, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { CommentEditor } from '../../comment-editor';
|
|
3
|
+
import { OnesEditorCommentsProvider } from '../../types';
|
|
4
|
+
import './mobile-comment-item.scss';
|
|
5
|
+
export declare class MobileCommentItem {
|
|
6
|
+
private editor;
|
|
7
|
+
private commentsProvider;
|
|
8
|
+
comment: OnesEditorComment;
|
|
9
|
+
root: HTMLDivElement;
|
|
10
|
+
private components;
|
|
11
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, comment: OnesEditorComment);
|
|
12
|
+
private get doc();
|
|
13
|
+
createItem(): {
|
|
14
|
+
mobileCommentEditor: CommentEditor;
|
|
15
|
+
};
|
|
16
|
+
reloadDoc: () => void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
import CommentsList, { MiniCommentsList } from '../comments-list';
|
|
3
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
4
3
|
export default class OnesEditorComments {
|
|
5
4
|
private editor;
|
|
6
5
|
private provider;
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
|
|
6
|
+
private root;
|
|
7
|
+
private commentList;
|
|
8
|
+
private mobileCommentList;
|
|
9
|
+
private miniCommentList;
|
|
10
|
+
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider, parent?: HTMLElement);
|
|
11
|
+
get isMobile(): boolean;
|
|
10
12
|
destroy(): void;
|
|
11
|
-
private
|
|
13
|
+
private showComment;
|
|
14
|
+
showCommentList: (groupId?: string) => void;
|
|
15
|
+
private handleCommentListClose;
|
|
16
|
+
private handleOnSelectComment;
|
|
12
17
|
private handleMiniCommentClose;
|
|
13
18
|
private handleMiniCommentItemClick;
|
|
14
|
-
createCommentsList(): CommentsList;
|
|
15
|
-
createCommentMiniList(): MiniCommentsList;
|
|
16
19
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
+
import type OnesEditorComments from '../comments/comments';
|
|
3
4
|
export default class BlockCommentButton {
|
|
4
5
|
private editor;
|
|
5
6
|
private commentProvider;
|
|
7
|
+
private editorComments;
|
|
6
8
|
private buttonElement;
|
|
7
9
|
private currentBlockId;
|
|
8
|
-
constructor(editor: OnesEditor, commentProvider: OnesEditorCommentsProvider);
|
|
10
|
+
constructor(editor: OnesEditor, commentProvider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
|
|
9
11
|
destroy(): void;
|
|
10
12
|
handleDocumentMouseMove: (event: MouseEvent) => void;
|
|
11
13
|
handleButtonClick: (event: MouseEvent) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OnesEditorComment, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isChildComment(comment: OnesEditorComment): boolean;
|
|
3
3
|
export declare function getCommentsRoot(): HTMLDivElement;
|
|
4
|
-
export declare function getCommentItemCountInGroupItem(groupItemRoot: HTMLElement): number;
|
|
4
|
+
export declare function getCommentItemCountInGroupItem(groupItemRoot: HTMLElement, commentItemCls?: string): number;
|
|
5
5
|
export declare function getClosestCommentItemId(element: HTMLElement): string | null;
|
|
6
6
|
export declare function addGroupActionToElement(element: HTMLElement, action: string): void;
|
|
7
7
|
export declare function getClosestGroupItemActionElement(element: HTMLElement): HTMLElement;
|
|
@@ -13,7 +13,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
|
|
|
13
13
|
private header;
|
|
14
14
|
private groupsContainer;
|
|
15
15
|
private list;
|
|
16
|
-
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider);
|
|
16
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
17
17
|
private get commentOptions();
|
|
18
18
|
destroy(): void;
|
|
19
19
|
onCreateComment(commentId: string, local: boolean): void;
|
|
@@ -2,7 +2,6 @@ import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
3
|
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../..';
|
|
4
4
|
import { MiniGroupList } from './group-list';
|
|
5
|
-
import './style.scss';
|
|
6
5
|
interface MiniCommentsListEvents {
|
|
7
6
|
onMiniCommentClose: () => void;
|
|
8
7
|
onItemClick: (groupId: string) => void;
|
|
@@ -13,7 +12,7 @@ export declare class MiniCommentsList extends TypedEmitter<MiniCommentsListEvent
|
|
|
13
12
|
list: MiniGroupList;
|
|
14
13
|
root: HTMLElement;
|
|
15
14
|
header: HTMLElement;
|
|
16
|
-
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider);
|
|
15
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
17
16
|
onCreateComment(commentId: string, local: boolean): void;
|
|
18
17
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
19
18
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OnesEditor, OnesEditorComment } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { MobileCommentItem } from '../../comment-item';
|
|
3
|
+
import ListBase from '../list-base';
|
|
4
|
+
import { OnesEditorCommentsProvider } from '../../types';
|
|
5
|
+
interface MobileCommentChildrenListOptions {
|
|
6
|
+
editor: OnesEditor;
|
|
7
|
+
commentsProvider: OnesEditorCommentsProvider;
|
|
8
|
+
parent: HTMLElement;
|
|
9
|
+
comments: OnesEditorComment[];
|
|
10
|
+
}
|
|
11
|
+
export declare class MobileCommentChildrenList extends ListBase<OnesEditorComment, MobileCommentItem, unknown> {
|
|
12
|
+
constructor({ editor, parent, commentsProvider, comments }: MobileCommentChildrenListOptions);
|
|
13
|
+
protected findInsertPos(): number;
|
|
14
|
+
createItem(data: OnesEditorComment): MobileCommentItem;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
import { OnesEditor, OnesEditorComment } from '../../../../../@ones-editor/core';
|
|
3
|
+
import type { CommentWithChildren, OnesEditorCommentsProvider } from '../../types';
|
|
4
|
+
import { MobileCommentChildrenList } from './children-list';
|
|
5
|
+
interface MobileGroupItemEvents {
|
|
6
|
+
onSwitchGroup: (groupId: CommentWithChildren['groupId'], scrollTime: number) => void;
|
|
7
|
+
onReachBottom: () => void;
|
|
8
|
+
onReachTop: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare class MobileGroupItem extends TypedEmitter<MobileGroupItemEvents> {
|
|
11
|
+
private editor;
|
|
12
|
+
private commentsProvider;
|
|
13
|
+
comment: CommentWithChildren;
|
|
14
|
+
root: HTMLElement;
|
|
15
|
+
childrenList: MobileCommentChildrenList;
|
|
16
|
+
private mainItem;
|
|
17
|
+
private scroller;
|
|
18
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, comment: CommentWithChildren);
|
|
19
|
+
createRoot: () => HTMLDivElement;
|
|
20
|
+
private createMainItem;
|
|
21
|
+
private createChildrenList;
|
|
22
|
+
get commentCount(): number;
|
|
23
|
+
private handleTouchEnd;
|
|
24
|
+
refreshScroller: () => void;
|
|
25
|
+
handleUpdateChildComment(comment: OnesEditorComment): void;
|
|
26
|
+
handleUpdateMainComment(comment: OnesEditorComment): void;
|
|
27
|
+
deleteMainComment(commentId: OnesEditorComment['id']): void;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorComment } from '../../../../../@ones-editor/core';
|
|
2
|
+
import type { CommentWithChildren, OnesEditorCommentsProvider } from '../../types';
|
|
3
|
+
import ListBase from '../list-base';
|
|
4
|
+
import { MobileGroupItem } from './group-item';
|
|
5
|
+
interface MobileCommentGroupListEvents {
|
|
6
|
+
onReachBottom: () => void;
|
|
7
|
+
onReachTop: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare class MobileGroupList extends ListBase<CommentWithChildren, MobileGroupItem, unknown, MobileCommentGroupListEvents> {
|
|
10
|
+
private scroller;
|
|
11
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement, scrollElement: HTMLElement);
|
|
12
|
+
createItem(data: CommentWithChildren): MobileGroupItem;
|
|
13
|
+
insertItem(data: CommentWithChildren): MobileGroupItem | null;
|
|
14
|
+
deleteItem: (commonId: CommentWithChildren['id']) => boolean;
|
|
15
|
+
private setupGroupItem;
|
|
16
|
+
protected findInsertPos(data: CommentWithChildren): number;
|
|
17
|
+
private handleReachBottom;
|
|
18
|
+
private handleReachTop;
|
|
19
|
+
private scrollToGroup;
|
|
20
|
+
setActiveItem(groupId: CommentWithChildren['groupId']): void;
|
|
21
|
+
findGroupItem: (groupId: string) => MobileGroupItem | undefined;
|
|
22
|
+
handleCreateComment(comment: OnesEditorComment, local: boolean): void;
|
|
23
|
+
handleDeleteComment(commentId: string): void;
|
|
24
|
+
handleUpdateComment(comment: OnesEditorComment): void;
|
|
25
|
+
handleDocChanged: () => void;
|
|
26
|
+
private updateComments;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MobileCommentsList } from './mobile-comments-list';
|
package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
+
import type { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
|
|
4
|
+
interface MobileCommentsListEvents {
|
|
5
|
+
onCommentListClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class MobileCommentsList extends TypedEmitter<MobileCommentsListEvents> implements OnesEditorCommentsEvents {
|
|
8
|
+
private editor;
|
|
9
|
+
private commentsProvider;
|
|
10
|
+
private root;
|
|
11
|
+
private list;
|
|
12
|
+
private mask;
|
|
13
|
+
private pullInfoContainer;
|
|
14
|
+
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
15
|
+
onCreateComment(commentId: string, local: boolean): void;
|
|
16
|
+
onDeleteComment(commentId: string, local: boolean): void;
|
|
17
|
+
onUpdateComment(commentId: string, local: boolean): void;
|
|
18
|
+
private handleRootClick;
|
|
19
|
+
private createPullInfo;
|
|
20
|
+
private showPullInfo;
|
|
21
|
+
private hidePullInfo;
|
|
22
|
+
private handleReachBottom;
|
|
23
|
+
private handleReachTop;
|
|
24
|
+
show: (groupId?: string) => void;
|
|
25
|
+
hide: () => void;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -14,4 +14,4 @@ export declare enum GroupItemActions {
|
|
|
14
14
|
export declare const GROUP_ITEM_ACTION_MARK = "group-item-action";
|
|
15
15
|
export declare const LAST_COMMENT_ITEM_MARK = "last-comment-item";
|
|
16
16
|
export declare const DISABLED_ACTION_CLS = "disabled";
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const SWITCH_SCROLL_TIME = 500;
|
|
@@ -3,7 +3,6 @@ import './style.scss';
|
|
|
3
3
|
import './locale';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export { OnesEditorCommentsRender } from './comments-render';
|
|
6
|
-
export { OnesEditorCommentInputHandler } from './comment-input-handler';
|
|
7
6
|
export { OnesEditorCommentPlaceholderHandler } from './comment-placeholder-handler';
|
|
8
7
|
export { OnesEditorComments };
|
|
9
8
|
export type { CommentItem } from './comment-item';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BlockCommandItem, BlockCommandItemWithSource, BlockElement, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
+
import type { OnesEditorComments } from '../comments';
|
|
3
4
|
export default class CommentsCommandProvider implements OnesEditorCommandProvider {
|
|
4
5
|
private provider;
|
|
6
|
+
private editorComments;
|
|
5
7
|
id: string;
|
|
6
|
-
constructor(provider: OnesEditorCommentsProvider);
|
|
8
|
+
constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
|
|
7
9
|
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
|
|
8
10
|
executeRangeCommand(editor: OnesEditor, range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams, result: CommandResult): boolean;
|
|
9
11
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { DocObject, LocalDoc, OnesEditor, OnesEditorComment } from '../../../@ones-editor/core';
|
|
2
2
|
import { AuthMessage } from '../../../@ones-editor/sharedb-doc';
|
|
3
|
-
import type { CommentGroupItem } from './comments-list/group-item';
|
|
4
|
-
import type { CommentItem } from './comment-item';
|
|
5
3
|
export type CommentData = {
|
|
6
4
|
[p in string]: unknown;
|
|
7
5
|
};
|
|
@@ -10,23 +8,13 @@ export interface OnesEditorCommentOptions {
|
|
|
10
8
|
disableReply?: boolean;
|
|
11
9
|
disableEdit?: boolean;
|
|
12
10
|
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
11
|
+
pullThreshold?: number;
|
|
13
12
|
}
|
|
14
13
|
export interface OnesEditorCommentsEvents {
|
|
15
14
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
16
15
|
onDeleteComment: (commentId: string, local: boolean) => void;
|
|
17
16
|
onUpdateComment: (commentId: string, local: boolean) => void;
|
|
18
17
|
}
|
|
19
|
-
export type CreateQuickReplyEditorOption = {
|
|
20
|
-
type: 'quick-reply';
|
|
21
|
-
groupItem: CommentGroupItem;
|
|
22
|
-
};
|
|
23
|
-
export type CreateCommentItemEditorOption = {
|
|
24
|
-
type: 'comment-item';
|
|
25
|
-
commentItem: CommentItem;
|
|
26
|
-
groupItem: CommentGroupItem;
|
|
27
|
-
comment: OnesEditorComment;
|
|
28
|
-
};
|
|
29
|
-
export type CreateCommentEditorOption = CreateQuickReplyEditorOption | CreateCommentItemEditorOption;
|
|
30
18
|
export interface OnesEditorCommentsProvider {
|
|
31
19
|
getAuth: () => AuthMessage;
|
|
32
20
|
getComments: () => OnesEditorComment[];
|
|
@@ -37,7 +25,7 @@ export interface OnesEditorCommentsProvider {
|
|
|
37
25
|
localUpdateComment: (comment: OnesEditorComment, doc: DocObject) => void;
|
|
38
26
|
addListener: (callback: OnesEditorCommentsEvents) => void;
|
|
39
27
|
removeListener: (callback: OnesEditorCommentsEvents) => void;
|
|
40
|
-
createCommentEditor: (parent: HTMLElement, doc: LocalDoc
|
|
28
|
+
createCommentEditor: (parent: HTMLElement, doc: LocalDoc) => OnesEditor;
|
|
41
29
|
}
|
|
42
30
|
export interface CommentWithChildren extends OnesEditorComment {
|
|
43
31
|
children: OnesEditorComment[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_STYLES = "\n<mxStylesheet>\n<add as=\"defaultVertex\">\n<add as=\"shape\" value=\"label\"/>\n<add as=\"perimeter\" value=\"rectanglePerimeter\"/>\n<add as=\"fontSize\" value=\"12\"/>\n<add as=\"fontFamily\" value=\"Helvetica\"/>\n<add as=\"align\" value=\"center\"/>\n<add as=\"verticalAlign\" value=\"middle\"/>\n<add as=\"fillColor\" value=\"#ffffff\"/>\n<add as=\"strokeColor\" value=\"#000000\"/>\n<add as=\"fontColor\" value=\"#000000\"/>\n</add>\n<add as=\"defaultEdge\">\n<add as=\"shape\" value=\"connector\"/>\n<add as=\"labelBackgroundColor\" value=\"#ffffff\"/>\n<add as=\"endArrow\" value=\"classic\"/>\n<add as=\"fontSize\" value=\"11\"/>\n<add as=\"fontFamily\" value=\"Helvetica\"/>\n<add as=\"align\" value=\"center\"/>\n<add as=\"verticalAlign\" value=\"middle\"/>\n<add as=\"rounded\" value=\"1\"/>\n<add as=\"strokeColor\" value=\"#000000\"/>\n<add as=\"fontColor\" value=\"#000000\"/>\n</add>\n<add as=\"text\">\n<add as=\"fillColor\" value=\"none\"/>\n<add as=\"gradientColor\" value=\"none\"/>\n<add as=\"strokeColor\" value=\"none\"/>\n<add as=\"align\" value=\"left\"/>\n<add as=\"verticalAlign\" value=\"top\"/>\n</add>\n<add as=\"edgeLabel\" extend=\"text\">\n<add as=\"labelBackgroundColor\" value=\"#ffffff\"/>\n<add as=\"fontSize\" value=\"11\"/>\n</add>\n<add as=\"label\">\n<add as=\"fontStyle\" value=\"1\"/>\n<add as=\"align\" value=\"left\"/>\n<add as=\"verticalAlign\" value=\"middle\"/>\n<add as=\"spacing\" value=\"2\"/>\n<add as=\"spacingLeft\" value=\"52\"/>\n<add as=\"imageWidth\" value=\"42\"/>\n<add as=\"imageHeight\" value=\"42\"/>\n<add as=\"rounded\" value=\"1\"/>\n</add>\n<add as=\"icon\" extend=\"label\">\n<add as=\"align\" value=\"center\"/>\n<add as=\"imageAlign\" value=\"center\"/>\n<add as=\"verticalLabelPosition\" value=\"bottom\"/>\n<add as=\"verticalAlign\" value=\"top\"/>\n<add as=\"spacingTop\" value=\"4\"/>\n<add as=\"labelBackgroundColor\" value=\"#ffffff\"/>\n<add as=\"spacing\" value=\"0\"/>\n<add as=\"spacingLeft\" value=\"0\"/>\n<add as=\"spacingTop\" value=\"6\"/>\n<add as=\"fontStyle\" value=\"0\"/>\n<add as=\"imageWidth\" value=\"48\"/>\n<add as=\"imageHeight\" value=\"48\"/>\n</add>\n<add as=\"swimlane\">\n<add as=\"shape\" value=\"swimlane\"/>\n<add as=\"fontSize\" value=\"12\"/>\n<add as=\"fontStyle\" value=\"1\"/>\n<add as=\"startSize\" value=\"23\"/>\n</add>\n<add as=\"group\">\n<add as=\"verticalAlign\" value=\"top\"/>\n<add as=\"fillColor\" value=\"none\"/>\n<add as=\"strokeColor\" value=\"none\"/>\n<add as=\"gradientColor\" value=\"none\"/>\n<add as=\"pointerEvents\" value=\"0\"/>\n</add>\n<add as=\"ellipse\">\n<add as=\"shape\" value=\"ellipse\"/>\n<add as=\"perimeter\" value=\"ellipsePerimeter\"/>\n</add>\n<add as=\"rhombus\">\n<add as=\"shape\" value=\"rhombus\"/>\n<add as=\"perimeter\" value=\"rhombusPerimeter\"/>\n</add>\n<add as=\"triangle\">\n<add as=\"shape\" value=\"triangle\"/>\n<add as=\"perimeter\" value=\"trianglePerimeter\"/>\n</add>\n<add as=\"line\">\n<add as=\"shape\" value=\"line\"/>\n<add as=\"strokeWidth\" value=\"4\"/>\n<add as=\"labelBackgroundColor\" value=\"#ffffff\"/>\n<add as=\"verticalAlign\" value=\"top\"/>\n<add as=\"spacingTop\" value=\"8\"/>\n</add>\n<add as=\"image\">\n<add as=\"shape\" value=\"image\"/>\n<add as=\"labelBackgroundColor\" value=\"white\"/>\n<add as=\"verticalAlign\" value=\"top\"/>\n<add as=\"verticalLabelPosition\" value=\"bottom\"/>\n</add>\n<add as=\"roundImage\" extend=\"image\">\n<add as=\"perimeter\" value=\"ellipsePerimeter\"/>\n</add>\n<add as=\"rhombusImage\" extend=\"image\">\n<add as=\"perimeter\" value=\"rhombusPerimeter\"/>\n</add>\n<add as=\"arrow\">\n<add as=\"shape\" value=\"arrow\"/>\n<add as=\"edgeStyle\" value=\"none\"/>\n<add as=\"fillColor\" value=\"#ffffff\"/>\n</add>\n</mxStylesheet>\n";
|
|
@@ -4,5 +4,5 @@ export declare class HeadingBlockDocEvents implements OnesEditorDocCallbacks {
|
|
|
4
4
|
constructor(editor: OnesEditor);
|
|
5
5
|
onInsertBlock(containerId: string, blockIndex: number, blockData: DocBlock, local: boolean): void;
|
|
6
6
|
onUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, local: boolean): void;
|
|
7
|
-
updateBlockIfNeeded(blockId: string): void;
|
|
7
|
+
updateBlockIfNeeded(blockId: string, delta?: DocBlockDelta): void;
|
|
8
8
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OnesEditorCustom, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
+
export default class OnesEditorBlockMention implements OnesEditorCustom {
|
|
3
|
+
private editor;
|
|
4
|
+
mentionButton: HTMLButtonElement;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
private shouldBlockShowMention;
|
|
7
|
+
private handleHoveringBlock;
|
|
8
|
+
private handleMouseDown;
|
|
9
|
+
destroy: () => void;
|
|
10
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import OnesEditorMention from './mention';
|
|
2
2
|
import MentionBox from './mention-box';
|
|
3
|
+
import OnesEditorBlockMention from './block-mention';
|
|
3
4
|
import './mention-style.scss';
|
|
4
|
-
export { OnesEditorMention, MentionBox };
|
|
5
|
+
export { OnesEditorMention, MentionBox, OnesEditorBlockMention };
|
|
5
6
|
export * from './types';
|