@ckeditor/ckeditor5-find-and-replace 48.2.0-alpha.7 → 48.3.0-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.
@@ -1,28 +1,28 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import type { FindAndReplace, FindAndReplaceEditing, FindAndReplaceUI, FindAndReplaceUtils, FindCommand, FindNextCommand, FindPreviousCommand, ReplaceAllCommand, ReplaceCommand, FindAndReplaceConfig } from './index.js';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [FindAndReplace.pluginName]: FindAndReplace;
9
- [FindAndReplaceEditing.pluginName]: FindAndReplaceEditing;
10
- [FindAndReplaceUI.pluginName]: FindAndReplaceUI;
11
- [FindAndReplaceUtils.pluginName]: FindAndReplaceUtils;
12
- }
13
- interface CommandsMap {
14
- find: FindCommand;
15
- findNext: FindNextCommand;
16
- findPrevious: FindPreviousCommand;
17
- replace: ReplaceCommand;
18
- replaceAll: ReplaceAllCommand;
19
- }
20
- interface EditorConfig {
21
- /**
22
- * The configuration of the {@link module:find-and-replace/findandreplace~FindAndReplace}.
23
- *
24
- * Read more in {@link module:find-and-replace/findandreplaceconfig~FindAndReplaceConfig}.
25
- */
26
- findAndReplace?: FindAndReplaceConfig;
27
- }
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import type { FindAndReplace, FindAndReplaceEditing, FindAndReplaceUI, FindAndReplaceUtils, FindCommand, FindNextCommand, FindPreviousCommand, ReplaceAllCommand, ReplaceCommand, FindAndReplaceConfig } from "./index.js";
6
+ declare module "@ckeditor/ckeditor5-core" {
7
+ interface PluginsMap {
8
+ [FindAndReplace.pluginName]: FindAndReplace;
9
+ [FindAndReplaceEditing.pluginName]: FindAndReplaceEditing;
10
+ [FindAndReplaceUI.pluginName]: FindAndReplaceUI;
11
+ [FindAndReplaceUtils.pluginName]: FindAndReplaceUtils;
12
+ }
13
+ interface CommandsMap {
14
+ find: FindCommand;
15
+ findNext: FindNextCommand;
16
+ findPrevious: FindPreviousCommand;
17
+ replace: ReplaceCommand;
18
+ replaceAll: ReplaceAllCommand;
19
+ }
20
+ interface EditorConfig {
21
+ /**
22
+ * The configuration of the {@link module:find-and-replace/findandreplace~FindAndReplace}.
23
+ *
24
+ * Read more in {@link module:find-and-replace/findandreplaceconfig~FindAndReplaceConfig}.
25
+ */
26
+ findAndReplace?: FindAndReplaceConfig;
27
+ }
28
28
  }
@@ -1,46 +1,46 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module find-and-replace/findandreplace
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { FindAndReplaceUI } from './findandreplaceui.js';
10
- import { FindAndReplaceEditing } from './findandreplaceediting.js';
11
- import type { Marker } from '@ckeditor/ckeditor5-engine';
6
+ * @module find-and-replace/findandreplace
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { FindAndReplaceUI } from "./findandreplaceui.js";
10
+ import { FindAndReplaceEditing } from "./findandreplaceediting.js";
11
+ import type { Marker } from "@ckeditor/ckeditor5-engine";
12
12
  export type FindResultType = {
13
- id?: string;
14
- label?: string;
15
- start?: number;
16
- end?: number;
17
- marker?: Marker;
13
+ id?: string;
14
+ label?: string;
15
+ start?: number;
16
+ end?: number;
17
+ marker?: Marker;
18
18
  };
19
19
  /**
20
- * The find and replace plugin.
21
- *
22
- * For a detailed overview, check the {@glink features/find-and-replace Find and replace feature documentation}.
23
- *
24
- * This is a "glue" plugin which loads the following plugins:
25
- *
26
- * * The {@link module:find-and-replace/findandreplaceediting~FindAndReplaceEditing find and replace editing feature},
27
- * * The {@link module:find-and-replace/findandreplaceui~FindAndReplaceUI find and replace UI feature}
28
- */
20
+ * The find and replace plugin.
21
+ *
22
+ * For a detailed overview, check the {@glink features/find-and-replace Find and replace feature documentation}.
23
+ *
24
+ * This is a "glue" plugin which loads the following plugins:
25
+ *
26
+ * * The {@link module:find-and-replace/findandreplaceediting~FindAndReplaceEditing find and replace editing feature},
27
+ * * The {@link module:find-and-replace/findandreplaceui~FindAndReplaceUI find and replace UI feature}
28
+ */
29
29
  export declare class FindAndReplace extends Plugin {
30
- /**
31
- * @inheritDoc
32
- */
33
- static get requires(): readonly [typeof FindAndReplaceEditing, typeof FindAndReplaceUI];
34
- /**
35
- * @inheritDoc
36
- */
37
- static get pluginName(): "FindAndReplace";
38
- /**
39
- * @inheritDoc
40
- */
41
- static get isOfficialPlugin(): true;
42
- /**
43
- * @inheritDoc
44
- */
45
- init(): void;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get requires(): PluginDependenciesOf<[FindAndReplaceEditing, FindAndReplaceUI]>;
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ static get pluginName(): "FindAndReplace";
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ static override get isOfficialPlugin(): true;
42
+ /**
43
+ * @inheritDoc
44
+ */
45
+ init(): void;
46
46
  }
