update interface button styles
This commit is contained in:
16
node_modules/@codemirror/search/.github/workflows/dispatch.yml
generated
vendored
Normal file
16
node_modules/@codemirror/search/.github/workflows/dispatch.yml
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Trigger CI
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Dispatch to main repo
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Emit repository_dispatch
|
||||
uses: mvasigh/dispatch-action@main
|
||||
with:
|
||||
# You should create a personal access token and store it in your repository
|
||||
token: ${{ secrets.DISPATCH_AUTH }}
|
||||
repo: dev
|
||||
owner: codemirror
|
||||
event_type: push
|
||||
244
node_modules/@codemirror/search/CHANGELOG.md
generated
vendored
Normal file
244
node_modules/@codemirror/search/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,244 @@
|
||||
## 6.5.0 (2023-06-05)
|
||||
|
||||
### New features
|
||||
|
||||
The new `regexp` option to `search` can be used to control whether queries have the regexp flag on by default.
|
||||
|
||||
## 6.4.0 (2023-04-25)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The `findNext` and `findPrevious` commands now select the search field text if that field is focused.
|
||||
|
||||
### New features
|
||||
|
||||
The `scrollToMatch` callback option now receives the editor view as a second parameter.
|
||||
|
||||
## 6.3.0 (2023-03-20)
|
||||
|
||||
### New features
|
||||
|
||||
The new `scrollToMatch` search option allows you to adjust the way the editor scrolls search matches into view.
|
||||
|
||||
## 6.2.3 (2022-11-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that hid the search dialog's close button when the editor was read-only.
|
||||
|
||||
## 6.2.2 (2022-10-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
When `literal` is off, \n, \r, and \t escapes are now also supported in replacement text.
|
||||
|
||||
Make sure search dialog inputs don't get treated as form fields when the editor is created inside a form.
|
||||
|
||||
Fix a bug in `RegExpCursor` that would cause it to stop matching in the middle of a line when its current match position was equal to the length of the line.
|
||||
|
||||
## 6.2.1 (2022-09-26)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
By-word search queries will now skip any result that had word characters both before and after a match boundary.
|
||||
|
||||
## 6.2.0 (2022-08-25)
|
||||
|
||||
### New features
|
||||
|
||||
A new `wholeWord` search query flag can be used to limit matches to whole words.
|
||||
|
||||
`SearchCursor` and `RegExpCursor` now support a `test` parameter that can be used to ignore certain matches.
|
||||
|
||||
## 6.1.0 (2022-08-16)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an infinite loop when the match position of a `RegExpCursor` ended up in the middle of an UTF16 surrogate pair.
|
||||
|
||||
### New features
|
||||
|
||||
The `literal` search option can now be set to make literal queries the default.
|
||||
|
||||
The new `searchPanelOpen` function can be used to find out whether the search panel is open for a given state.
|
||||
|
||||
## 6.0.1 (2022-07-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
`findNext` and `findPrevious` will now return to the current result (and scroll it into view) if no other matches are found.
|
||||
|
||||
## 6.0.0 (2022-06-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't crash when a custom search panel doesn't have a field named 'search'.
|
||||
|
||||
Make sure replacements are announced to screen readers.
|
||||
|
||||
## 0.20.1 (2022-04-22)
|
||||
|
||||
### New features
|
||||
|
||||
It is now possible to disable backslash escapes in search queries with the `literal` option.
|
||||
|
||||
## 0.20.0 (2022-04-20)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make the `wholeWords` option to `highlightSelectionMatches` default to false, as intended.
|
||||
|
||||
## 0.19.10 (2022-04-04)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make sure search matches are highlighted when scrolling new content into view.
|
||||
|
||||
## 0.19.9 (2022-03-03)
|
||||
|
||||
### New features
|
||||
|
||||
The selection-matching extension now accepts a `wholeWords` option that makes it only highlight matches that span a whole word. Add SearchQuery.getCursor
|
||||
|
||||
The `SearchQuery` class now has a `getCursor` method that allows external code to create a cursor for the query.
|
||||
|
||||
## 0.19.8 (2022-02-14)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that caused the search panel to start open when configuring a state with the `search()` extension.
|
||||
|
||||
## 0.19.7 (2022-02-14)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
`searchConfig` is deprecated in favor of `search` (but will exist until next major release).
|
||||
|
||||
### New features
|
||||
|
||||
The new `search` function is now used to enable and configure the search extension.
|
||||
|
||||
## 0.19.6 (2022-01-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make `selectNextOccurrence` scroll the newly selected range into view.
|
||||
|
||||
## 0.19.5 (2021-12-16)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
The search option `matchCase` was renamed to `caseSensitive` (the old name will continue to work until the next breaking release).
|
||||
|
||||
### Bug fixes
|
||||
|
||||
`openSearchPanel` will now update the search query to the current selection even if the panel was already open.
|
||||
|
||||
### New features
|
||||
|
||||
Client code can now pass a custom search panel creation function in the search configuration.
|
||||
|
||||
The `getSearchQuery` function and `setSearchQuery` effect can now be used to inspect or change the current search query.
|
||||
|
||||
## 0.19.4 (2021-12-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The search panel will no longer show the replace interface when the editor is read-only.
|
||||
|
||||
## 0.19.3 (2021-11-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Add `userEvent` annotations to search and replace transactions.
|
||||
|
||||
Make sure the editor handles keys bound to `findNext`/`findPrevious` even when there are no matches, to avoid the browser's search interrupting users.
|
||||
|
||||
### New features
|
||||
|
||||
Add a `Symbol.iterator` property to the cursor types, so that they can be used with `for`/`of`.
|
||||
|
||||
## 0.19.2 (2021-09-16)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
`selectNextOccurrence` will now only select partial words if the current main selection hold a partial word.
|
||||
|
||||
Explicitly set the button's type to prevent the browser from submitting forms wrapped around the editor.
|
||||
|
||||
## 0.19.1 (2021-09-06)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make `highlightSelectionMatches` not produce overlapping decorations, since those tend to just get unreadable.
|
||||
|
||||
Make sure any existing search text is selected when opening the search panel. Add search config option to not match case when search panel is opened (#4)
|
||||
|
||||
### New features
|
||||
|
||||
The `searchConfig` function now takes a `matchCase` option that controls whether the search panel starts in case-sensitive mode.
|
||||
|
||||
## 0.19.0 (2021-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make sure to prevent the native Mod-d behavior so that the editor doesn't lose focus after selecting past the last occurrence.
|
||||
|
||||
## 0.18.4 (2021-05-27)
|
||||
|
||||
### New features
|
||||
|
||||
Initialize the search query to the current selection, when there is one, when opening the search dialog.
|
||||
|
||||
Add a `searchConfig` function, supporting an option to put the search panel at the top of the editor.
|
||||
|
||||
## 0.18.3 (2021-05-18)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where the first search command in a new editor wouldn't properly open the panel.
|
||||
|
||||
### New features
|
||||
|
||||
New command `selectNextOccurrence` that selects the next occurrence of the selected word (bound to Mod-d in the search keymap).
|
||||
|
||||
## 0.18.2 (2021-03-19)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
The search interface and cursor will no longer include overlapping matches (aligning with what all other editors are doing).
|
||||
|
||||
### New features
|
||||
|
||||
The package now exports a `RegExpCursor` which is a search cursor that matches regular expression patterns.
|
||||
|
||||
The search/replace interface now allows the user to use regular expressions.
|
||||
|
||||
The `SearchCursor` class now has a `nextOverlapping` method that includes matches that start inside the previous match.
|
||||
|
||||
Basic backslash escapes (\n, \r, \t, and \\) are now accepted in string search patterns in the UI.
|
||||
|
||||
## 0.18.1 (2021-03-15)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an issue where entering an invalid input in the goto-line dialog would submit a form and reload the page.
|
||||
|
||||
## 0.18.0 (2021-03-03)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Update dependencies to 0.18.
|
||||
|
||||
## 0.17.1 (2021-01-06)
|
||||
|
||||
### New features
|
||||
|
||||
The package now also exports a CommonJS module.
|
||||
|
||||
## 0.17.0 (2020-12-29)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
First numbered release.
|
||||
|
||||
21
node_modules/@codemirror/search/LICENSE
generated
vendored
Normal file
21
node_modules/@codemirror/search/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
18
node_modules/@codemirror/search/README.md
generated
vendored
Normal file
18
node_modules/@codemirror/search/README.md
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# @codemirror/search [](https://www.npmjs.org/package/@codemirror/search)
|
||||
|
||||
[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#search) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/search/blob/main/CHANGELOG.md) ]
|
||||
|
||||
This package implements search functionality for the
|
||||
[CodeMirror](https://codemirror.net/) code editor.
|
||||
|
||||
The [project page](https://codemirror.net/) has more information, a
|
||||
number of [examples](https://codemirror.net/examples/) and the
|
||||
[documentation](https://codemirror.net/docs/).
|
||||
|
||||
This code is released under an
|
||||
[MIT license](https://github.com/codemirror/search/tree/main/LICENSE).
|
||||
|
||||
We aim to be an inclusive, welcoming community. To make that explicit,
|
||||
we have a [code of
|
||||
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
|
||||
to communication around the project.
|
||||
1243
node_modules/@codemirror/search/dist/index.cjs
generated
vendored
Normal file
1243
node_modules/@codemirror/search/dist/index.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
375
node_modules/@codemirror/search/dist/index.d.cts
generated
vendored
Normal file
375
node_modules/@codemirror/search/dist/index.d.cts
generated
vendored
Normal file
@ -0,0 +1,375 @@
|
||||
import * as _codemirror_state from '@codemirror/state';
|
||||
import { Text, Extension, StateCommand, EditorState, SelectionRange, StateEffect } from '@codemirror/state';
|
||||
import { Command, KeyBinding, EditorView, Panel } from '@codemirror/view';
|
||||
|
||||
/**
|
||||
A search cursor provides an iterator over text matches in a
|
||||
document.
|
||||
*/
|
||||
declare class SearchCursor implements Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
}> {
|
||||
private test?;
|
||||
private iter;
|
||||
/**
|
||||
The current match (only holds a meaningful value after
|
||||
[`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when
|
||||
`done` is false).
|
||||
*/
|
||||
value: {
|
||||
from: number;
|
||||
to: number;
|
||||
};
|
||||
/**
|
||||
Whether the end of the iterated region has been reached.
|
||||
*/
|
||||
done: boolean;
|
||||
private matches;
|
||||
private buffer;
|
||||
private bufferPos;
|
||||
private bufferStart;
|
||||
private normalize;
|
||||
private query;
|
||||
/**
|
||||
Create a text cursor. The query is the search string, `from` to
|
||||
`to` provides the region to search.
|
||||
|
||||
When `normalize` is given, it will be called, on both the query
|
||||
string and the content it is matched against, before comparing.
|
||||
You can, for example, create a case-insensitive search by
|
||||
passing `s => s.toLowerCase()`.
|
||||
|
||||
Text is always normalized with
|
||||
[`.normalize("NFKD")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)
|
||||
(when supported).
|
||||
*/
|
||||
constructor(text: Text, query: string, from?: number, to?: number, normalize?: (string: string) => string, test?: ((from: number, to: number, buffer: string, bufferPos: number) => boolean) | undefined);
|
||||
private peek;
|
||||
/**
|
||||
Look for the next match. Updates the iterator's
|
||||
[`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and
|
||||
[`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called
|
||||
at least once before using the cursor.
|
||||
*/
|
||||
next(): this;
|
||||
/**
|
||||
The `next` method will ignore matches that partially overlap a
|
||||
previous match. This method behaves like `next`, but includes
|
||||
such matches.
|
||||
*/
|
||||
nextOverlapping(): this;
|
||||
private match;
|
||||
[Symbol.iterator]: () => Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
interface RegExpCursorOptions {
|
||||
ignoreCase?: boolean;
|
||||
test?: (from: number, to: number, match: RegExpExecArray) => boolean;
|
||||
}
|
||||
/**
|
||||
This class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor)
|
||||
but searches for a regular expression pattern instead of a plain
|
||||
string.
|
||||
*/
|
||||
declare class RegExpCursor implements Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
match: RegExpExecArray;
|
||||
}> {
|
||||
private text;
|
||||
private to;
|
||||
private iter;
|
||||
private re;
|
||||
private test?;
|
||||
private curLine;
|
||||
private curLineStart;
|
||||
private matchPos;
|
||||
/**
|
||||
Set to `true` when the cursor has reached the end of the search
|
||||
range.
|
||||
*/
|
||||
done: boolean;
|
||||
/**
|
||||
Will contain an object with the extent of the match and the
|
||||
match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next)
|
||||
sucessfully finds a match.
|
||||
*/
|
||||
value: {
|
||||
from: number;
|
||||
to: number;
|
||||
match: RegExpExecArray;
|
||||
};
|
||||
/**
|
||||
Create a cursor that will search the given range in the given
|
||||
document. `query` should be the raw pattern (as you'd pass it to
|
||||
`new RegExp`).
|
||||
*/
|
||||
constructor(text: Text, query: string, options?: RegExpCursorOptions, from?: number, to?: number);
|
||||
private getLine;
|
||||
private nextLine;
|
||||
/**
|
||||
Move to the next match, if there is one.
|
||||
*/
|
||||
next(): this;
|
||||
[Symbol.iterator]: () => Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
match: RegExpExecArray;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
Command that shows a dialog asking the user for a line number, and
|
||||
when a valid position is provided, moves the cursor to that line.
|
||||
|
||||
Supports line numbers, relative line offsets prefixed with `+` or
|
||||
`-`, document percentages suffixed with `%`, and an optional
|
||||
column position by adding `:` and a second number after the line
|
||||
number.
|
||||
*/
|
||||
declare const gotoLine: Command;
|
||||
|
||||
declare type HighlightOptions = {
|
||||
/**
|
||||
Determines whether, when nothing is selected, the word around
|
||||
the cursor is matched instead. Defaults to false.
|
||||
*/
|
||||
highlightWordAroundCursor?: boolean;
|
||||
/**
|
||||
The minimum length of the selection before it is highlighted.
|
||||
Defaults to 1 (always highlight non-cursor selections).
|
||||
*/
|
||||
minSelectionLength?: number;
|
||||
/**
|
||||
The amount of matches (in the viewport) at which to disable
|
||||
highlighting. Defaults to 100.
|
||||
*/
|
||||
maxMatches?: number;
|
||||
/**
|
||||
Whether to only highlight whole words.
|
||||
*/
|
||||
wholeWords?: boolean;
|
||||
};
|
||||
/**
|
||||
This extension highlights text that matches the selection. It uses
|
||||
the `"cm-selectionMatch"` class for the highlighting. When
|
||||
`highlightWordAroundCursor` is enabled, the word at the cursor
|
||||
itself will be highlighted with `"cm-selectionMatch-main"`.
|
||||
*/
|
||||
declare function highlightSelectionMatches(options?: HighlightOptions): Extension;
|
||||
/**
|
||||
Select next occurrence of the current selection. Expand selection
|
||||
to the surrounding word when the selection is empty.
|
||||
*/
|
||||
declare const selectNextOccurrence: StateCommand;
|
||||
|
||||
interface SearchConfig {
|
||||
/**
|
||||
Whether to position the search panel at the top of the editor
|
||||
(the default is at the bottom).
|
||||
*/
|
||||
top?: boolean;
|
||||
/**
|
||||
Whether to enable case sensitivity by default when the search
|
||||
panel is activated (defaults to false).
|
||||
*/
|
||||
caseSensitive?: boolean;
|
||||
/**
|
||||
Whether to treat string searches literally by default (defaults to false).
|
||||
*/
|
||||
literal?: boolean;
|
||||
/**
|
||||
Controls whether the default query has by-word matching enabled.
|
||||
Defaults to false.
|
||||
*/
|
||||
wholeWord?: boolean;
|
||||
/**
|
||||
Used to turn on regular expression search in the default query.
|
||||
Defaults to false.
|
||||
*/
|
||||
regexp?: boolean;
|
||||
/**
|
||||
Can be used to override the way the search panel is implemented.
|
||||
Should create a [Panel](https://codemirror.net/6/docs/ref/#view.Panel) that contains a form
|
||||
which lets the user:
|
||||
|
||||
- See the [current](https://codemirror.net/6/docs/ref/#search.getSearchQuery) search query.
|
||||
- Manipulate the [query](https://codemirror.net/6/docs/ref/#search.SearchQuery) and
|
||||
[update](https://codemirror.net/6/docs/ref/#search.setSearchQuery) the search state with a new
|
||||
query.
|
||||
- Notice external changes to the query by reacting to the
|
||||
appropriate [state effect](https://codemirror.net/6/docs/ref/#search.setSearchQuery).
|
||||
- Run some of the search commands.
|
||||
|
||||
The field that should be focused when opening the panel must be
|
||||
tagged with a `main-field=true` DOM attribute.
|
||||
*/
|
||||
createPanel?: (view: EditorView) => Panel;
|
||||
/**
|
||||
By default, matches are scrolled into view using the default
|
||||
behavior of
|
||||
[`EditorView.scrollIntoView`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView).
|
||||
This option allows you to pass a custom function to produce the
|
||||
scroll effect.
|
||||
*/
|
||||
scrollToMatch?: (range: SelectionRange, view: EditorView) => StateEffect<unknown>;
|
||||
}
|
||||
/**
|
||||
Add search state to the editor configuration, and optionally
|
||||
configure the search extension.
|
||||
([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) will automatically
|
||||
enable this if it isn't already on).
|
||||
*/
|
||||
declare function search(config?: SearchConfig): Extension;
|
||||
/**
|
||||
A search query. Part of the editor's search state.
|
||||
*/
|
||||
declare class SearchQuery {
|
||||
/**
|
||||
The search string (or regular expression).
|
||||
*/
|
||||
readonly search: string;
|
||||
/**
|
||||
Indicates whether the search is case-sensitive.
|
||||
*/
|
||||
readonly caseSensitive: boolean;
|
||||
/**
|
||||
By default, string search will replace `\n`, `\r`, and `\t` in
|
||||
the query with newline, return, and tab characters. When this
|
||||
is set to true, that behavior is disabled.
|
||||
*/
|
||||
readonly literal: boolean;
|
||||
/**
|
||||
When true, the search string is interpreted as a regular
|
||||
expression.
|
||||
*/
|
||||
readonly regexp: boolean;
|
||||
/**
|
||||
The replace text, or the empty string if no replace text has
|
||||
been given.
|
||||
*/
|
||||
readonly replace: string;
|
||||
/**
|
||||
Whether this query is non-empty and, in case of a regular
|
||||
expression search, syntactically valid.
|
||||
*/
|
||||
readonly valid: boolean;
|
||||
/**
|
||||
When true, matches that contain words are ignored when there are
|
||||
further word characters around them.
|
||||
*/
|
||||
readonly wholeWord: boolean;
|
||||
/**
|
||||
Create a query object.
|
||||
*/
|
||||
constructor(config: {
|
||||
/**
|
||||
The search string.
|
||||
*/
|
||||
search: string;
|
||||
/**
|
||||
Controls whether the search should be case-sensitive.
|
||||
*/
|
||||
caseSensitive?: boolean;
|
||||
/**
|
||||
By default, string search will replace `\n`, `\r`, and `\t` in
|
||||
the query with newline, return, and tab characters. When this
|
||||
is set to true, that behavior is disabled.
|
||||
*/
|
||||
literal?: boolean;
|
||||
/**
|
||||
When true, interpret the search string as a regular expression.
|
||||
*/
|
||||
regexp?: boolean;
|
||||
/**
|
||||
The replace text.
|
||||
*/
|
||||
replace?: string;
|
||||
/**
|
||||
Enable whole-word matching.
|
||||
*/
|
||||
wholeWord?: boolean;
|
||||
});
|
||||
/**
|
||||
Compare this query to another query.
|
||||
*/
|
||||
eq(other: SearchQuery): boolean;
|
||||
/**
|
||||
Get a search cursor for this query, searching through the given
|
||||
range in the given state.
|
||||
*/
|
||||
getCursor(state: EditorState | Text, from?: number, to?: number): Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
}>;
|
||||
}
|
||||
/**
|
||||
A state effect that updates the current search query. Note that
|
||||
this only has an effect if the search state has been initialized
|
||||
(by including [`search`](https://codemirror.net/6/docs/ref/#search.search) in your configuration or
|
||||
by running [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) at least
|
||||
once).
|
||||
*/
|
||||
declare const setSearchQuery: _codemirror_state.StateEffectType<SearchQuery>;
|
||||
/**
|
||||
Get the current search query from an editor state.
|
||||
*/
|
||||
declare function getSearchQuery(state: EditorState): SearchQuery;
|
||||
/**
|
||||
Query whether the search panel is open in the given editor state.
|
||||
*/
|
||||
declare function searchPanelOpen(state: EditorState): boolean;
|
||||
/**
|
||||
Open the search panel if it isn't already open, and move the
|
||||
selection to the first match after the current main selection.
|
||||
Will wrap around to the start of the document when it reaches the
|
||||
end.
|
||||
*/
|
||||
declare const findNext: Command;
|
||||
/**
|
||||
Move the selection to the previous instance of the search query,
|
||||
before the current main selection. Will wrap past the start
|
||||
of the document to start searching at the end again.
|
||||
*/
|
||||
declare const findPrevious: Command;
|
||||
/**
|
||||
Select all instances of the search query.
|
||||
*/
|
||||
declare const selectMatches: Command;
|
||||
/**
|
||||
Select all instances of the currently selected text.
|
||||
*/
|
||||
declare const selectSelectionMatches: StateCommand;
|
||||
/**
|
||||
Replace the current match of the search query.
|
||||
*/
|
||||
declare const replaceNext: Command;
|
||||
/**
|
||||
Replace all instances of the search query with the given
|
||||
replacement.
|
||||
*/
|
||||
declare const replaceAll: Command;
|
||||
/**
|
||||
Make sure the search panel is open and focused.
|
||||
*/
|
||||
declare const openSearchPanel: Command;
|
||||
/**
|
||||
Close the search panel.
|
||||
*/
|
||||
declare const closeSearchPanel: Command;
|
||||
/**
|
||||
Default search-related key bindings.
|
||||
|
||||
- Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel)
|
||||
- F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext)
|
||||
- Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious)
|
||||
- Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)
|
||||
- Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence)
|
||||
*/
|
||||
declare const searchKeymap: readonly KeyBinding[];
|
||||
|
||||
export { RegExpCursor, SearchCursor, SearchQuery, closeSearchPanel, findNext, findPrevious, getSearchQuery, gotoLine, highlightSelectionMatches, openSearchPanel, replaceAll, replaceNext, search, searchKeymap, searchPanelOpen, selectMatches, selectNextOccurrence, selectSelectionMatches, setSearchQuery };
|
||||
375
node_modules/@codemirror/search/dist/index.d.ts
generated
vendored
Normal file
375
node_modules/@codemirror/search/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,375 @@
|
||||
import * as _codemirror_state from '@codemirror/state';
|
||||
import { Text, Extension, StateCommand, EditorState, SelectionRange, StateEffect } from '@codemirror/state';
|
||||
import { Command, KeyBinding, EditorView, Panel } from '@codemirror/view';
|
||||
|
||||
/**
|
||||
A search cursor provides an iterator over text matches in a
|
||||
document.
|
||||
*/
|
||||
declare class SearchCursor implements Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
}> {
|
||||
private test?;
|
||||
private iter;
|
||||
/**
|
||||
The current match (only holds a meaningful value after
|
||||
[`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when
|
||||
`done` is false).
|
||||
*/
|
||||
value: {
|
||||
from: number;
|
||||
to: number;
|
||||
};
|
||||
/**
|
||||
Whether the end of the iterated region has been reached.
|
||||
*/
|
||||
done: boolean;
|
||||
private matches;
|
||||
private buffer;
|
||||
private bufferPos;
|
||||
private bufferStart;
|
||||
private normalize;
|
||||
private query;
|
||||
/**
|
||||
Create a text cursor. The query is the search string, `from` to
|
||||
`to` provides the region to search.
|
||||
|
||||
When `normalize` is given, it will be called, on both the query
|
||||
string and the content it is matched against, before comparing.
|
||||
You can, for example, create a case-insensitive search by
|
||||
passing `s => s.toLowerCase()`.
|
||||
|
||||
Text is always normalized with
|
||||
[`.normalize("NFKD")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)
|
||||
(when supported).
|
||||
*/
|
||||
constructor(text: Text, query: string, from?: number, to?: number, normalize?: (string: string) => string, test?: ((from: number, to: number, buffer: string, bufferPos: number) => boolean) | undefined);
|
||||
private peek;
|
||||
/**
|
||||
Look for the next match. Updates the iterator's
|
||||
[`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and
|
||||
[`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called
|
||||
at least once before using the cursor.
|
||||
*/
|
||||
next(): this;
|
||||
/**
|
||||
The `next` method will ignore matches that partially overlap a
|
||||
previous match. This method behaves like `next`, but includes
|
||||
such matches.
|
||||
*/
|
||||
nextOverlapping(): this;
|
||||
private match;
|
||||
[Symbol.iterator]: () => Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
interface RegExpCursorOptions {
|
||||
ignoreCase?: boolean;
|
||||
test?: (from: number, to: number, match: RegExpExecArray) => boolean;
|
||||
}
|
||||
/**
|
||||
This class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor)
|
||||
but searches for a regular expression pattern instead of a plain
|
||||
string.
|
||||
*/
|
||||
declare class RegExpCursor implements Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
match: RegExpExecArray;
|
||||
}> {
|
||||
private text;
|
||||
private to;
|
||||
private iter;
|
||||
private re;
|
||||
private test?;
|
||||
private curLine;
|
||||
private curLineStart;
|
||||
private matchPos;
|
||||
/**
|
||||
Set to `true` when the cursor has reached the end of the search
|
||||
range.
|
||||
*/
|
||||
done: boolean;
|
||||
/**
|
||||
Will contain an object with the extent of the match and the
|
||||
match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next)
|
||||
sucessfully finds a match.
|
||||
*/
|
||||
value: {
|
||||
from: number;
|
||||
to: number;
|
||||
match: RegExpExecArray;
|
||||
};
|
||||
/**
|
||||
Create a cursor that will search the given range in the given
|
||||
document. `query` should be the raw pattern (as you'd pass it to
|
||||
`new RegExp`).
|
||||
*/
|
||||
constructor(text: Text, query: string, options?: RegExpCursorOptions, from?: number, to?: number);
|
||||
private getLine;
|
||||
private nextLine;
|
||||
/**
|
||||
Move to the next match, if there is one.
|
||||
*/
|
||||
next(): this;
|
||||
[Symbol.iterator]: () => Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
match: RegExpExecArray;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
Command that shows a dialog asking the user for a line number, and
|
||||
when a valid position is provided, moves the cursor to that line.
|
||||
|
||||
Supports line numbers, relative line offsets prefixed with `+` or
|
||||
`-`, document percentages suffixed with `%`, and an optional
|
||||
column position by adding `:` and a second number after the line
|
||||
number.
|
||||
*/
|
||||
declare const gotoLine: Command;
|
||||
|
||||
declare type HighlightOptions = {
|
||||
/**
|
||||
Determines whether, when nothing is selected, the word around
|
||||
the cursor is matched instead. Defaults to false.
|
||||
*/
|
||||
highlightWordAroundCursor?: boolean;
|
||||
/**
|
||||
The minimum length of the selection before it is highlighted.
|
||||
Defaults to 1 (always highlight non-cursor selections).
|
||||
*/
|
||||
minSelectionLength?: number;
|
||||
/**
|
||||
The amount of matches (in the viewport) at which to disable
|
||||
highlighting. Defaults to 100.
|
||||
*/
|
||||
maxMatches?: number;
|
||||
/**
|
||||
Whether to only highlight whole words.
|
||||
*/
|
||||
wholeWords?: boolean;
|
||||
};
|
||||
/**
|
||||
This extension highlights text that matches the selection. It uses
|
||||
the `"cm-selectionMatch"` class for the highlighting. When
|
||||
`highlightWordAroundCursor` is enabled, the word at the cursor
|
||||
itself will be highlighted with `"cm-selectionMatch-main"`.
|
||||
*/
|
||||
declare function highlightSelectionMatches(options?: HighlightOptions): Extension;
|
||||
/**
|
||||
Select next occurrence of the current selection. Expand selection
|
||||
to the surrounding word when the selection is empty.
|
||||
*/
|
||||
declare const selectNextOccurrence: StateCommand;
|
||||
|
||||
interface SearchConfig {
|
||||
/**
|
||||
Whether to position the search panel at the top of the editor
|
||||
(the default is at the bottom).
|
||||
*/
|
||||
top?: boolean;
|
||||
/**
|
||||
Whether to enable case sensitivity by default when the search
|
||||
panel is activated (defaults to false).
|
||||
*/
|
||||
caseSensitive?: boolean;
|
||||
/**
|
||||
Whether to treat string searches literally by default (defaults to false).
|
||||
*/
|
||||
literal?: boolean;
|
||||
/**
|
||||
Controls whether the default query has by-word matching enabled.
|
||||
Defaults to false.
|
||||
*/
|
||||
wholeWord?: boolean;
|
||||
/**
|
||||
Used to turn on regular expression search in the default query.
|
||||
Defaults to false.
|
||||
*/
|
||||
regexp?: boolean;
|
||||
/**
|
||||
Can be used to override the way the search panel is implemented.
|
||||
Should create a [Panel](https://codemirror.net/6/docs/ref/#view.Panel) that contains a form
|
||||
which lets the user:
|
||||
|
||||
- See the [current](https://codemirror.net/6/docs/ref/#search.getSearchQuery) search query.
|
||||
- Manipulate the [query](https://codemirror.net/6/docs/ref/#search.SearchQuery) and
|
||||
[update](https://codemirror.net/6/docs/ref/#search.setSearchQuery) the search state with a new
|
||||
query.
|
||||
- Notice external changes to the query by reacting to the
|
||||
appropriate [state effect](https://codemirror.net/6/docs/ref/#search.setSearchQuery).
|
||||
- Run some of the search commands.
|
||||
|
||||
The field that should be focused when opening the panel must be
|
||||
tagged with a `main-field=true` DOM attribute.
|
||||
*/
|
||||
createPanel?: (view: EditorView) => Panel;
|
||||
/**
|
||||
By default, matches are scrolled into view using the default
|
||||
behavior of
|
||||
[`EditorView.scrollIntoView`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView).
|
||||
This option allows you to pass a custom function to produce the
|
||||
scroll effect.
|
||||
*/
|
||||
scrollToMatch?: (range: SelectionRange, view: EditorView) => StateEffect<unknown>;
|
||||
}
|
||||
/**
|
||||
Add search state to the editor configuration, and optionally
|
||||
configure the search extension.
|
||||
([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) will automatically
|
||||
enable this if it isn't already on).
|
||||
*/
|
||||
declare function search(config?: SearchConfig): Extension;
|
||||
/**
|
||||
A search query. Part of the editor's search state.
|
||||
*/
|
||||
declare class SearchQuery {
|
||||
/**
|
||||
The search string (or regular expression).
|
||||
*/
|
||||
readonly search: string;
|
||||
/**
|
||||
Indicates whether the search is case-sensitive.
|
||||
*/
|
||||
readonly caseSensitive: boolean;
|
||||
/**
|
||||
By default, string search will replace `\n`, `\r`, and `\t` in
|
||||
the query with newline, return, and tab characters. When this
|
||||
is set to true, that behavior is disabled.
|
||||
*/
|
||||
readonly literal: boolean;
|
||||
/**
|
||||
When true, the search string is interpreted as a regular
|
||||
expression.
|
||||
*/
|
||||
readonly regexp: boolean;
|
||||
/**
|
||||
The replace text, or the empty string if no replace text has
|
||||
been given.
|
||||
*/
|
||||
readonly replace: string;
|
||||
/**
|
||||
Whether this query is non-empty and, in case of a regular
|
||||
expression search, syntactically valid.
|
||||
*/
|
||||
readonly valid: boolean;
|
||||
/**
|
||||
When true, matches that contain words are ignored when there are
|
||||
further word characters around them.
|
||||
*/
|
||||
readonly wholeWord: boolean;
|
||||
/**
|
||||
Create a query object.
|
||||
*/
|
||||
constructor(config: {
|
||||
/**
|
||||
The search string.
|
||||
*/
|
||||
search: string;
|
||||
/**
|
||||
Controls whether the search should be case-sensitive.
|
||||
*/
|
||||
caseSensitive?: boolean;
|
||||
/**
|
||||
By default, string search will replace `\n`, `\r`, and `\t` in
|
||||
the query with newline, return, and tab characters. When this
|
||||
is set to true, that behavior is disabled.
|
||||
*/
|
||||
literal?: boolean;
|
||||
/**
|
||||
When true, interpret the search string as a regular expression.
|
||||
*/
|
||||
regexp?: boolean;
|
||||
/**
|
||||
The replace text.
|
||||
*/
|
||||
replace?: string;
|
||||
/**
|
||||
Enable whole-word matching.
|
||||
*/
|
||||
wholeWord?: boolean;
|
||||
});
|
||||
/**
|
||||
Compare this query to another query.
|
||||
*/
|
||||
eq(other: SearchQuery): boolean;
|
||||
/**
|
||||
Get a search cursor for this query, searching through the given
|
||||
range in the given state.
|
||||
*/
|
||||
getCursor(state: EditorState | Text, from?: number, to?: number): Iterator<{
|
||||
from: number;
|
||||
to: number;
|
||||
}>;
|
||||
}
|
||||
/**
|
||||
A state effect that updates the current search query. Note that
|
||||
this only has an effect if the search state has been initialized
|
||||
(by including [`search`](https://codemirror.net/6/docs/ref/#search.search) in your configuration or
|
||||
by running [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) at least
|
||||
once).
|
||||
*/
|
||||
declare const setSearchQuery: _codemirror_state.StateEffectType<SearchQuery>;
|
||||
/**
|
||||
Get the current search query from an editor state.
|
||||
*/
|
||||
declare function getSearchQuery(state: EditorState): SearchQuery;
|
||||
/**
|
||||
Query whether the search panel is open in the given editor state.
|
||||
*/
|
||||
declare function searchPanelOpen(state: EditorState): boolean;
|
||||
/**
|
||||
Open the search panel if it isn't already open, and move the
|
||||
selection to the first match after the current main selection.
|
||||
Will wrap around to the start of the document when it reaches the
|
||||
end.
|
||||
*/
|
||||
declare const findNext: Command;
|
||||
/**
|
||||
Move the selection to the previous instance of the search query,
|
||||
before the current main selection. Will wrap past the start
|
||||
of the document to start searching at the end again.
|
||||
*/
|
||||
declare const findPrevious: Command;
|
||||
/**
|
||||
Select all instances of the search query.
|
||||
*/
|
||||
declare const selectMatches: Command;
|
||||
/**
|
||||
Select all instances of the currently selected text.
|
||||
*/
|
||||
declare const selectSelectionMatches: StateCommand;
|
||||
/**
|
||||
Replace the current match of the search query.
|
||||
*/
|
||||
declare const replaceNext: Command;
|
||||
/**
|
||||
Replace all instances of the search query with the given
|
||||
replacement.
|
||||
*/
|
||||
declare const replaceAll: Command;
|
||||
/**
|
||||
Make sure the search panel is open and focused.
|
||||
*/
|
||||
declare const openSearchPanel: Command;
|
||||
/**
|
||||
Close the search panel.
|
||||
*/
|
||||
declare const closeSearchPanel: Command;
|
||||
/**
|
||||
Default search-related key bindings.
|
||||
|
||||
- Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel)
|
||||
- F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext)
|
||||
- Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious)
|
||||
- Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)
|
||||
- Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence)
|
||||
*/
|
||||
declare const searchKeymap: readonly KeyBinding[];
|
||||
|
||||
export { RegExpCursor, SearchCursor, SearchQuery, closeSearchPanel, findNext, findPrevious, getSearchQuery, gotoLine, highlightSelectionMatches, openSearchPanel, replaceAll, replaceNext, search, searchKeymap, searchPanelOpen, selectMatches, selectNextOccurrence, selectSelectionMatches, setSearchQuery };
|
||||
1217
node_modules/@codemirror/search/dist/index.js
generated
vendored
Normal file
1217
node_modules/@codemirror/search/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
40
node_modules/@codemirror/search/package.json
generated
vendored
Normal file
40
node_modules/@codemirror/search/package.json
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "@codemirror/search",
|
||||
"version": "6.5.0",
|
||||
"description": "Search functionality for the CodeMirror code editor",
|
||||
"scripts": {
|
||||
"test": "cm-runtests",
|
||||
"prepare": "cm-buildhelper src/search.ts"
|
||||
},
|
||||
"keywords": [
|
||||
"editor",
|
||||
"code"
|
||||
],
|
||||
"author": {
|
||||
"name": "Marijn Haverbeke",
|
||||
"email": "marijn@haverbeke.berlin",
|
||||
"url": "http://marijnhaverbeke.nl"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "dist/index.cjs",
|
||||
"exports": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"types": "dist/index.d.ts",
|
||||
"module": "dist/index.js",
|
||||
"sideEffects": false,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.0.0",
|
||||
"crelt": "^1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codemirror/buildhelper": "^1.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codemirror/search.git"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user