@ones-editor/editor 2.0.2-beta.2 → 2.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/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +5 -4
- package/@ones-editor/core/src/core/containers/container.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/apply-data-delta.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +21 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +1 -2
- package/@ones-editor/core/src/core/selection/index.d.ts +0 -1
- package/@ones-editor/core/src/core/types.d.ts +1 -1
- package/@ones-editor/core/src/utils/drag-drop.d.ts +3 -8
- package/@ones-editor/image-embed/src/splitter-resizer/index.d.ts +3 -3
- package/@ones-editor/mobile-helper/src/index.d.ts +0 -2
- package/@ones-editor/table-block/src/table-block/table-resize/resize-drag-drop.d.ts +4 -4
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +1 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -1
- package/@ones-editor/ui-base/src/popup/popup.d.ts +1 -1
- package/dist/index.js +842 -77444
- package/package.json +1 -1
- package/@ones-editor/mobile-helper/src/selection-gripper/index.d.ts +0 -19
- package/@ones-editor/mobile-helper/src/selection-gripper/select-handle.d.ts +0 -3
- package/dist/mobile/action.d.ts +0 -3
- package/dist/mobile/command-handler.d.ts +0 -15
- package/dist/mobile/command.d.ts +0 -19
- package/dist/mobile/commands/copy.d.ts +0 -8
- package/dist/mobile/layout.d.ts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
2
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
-
import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
|
|
3
|
+
import type { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../../types';
|
|
4
4
|
import { MiniGroupList } from './group-list';
|
|
5
5
|
interface MiniCommentsListEvents {
|
|
6
6
|
onMiniCommentClose: () => void;
|
|
@@ -25,15 +25,16 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
25
25
|
editor: OnesEditor;
|
|
26
26
|
composing: boolean;
|
|
27
27
|
callbacks: EditorInputCallbacks;
|
|
28
|
-
inputElement:
|
|
28
|
+
inputElement: HTMLInputElement;
|
|
29
29
|
constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
|
|
30
30
|
private isInCommandbar;
|
|
31
31
|
destroy(): void;
|
|
32
|
-
getInput():
|
|
32
|
+
getInput(): HTMLInputElement;
|
|
33
33
|
focus(): void;
|
|
34
|
-
isInDisableScrollMask(target:
|
|
34
|
+
isInDisableScrollMask(target: HTMLElement): boolean;
|
|
35
35
|
handleWindowBlur: () => void;
|
|
36
|
-
|
|
36
|
+
handleWindowFocus: () => void;
|
|
37
|
+
handleDocumentClick: (event: MouseEvent) => void;
|
|
37
38
|
handleDocumentSelectionChange: () => void;
|
|
38
39
|
handleEditorSelectionChanged: () => void;
|
|
39
40
|
handleReadonlyChanged: () => void;
|
|
@@ -5,3 +5,4 @@ export declare function isRootContainer(container: ContainerElement): boolean;
|
|
|
5
5
|
export declare function isChildContainer(container: ContainerElement): boolean;
|
|
6
6
|
export declare function getContainerId(container: ContainerElement): string;
|
|
7
7
|
export declare function getContainerBlocks(container: ContainerElement, doc: OnesEditorDoc): DocBlock[];
|
|
8
|
+
export declare function generateEditorContainerId(containerId: string): string;
|
|
@@ -23,11 +23,32 @@ export type DocBlockTextActions = DocBlockTextActionOp[];
|
|
|
23
23
|
export type DocBlockAttributes = {
|
|
24
24
|
[index: string]: unknown;
|
|
25
25
|
};
|
|
26
|
+
export type ExportDSpecText = {
|
|
27
|
+
type: 'text';
|
|
28
|
+
data: string;
|
|
29
|
+
};
|
|
30
|
+
export type ExportDSpecImage = {
|
|
31
|
+
type: 'image';
|
|
32
|
+
data: string;
|
|
33
|
+
};
|
|
34
|
+
export type ExportDSpecLink = {
|
|
35
|
+
type: 'link';
|
|
36
|
+
data: {
|
|
37
|
+
url: string;
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ExportDSpecBlock = {
|
|
42
|
+
type: 'block';
|
|
43
|
+
data: string[];
|
|
44
|
+
};
|
|
45
|
+
export type DocExportSpec = ExportDSpecText | ExportDSpecImage | ExportDSpecLink | ExportDSpecBlock;
|
|
26
46
|
export type DocBlock = {
|
|
27
47
|
type: string;
|
|
28
48
|
id: string;
|
|
29
49
|
text?: DocBlockText;
|
|
30
50
|
children?: string[];
|
|
51
|
+
exportSpec?: DocExportSpec[];
|
|
31
52
|
} & DocBlockAttributes;
|
|
32
53
|
export type DocEmbedData = {
|
|
33
54
|
[index: string]: unknown;
|
|
@@ -23,5 +23,4 @@ import { editorMovePageDown } from './move-page-down';
|
|
|
23
23
|
import { editorSelectPageUp } from './select-page-up';
|
|
24
24
|
import { editorSelectPageDown } from './select-page-down';
|
|
25
25
|
import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
|
|
26
|
-
|
|
27
|
-
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorSelectWord, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
26
|
+
export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
|
|
@@ -581,7 +581,7 @@ export type PasteOptions = {
|
|
|
581
581
|
toPlainText?: boolean;
|
|
582
582
|
};
|
|
583
583
|
export interface OnesEditorInput {
|
|
584
|
-
readonly inputElement:
|
|
584
|
+
readonly inputElement: HTMLInputElement;
|
|
585
585
|
destroy: () => void;
|
|
586
586
|
focus: () => void;
|
|
587
587
|
handleDocumentSelectionChange: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent
|
|
2
|
-
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent
|
|
3
|
-
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent
|
|
1
|
+
export type DragStartHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement) => void;
|
|
2
|
+
export type DraggingHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
3
|
+
export type DragEndHandler<T> = (drag: DragDrop<T>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number) => void;
|
|
4
4
|
export interface DragDropOptions<T> {
|
|
5
5
|
elem: HTMLElement;
|
|
6
6
|
onDragStart: DragStartHandler<T>;
|
|
@@ -10,7 +10,6 @@ export interface DragDropOptions<T> {
|
|
|
10
10
|
minThreshold?: number;
|
|
11
11
|
cursor?: string;
|
|
12
12
|
mouseDownEvent?: MouseEvent;
|
|
13
|
-
mobile?: boolean;
|
|
14
13
|
}
|
|
15
14
|
export declare const MIN_DISTANCE_THRESHOLD = 3;
|
|
16
15
|
export declare class DragDrop<T> {
|
|
@@ -38,9 +37,5 @@ export declare class DragDrop<T> {
|
|
|
38
37
|
private onDragging;
|
|
39
38
|
private onDragEnd;
|
|
40
39
|
destroy(): void;
|
|
41
|
-
static getEventPosition(event: MouseEvent | TouchEvent): {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
};
|
|
45
40
|
}
|
|
46
41
|
export declare function registerDragDrop<T>(options: DragDropOptions<T>): DragDrop<T>;
|
|
@@ -11,7 +11,7 @@ export declare class ImageSplitterResizer implements DragDropOptions<ImageSplitt
|
|
|
11
11
|
cursor: string;
|
|
12
12
|
initWidths: number[];
|
|
13
13
|
constructor(editor: OnesEditor, elem: HTMLElement, data: ImageSplitterResizerData, mouseDownEvent: MouseEvent);
|
|
14
|
-
onDragStart(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent
|
|
15
|
-
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent
|
|
16
|
-
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent
|
|
14
|
+
onDragStart(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement): void;
|
|
15
|
+
onDragging(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
16
|
+
onDragEnd(drag: DragDrop<ImageSplitterResizerData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
17
17
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
|
-
import './mobile-helper-styles.scss';
|
|
3
2
|
export declare class OnesEditorMobileHelper implements OnesEditorCustom {
|
|
4
3
|
private editor;
|
|
5
4
|
private longPressTimeout;
|
|
6
|
-
private gripper;
|
|
7
5
|
constructor(editor: OnesEditor);
|
|
8
6
|
destroy(): void;
|
|
9
7
|
handleSelectionChange: () => void;
|
|
@@ -10,8 +10,8 @@ export declare class TableResizeDragDrop implements DragDropOptions<TableResizeD
|
|
|
10
10
|
data: TableResizeDragDropData;
|
|
11
11
|
private onEnd;
|
|
12
12
|
cursor: string;
|
|
13
|
-
constructor(editor: OnesEditor, elem: HTMLDivElement, data: TableResizeDragDropData, onEnd: ((event: MouseEvent
|
|
14
|
-
onDragStart(drag: DragDrop<TableResizeDragDropData>, event: MouseEvent
|
|
15
|
-
onDragging(drag: DragDrop<TableResizeDragDropData>, event: MouseEvent
|
|
16
|
-
onDragEnd(drag: DragDrop<TableResizeDragDropData>, event: MouseEvent
|
|
13
|
+
constructor(editor: OnesEditor, elem: HTMLDivElement, data: TableResizeDragDropData, onEnd: ((event: MouseEvent) => void) | null);
|
|
14
|
+
onDragStart(drag: DragDrop<TableResizeDragDropData>, event: MouseEvent, elem: HTMLElement): void;
|
|
15
|
+
onDragging(drag: DragDrop<TableResizeDragDropData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
16
|
+
onDragEnd(drag: DragDrop<TableResizeDragDropData>, event: MouseEvent, elem: HTMLElement, deltaX: number, deltaY: number): void;
|
|
17
17
|
}
|