@@ -1,31 +1,31 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module find-and-replace/findandreplaceconfig
7
- */
6
+ * @module find-and-replace/findandreplaceconfig
7
+ */
8
8
  /**
9
- * The configuration of the find and replace feature.
10
- * The option is used by the {@link module:find-and-replace/findandreplace~FindAndReplace} feature.
11
- *
12
- * ```ts
13
- * ClassicEditor
14
- * .create( {
15
- * findAndReplace: ... // Find and replace feature config.
16
- * } )
17
- * .then( ... )
18
- * .catch( ... );
19
- * ```
20
- *
21
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
22
- */
9
+ * The configuration of the find and replace feature.
10
+ * The option is used by the {@link module:find-and-replace/findandreplace~FindAndReplace} feature.
11
+ *
12
+ * ```ts
13
+ * ClassicEditor
14
+ * .create( {
15
+ * findAndReplace: ... // Find and replace feature config.
16
+ * } )
17
+ * .then( ... )
18
+ * .catch( ... );
19
+ * ```
20
+ *
21
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
22
+ */
23
23
  export interface FindAndReplaceConfig {
24
- /**
25
- * The type of the find and replace UI opened by the `'findAndReplace'` button registered in the
26
- * editor's {@link module:ui/componentfactory~ComponentFactory component factory}
27
- *
28
- * The default value is `'dialog'`.
29
- */
30
- uiType?: 'dialog' | 'dropdown';
24
+ /**
25
+ * The type of the find and replace UI opened by the `'findAndReplace'` button registered in the
26
+ * editor's {@link module:ui/componentfactory~ComponentFactory component factory}
27
+ *
28
+ * The default value is `'dialog'`.
29
+ */
30
+ uiType?: "dialog" | "dropdown";
31
31
  }
