@ones-editor/editor 0.0.3-beta.18 → 0.0.3-beta.19
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-locker/src/i18n/en-US.d.ts +8 -0
- package/@ones-editor/block-locker/src/i18n/index.d.ts +1 -0
- package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +8 -0
- package/@ones-editor/block-locker/src/index.d.ts +2 -0
- package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +3 -2
- package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +2 -1
- package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +2 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +4 -3
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +0 -8
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +0 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +0 -3
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +10 -2
- package/@ones-editor/core/src/core/converter/block-to-doc.d.ts +1 -1
- package/@ones-editor/core/src/core/converter/selected-block-to-doc.d.ts +3 -1
- package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +1 -1
- package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +2 -0
- package/@ones-editor/core/src/core/types.d.ts +7 -5
- package/@ones-editor/core/src/utils/file.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-target.d.ts +1 -1
- package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +8 -0
- package/@ones-editor/e2e/cypress/support/commands.d.ts +6 -0
- package/@ones-editor/e2e/src/block-menu/case.d.ts +17 -0
- package/@ones-editor/e2e/src/block-menu/menu.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/data.d.ts +32 -7
- package/@ones-editor/heading-collapse/src/heading-collapse-button/drop-handler.d.ts +1 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +5 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -1
- package/@ones-editor/list-block/src/drop/index.d.ts +1 -1
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +12 -0
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-resize/resize-gripper.d.ts +1 -1
- package/@ones-editor/templates/package.json +9 -0
- package/@ones-editor/templates/src/index.d.ts +4 -0
- package/@ones-editor/templates/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/templates/src/locale/index.d.ts +1 -0
- package/@ones-editor/templates/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/templates/src/templates/select-template.d.ts +8 -0
- package/@ones-editor/templates/src/templates/types.d.ts +14 -0
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +22 -0
- package/@ones-editor/toc/src/heading-scroll/utils.d.ts +7 -0
- package/@ones-editor/toc/src/index.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +1 -1
- package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -2
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -1
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +154 -154
- package/dist/types.d.ts +2 -3
- package/package.json +1 -1
- package/@ones-editor/e2e/src/block-menu/menu-list.cy.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function updateCommentToBlock(editor: OnesEditor, block: BlockElement, comment: OnesEditorComment): void;
|
|
4
|
+
export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): OnesEditorComment;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { OnesEditor, OnesEditorComment, SelectionRange } from '../../../../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, OnesEditorComment, SelectedBlock, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
+
export declare function addCommentToSelectedTextBlock(editor: OnesEditor, selectedBlock: SelectedBlock, comment: OnesEditorComment): void;
|
|
3
4
|
export declare function addCommentToTextBlocks(editor: OnesEditor, range: SelectionRange, provider: OnesEditorCommentsProvider): OnesEditorComment;
|
|
@@ -3,17 +3,18 @@ import { OnesEditorCommentsProvider } from '../types';
|
|
|
3
3
|
export default class OnesEditorComments {
|
|
4
4
|
private editor;
|
|
5
5
|
private provider;
|
|
6
|
-
private root;
|
|
7
6
|
private commentList;
|
|
8
7
|
private mobileCommentList;
|
|
9
8
|
private miniCommentList;
|
|
10
|
-
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider
|
|
9
|
+
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
|
|
10
|
+
private get commentOptions();
|
|
11
|
+
get commentProvider(): OnesEditorCommentsProvider;
|
|
11
12
|
get isMobile(): boolean;
|
|
13
|
+
private getCommentRoot;
|
|
12
14
|
destroy(): void;
|
|
13
15
|
private showComment;
|
|
14
16
|
showCommentList: (groupId?: string) => void;
|
|
15
17
|
private handleCommentListClose;
|
|
16
18
|
private handleOnSelectComment;
|
|
17
|
-
private handleMiniCommentClose;
|
|
18
19
|
private handleMiniCommentItemClick;
|
|
19
20
|
}
|
|
@@ -8,3 +8,4 @@ export declare function getClosestGroupItemActionElement(element: HTMLElement):
|
|
|
8
8
|
export declare function getActionFromActionElement(actionElement: HTMLElement): string;
|
|
9
9
|
export declare function isDisabledActionElement(actionElement: HTMLElement): boolean;
|
|
10
10
|
export declare function getBlockIdByGroupId(editor: OnesEditor, commentId: string): string | null;
|
|
11
|
+
export declare function getAllCommentInCommentElement(element: HTMLElement): string[];
|
|
@@ -3,14 +3,12 @@ import { TypedEmitter } from 'tiny-typed-emitter';
|
|
|
3
3
|
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../types';
|
|
4
4
|
import CommentGroupList from './group-list';
|
|
5
5
|
interface CommentsListEvents {
|
|
6
|
-
onCommentListClose: () => void;
|
|
7
6
|
onSelectComment: () => void;
|
|
8
7
|
}
|
|
9
8
|
export default class CommentsList extends TypedEmitter<CommentsListEvents> implements OnesEditorCommentsEvents {
|
|
10
9
|
private editor;
|
|
11
10
|
private commentsProvider;
|
|
12
11
|
private root;
|
|
13
|
-
private header;
|
|
14
12
|
private groupsContainer;
|
|
15
13
|
private list;
|
|
16
14
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
@@ -19,13 +17,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
|
|
|
19
17
|
onCreateComment(commentId: string, local: boolean): void;
|
|
20
18
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
21
19
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
22
|
-
createHeader(): {
|
|
23
|
-
header: HTMLDivElement;
|
|
24
|
-
count: HTMLSpanElement;
|
|
25
|
-
closeButton: HTMLButtonElement;
|
|
26
|
-
};
|
|
27
20
|
createList(): CommentGroupList;
|
|
28
|
-
handleCloseButtonClick: () => void;
|
|
29
21
|
handleSelectionOnComment: () => void;
|
|
30
22
|
updateCommentCount: () => void;
|
|
31
23
|
handleActiveItemChanged: () => void;
|
|
@@ -6,7 +6,6 @@ import { CommentGroupItemHandlers } from './handler';
|
|
|
6
6
|
export interface CommentGroupListEvents {
|
|
7
7
|
activeItemChanged: (index: number) => void;
|
|
8
8
|
itemLayoutUpdated: () => void;
|
|
9
|
-
itemCountClicked: () => void;
|
|
10
9
|
selectionOnComment: () => void;
|
|
11
10
|
commentCountChanged: () => void;
|
|
12
11
|
}
|
|
@@ -11,15 +11,12 @@ export declare class MiniCommentsList extends TypedEmitter<MiniCommentsListEvent
|
|
|
11
11
|
private commentsProvider;
|
|
12
12
|
list: MiniGroupList;
|
|
13
13
|
root: HTMLElement;
|
|
14
|
-
header: HTMLElement;
|
|
15
14
|
constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
|
|
16
15
|
onCreateComment(commentId: string, local: boolean): void;
|
|
17
16
|
onDeleteComment(commentId: string, local: boolean): void;
|
|
18
17
|
onUpdateComment(commentId: string, local: boolean): void;
|
|
19
|
-
private createHeader;
|
|
20
18
|
private createList;
|
|
21
19
|
private handleListContainerClick;
|
|
22
|
-
private closeMiniComment;
|
|
23
20
|
show(): void;
|
|
24
21
|
hide(): void;
|
|
25
22
|
destroy(): void;
|
|
@@ -8,3 +8,4 @@ export { OnesEditorComments };
|
|
|
8
8
|
export type { CommentItem } from './comment-item';
|
|
9
9
|
export type { CommentGroupItem } from './comments-list/group-item';
|
|
10
10
|
export { removeCommentFromBlock } from './actions/remove-comment-from-block';
|
|
11
|
+
export { editorAddComment } from './actions/editor-add-comment';
|
|
@@ -3,12 +3,20 @@ import { AuthMessage } from '../../../@ones-editor/sharedb-doc';
|
|
|
3
3
|
export type CommentData = {
|
|
4
4
|
[p in string]: unknown;
|
|
5
5
|
};
|
|
6
|
+
export interface OnesEditorCommentController {
|
|
7
|
+
showCommentList: () => void;
|
|
8
|
+
}
|
|
9
|
+
export type CommentRootType = keyof Pick<OnesEditorCommentOptions, 'container' | 'miniContainer' | 'mobileContainer'>;
|
|
6
10
|
export interface OnesEditorCommentOptions {
|
|
7
|
-
|
|
11
|
+
controller: OnesEditorCommentController;
|
|
12
|
+
container?: HTMLElement;
|
|
13
|
+
miniContainer?: HTMLElement;
|
|
14
|
+
mobileContainer?: HTMLElement;
|
|
8
15
|
disableReply?: boolean;
|
|
9
16
|
disableEdit?: boolean;
|
|
10
|
-
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
11
17
|
pullThreshold?: number;
|
|
18
|
+
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
19
|
+
onCommentCountChange?: (count: number) => void;
|
|
12
20
|
}
|
|
13
21
|
export interface OnesEditorCommentsEvents {
|
|
14
22
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DocObject } from '../doc';
|
|
2
2
|
import { BlockElement, OnesEditor } from '../types';
|
|
3
|
-
export declare function blockToDoc(editor: OnesEditor, block: BlockElement): DocObject;
|
|
3
|
+
export declare function blockToDoc(editor: OnesEditor, block: BlockElement, ignoreLockInfo?: boolean): DocObject;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { DocObject } from '../doc';
|
|
2
2
|
import { OnesEditor, SelectedBlock } from '../types';
|
|
3
|
-
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock
|
|
3
|
+
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock, options?: {
|
|
4
|
+
ignoreLockInfo: boolean;
|
|
5
|
+
}): DocObject;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BlockElement, BreakTextOptions, OnesEditor } from '../../types';
|
|
2
|
+
import { DocBlockAttributes } from '../../doc';
|
|
2
3
|
export interface BreakTextBlockResult {
|
|
3
4
|
block: BlockElement;
|
|
4
5
|
newBlock: BlockElement;
|
|
5
6
|
}
|
|
7
|
+
export declare function copyBlockAttributes(editor: OnesEditor, block: BlockElement): DocBlockAttributes;
|
|
6
8
|
export declare function editorBreakTextBlock(editor: OnesEditor, block: BlockElement, offset: number, options?: BreakTextOptions): BreakTextBlockResult;
|
|
@@ -12,7 +12,7 @@ declare class DomEventHandler {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class EditorDomEvents {
|
|
14
14
|
private editor;
|
|
15
|
-
handlers: Map<
|
|
15
|
+
handlers: Map<Document | Element | Window, DomEventHandler[]>;
|
|
16
16
|
constructor(editor: OnesEditor);
|
|
17
17
|
destroy(): void;
|
|
18
18
|
addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown): void;
|
|
@@ -88,8 +88,8 @@ export interface Embed {
|
|
|
88
88
|
getOptions?: (editor: OnesEditor) => EmbedOptions;
|
|
89
89
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
90
90
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock) => boolean;
|
|
91
|
-
handleDropOver?: (editor: OnesEditor, block: BlockElement,
|
|
92
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement,
|
|
91
|
+
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | null, x: number, y: number) => DropInsertPos | undefined;
|
|
92
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
|
|
93
93
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
94
94
|
offset: number;
|
|
95
95
|
data?: DocBlockAttributes;
|
|
@@ -118,7 +118,7 @@ export interface CommandItem {
|
|
|
118
118
|
value?: string;
|
|
119
119
|
order?: number;
|
|
120
120
|
type?: CommandItemType;
|
|
121
|
-
element?: HTMLElement;
|
|
121
|
+
element?: HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
122
122
|
icon?: string;
|
|
123
123
|
childrenType?: 'menu' | 'toolbar';
|
|
124
124
|
children?: CommandItem[];
|
|
@@ -131,6 +131,7 @@ export interface CommandItem {
|
|
|
131
131
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
132
132
|
childrenOffset?: [number, number];
|
|
133
133
|
shortcut?: string;
|
|
134
|
+
defaultCheckedChildren?: string[];
|
|
134
135
|
setCloseable?: (closeable: Closeable) => void;
|
|
135
136
|
beforePopup?: (parent: unknown) => void;
|
|
136
137
|
}
|
|
@@ -204,8 +205,8 @@ export interface Block {
|
|
|
204
205
|
handleContainerResized?: (editor: OnesEditor, block: BlockElement) => void;
|
|
205
206
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
206
207
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => boolean;
|
|
207
|
-
handleDropOver?: (editor: OnesEditor, block: BlockElement,
|
|
208
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement,
|
|
208
|
+
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | null, x: number, y: number) => DropInsertPos | undefined;
|
|
209
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
|
|
209
210
|
getClientRects?: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => DOMRect[];
|
|
210
211
|
getMinWidth?: (editor: OnesEditor, block: BlockElement) => number | undefined;
|
|
211
212
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
@@ -344,6 +345,7 @@ export interface OnesEditorDataConverters {
|
|
|
344
345
|
export interface BreakTextOptions {
|
|
345
346
|
forceInsertAfter?: boolean;
|
|
346
347
|
newBlockData?: DocBlock;
|
|
348
|
+
copyBlockAttributes?: boolean;
|
|
347
349
|
}
|
|
348
350
|
export interface OnesEditorEvents {
|
|
349
351
|
'docChanged': (editor: OnesEditor) => void;
|
|
@@ -4,6 +4,7 @@ interface SelectFileOptions {
|
|
|
4
4
|
export declare function selectFile<T extends SelectFileOptions = SelectFileOptions>(accept: string, options?: T): Promise<T extends {
|
|
5
5
|
multiple: true;
|
|
6
6
|
} ? File[] : File>;
|
|
7
|
+
export declare function isDraggingFiles(v: unknown): v is File[];
|
|
7
8
|
export declare function getFileExt(file: string): string;
|
|
8
9
|
export declare function requestDownload(downloadUrl: string, fileName?: string): void;
|
|
9
10
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlockElement, ContainerElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
import DropIndicator from './drop-indicator';
|
|
3
3
|
export interface DropHandler {
|
|
4
|
-
handleDrop: (editor: OnesEditor,
|
|
4
|
+
handleDrop: (editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number) => boolean | undefined;
|
|
5
5
|
}
|
|
6
6
|
export default class OnesEditorDropTarget {
|
|
7
7
|
private editor;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor, ContainerElement, BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { DropHandler } from '../drop-target';
|
|
3
|
+
export declare class DropFileHandler implements DropHandler {
|
|
4
|
+
private editor;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
private getEmbedClassByFile;
|
|
7
|
+
handleDrop: (editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number) => boolean;
|
|
8
|
+
}
|
|
@@ -8,6 +8,12 @@ declare namespace Cypress {
|
|
|
8
8
|
getBlockContentByBlockId: (blockId: string) => Chainable<Element>;
|
|
9
9
|
cacheBlock: (blockType: string, block: BlockCache) => Chainable<JQuery>;
|
|
10
10
|
createHeadingByShortcut: (blockId: string, level: number, title: string) => Chainable<Element>;
|
|
11
|
+
getMenuItemByDataId: (dataId: string) => Chainable<Element>;
|
|
12
|
+
clickBlockMenuButton: (dataId: string) => Chainable<JQuery>;
|
|
13
|
+
getBlockMenuButton: (dataId: string) => Chainable<JQuery>;
|
|
14
|
+
checkTextStyle: (blockId: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string) => Chainable<JQuery>;
|
|
15
|
+
checkTextColer: (blockId: string, checkSpanIndex: number, expectedClassValue: string, expectBlockAttr: string, expectBlockAttrValue: string, expectedTextValue: string) => Chainable<JQuery>;
|
|
16
|
+
checkHeadingStyle: (blockId: string, expectBlockAttr: string, expectBlockAttrValue: string) => Chainable<JQuery>;
|
|
11
17
|
}
|
|
12
18
|
}
|
|
13
19
|
interface BlockCache {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseAssertion } from '../data';
|
|
2
|
+
declare class Item {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
shortcut: string;
|
|
6
|
+
constructor(id: string, name: string, shortcut: string);
|
|
7
|
+
}
|
|
8
|
+
export declare const items: Map<string, Item>;
|
|
9
|
+
export declare class BlockMenuCase {
|
|
10
|
+
/**
|
|
11
|
+
* howToOpen : clickToOpen | shortcutToOpen:default
|
|
12
|
+
* @returns null
|
|
13
|
+
*/
|
|
14
|
+
checkBlockMenuItem: (howToOpen: string, block: string) => () => void;
|
|
15
|
+
checkBlockMenuButton: (button: string, assertData: BaseAssertion) => () => void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'cypress-real-events';
|
|
@@ -6,20 +6,35 @@ export declare class BlockCache {
|
|
|
6
6
|
getLastBlockId(blockType: string): string;
|
|
7
7
|
setTitleBlockId(blockId: string): void;
|
|
8
8
|
}
|
|
9
|
-
export declare class
|
|
10
|
-
inputStr: string;
|
|
11
|
-
checkSpanIndex: number;
|
|
12
|
-
expectedClassValue: string;
|
|
13
|
-
expectedTextValue: string;
|
|
14
|
-
constructor(inputStr: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
|
|
9
|
+
export declare class BaseAssertion {
|
|
15
10
|
}
|
|
16
|
-
export declare class TestHeadingStyleData {
|
|
11
|
+
export declare class TestHeadingStyleData extends BaseAssertion {
|
|
17
12
|
key: string;
|
|
18
13
|
inputStr: string;
|
|
19
14
|
expected: string;
|
|
20
15
|
expectedPlaceholder: string;
|
|
21
16
|
constructor(key: string, inputStr: string, expected: string, expectedPlaceholder: string);
|
|
22
17
|
}
|
|
18
|
+
export declare class CheckBlockData extends BaseAssertion {
|
|
19
|
+
expectBlockAttr: string;
|
|
20
|
+
expectBlockAttrValue: string;
|
|
21
|
+
constructor(expectBlockAttr: string, expectBlockAttrValue: string);
|
|
22
|
+
}
|
|
23
|
+
export declare class CheckTextStyleData extends BaseAssertion {
|
|
24
|
+
checkSpanIndex: number;
|
|
25
|
+
expectedClassValue: string;
|
|
26
|
+
expectedTextValue: string;
|
|
27
|
+
constructor(checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
|
|
28
|
+
}
|
|
29
|
+
export declare class TestTextStyleData extends CheckTextStyleData {
|
|
30
|
+
inputStr: string;
|
|
31
|
+
constructor(inputStr: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class CheckTextColerData extends CheckTextStyleData {
|
|
34
|
+
attr: string;
|
|
35
|
+
attrValue: string;
|
|
36
|
+
constructor(attr: string, attrValue: string, checkSpanIndex: number, expectedClassValue: string, expectedTextValue: string);
|
|
37
|
+
}
|
|
23
38
|
export declare const docTestBlockStyle = "block-style";
|
|
24
39
|
export declare const blockCache: BlockCache;
|
|
25
40
|
export declare const TEXT_BLOCK_ATTRIBUTE: {
|
|
@@ -41,11 +56,21 @@ export declare const TEXT_BLOCK_ATTRIBUTE: {
|
|
|
41
56
|
STYLE_QUOTE: {
|
|
42
57
|
QUOTECLASSNAME: string;
|
|
43
58
|
};
|
|
59
|
+
STYLE_ALIGN: {
|
|
60
|
+
ALIGN: string;
|
|
61
|
+
};
|
|
62
|
+
STYLE_COLER: {
|
|
63
|
+
TC_COLER: string;
|
|
64
|
+
BC_CLOER: string;
|
|
65
|
+
};
|
|
44
66
|
STYLE_TEXT: {
|
|
45
67
|
BoldStyleClass: string;
|
|
68
|
+
BoldAndItalicStyleClass: string;
|
|
46
69
|
ItalicStyleClass: string;
|
|
47
70
|
CodeStyleClass: string;
|
|
48
71
|
StrikeThrough: string;
|
|
72
|
+
SubscriptCLass: string;
|
|
73
|
+
SuperscriptClass: string;
|
|
49
74
|
};
|
|
50
75
|
};
|
|
51
76
|
export declare const LIST_BLOCK_ATTRIBUTE: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropHandler } from '../../../../@ones-editor/drop-target';
|
|
2
2
|
import { OnesEditor, BlockElement, ContainerElement } from '../../../../@ones-editor/core';
|
|
3
3
|
export default class HeadingBlockDropHandler implements DropHandler {
|
|
4
|
-
handleDrop(editor: OnesEditor,
|
|
4
|
+
handleDrop(editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number): boolean | undefined;
|
|
5
5
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { BlockElement, DragObject, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ImageDragInsertPos } from './types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function getDragInsertPos(editor: OnesEditor, block: BlockElement, images: HTMLElement[], x: number, y?: number): {
|
|
4
|
+
rect: DOMRect;
|
|
5
|
+
data: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function handleDropOver(editor: OnesEditor, block: BlockElement, dragObject: DragObject | null, x: number, y: number): ImageDragInsertPos | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BlockElement, DragObject, DropInsertPos, DropOptions, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function handleDrop(editor: OnesEditor, block: BlockElement,
|
|
2
|
+
export declare function handleDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions): boolean | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OnesEditor, BlockElement, DragObject, DropInsertPos, DropOptions } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function handleListDrop(editor: OnesEditor, block: BlockElement,
|
|
2
|
+
export declare function handleListDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
|
+
export declare class LocatingContainerResizeObserver {
|
|
3
|
+
private scrollCore;
|
|
4
|
+
private resizeObserver;
|
|
5
|
+
private scrollContainersMap;
|
|
6
|
+
constructor(scrollCore: ScrollCore);
|
|
7
|
+
private handleResizeEntry;
|
|
8
|
+
private handleResize;
|
|
9
|
+
bind(scrollContainer: ScrollContainerElement): void;
|
|
10
|
+
unbind(scrollContainer: ScrollContainerElement): void;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
}
|
|
@@ -12,6 +12,7 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
12
12
|
private containerScrollObserver;
|
|
13
13
|
private parentContainerScrollObserver;
|
|
14
14
|
private scrollWrapResizeObserve;
|
|
15
|
+
private locatingContainerResizeObserver;
|
|
15
16
|
private isWindowEventBind;
|
|
16
17
|
containers: ScrollCore['containers'];
|
|
17
18
|
constructor(parentContainer: ParentContainerElement);
|
|
@@ -8,4 +8,4 @@ export declare function getExistsResizeGripper(editor: OnesEditor, block: BlockE
|
|
|
8
8
|
export declare function createResizeGripper(editor: OnesEditor, block: BlockElement): HTMLDivElement;
|
|
9
9
|
export declare function updateResizeGripper(editor: OnesEditor, block: BlockElement, cell: HTMLTableCellElement): void;
|
|
10
10
|
export declare function removeAllResizeGripper(editor: OnesEditor): void;
|
|
11
|
-
export declare function setTableColumnWidths(editor: OnesEditor, block: BlockElement,
|
|
11
|
+
export declare function setTableColumnWidths(editor: OnesEditor, block: BlockElement, colsWidth: number[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import './templates.css';
|
|
3
|
+
import './select-templates.scss';
|
|
4
|
+
interface ShowTemplatesOptions {
|
|
5
|
+
reset?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function autoShowHideTemplates(editor: OnesEditor, options?: ShowTemplatesOptions): void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export interface DocTemplate {
|
|
3
|
+
docId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
thumbnailUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TemplateOptions {
|
|
8
|
+
templates: DocTemplate[];
|
|
9
|
+
placeHolderImageSrc?: string;
|
|
10
|
+
showTemplateTitleAttr?: boolean;
|
|
11
|
+
onChooseTemplate?: (editor: OnesEditor) => void;
|
|
12
|
+
onApplyTemplate?: (editor: OnesEditor, template: DocTemplate) => Promise<void>;
|
|
13
|
+
onTemplateChooserStatusChanged?: (editor: OnesEditor, cardContainer: HTMLElement | null, status: 'visible' | 'hide') => void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
+
export interface ScrollStatus {
|
|
4
|
+
curHeadingBlock: BlockElement | null;
|
|
5
|
+
previousHeadingBlock: BlockElement | null;
|
|
6
|
+
nextHeadingBlock: BlockElement | null;
|
|
7
|
+
}
|
|
8
|
+
export interface HeadingBlockScrollListenerEvents {
|
|
9
|
+
change: (editor: OnesEditor, status: ScrollStatus) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class HeadingBlockScrollListener extends TypedEmitter<HeadingBlockScrollListenerEvents> implements OnesEditorCustom {
|
|
12
|
+
private editor;
|
|
13
|
+
scrollContainer?: HTMLElement;
|
|
14
|
+
scrollEventTarget?: HTMLElement | Document;
|
|
15
|
+
scrollStatus: ScrollStatus;
|
|
16
|
+
constructor(editor: OnesEditor);
|
|
17
|
+
private setStatus;
|
|
18
|
+
private handleScroll;
|
|
19
|
+
private start;
|
|
20
|
+
private stop;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function isHeadingBlock(block: BlockElement): boolean;
|
|
3
|
+
export declare function isHeadingBlockWithText(editor: OnesEditor, block: BlockElement): boolean;
|
|
4
|
+
export declare function getFirstVisibleBlock(editor: OnesEditor): BlockElement | null;
|
|
5
|
+
export declare function getNextHeadingBlock(editor: OnesEditor, target: BlockElement): BlockElement | null;
|
|
6
|
+
export declare function isTitleBlock(block: BlockElement): boolean;
|
|
7
|
+
export declare function getPreviousHeadingBlock(editor: OnesEditor, target: BlockElement): BlockElement | null;
|