@ones-editor/editor 1.1.7-beta.5 → 1.1.7-beta.7

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.
@@ -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;
@@ -15,3 +15,4 @@ export * from './insert-doc';
15
15
  export * from './replace-container';
16
16
  export * from './add-text-attribute';
17
17
  export * from './focus-to-end';
18
+ export * from './replace-text';
@@ -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;
@@ -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;
@@ -41,7 +41,10 @@ export default class FindDialog {
41
41
  }): void;
42
42
  gotoNext(): void;
43
43
  gotoPrev(): void;
44
- updateSearchStatus(curr: number, count: number): void;
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;