@ones-editor/editor 0.0.3-beta.16 → 0.0.3-beta.18
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/index.d.ts +0 -2
- package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +2 -3
- package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +1 -2
- package/@ones-editor/comments/src/comments/comments.d.ts +1 -3
- package/@ones-editor/comments/src/index.d.ts +0 -1
- package/@ones-editor/comments/src/types.d.ts +0 -1
- 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 +1 -3
- package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +0 -2
- package/@ones-editor/core/src/core/types.d.ts +5 -7
- package/@ones-editor/core/src/utils/file.d.ts +0 -1
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +0 -1
- package/@ones-editor/drop-target/src/drop-target.d.ts +1 -1
- 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 +1 -5
- 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/scroll-listener.d.ts +0 -1
- 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/toc/src/index.d.ts +0 -1
- 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 +3 -2
- package/package.json +1 -1
- package/@ones-editor/block-locker/src/i18n/en-US.d.ts +0 -8
- package/@ones-editor/block-locker/src/i18n/index.d.ts +0 -1
- package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +0 -8
- package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +0 -2
- package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +0 -2
- package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +0 -8
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +0 -12
- package/@ones-editor/templates/package.json +0 -9
- package/@ones-editor/templates/src/index.d.ts +0 -4
- package/@ones-editor/templates/src/locale/en-us.d.ts +0 -9
- package/@ones-editor/templates/src/locale/index.d.ts +0 -1
- package/@ones-editor/templates/src/locale/zh-cn.d.ts +0 -9
- package/@ones-editor/templates/src/templates/select-template.d.ts +0 -8
- package/@ones-editor/templates/src/templates/types.d.ts +0 -17
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +0 -22
- package/@ones-editor/toc/src/heading-scroll/utils.d.ts +0 -7
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): OnesEditorComment;
|
|
3
|
+
export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): import("@ones-editor/core").OnesEditorComment;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OnesEditor, OnesEditorComment,
|
|
1
|
+
import { OnesEditor, OnesEditorComment, SelectionRange } from '../../../../@ones-editor/core';
|
|
2
2
|
import { OnesEditorCommentsProvider } from '../types';
|
|
3
|
-
export declare function addCommentToSelectedTextBlock(editor: OnesEditor, selectedBlock: SelectedBlock, comment: OnesEditorComment): void;
|
|
4
3
|
export declare function addCommentToTextBlocks(editor: OnesEditor, range: SelectionRange, provider: OnesEditorCommentsProvider): OnesEditorComment;
|
|
@@ -7,11 +7,9 @@ export default class OnesEditorComments {
|
|
|
7
7
|
private commentList;
|
|
8
8
|
private mobileCommentList;
|
|
9
9
|
private miniCommentList;
|
|
10
|
-
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
|
|
11
|
-
get commentProvider(): OnesEditorCommentsProvider;
|
|
10
|
+
constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider, parent?: HTMLElement);
|
|
12
11
|
get isMobile(): boolean;
|
|
13
12
|
destroy(): void;
|
|
14
|
-
private createRoot;
|
|
15
13
|
private showComment;
|
|
16
14
|
showCommentList: (groupId?: string) => void;
|
|
17
15
|
private handleCommentListClose;
|
|
@@ -8,4 +8,3 @@ 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';
|
|
@@ -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
|
|
3
|
+
export declare function blockToDoc(editor: OnesEditor, block: BlockElement): DocObject;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { DocObject } from '../doc';
|
|
2
2
|
import { OnesEditor, SelectedBlock } from '../types';
|
|
3
|
-
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock
|
|
4
|
-
ignoreLockInfo: boolean;
|
|
5
|
-
}): DocObject;
|
|
3
|
+
export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock): DocObject;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { BlockElement, BreakTextOptions, OnesEditor } from '../../types';
|
|
2
|
-
import { DocBlockAttributes } from '../../doc';
|
|
3
2
|
export interface BreakTextBlockResult {
|
|
4
3
|
block: BlockElement;
|
|
5
4
|
newBlock: BlockElement;
|
|
6
5
|
}
|
|
7
|
-
export declare function copyBlockAttributes(editor: OnesEditor, block: BlockElement): DocBlockAttributes;
|
|
8
6
|
export declare function editorBreakTextBlock(editor: OnesEditor, block: BlockElement, offset: number, options?: BreakTextOptions): BreakTextBlockResult;
|
|
@@ -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, dragObject: DragObject, x: number, y: number) => DropInsertPos | undefined;
|
|
92
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragObject: DragObject, 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;
|
|
122
122
|
icon?: string;
|
|
123
123
|
childrenType?: 'menu' | 'toolbar';
|
|
124
124
|
children?: CommandItem[];
|
|
@@ -131,7 +131,6 @@ export interface CommandItem {
|
|
|
131
131
|
childrenPlacement?: CommandItemChildrenPlacement;
|
|
132
132
|
childrenOffset?: [number, number];
|
|
133
133
|
shortcut?: string;
|
|
134
|
-
defaultCheckedChildren?: string[];
|
|
135
134
|
setCloseable?: (closeable: Closeable) => void;
|
|
136
135
|
beforePopup?: (parent: unknown) => void;
|
|
137
136
|
}
|
|
@@ -205,8 +204,8 @@ export interface Block {
|
|
|
205
204
|
handleContainerResized?: (editor: OnesEditor, block: BlockElement) => void;
|
|
206
205
|
handleDeleteBlock?: (editor: OnesEditor, block: BlockElement, local: boolean, options: DeleteBlockEventOptions) => void;
|
|
207
206
|
handleUpdateBlock?: (editor: OnesEditor, block: BlockElement, blockData: DocBlock) => boolean;
|
|
208
|
-
handleDropOver?: (editor: OnesEditor, block: BlockElement,
|
|
209
|
-
handleDrop?: (editor: OnesEditor, block: BlockElement,
|
|
207
|
+
handleDropOver?: (editor: OnesEditor, block: BlockElement, dragObject: DragObject, x: number, y: number) => DropInsertPos | undefined;
|
|
208
|
+
handleDrop?: (editor: OnesEditor, block: BlockElement, dragObject: DragObject, insertPos: DropInsertPos, options: DropOptions) => boolean | undefined;
|
|
210
209
|
getClientRects?: (editor: OnesEditor, block: BlockElement, range: SelectionRange) => DOMRect[];
|
|
211
210
|
getMinWidth?: (editor: OnesEditor, block: BlockElement) => number | undefined;
|
|
212
211
|
convertFrom?: (editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
@@ -345,7 +344,6 @@ export interface OnesEditorDataConverters {
|
|
|
345
344
|
export interface BreakTextOptions {
|
|
346
345
|
forceInsertAfter?: boolean;
|
|
347
346
|
newBlockData?: DocBlock;
|
|
348
|
-
copyBlockAttributes?: boolean;
|
|
349
347
|
}
|
|
350
348
|
export interface OnesEditorEvents {
|
|
351
349
|
'docChanged': (editor: OnesEditor) => void;
|
|
@@ -4,7 +4,6 @@ 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[];
|
|
8
7
|
export declare function getFileExt(file: string): string;
|
|
9
8
|
export declare function requestDownload(downloadUrl: string, fileName?: string): void;
|
|
10
9
|
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, draggedBlock: BlockElement, targetContainer: ContainerElement, blockIndex: number) => boolean | undefined;
|
|
5
5
|
}
|
|
6
6
|
export default class OnesEditorDropTarget {
|
|
7
7
|
private editor;
|
|
@@ -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, draggedBlock: BlockElement, targetContainer: ContainerElement, blockIndex: number): boolean | undefined;
|
|
5
5
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { BlockElement, DragObject, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ImageDragInsertPos } from './types';
|
|
3
|
-
export declare function
|
|
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;
|
|
3
|
+
export declare function handleDropOver(editor: OnesEditor, block: BlockElement, dragObject: DragObject, 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, dragObject: DragObject, 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, dragObject: DragObject, insertPos: DropInsertPos, options: DropOptions): boolean;
|
|
@@ -12,7 +12,6 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
12
12
|
private containerScrollObserver;
|
|
13
13
|
private parentContainerScrollObserver;
|
|
14
14
|
private scrollWrapResizeObserve;
|
|
15
|
-
private locatingContainerResizeObserver;
|
|
16
15
|
private isWindowEventBind;
|
|
17
16
|
containers: ScrollCore['containers'];
|
|
18
17
|
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, widths: number[]): void;
|