@ones-editor/editor 1.1.6 → 1.1.7-beta.10
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/child-block-tracker/src/event-tracker.d.ts +3 -2
- package/@ones-editor/child-block-tracker/src/index.d.ts +3 -3
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/rich-text/replace-text.d.ts +0 -8
- package/@ones-editor/core/src/core/editor/actions/index.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/actions/replace-text.d.ts +10 -0
- package/@ones-editor/core/src/core/selection/actions/move-simple-block-position.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/actions/page-offset.d.ts +5 -1
- package/@ones-editor/core/src/core/types.d.ts +2 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +4 -1
- package/@ones-editor/find-dialog/src/highlights/highlight-dom.d.ts +4 -0
- package/@ones-editor/mathjax/src/index.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/chart/index.d.ts +2 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +159 -159
- package/dist/lang/en-us.d.ts +1 -0
- package/dist/lang/ja-jp.d.ts +1 -0
- package/dist/lang/zh-cn.d.ts +1 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
-
import { BlockElement, OnesEditor, OnesEditorDocCallbacks } from '../../../@ones-editor/core';
|
|
2
|
+
import { BlockElement, BlockPathComponent, OnesEditor, OnesEditorDocCallbacks } from '../../../@ones-editor/core';
|
|
3
3
|
export type ChildBlockAction = 'text-change' | 'data-change' | 'insert' | 'remove';
|
|
4
4
|
export interface ChildBlockEvents {
|
|
5
|
-
change: (editor: OnesEditor, parentBlock: BlockElement, childBlock: BlockElement, action: ChildBlockAction) => void;
|
|
5
|
+
change: (editor: OnesEditor, target: BlockPathComponent, parentBlock: BlockElement, childBlock: BlockElement, action: ChildBlockAction) => void;
|
|
6
|
+
insert: (editor: OnesEditor, target: BlockPathComponent) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare class ChildBlockEventTracker extends TypedEmitter<ChildBlockEvents> implements OnesEditorDocCallbacks {
|
|
8
9
|
private editor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, BlockPathComponent, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export * from './event-tracker';
|
|
3
|
-
export declare function trackChildBlockEvent(editor: OnesEditor, callback: (editor: OnesEditor,
|
|
4
|
-
export declare function untrackChildBlockEvent(editor: OnesEditor, callback: (editor: OnesEditor,
|
|
3
|
+
export declare function trackChildBlockEvent(editor: OnesEditor, callback: (editor: OnesEditor, target: BlockPathComponent, parentBlock?: BlockElement, childBlock?: BlockElement) => void): void;
|
|
4
|
+
export declare function untrackChildBlockEvent(editor: OnesEditor, callback: (editor: OnesEditor, target: BlockPathComponent, parentBlock?: BlockElement, childBlock?: BlockElement) => void): void;
|
|
@@ -30,6 +30,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
30
30
|
destroy(): void;
|
|
31
31
|
getInput(): HTMLInputElement;
|
|
32
32
|
focus(): void;
|
|
33
|
+
handleWindowBlur: () => void;
|
|
33
34
|
handleDocumentClick: (event: MouseEvent) => void;
|
|
34
35
|
handleDocumentSelectionChange: () => void;
|
|
35
36
|
handleEditorSelectionChanged: () => void;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { DocBlockText } from '../doc';
|
|
2
2
|
export declare function replaceText(text: DocBlockText, start: number, end: number, replaceWith: string): DocBlockText;
|
|
3
|
-
export interface FindTextRange {
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function findAllText(text: DocBlockText, find: string): FindTextRange[];
|
|
8
|
-
export declare function replaceAllText(text: DocBlockText, find: string, replaceWith: string, replaceResult?: {
|
|
9
|
-
count: number;
|
|
10
|
-
}): DocBlockText;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnesEditor } from '../../types';
|
|
2
|
+
import { DocBlockText } from '../../doc';
|
|
3
|
+
export interface FindTextRange {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function findAllText(editor: OnesEditor, text: DocBlockText, find: string, ignoreBox?: boolean): FindTextRange[];
|
|
8
|
+
export declare function replaceAllText(editor: OnesEditor, text: DocBlockText, find: string, replaceWith: string, replaceResult?: {
|
|
9
|
+
count: number;
|
|
10
|
+
}): DocBlockText;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BlockPosition, OnesEditor, SimpleBlockPosition, MoveDirection } from '../../types';
|
|
2
|
-
export declare function moveSimpleBlockPosition(editor: OnesEditor, old: SimpleBlockPosition, type:
|
|
2
|
+
export declare function moveSimpleBlockPosition(editor: OnesEditor, old: SimpleBlockPosition, direction: MoveDirection, type: 'select' | 'move'): BlockPosition | null;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { OnesEditor, SimpleBlockPosition } from '../../types';
|
|
1
|
+
import { BlockElement, OnesEditor, SimpleBlockPosition } from '../../types';
|
|
2
2
|
export declare function editorGetPageUpPos(editor: OnesEditor): SimpleBlockPosition | null;
|
|
3
3
|
export declare function editorGetPageDownPos(editor: OnesEditor): SimpleBlockPosition | null;
|
|
4
|
+
export declare function pageDownSelect(editor: OnesEditor, block: BlockElement): boolean;
|
|
5
|
+
export declare function pageUpSelect(editor: OnesEditor, block: BlockElement): boolean;
|
|
6
|
+
export declare function editorPageDownScroll(editor: OnesEditor): Promise<void>;
|
|
7
|
+
export declare function editorPageUpScroll(editor: OnesEditor): Promise<void>;
|
|
@@ -67,6 +67,7 @@ export interface Box {
|
|
|
67
67
|
toStandardText?: (editor: OnesEditor, box: DocBox) => Promise<DocBlockText | undefined>;
|
|
68
68
|
getBoxProperties?: (editor: OnesEditor, boxElement: BoxElement) => BoxProperties;
|
|
69
69
|
getResources?: (editor: OnesEditor, box: DocBox) => string[] | null;
|
|
70
|
+
matchText?: (editor: OnesEditor, box: DocBox, keyword: string) => boolean;
|
|
70
71
|
}
|
|
71
72
|
export interface Insertion {
|
|
72
73
|
insertionType: string;
|
|
@@ -77,6 +78,7 @@ export interface InsertEmptyBlockOptions {
|
|
|
77
78
|
containerId: string;
|
|
78
79
|
blockIndex: number;
|
|
79
80
|
data?: Record<string, unknown>;
|
|
81
|
+
from?: 'block-menu' | 'quick-menu';
|
|
80
82
|
}
|
|
81
83
|
export interface EmbedOptions {
|
|
82
84
|
name: string;
|
|
@@ -41,7 +41,10 @@ export default class FindDialog {
|
|
|
41
41
|
}): void;
|
|
42
42
|
gotoNext(): void;
|
|
43
43
|
gotoPrev(): void;
|
|
44
|
-
updateSearchStatus(curr: number,
|
|
44
|
+
updateSearchStatus(curr: number, highlights: {
|
|
45
|
+
ele: HTMLElement;
|
|
46
|
+
type: 'text' | 'box';
|
|
47
|
+
}[]): void;
|
|
45
48
|
doSearch: import("lodash").DebouncedFunc<(options: {
|
|
46
49
|
keepReplaceResult: boolean;
|
|
47
50
|
gotoFirstSearchResult: boolean;
|
|
@@ -6,6 +6,10 @@ export declare function getAllReplaceResultHighlights(editor: OnesEditor): HTMLE
|
|
|
6
6
|
export declare function getBlockHighlight(block: BlockElement): HTMLElement[];
|
|
7
7
|
export declare function clearBlockHighlight(block: BlockElement): void;
|
|
8
8
|
export declare function getHighlightCount(editor: OnesEditor): number;
|
|
9
|
+
export declare function getHighlightInfo(editor: OnesEditor): {
|
|
10
|
+
ele: HTMLElement;
|
|
11
|
+
type: 'text' | 'box';
|
|
12
|
+
}[];
|
|
9
13
|
export declare function getHighlightByIndex(editor: OnesEditor, index: number): HTMLElement | null;
|
|
10
14
|
export declare function createFindHighlight(editor: OnesEditor, block: BlockElement, start: number, end: number): void;
|
|
11
15
|
export declare function createReplaceResultHighligh(editor: OnesEditor, block: BlockElement, start: number, end: number): void;
|
|
@@ -4,4 +4,6 @@ import MathjaxEmbed from './mathjax-embed';
|
|
|
4
4
|
import './mathjax-style.scss';
|
|
5
5
|
import './locale';
|
|
6
6
|
import ConvertEmptyMathjaxBoxInputHandler from './mathjax-box/convert-mathjax';
|
|
7
|
+
import { MathjaxOptions } from './mathjax/convert';
|
|
8
|
+
export type { MathjaxOptions };
|
|
7
9
|
export { MathjaxBox, MathjaxEmbed, createEmptyMathjaxBox, editMathjaxBox, ConvertEmptyMathjaxBoxInputHandler, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OnesEditor, BlockElement } from '../../../../../@ones-editor/core';
|
|
2
|
-
export declare function handleChartDebounceUpdate(editor: OnesEditor, parentBlock
|
|
1
|
+
import { OnesEditor, BlockElement, BlockPathComponent } from '../../../../../@ones-editor/core';
|
|
2
|
+
export declare function handleChartDebounceUpdate(editor: OnesEditor, target?: BlockPathComponent, parentBlock?: BlockElement): void;
|
|
3
3
|
export declare function handleChartUpdate(editor: OnesEditor, parentBlock: BlockElement): void;
|