@ones-editor/editor 2.2.0 → 2.2.2
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/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +2 -5
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/line-breaks.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/range.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/text-offset.d.ts +1 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +2 -1
- package/@ones-editor/core/src/core/insertions/editor-insertions.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/adjust-selection-pos.d.ts +5 -1
- package/@ones-editor/core/src/core/types.d.ts +1 -0
- package/@ones-editor/core/src/helper/hovering-block.d.ts +1 -2
- package/@ones-editor/excalidraw/package.json +4 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +379 -364
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement, BlockPosition, ContainerElement,
|
|
1
|
+
import { OnesEditor, BlockElement, BlockPosition, ContainerElement, GetChildContainerOptions, ComplexSelectionRange } from '../../types';
|
|
2
|
+
export declare const logger: import("../../../utils").Logger;
|
|
2
3
|
export declare function complexBlockGetAllChildContainers(editor: OnesEditor, block: BlockElement, options?: GetChildContainerOptions): ContainerElement[];
|
|
3
4
|
export declare function complexBlockGetSelectedContainers(editor: OnesEditor, block: BlockElement, start: BlockPosition, end: BlockPosition): ContainerElement[];
|
|
4
5
|
export declare function isFirstChildBlockInComplexBlock(editor: OnesEditor, childBlock: BlockElement): boolean;
|
|
@@ -9,8 +10,4 @@ export declare function findPrevSimpleBlockBeforeChildContainer(editor: OnesEdit
|
|
|
9
10
|
export declare function complexBlockGetTopChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
10
11
|
export declare function complexBlockGetBottomChildContainers(editor: OnesEditor, complexBlock: BlockElement): ContainerElement[];
|
|
11
12
|
export declare function complexBlockFindNearestChildBlock(editor: OnesEditor, complexBlock: BlockElement, x: number, y: number): BlockElement;
|
|
12
|
-
export declare function complexBlockAdjustSelectionPos(editor: OnesEditor, complexBlock: BlockElement, anchor: ComplexBlockPosition, focus: ComplexBlockPosition): {
|
|
13
|
-
anchor: ComplexBlockPosition;
|
|
14
|
-
focus: ComplexBlockPosition;
|
|
15
|
-
};
|
|
16
13
|
export declare function isFullSelectedOneComplexBlock(editor: OnesEditor, complexRange?: ComplexSelectionRange): boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockElement,
|
|
2
|
-
export type { TextBlockContentTextChild, TextBlockContentBoxChild, TextBlockContentInsertionChild, TextBlockContentChild };
|
|
1
|
+
import { BlockElement, TextBlockContentChild } from '../../../types';
|
|
3
2
|
export type TextBlockContentChildren = TextBlockContentChild[];
|
|
4
3
|
export type TextBlockContentChildType = 'text' | 'box' | 'insertion';
|
|
5
4
|
export declare function isTextBlockContentChild(elem: Element): boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockElement, SimpleBlockPosition } from '../../../types';
|
|
2
|
-
import { TextBlockContentChild } from './child';
|
|
1
|
+
import { BlockElement, SimpleBlockPosition, TextBlockContentChild } from '../../../types';
|
|
3
2
|
export interface LineBreakInfo {
|
|
4
3
|
offset: number;
|
|
5
4
|
type: 'betweenChild' | 'textBreakWord';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockElement, BoxElement, InsertionElement } from '../../../types';
|
|
2
|
-
import { TextBlockContentChild } from './child';
|
|
1
|
+
import { BlockElement, BoxElement, InsertionElement, TextBlockContentChild } from '../../../types';
|
|
3
2
|
export interface BlockRangeInfo {
|
|
4
3
|
child: TextBlockContentChild;
|
|
5
4
|
container: Text | BoxElement | HTMLBRElement | InsertionElement;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockElement } from '../../../types';
|
|
2
|
-
import { TextBlockContentChild } from './child';
|
|
1
|
+
import { BlockElement, TextBlockContentChild } from '../../../types';
|
|
3
2
|
export declare function getChildOffset(block: BlockElement, child: TextBlockContentChild): {
|
|
4
3
|
start: number;
|
|
5
4
|
end: number;
|
|
@@ -32,7 +32,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
32
32
|
getInput(): HTMLTextAreaElement;
|
|
33
33
|
focus(options?: FocusOptions): void;
|
|
34
34
|
isInDisableScrollMask(target: Node): boolean;
|
|
35
|
-
|
|
35
|
+
handleBlur: () => void;
|
|
36
36
|
handleWindowFocus: () => void;
|
|
37
37
|
handleDocumentClick: (event: MouseEvent | TouchEvent) => void;
|
|
38
38
|
handleDocumentSelectionChange: () => void;
|
|
@@ -19,7 +19,8 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
|
|
|
19
19
|
onPaste(event: ClipboardEvent): void;
|
|
20
20
|
onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
|
|
21
21
|
onFocus(): void;
|
|
22
|
-
onBlur:
|
|
22
|
+
onBlur: () => void;
|
|
23
|
+
debounceBlur: import("lodash").DebouncedFunc<() => void>;
|
|
23
24
|
removeActiveForBlur: import("lodash").DebouncedFunc<() => void>;
|
|
24
25
|
addHandler(handler: OnesEditorInputHandler): void;
|
|
25
26
|
removeHandler(handler: OnesEditorInputHandler): void;
|
|
@@ -6,5 +6,6 @@ export default class EditorInsertions {
|
|
|
6
6
|
constructor(editor: OnesEditor);
|
|
7
7
|
registerInsertionClass(insertionClass: Insertion): void;
|
|
8
8
|
getInsertionClass(type: string): Insertion;
|
|
9
|
+
private createInsertionElement;
|
|
9
10
|
createInsertion(blockContent: BlockContentElement, insertion: DocInsertion): InsertionElement;
|
|
10
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockPosition, OnesEditor } from '../types';
|
|
1
|
+
import { BlockElement, BlockPosition, OnesEditor, ComplexBlockPosition } from '../types';
|
|
2
2
|
import { EditorComplexBlockPosition, EditorSimpleBlockPosition } from './editor-position';
|
|
3
3
|
type AdjustSelectionPosResult = {
|
|
4
4
|
anchor: EditorSimpleBlockPosition;
|
|
@@ -7,5 +7,9 @@ type AdjustSelectionPosResult = {
|
|
|
7
7
|
anchor: EditorComplexBlockPosition;
|
|
8
8
|
focus: EditorComplexBlockPosition;
|
|
9
9
|
};
|
|
10
|
+
export declare function complexBlockAdjustSelectionPos(editor: OnesEditor, complexBlock: BlockElement, anchor: ComplexBlockPosition, focus: ComplexBlockPosition): {
|
|
11
|
+
anchor: ComplexBlockPosition;
|
|
12
|
+
focus: ComplexBlockPosition;
|
|
13
|
+
};
|
|
10
14
|
export declare function adjustSelectionPos(editor: OnesEditor, anchor: BlockPosition, focus: BlockPosition): AdjustSelectionPosResult | null;
|
|
11
15
|
export {};
|
|
@@ -688,6 +688,7 @@ export interface OnesEditorInputHandler {
|
|
|
688
688
|
handleRemoteChanged?: (editor: OnesEditor, type: RemoteChangeType) => void;
|
|
689
689
|
handleCompositionStart?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number) => void;
|
|
690
690
|
handleUpdateCompositionText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, end: boolean) => void;
|
|
691
|
+
handleBlur?: (editor: OnesEditor) => void;
|
|
691
692
|
destroy?: (editor: OnesEditor) => void;
|
|
692
693
|
}
|
|
693
694
|
export interface OnesEditorBlocks {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import
|
|
3
|
-
import { BlockElement, OnesEditor, OnesEditorCustom } from '../core/types';
|
|
2
|
+
import { BlockElement, OnesEditor, OnesEditorCustom, TextBlockContentChild } from '../core/types';
|
|
4
3
|
export interface OnesEditorHoveringBlockEvents {
|
|
5
4
|
change: (block: BlockElement | null, old: BlockElement | null, event: MouseEvent) => void;
|
|
6
5
|
targetChange: (block: BlockElement | null, old: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
|