@@ -1,76 +1,76 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module find-and-replace/findandreplaceediting
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { type Collection } from '@ckeditor/ckeditor5-utils';
10
- import { type FindAttributes } from './findcommand.js';
11
- import { FindAndReplaceState, type FindCallback } from './findandreplacestate.js';
12
- import { FindAndReplaceUtils } from './findandreplaceutils.js';
13
- import type { FindResultType } from './findandreplace.js';
14
- import '../theme/findandreplace.css';
6
+ * @module find-and-replace/findandreplaceediting
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { type Collection } from "@ckeditor/ckeditor5-utils";
10
+ import { type FindAttributes } from "./findcommand.js";
11
+ import { FindAndReplaceState, type FindCallback } from "./findandreplacestate.js";
12
+ import { FindAndReplaceUtils } from "./findandreplaceutils.js";
13
+ import type { FindResultType } from "./findandreplace.js";
14
+ import "../theme/findandreplace.css";
15
15
  /**
16
- * Implements the editing part for find and replace plugin. For example conversion, commands etc.
17
- */
16
+ * Implements the editing part for find and replace plugin. For example conversion, commands etc.
17
+ */
18
18
  export declare class FindAndReplaceEditing extends Plugin {
19
- /**
20
- * @inheritDoc
21
- */
22
- static get requires(): readonly [typeof FindAndReplaceUtils];
23
- /**
24
- * @inheritDoc
25
- */
26
- static get pluginName(): "FindAndReplaceEditing";
27
- /**
28
- * @inheritDoc
29
- * @internal
30
- */
31
- static get licenseFeatureCode(): string;
32
- /**
33
- * @inheritDoc
34
- */
35
- static get isPremiumPlugin(): true;
36
- /**
37
- * @inheritDoc
38
- */
39
- static get isOfficialPlugin(): true;
40
- /**
41
- * An object storing the find and replace state within a given editor instance.
42
- */
43
- state?: FindAndReplaceState;
44
- /**
45
- * A flag that indicates that the user has started a search and the editor is listening for changes
46
- * to the text on which it will perform an automatic search. Among other things, the mode is activated
47
- * when the user first clicks 'Find' button and then later deactivated when the modal or search dropdown is closed.
48
- *
49
- * @internal
50
- */
51
- _isSearchActive: boolean;
52
- /**
53
- * @inheritDoc
54
- */
55
- init(): void;
56
- /**
57
- * Initiate a search.
58
- */
59
- find(callbackOrText: string | FindCallback, findAttributes?: FindAttributes): Collection<FindResultType>;
60
- /**
61
- * Stops active results from updating, and clears out the results.
62
- */
63
- stop(): void;
64
- /**
65
- * Sets up the commands.
66
- */
67
- private _defineCommands;
68
- /**
69
- * Sets up the marker downcast converters for search results highlighting.
70
- */
71
- private _defineConverters;
72
- /**
73
- * Reacts to document changes in order to update search list.
74
- */
75
- private _onDocumentChange;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ static get requires(): PluginDependenciesOf<[FindAndReplaceUtils]>;
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get pluginName(): "FindAndReplaceEditing";
27
+ /**
28
+ * @inheritDoc
29
+ * @internal
30
+ */
31
+ static get licenseFeatureCode(): string;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static override get isPremiumPlugin(): true;
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ static override get isOfficialPlugin(): true;
40
+ /**
41
+ * An object storing the find and replace state within a given editor instance.
42
+ */
43
+ state?: FindAndReplaceState;
44
+ /**
45
+ * A flag that indicates that the user has started a search and the editor is listening for changes
46
+ * to the text on which it will perform an automatic search. Among other things, the mode is activated
47
+ * when the user first clicks 'Find' button and then later deactivated when the modal or search dropdown is closed.
48
+ *
49
+ * @internal
50
+ */
51
+ _isSearchActive: boolean;
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ init(): void;
56
+ /**
57
+ * Initiate a search.
58
+ */
59
+ find(callbackOrText: string | FindCallback, findAttributes?: FindAttributes): Collection<FindResultType>;
60
+ /**
61
+ * Stops active results from updating, and clears out the results.
62
+ */
63
+ stop(): void;
64
+ /**
65
+ * Sets up the commands.
66
+ */
67
+ private _defineCommands;
68
+ /**
69
+ * Sets up the marker downcast converters for search results highlighting.
70
+ */
71
+ private _defineConverters;
72
+ /**
73
+ * Reacts to document changes in order to update search list.
74
+ */
75
+ private _onDocumentChange;
76
76
  }
