@ones-editor/editor 0.0.3-beta.127 → 0.0.3-beta.129
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/file/src/types.d.ts +1 -0
- package/@ones-editor/find-dialog/src/doc/doc-handler.d.ts +15 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +4 -1
- package/@ones-editor/find-dialog/src/highlights/highligh-text.d.ts +3 -0
- package/@ones-editor/find-dialog/src/highlights/highlight-dom.d.ts +1 -0
- package/@ones-editor/toc/src/build-toc.d.ts +4 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +144 -144
- package/package.json +1 -1
|
@@ -20,4 +20,5 @@ export interface FileOptions {
|
|
|
20
20
|
onClick?: (editor: OnesEditor, elem: BlockElement | BoxElement, event: MouseEvent) => void;
|
|
21
21
|
onDownloadFile?: (editor: OnesEditor, data: FileData) => void;
|
|
22
22
|
renderFileCardIcon?: (editor: OnesEditor, blockData: FileEmbedData) => Promise<false | HTMLImageElement>;
|
|
23
|
+
onGetFileDownloadUrl?: (editor: OnesEditor, box: FileBoxData) => Promise<string | undefined>;
|
|
23
24
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
import type { OnesEditorDocCallbacks, OnesEditor, DocBlockTextActions, BlockElement, DocBlock } from '../../../../@ones-editor/core';
|
|
3
|
+
interface DocEvent {
|
|
4
|
+
onDocChanged: (changedBlock: BlockElement) => void;
|
|
5
|
+
onDocInserted: () => void;
|
|
6
|
+
onDocDeleted: (deletedBlock: BlockElement) => void;
|
|
7
|
+
}
|
|
8
|
+
declare class FindDialogDocHandler extends TypedEmitter<DocEvent> implements OnesEditorDocCallbacks {
|
|
9
|
+
private editor;
|
|
10
|
+
constructor(editor: OnesEditor);
|
|
11
|
+
onUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): void;
|
|
12
|
+
onInsertBlock(containerId: string, blockIndex: number, blockData: DocBlock, local: boolean): void;
|
|
13
|
+
onDeleteBlock(containerId: string, blockIndex: number, local: boolean): void;
|
|
14
|
+
}
|
|
15
|
+
export default FindDialogDocHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { ManualCloseDialog } from '../../../@ones-editor/ui-base';
|
|
3
|
-
import { OnesEditor } from '../../../@ones-editor/core';
|
|
3
|
+
import { OnesEditor, BlockElement } from '../../../@ones-editor/core';
|
|
4
4
|
export default class FindDialog {
|
|
5
5
|
private editor;
|
|
6
6
|
dialog: ManualCloseDialog | null;
|
|
@@ -25,6 +25,9 @@ export default class FindDialog {
|
|
|
25
25
|
constructor(editor: OnesEditor);
|
|
26
26
|
handleFindChanged: () => void;
|
|
27
27
|
handleCompositionEnd: () => void;
|
|
28
|
+
handleDocChanged: (changedBlock: BlockElement) => void;
|
|
29
|
+
handleDocInserted: () => void;
|
|
30
|
+
handleDocDeleted: (deletedBlock: BlockElement) => void;
|
|
28
31
|
handleInput: (event: Event) => void;
|
|
29
32
|
handleFind: () => void;
|
|
30
33
|
findNext(options: {
|
|
@@ -3,6 +3,9 @@ export declare function clearAllReplaceResultHighlight(editor: OnesEditor): void
|
|
|
3
3
|
export declare function clearAllHighlights(editor: OnesEditor, options?: {
|
|
4
4
|
keepReplaceResult?: boolean;
|
|
5
5
|
}): void;
|
|
6
|
+
export declare function clearHighlightsInBlock(editor: OnesEditor, block: BlockElement, options?: {
|
|
7
|
+
keepReplaceResult?: boolean;
|
|
8
|
+
}): void;
|
|
6
9
|
export declare function getCurrentHighlighIndex(editor: OnesEditor): number;
|
|
7
10
|
export declare function gotoFirstHighlight(editor: OnesEditor): number;
|
|
8
11
|
export declare function gotoNextHighlight(editor: OnesEditor): number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isHighlight(elem: HTMLElement): boolean;
|
|
3
3
|
export declare function getAllHighlights(editor: OnesEditor): HTMLElement[];
|
|
4
|
+
export declare function getHighlightsInBlock(editor: OnesEditor, block: BlockElement): HTMLElement[];
|
|
4
5
|
export declare function getAllReplaceResultHighlights(editor: OnesEditor): HTMLElement[];
|
|
5
6
|
export declare function getBlockHighlight(block: BlockElement): HTMLElement[];
|
|
6
7
|
export declare function clearBlockHighlight(block: BlockElement): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocBlock, DocObject } from '../../../@ones-editor/core';
|
|
1
|
+
import { DocBlock, DocObject, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export interface TocNode {
|
|
3
3
|
parentNode: TocNode | null;
|
|
4
4
|
children: TocNode[];
|
|
@@ -7,8 +7,10 @@ export interface TocNode {
|
|
|
7
7
|
block: DocBlock;
|
|
8
8
|
}
|
|
9
9
|
export declare class OnesEditorToc {
|
|
10
|
+
private editor;
|
|
10
11
|
nodes: TocNode[];
|
|
12
|
+
constructor(editor: OnesEditor);
|
|
11
13
|
private appendBlock;
|
|
12
14
|
private findParent;
|
|
13
|
-
static buildToc(doc: DocObject): OnesEditorToc;
|
|
15
|
+
static buildToc(editor: OnesEditor, doc: DocObject): OnesEditorToc;
|
|
14
16
|
}
|