@difizen/libro-search 0.0.2-alpha.0
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/LICENSE +21 -0
- package/README.md +1 -0
- package/es/abstract-search-provider.d.ts +113 -0
- package/es/abstract-search-provider.d.ts.map +1 -0
- package/es/abstract-search-provider.js +126 -0
- package/es/index.d.ts +10 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +9 -0
- package/es/index.less +107 -0
- package/es/libro-cell-search-provider.d.ts +10 -0
- package/es/libro-cell-search-provider.d.ts.map +1 -0
- package/es/libro-cell-search-provider.js +54 -0
- package/es/libro-search-engine-html.d.ts +3 -0
- package/es/libro-search-engine-html.d.ts.map +1 -0
- package/es/libro-search-engine-html.js +59 -0
- package/es/libro-search-engine-text.d.ts +10 -0
- package/es/libro-search-engine-text.d.ts.map +1 -0
- package/es/libro-search-engine-text.js +32 -0
- package/es/libro-search-generic-provider.d.ts +107 -0
- package/es/libro-search-generic-provider.d.ts.map +1 -0
- package/es/libro-search-generic-provider.js +467 -0
- package/es/libro-search-manager.d.ts +22 -0
- package/es/libro-search-manager.d.ts.map +1 -0
- package/es/libro-search-manager.js +102 -0
- package/es/libro-search-model.d.ts +111 -0
- package/es/libro-search-model.d.ts.map +1 -0
- package/es/libro-search-model.js +395 -0
- package/es/libro-search-protocol.d.ts +176 -0
- package/es/libro-search-protocol.d.ts.map +1 -0
- package/es/libro-search-protocol.js +36 -0
- package/es/libro-search-provider.d.ts +138 -0
- package/es/libro-search-provider.d.ts.map +1 -0
- package/es/libro-search-provider.js +759 -0
- package/es/libro-search-utils.d.ts +25 -0
- package/es/libro-search-utils.d.ts.map +1 -0
- package/es/libro-search-utils.js +85 -0
- package/es/libro-search-view.d.ts +59 -0
- package/es/libro-search-view.d.ts.map +1 -0
- package/es/libro-search-view.js +455 -0
- package/es/module.d.ts +4 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +35 -0
- package/package.json +66 -0
- package/src/abstract-search-provider.ts +160 -0
- package/src/index.less +107 -0
- package/src/index.ts +9 -0
- package/src/libro-cell-search-provider.ts +39 -0
- package/src/libro-search-engine-html.ts +74 -0
- package/src/libro-search-engine-text.ts +34 -0
- package/src/libro-search-generic-provider.ts +303 -0
- package/src/libro-search-manager.ts +86 -0
- package/src/libro-search-model.ts +266 -0
- package/src/libro-search-protocol.ts +209 -0
- package/src/libro-search-provider.ts +507 -0
- package/src/libro-search-utils.spec.ts +37 -0
- package/src/libro-search-utils.ts +83 -0
- package/src/libro-search-view.tsx +404 -0
- package/src/module.ts +59 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { CellView } from '@difizen/libro-core';
|
|
2
|
+
import type { Disposable, Event } from '@difizen/mana-app';
|
|
3
|
+
import type { View } from '@difizen/mana-app';
|
|
4
|
+
import { Syringe } from '@difizen/mana-app';
|
|
5
|
+
/**
|
|
6
|
+
* Base search match interface
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchMatch {
|
|
9
|
+
/**
|
|
10
|
+
* Text of the exact match itself
|
|
11
|
+
*/
|
|
12
|
+
readonly text: string;
|
|
13
|
+
/**
|
|
14
|
+
* Start location of the match (in a text, this is the column)
|
|
15
|
+
*/
|
|
16
|
+
position: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* HTML search match interface
|
|
20
|
+
*/
|
|
21
|
+
export interface HTMLSearchMatch extends SearchMatch {
|
|
22
|
+
/**
|
|
23
|
+
* Node containing the match
|
|
24
|
+
*/
|
|
25
|
+
readonly node: Text;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Filter interface
|
|
29
|
+
*/
|
|
30
|
+
export interface SearchFilter {
|
|
31
|
+
/**
|
|
32
|
+
* Filter title
|
|
33
|
+
*/
|
|
34
|
+
title: string;
|
|
35
|
+
/**
|
|
36
|
+
* Filter description
|
|
37
|
+
*/
|
|
38
|
+
description: string;
|
|
39
|
+
/**
|
|
40
|
+
* Default value
|
|
41
|
+
*/
|
|
42
|
+
default: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Does the filter support replace?
|
|
45
|
+
*/
|
|
46
|
+
supportReplace: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Type of filters
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
export interface SearchFilters {
|
|
53
|
+
searchCellOutput: boolean;
|
|
54
|
+
onlySearchSelectedCells: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Base search provider interface
|
|
58
|
+
*
|
|
59
|
+
* #### Notes
|
|
60
|
+
* It is implemented by subprovider like searching on a single cell.
|
|
61
|
+
*/
|
|
62
|
+
export interface BaseSearchProvider extends Disposable {
|
|
63
|
+
/**
|
|
64
|
+
* Get an initial query value if applicable so that it can be entered
|
|
65
|
+
* into the search box as an initial query
|
|
66
|
+
*
|
|
67
|
+
* @returns Initial value used to populate the search box.
|
|
68
|
+
*/
|
|
69
|
+
getInitialQuery?(): string;
|
|
70
|
+
/**
|
|
71
|
+
* Start a search
|
|
72
|
+
*
|
|
73
|
+
* @param query Regular expression to test for
|
|
74
|
+
* @param filters Filters to apply when searching
|
|
75
|
+
*/
|
|
76
|
+
startQuery(query: RegExp, filters?: SearchFilters): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Stop a search and clear any internal state of the provider
|
|
79
|
+
*/
|
|
80
|
+
endQuery(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Clear currently highlighted match.
|
|
83
|
+
*/
|
|
84
|
+
clearHighlight(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Highlight the next match
|
|
87
|
+
*
|
|
88
|
+
* @param loop Whether to loop within the matches list.
|
|
89
|
+
*
|
|
90
|
+
* @returns The next match if it exists
|
|
91
|
+
*/
|
|
92
|
+
highlightNext(loop?: boolean): Promise<SearchMatch | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* Highlight the previous match
|
|
95
|
+
*
|
|
96
|
+
* @param loop Whether to loop within the matches list.
|
|
97
|
+
*
|
|
98
|
+
* @returns The previous match if it exists.
|
|
99
|
+
*/
|
|
100
|
+
highlightPrevious(loop?: boolean): Promise<SearchMatch | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* Replace the currently selected match with the provided text
|
|
103
|
+
* and highlight the next match.
|
|
104
|
+
*
|
|
105
|
+
* @param newText The replacement text
|
|
106
|
+
* @param loop Whether to loop within the matches list.
|
|
107
|
+
*
|
|
108
|
+
* @returns A promise that resolves with a boolean indicating whether a replace occurred.
|
|
109
|
+
*/
|
|
110
|
+
replaceCurrentMatch(newText: string, loop?: boolean): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Replace all matches in the widget with the provided text
|
|
113
|
+
*
|
|
114
|
+
* @param newText The replacement text.
|
|
115
|
+
*
|
|
116
|
+
* @returns A promise that resolves with a boolean indicating whether a replace occurred.
|
|
117
|
+
*/
|
|
118
|
+
replaceAllMatches(newText: string): Promise<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Signal indicating that something in the search has changed, so the UI should update
|
|
121
|
+
*/
|
|
122
|
+
readonly stateChanged: Event<void>;
|
|
123
|
+
/**
|
|
124
|
+
* The current index of the selected match.
|
|
125
|
+
*/
|
|
126
|
+
readonly currentMatchIndex: number | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* The number of matches.
|
|
129
|
+
*/
|
|
130
|
+
readonly matchesCount: number | undefined;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Search provider interface
|
|
134
|
+
*/
|
|
135
|
+
export interface SearchProvider extends BaseSearchProvider {
|
|
136
|
+
/**
|
|
137
|
+
* Set to true if the widget under search is read-only, false
|
|
138
|
+
* if it is editable. Will be used to determine whether to show
|
|
139
|
+
* the replace option.
|
|
140
|
+
*/
|
|
141
|
+
readonly isReadOnly: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Get the filters definition for the given provider.
|
|
144
|
+
*
|
|
145
|
+
* @returns The filters definition.
|
|
146
|
+
*
|
|
147
|
+
* ### Notes
|
|
148
|
+
* TODO For now it only supports boolean filters (represented with checkboxes)
|
|
149
|
+
*/
|
|
150
|
+
getFilters?(): Record<string, SearchFilter>;
|
|
151
|
+
/**
|
|
152
|
+
* Validate a new filter value for the widget.
|
|
153
|
+
*
|
|
154
|
+
* @param name The filter name
|
|
155
|
+
* @param value The filter value candidate
|
|
156
|
+
*
|
|
157
|
+
* @returns The valid filter value
|
|
158
|
+
*/
|
|
159
|
+
validateFilter?(name: string, value: boolean): Promise<boolean>;
|
|
160
|
+
}
|
|
161
|
+
export interface CellSearchProvider extends BaseSearchProvider {
|
|
162
|
+
isActive: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface CellSearchProviderContribution {
|
|
165
|
+
canHandle: (cell: CellView) => number;
|
|
166
|
+
factory: (cell: CellView) => CellSearchProvider;
|
|
167
|
+
getInitialQuery?: (cell: CellView) => string;
|
|
168
|
+
}
|
|
169
|
+
export declare const CellSearchProviderContribution: Syringe.DefinedToken;
|
|
170
|
+
export declare const LIBRO_SEARCH_FOUND_CLASSES: string[];
|
|
171
|
+
export declare const LIBRO_SEARCH_SELECTED_CLASSES: string[];
|
|
172
|
+
export interface SearchProviderOption {
|
|
173
|
+
view: View;
|
|
174
|
+
}
|
|
175
|
+
export declare const SearchProviderOption: unique symbol;
|
|
176
|
+
//# sourceMappingURL=libro-search-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-search-protocol.d.ts","sourceRoot":"","sources":["../src/libro-search-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA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{ Syringe } from '@difizen/mana-app';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base search match interface
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* HTML search match interface
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Filter interface
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Type of filters
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Base search provider interface
|
|
22
|
+
*
|
|
23
|
+
* #### Notes
|
|
24
|
+
* It is implemented by subprovider like searching on a single cell.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Search provider interface
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
// export const SearchProvider = Syringe.defineToken('SearchProvider');
|
|
32
|
+
|
|
33
|
+
export var CellSearchProviderContribution = Syringe.defineToken('CellSearchProviderContribution');
|
|
34
|
+
export var LIBRO_SEARCH_FOUND_CLASSES = ['cm-string', 'cm-overlay', 'cm-searching', 'libro-searching'];
|
|
35
|
+
export var LIBRO_SEARCH_SELECTED_CLASSES = ['CodeMirror-selectedtext', 'libro-selectedtext'];
|
|
36
|
+
export var SearchProviderOption = Symbol('SearchProviderOption');
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { CellView } from '@difizen/libro-core';
|
|
2
|
+
import { LibroView } from '@difizen/libro-core';
|
|
3
|
+
import { Deferred, DisposableCollection } from '@difizen/mana-app';
|
|
4
|
+
import { AbstractSearchProvider } from './abstract-search-provider.js';
|
|
5
|
+
import { LibroCellSearchProvider } from './libro-cell-search-provider.js';
|
|
6
|
+
import type { CellSearchProvider, SearchFilter, SearchMatch, SearchFilters } from './libro-search-protocol.js';
|
|
7
|
+
import { SearchProviderOption } from './libro-search-protocol.js';
|
|
8
|
+
export type LibroSearchProviderFactory = (option: SearchProviderOption) => LibroSearchProvider;
|
|
9
|
+
export declare const LibroSearchProviderFactory: unique symbol;
|
|
10
|
+
/**
|
|
11
|
+
* Libro view search provider
|
|
12
|
+
*/
|
|
13
|
+
export declare class LibroSearchProvider extends AbstractSearchProvider {
|
|
14
|
+
libroCellSearchProvider: LibroCellSearchProvider;
|
|
15
|
+
protected cellsChangeDeferred: Deferred<void> | undefined;
|
|
16
|
+
protected toDispose: DisposableCollection;
|
|
17
|
+
protected currentProviderIndex: number | undefined;
|
|
18
|
+
searchCellOutput: boolean;
|
|
19
|
+
protected onlySearchSelectedCells: boolean;
|
|
20
|
+
replaceMode: boolean;
|
|
21
|
+
protected get filters(): SearchFilters;
|
|
22
|
+
protected query: RegExp | undefined;
|
|
23
|
+
protected searchProviders: (CellSearchProvider | undefined)[];
|
|
24
|
+
protected providerMap: Map<string, CellSearchProvider>;
|
|
25
|
+
protected documentHasChanged: boolean;
|
|
26
|
+
protected view: LibroView;
|
|
27
|
+
updateSearchCellOutput(value: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* @param option Provide the view to search in
|
|
30
|
+
*/
|
|
31
|
+
constructor(option: SearchProviderOption);
|
|
32
|
+
protected getProvider: (cell: CellView) => CellSearchProvider | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Report whether or not this provider has the ability to search on the given object
|
|
35
|
+
*
|
|
36
|
+
* @param domain Widget to test
|
|
37
|
+
* @returns Search ability
|
|
38
|
+
*/
|
|
39
|
+
static isApplicable(domain: LibroView): domain is LibroView;
|
|
40
|
+
/**
|
|
41
|
+
* The current index of the selected match.
|
|
42
|
+
*/
|
|
43
|
+
get currentMatchIndex(): number | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The number of matches.
|
|
46
|
+
*/
|
|
47
|
+
get matchesCount(): number | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Set to true if the widget under search is read-only, false
|
|
50
|
+
* if it is editable. Will be used to determine whether to show
|
|
51
|
+
* the replace option.
|
|
52
|
+
*/
|
|
53
|
+
get isReadOnly(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Dispose of the resources held by the search provider.
|
|
56
|
+
*
|
|
57
|
+
* #### Notes
|
|
58
|
+
* If the object's `dispose` method is called more than once, all
|
|
59
|
+
* calls made after the first will be a no-op.
|
|
60
|
+
*
|
|
61
|
+
* #### Undefined Behavior
|
|
62
|
+
* It is undefined behavior to use any functionality of the object
|
|
63
|
+
* after it has been disposed unless otherwise explicitly noted.
|
|
64
|
+
*/
|
|
65
|
+
dispose(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get the filters for the given provider.
|
|
68
|
+
*
|
|
69
|
+
* @returns The filters.
|
|
70
|
+
*/
|
|
71
|
+
getFilters(): Record<string, SearchFilter>;
|
|
72
|
+
/**
|
|
73
|
+
* Get an initial query value if applicable so that it can be entered
|
|
74
|
+
* into the search box as an initial query
|
|
75
|
+
*
|
|
76
|
+
* @returns Initial value used to populate the search box.
|
|
77
|
+
*/
|
|
78
|
+
getInitialQuery: () => string;
|
|
79
|
+
/**
|
|
80
|
+
* Clear currently highlighted match.
|
|
81
|
+
*/
|
|
82
|
+
clearHighlight: () => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Highlight the next match.
|
|
85
|
+
*
|
|
86
|
+
* @param loop Whether to loop within the matches list.
|
|
87
|
+
*
|
|
88
|
+
* @returns The next match if available.
|
|
89
|
+
*/
|
|
90
|
+
highlightNext: (loop?: boolean) => Promise<SearchMatch | undefined>;
|
|
91
|
+
/**
|
|
92
|
+
* Highlight the previous match.
|
|
93
|
+
*
|
|
94
|
+
* @param loop Whether to loop within the matches list.
|
|
95
|
+
*
|
|
96
|
+
* @returns The previous match if available.
|
|
97
|
+
*/
|
|
98
|
+
highlightPrevious: (loop?: boolean) => Promise<SearchMatch | undefined>;
|
|
99
|
+
/**
|
|
100
|
+
* Search for a regular expression with optional filters.
|
|
101
|
+
*
|
|
102
|
+
* @param query A regular expression to test for
|
|
103
|
+
* @param filters Filter parameters to pass to provider
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
startQuery: (query: RegExp, _filters?: SearchFilters, highlightNext?: boolean) => Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Stop the search and clear all internal state.
|
|
109
|
+
*/
|
|
110
|
+
endQuery: () => Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Replace the currently selected match with the provided text
|
|
113
|
+
*
|
|
114
|
+
* @param newText The replacement text.
|
|
115
|
+
* @param loop Whether to loop within the matches list.
|
|
116
|
+
*
|
|
117
|
+
* @returns A promise that resolves with a boolean indicating whether a replace occurred.
|
|
118
|
+
*/
|
|
119
|
+
replaceCurrentMatch: (newText: string, loop?: boolean) => Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Replace all matches in the notebook with the provided text
|
|
122
|
+
*
|
|
123
|
+
* @param newText The replacement text.
|
|
124
|
+
*
|
|
125
|
+
* @returns A promise that resolves with a boolean indicating whether a replace occurred.
|
|
126
|
+
*/
|
|
127
|
+
replaceAllMatches: (newText: string) => Promise<boolean>;
|
|
128
|
+
protected addCellProvider: (index: number) => void;
|
|
129
|
+
protected removeCellProvider: (index: number) => void;
|
|
130
|
+
protected doCellsChanged: () => Promise<void>;
|
|
131
|
+
protected onCellsChanged: () => Promise<void>;
|
|
132
|
+
protected getActiveIndex: () => number | undefined;
|
|
133
|
+
protected stepNext: (reverse?: boolean, loop?: boolean) => Promise<SearchMatch | undefined>;
|
|
134
|
+
protected onActiveCellChanged: () => Promise<void>;
|
|
135
|
+
protected onSearchProviderChanged: () => void;
|
|
136
|
+
protected _onSelectionChanged: () => Promise<void>;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=libro-search-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-search-provider.d.ts","sourceRoot":"","sources":["../src/libro-search-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAA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