@@ -1,120 +1,117 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module find-and-replace/findandreplacestate
7
- */
8
- import type { Model, ModelItem } from '@ckeditor/ckeditor5-engine';
9
- import { Collection } from '@ckeditor/ckeditor5-utils';
10
- import type { FindResultType } from './findandreplace.js';
11
- declare const FindAndReplaceState_base: {
12
- new (): import("@ckeditor/ckeditor5-utils").Observable;
13
- prototype: import("@ckeditor/ckeditor5-utils").Observable;
14
- };
6
+ * @module find-and-replace/findandreplacestate
7
+ */
8
+ import type { Model, ModelItem } from "@ckeditor/ckeditor5-engine";
9
+ import { Collection, type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
10
+ import type { FindResultType } from "./findandreplace.js";
11
+ declare const FindAndReplaceStateBase: ObservableMixinConstructor;
15
12
  /**
16
- * The object storing find and replace plugin state for a given editor instance.
17
- */
18
- export declare class FindAndReplaceState extends /* #__PURE__ */ FindAndReplaceState_base {
19
- /**
20
- * A collection of find matches.
21
- *
22
- * @observable
23
- */
24
- results: Collection<FindResultType>;
25
- /**
26
- * Currently highlighted search result in {@link #results matched results}.
27
- *
28
- * @readonly
29
- * @observable
30
- */
31
- highlightedResult: FindResultType | null;
32
- /**
33
- * Currently highlighted search result offset in {@link #results matched results}.
34
- *
35
- * @readonly
36
- * @observable
37
- */
38
- highlightedOffset: number;
39
- /**
40
- * Searched text value.
41
- *
42
- * @readonly
43
- * @observable
44
- */
45
- searchText: string;
46
- /**
47
- * The most recent search callback used by the feature to find matches.
48
- * It is used to re-run the search when user modifies the editor content.
49
- *
50
- * @readonly
51
- * @observable
52
- */
53
- lastSearchCallback: FindCallback | null;
54
- /**
55
- * Replace text value.
56
- *
57
- * @readonly
58
- * @observable
59
- */
60
- replaceText: string;
61
- /**
62
- * Indicates whether the matchCase checkbox has been checked.
63
- *
64
- * @readonly
65
- * @observable
66
- */
67
- matchCase: boolean;
68
- /**
69
- * Indicates whether the matchWholeWords checkbox has been checked.
70
- *
71
- * @readonly
72
- * @observable
73
- */
74
- matchWholeWords: boolean;
75
- /**
76
- * Creates an instance of the state.
77
- */
78
- constructor(model: Model);
79
- /**
80
- * Cleans the state up and removes markers from the model.
81
- */
82
- clear(model: Model): void;
83
- /**
84
- * Refreshes the highlight result offset based on it's index within the result list.
85
- */
86
- refreshHighlightOffset(model: Model): void;
13
+ * The object storing find and replace plugin state for a given editor instance.
14
+ */
15
+ export declare class FindAndReplaceState extends FindAndReplaceStateBase {
16
+ /**
17
+ * A collection of find matches.
18
+ *
19
+ * @observable
20
+ */
21
+ results: Collection<FindResultType>;
22
+ /**
23
+ * Currently highlighted search result in {@link #results matched results}.
24
+ *
25
+ * @readonly
26
+ * @observable
27
+ */
28
+ highlightedResult: FindResultType | null;
29
+ /**
30
+ * Currently highlighted search result offset in {@link #results matched results}.
31
+ *
32
+ * @readonly
33
+ * @observable
34
+ */
35
+ highlightedOffset: number;
36
+ /**
37
+ * Searched text value.
38
+ *
39
+ * @readonly
40
+ * @observable
41
+ */
42
+ searchText: string;
43
+ /**
44
+ * The most recent search callback used by the feature to find matches.
45
+ * It is used to re-run the search when user modifies the editor content.
46
+ *
47
+ * @readonly
48
+ * @observable
49
+ */
50
+ lastSearchCallback: FindCallback | null;
51
+ /**
52
+ * Replace text value.
53
+ *
54
+ * @readonly
55
+ * @observable
56
+ */
57
+ replaceText: string;
58
+ /**
59
+ * Indicates whether the matchCase checkbox has been checked.
60
+ *
61
+ * @readonly
62
+ * @observable
63
+ */
64
+ matchCase: boolean;
65
+ /**
66
+ * Indicates whether the matchWholeWords checkbox has been checked.
67
+ *
68
+ * @readonly
69
+ * @observable
70
+ */
71
+ matchWholeWords: boolean;
72
+ /**
73
+ * Creates an instance of the state.
74
+ */
75
+ constructor(model: Model);
76
+ /**
77
+ * Cleans the state up and removes markers from the model.
78
+ */
79
+ clear(model: Model): void;
80
+ /**
81
+ * Refreshes the highlight result offset based on it's index within the result list.
82
+ */
83
+ refreshHighlightOffset(model: Model): void;
87
84
  }
88
85
  /**
89
- * Sorts search results by marker positions. Make sure that the results are sorted in the same order as they appear in the document
90
- * to avoid issues with the `find next` command. Apparently, the order of the results in the state might be different than the order
91
- * of the markers in the model.
92
- *
93
- * @internal
94
- */
86
+ * Sorts search results by marker positions. Make sure that the results are sorted in the same order as they appear in the document
87
+ * to avoid issues with the `find next` command. Apparently, the order of the results in the state might be different than the order
88
+ * of the markers in the model.
89
+ *
90
+ * @internal
91
+ */
95
92
  export declare function sortSearchResultsByMarkerPositions(model: Model, results: Array<FindResultType>): Array<FindResultType>;
96
93
  /**
97
- * The callback function used to find matches in the document.
98
- */
94
+ * The callback function used to find matches in the document.
95
+ */
99
96
  export type FindCallback = ({ item, text }: {
100
- item: ModelItem;
101
- text: string;
97
+ item: ModelItem;
98
+ text: string;
102
99
  }) => FindCallbackResultObject | FindCallbackResult;
103
100
  /**
104
- * Represents the result of a find callback.
105
- *
106
- * The `searchText` attribute in the result object is used to determine if the search text has changed.
107
- * If returned `searchText` is different than the last search text, the search results will be invalidated
108
- * while searching for next item and the search will start from the beginning of the document.
109
- */
101
+ * Represents the result of a find callback.
102
+ *
103
+ * The `searchText` attribute in the result object is used to determine if the search text has changed.
104
+ * If returned `searchText` is different than the last search text, the search results will be invalidated
105
+ * while searching for next item and the search will start from the beginning of the document.
106
+ */
110
107
  export type FindCallbackResultObject = {
111
- results: Array<FindResultType>;
112
- searchText: string;
108
+ results: Array<FindResultType>;
109
+ searchText: string;
113
110
  };
114
111
  /**
115
- * Represents the result of a find callback.
116
- *
117
- * @deprecated Use `FindCallbackResultObject` instead.
118
- */
112
+ * Represents the result of a find callback.
113
+ *
114
+ * @deprecated Use `FindCallbackResultObject` instead.
115
+ */
119
116
  export type FindCallbackResult = Array<FindResultType>;
120
117
  export {};