@theia/search-in-workspace 1.45.0 → 1.46.0-next.72

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.
Files changed (58) hide show
  1. package/README.md +40 -40
  2. package/lib/browser/components/search-in-workspace-input.d.ts +39 -39
  3. package/lib/browser/components/search-in-workspace-input.js +123 -123
  4. package/lib/browser/components/search-in-workspace-textarea.d.ts +39 -39
  5. package/lib/browser/components/search-in-workspace-textarea.js +130 -130
  6. package/lib/browser/search-in-workspace-context-key-service.d.ts +23 -23
  7. package/lib/browser/search-in-workspace-context-key-service.js +90 -90
  8. package/lib/browser/search-in-workspace-factory.d.ts +10 -10
  9. package/lib/browser/search-in-workspace-factory.js +68 -68
  10. package/lib/browser/search-in-workspace-frontend-contribution.d.ts +57 -55
  11. package/lib/browser/search-in-workspace-frontend-contribution.d.ts.map +1 -1
  12. package/lib/browser/search-in-workspace-frontend-contribution.js +516 -482
  13. package/lib/browser/search-in-workspace-frontend-contribution.js.map +1 -1
  14. package/lib/browser/search-in-workspace-frontend-module.d.ts +6 -6
  15. package/lib/browser/search-in-workspace-frontend-module.js +71 -71
  16. package/lib/browser/search-in-workspace-label-provider.d.ts +9 -9
  17. package/lib/browser/search-in-workspace-label-provider.js +57 -57
  18. package/lib/browser/search-in-workspace-preferences.d.ts +17 -17
  19. package/lib/browser/search-in-workspace-preferences.js +87 -87
  20. package/lib/browser/search-in-workspace-result-tree-widget.d.ts +259 -255
  21. package/lib/browser/search-in-workspace-result-tree-widget.d.ts.map +1 -1
  22. package/lib/browser/search-in-workspace-result-tree-widget.js +1172 -1099
  23. package/lib/browser/search-in-workspace-result-tree-widget.js.map +1 -1
  24. package/lib/browser/search-in-workspace-service.d.ts +35 -35
  25. package/lib/browser/search-in-workspace-service.js +158 -158
  26. package/lib/browser/search-in-workspace-widget.d.ts +121 -121
  27. package/lib/browser/search-in-workspace-widget.js +629 -629
  28. package/lib/browser/search-layout-migrations.d.ts +5 -5
  29. package/lib/browser/search-layout-migrations.js +64 -64
  30. package/lib/common/search-in-workspace-interface.d.ts +116 -116
  31. package/lib/common/search-in-workspace-interface.js +35 -35
  32. package/lib/node/ripgrep-search-in-workspace-server.d.ts +94 -94
  33. package/lib/node/ripgrep-search-in-workspace-server.js +430 -430
  34. package/lib/node/ripgrep-search-in-workspace-server.js.map +1 -1
  35. package/lib/node/ripgrep-search-in-workspace-server.slow-spec.d.ts +1 -1
  36. package/lib/node/ripgrep-search-in-workspace-server.slow-spec.js +899 -899
  37. package/lib/node/ripgrep-search-in-workspace-server.slow-spec.js.map +1 -1
  38. package/lib/node/search-in-workspace-backend-module.d.ts +3 -3
  39. package/lib/node/search-in-workspace-backend-module.js +32 -32
  40. package/package.json +9 -9
  41. package/src/browser/components/search-in-workspace-input.tsx +139 -139
  42. package/src/browser/components/search-in-workspace-textarea.tsx +153 -153
  43. package/src/browser/search-in-workspace-context-key-service.ts +93 -93
  44. package/src/browser/search-in-workspace-factory.ts +59 -59
  45. package/src/browser/search-in-workspace-frontend-contribution.ts +510 -474
  46. package/src/browser/search-in-workspace-frontend-module.ts +83 -83
  47. package/src/browser/search-in-workspace-label-provider.ts +48 -48
  48. package/src/browser/search-in-workspace-preferences.ts +96 -96
  49. package/src/browser/search-in-workspace-result-tree-widget.tsx +1318 -1245
  50. package/src/browser/search-in-workspace-service.ts +152 -152
  51. package/src/browser/search-in-workspace-widget.tsx +727 -727
  52. package/src/browser/search-layout-migrations.ts +53 -53
  53. package/src/browser/styles/index.css +400 -400
  54. package/src/browser/styles/search.svg +6 -6
  55. package/src/common/search-in-workspace-interface.ts +153 -153
  56. package/src/node/ripgrep-search-in-workspace-server.slow-spec.ts +1073 -1073
  57. package/src/node/ripgrep-search-in-workspace-server.ts +490 -490
  58. package/src/node/search-in-workspace-backend-module.ts +33 -33
@@ -1,131 +1,131 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2021 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.SearchInWorkspaceTextArea = void 0;
19
- const browser_1 = require("@theia/core/lib/browser");
20
- const React = require("@theia/core/shared/react");
21
- const react_autosize_textarea_1 = require("react-autosize-textarea");
22
- const debounce = require("@theia/core/shared/lodash.debounce");
23
- ;
24
- class SearchInWorkspaceTextArea extends React.Component {
25
- constructor(props) {
26
- super(props);
27
- this.textarea = React.createRef();
28
- /**
29
- * Handle history navigation without overriding the parent's onKeyDown handler, if any.
30
- */
31
- this.onKeyDown = (e) => {
32
- var _a, _b, _c, _d, _e;
33
- // Navigate history only when cursor is at first or last position of the textarea
34
- if (browser_1.Key.ARROW_UP.keyCode === ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) && e.currentTarget.selectionStart === 0) {
35
- e.preventDefault();
36
- this.previousValue();
37
- }
38
- else if (browser_1.Key.ARROW_DOWN.keyCode === ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode) && e.currentTarget.selectionEnd === e.currentTarget.value.length) {
39
- e.preventDefault();
40
- this.nextValue();
41
- }
42
- // Prevent newline on enter
43
- if (browser_1.Key.ENTER.keyCode === ((_c = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _c === void 0 ? void 0 : _c.keyCode) && !e.nativeEvent.shiftKey) {
44
- e.preventDefault();
45
- }
46
- (_e = (_d = this.props).onKeyDown) === null || _e === void 0 ? void 0 : _e.call(_d, e);
47
- };
48
- /**
49
- * Handle history collection and textarea resizing without overriding the parent's onChange handler, if any.
50
- */
51
- this.onChange = (e) => {
52
- var _a, _b;
53
- this.addToHistory();
54
- (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, e);
55
- };
56
- /**
57
- * Add a nonempty current value to the history, if not already present. (Debounced, 1 second delay.)
58
- */
59
- this.addToHistory = debounce(this.doAddToHistory, 1000);
60
- this.state = {
61
- history: [],
62
- index: 0,
63
- };
64
- }
65
- updateState(index, history) {
66
- this.value = history ? history[index] : this.state.history[index];
67
- this.setState(prevState => {
68
- const newState = {
69
- ...prevState,
70
- index,
71
- };
72
- if (history) {
73
- newState.history = history;
74
- }
75
- return newState;
76
- });
77
- }
78
- get value() {
79
- var _a, _b;
80
- return (_b = (_a = this.textarea.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
81
- }
82
- set value(value) {
83
- if (this.textarea.current) {
84
- this.textarea.current.value = value;
85
- }
86
- }
87
- /**
88
- * Switch the textarea's text to the previous value, if any.
89
- */
90
- previousValue() {
91
- const { history, index } = this.state;
92
- if (!this.value) {
93
- this.value = history[index];
94
- }
95
- else if (index > 0 && index < history.length) {
96
- this.updateState(index - 1);
97
- }
98
- }
99
- /**
100
- * Switch the textarea's text to the next value, if any.
101
- */
102
- nextValue() {
103
- const { history, index } = this.state;
104
- if (index === history.length - 1) {
105
- this.value = '';
106
- }
107
- else if (!this.value) {
108
- this.value = history[index];
109
- }
110
- else if (index >= 0 && index < history.length - 1) {
111
- this.updateState(index + 1);
112
- }
113
- }
114
- doAddToHistory() {
115
- if (!this.value) {
116
- return;
117
- }
118
- const history = this.state.history
119
- .filter(term => term !== this.value)
120
- .concat(this.value)
121
- .slice(-SearchInWorkspaceTextArea.LIMIT);
122
- this.updateState(history.length - 1, history);
123
- }
124
- render() {
125
- const { onResize, ...filteredProps } = this.props;
126
- return (React.createElement(react_autosize_textarea_1.default, { ...filteredProps, autoCapitalize: "off", autoCorrect: "off", maxRows: 7, onChange: this.onChange, onKeyDown: this.onKeyDown, ref: this.textarea, rows: 1, spellCheck: false }));
127
- }
128
- }
129
- exports.SearchInWorkspaceTextArea = SearchInWorkspaceTextArea;
130
- SearchInWorkspaceTextArea.LIMIT = 100;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2021 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SearchInWorkspaceTextArea = void 0;
19
+ const browser_1 = require("@theia/core/lib/browser");
20
+ const React = require("@theia/core/shared/react");
21
+ const react_autosize_textarea_1 = require("react-autosize-textarea");
22
+ const debounce = require("@theia/core/shared/lodash.debounce");
23
+ ;
24
+ class SearchInWorkspaceTextArea extends React.Component {
25
+ constructor(props) {
26
+ super(props);
27
+ this.textarea = React.createRef();
28
+ /**
29
+ * Handle history navigation without overriding the parent's onKeyDown handler, if any.
30
+ */
31
+ this.onKeyDown = (e) => {
32
+ var _a, _b, _c, _d, _e;
33
+ // Navigate history only when cursor is at first or last position of the textarea
34
+ if (browser_1.Key.ARROW_UP.keyCode === ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) && e.currentTarget.selectionStart === 0) {
35
+ e.preventDefault();
36
+ this.previousValue();
37
+ }
38
+ else if (browser_1.Key.ARROW_DOWN.keyCode === ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode) && e.currentTarget.selectionEnd === e.currentTarget.value.length) {
39
+ e.preventDefault();
40
+ this.nextValue();
41
+ }
42
+ // Prevent newline on enter
43
+ if (browser_1.Key.ENTER.keyCode === ((_c = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _c === void 0 ? void 0 : _c.keyCode) && !e.nativeEvent.shiftKey) {
44
+ e.preventDefault();
45
+ }
46
+ (_e = (_d = this.props).onKeyDown) === null || _e === void 0 ? void 0 : _e.call(_d, e);
47
+ };
48
+ /**
49
+ * Handle history collection and textarea resizing without overriding the parent's onChange handler, if any.
50
+ */
51
+ this.onChange = (e) => {
52
+ var _a, _b;
53
+ this.addToHistory();
54
+ (_b = (_a = this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, e);
55
+ };
56
+ /**
57
+ * Add a nonempty current value to the history, if not already present. (Debounced, 1 second delay.)
58
+ */
59
+ this.addToHistory = debounce(this.doAddToHistory, 1000);
60
+ this.state = {
61
+ history: [],
62
+ index: 0,
63
+ };
64
+ }
65
+ updateState(index, history) {
66
+ this.value = history ? history[index] : this.state.history[index];
67
+ this.setState(prevState => {
68
+ const newState = {
69
+ ...prevState,
70
+ index,
71
+ };
72
+ if (history) {
73
+ newState.history = history;
74
+ }
75
+ return newState;
76
+ });
77
+ }
78
+ get value() {
79
+ var _a, _b;
80
+ return (_b = (_a = this.textarea.current) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
81
+ }
82
+ set value(value) {
83
+ if (this.textarea.current) {
84
+ this.textarea.current.value = value;
85
+ }
86
+ }
87
+ /**
88
+ * Switch the textarea's text to the previous value, if any.
89
+ */
90
+ previousValue() {
91
+ const { history, index } = this.state;
92
+ if (!this.value) {
93
+ this.value = history[index];
94
+ }
95
+ else if (index > 0 && index < history.length) {
96
+ this.updateState(index - 1);
97
+ }
98
+ }
99
+ /**
100
+ * Switch the textarea's text to the next value, if any.
101
+ */
102
+ nextValue() {
103
+ const { history, index } = this.state;
104
+ if (index === history.length - 1) {
105
+ this.value = '';
106
+ }
107
+ else if (!this.value) {
108
+ this.value = history[index];
109
+ }
110
+ else if (index >= 0 && index < history.length - 1) {
111
+ this.updateState(index + 1);
112
+ }
113
+ }
114
+ doAddToHistory() {
115
+ if (!this.value) {
116
+ return;
117
+ }
118
+ const history = this.state.history
119
+ .filter(term => term !== this.value)
120
+ .concat(this.value)
121
+ .slice(-SearchInWorkspaceTextArea.LIMIT);
122
+ this.updateState(history.length - 1, history);
123
+ }
124
+ render() {
125
+ const { onResize, ...filteredProps } = this.props;
126
+ return (React.createElement(react_autosize_textarea_1.default, { ...filteredProps, autoCapitalize: "off", autoCorrect: "off", maxRows: 7, onChange: this.onChange, onKeyDown: this.onKeyDown, ref: this.textarea, rows: 1, spellCheck: false }));
127
+ }
128
+ }
129
+ exports.SearchInWorkspaceTextArea = SearchInWorkspaceTextArea;
130
+ SearchInWorkspaceTextArea.LIMIT = 100;
131
131
  //# sourceMappingURL=search-in-workspace-textarea.js.map
@@ -1,24 +1,24 @@
1
- import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
2
- export declare class SearchInWorkspaceContextKeyService {
3
- protected readonly contextKeyService: ContextKeyService;
4
- protected _searchViewletVisible: ContextKey<boolean>;
5
- get searchViewletVisible(): ContextKey<boolean>;
6
- protected _searchViewletFocus: ContextKey<boolean>;
7
- get searchViewletFocus(): ContextKey<boolean>;
8
- protected searchInputBoxFocus: ContextKey<boolean>;
9
- setSearchInputBoxFocus(searchInputBoxFocus: boolean): void;
10
- protected replaceInputBoxFocus: ContextKey<boolean>;
11
- setReplaceInputBoxFocus(replaceInputBoxFocus: boolean): void;
12
- protected patternIncludesInputBoxFocus: ContextKey<boolean>;
13
- setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus: boolean): void;
14
- protected patternExcludesInputBoxFocus: ContextKey<boolean>;
15
- setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus: boolean): void;
16
- protected inputBoxFocus: ContextKey<boolean>;
17
- protected updateInputBoxFocus(): void;
18
- protected _replaceActive: ContextKey<boolean>;
19
- get replaceActive(): ContextKey<boolean>;
20
- protected _hasSearchResult: ContextKey<boolean>;
21
- get hasSearchResult(): ContextKey<boolean>;
22
- protected init(): void;
23
- }
1
+ import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
2
+ export declare class SearchInWorkspaceContextKeyService {
3
+ protected readonly contextKeyService: ContextKeyService;
4
+ protected _searchViewletVisible: ContextKey<boolean>;
5
+ get searchViewletVisible(): ContextKey<boolean>;
6
+ protected _searchViewletFocus: ContextKey<boolean>;
7
+ get searchViewletFocus(): ContextKey<boolean>;
8
+ protected searchInputBoxFocus: ContextKey<boolean>;
9
+ setSearchInputBoxFocus(searchInputBoxFocus: boolean): void;
10
+ protected replaceInputBoxFocus: ContextKey<boolean>;
11
+ setReplaceInputBoxFocus(replaceInputBoxFocus: boolean): void;
12
+ protected patternIncludesInputBoxFocus: ContextKey<boolean>;
13
+ setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus: boolean): void;
14
+ protected patternExcludesInputBoxFocus: ContextKey<boolean>;
15
+ setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus: boolean): void;
16
+ protected inputBoxFocus: ContextKey<boolean>;
17
+ protected updateInputBoxFocus(): void;
18
+ protected _replaceActive: ContextKey<boolean>;
19
+ get replaceActive(): ContextKey<boolean>;
20
+ protected _hasSearchResult: ContextKey<boolean>;
21
+ get hasSearchResult(): ContextKey<boolean>;
22
+ protected init(): void;
23
+ }
24
24
  //# sourceMappingURL=search-in-workspace-context-key-service.d.ts.map
@@ -1,91 +1,91 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.SearchInWorkspaceContextKeyService = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
30
- let SearchInWorkspaceContextKeyService = class SearchInWorkspaceContextKeyService {
31
- get searchViewletVisible() {
32
- return this._searchViewletVisible;
33
- }
34
- get searchViewletFocus() {
35
- return this._searchViewletFocus;
36
- }
37
- setSearchInputBoxFocus(searchInputBoxFocus) {
38
- this.searchInputBoxFocus.set(searchInputBoxFocus);
39
- this.updateInputBoxFocus();
40
- }
41
- setReplaceInputBoxFocus(replaceInputBoxFocus) {
42
- this.replaceInputBoxFocus.set(replaceInputBoxFocus);
43
- this.updateInputBoxFocus();
44
- }
45
- setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus) {
46
- this.patternIncludesInputBoxFocus.set(patternIncludesInputBoxFocus);
47
- this.updateInputBoxFocus();
48
- }
49
- setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus) {
50
- this.patternExcludesInputBoxFocus.set(patternExcludesInputBoxFocus);
51
- this.updateInputBoxFocus();
52
- }
53
- updateInputBoxFocus() {
54
- this.inputBoxFocus.set(this.searchInputBoxFocus.get() ||
55
- this.replaceInputBoxFocus.get() ||
56
- this.patternIncludesInputBoxFocus.get() ||
57
- this.patternExcludesInputBoxFocus.get());
58
- }
59
- get replaceActive() {
60
- return this._replaceActive;
61
- }
62
- get hasSearchResult() {
63
- return this._hasSearchResult;
64
- }
65
- init() {
66
- this._searchViewletVisible = this.contextKeyService.createKey('searchViewletVisible', false);
67
- this._searchViewletFocus = this.contextKeyService.createKey('searchViewletFocus', false);
68
- this.inputBoxFocus = this.contextKeyService.createKey('inputBoxFocus', false);
69
- this.searchInputBoxFocus = this.contextKeyService.createKey('searchInputBoxFocus', false);
70
- this.replaceInputBoxFocus = this.contextKeyService.createKey('replaceInputBoxFocus', false);
71
- this.patternIncludesInputBoxFocus = this.contextKeyService.createKey('patternIncludesInputBoxFocus', false);
72
- this.patternExcludesInputBoxFocus = this.contextKeyService.createKey('patternExcludesInputBoxFocus', false);
73
- this._replaceActive = this.contextKeyService.createKey('replaceActive', false);
74
- this._hasSearchResult = this.contextKeyService.createKey('hasSearchResult', false);
75
- }
76
- };
77
- __decorate([
78
- (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
79
- __metadata("design:type", Object)
80
- ], SearchInWorkspaceContextKeyService.prototype, "contextKeyService", void 0);
81
- __decorate([
82
- (0, inversify_1.postConstruct)(),
83
- __metadata("design:type", Function),
84
- __metadata("design:paramtypes", []),
85
- __metadata("design:returntype", void 0)
86
- ], SearchInWorkspaceContextKeyService.prototype, "init", null);
87
- SearchInWorkspaceContextKeyService = __decorate([
88
- (0, inversify_1.injectable)()
89
- ], SearchInWorkspaceContextKeyService);
90
- exports.SearchInWorkspaceContextKeyService = SearchInWorkspaceContextKeyService;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.SearchInWorkspaceContextKeyService = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
30
+ let SearchInWorkspaceContextKeyService = class SearchInWorkspaceContextKeyService {
31
+ get searchViewletVisible() {
32
+ return this._searchViewletVisible;
33
+ }
34
+ get searchViewletFocus() {
35
+ return this._searchViewletFocus;
36
+ }
37
+ setSearchInputBoxFocus(searchInputBoxFocus) {
38
+ this.searchInputBoxFocus.set(searchInputBoxFocus);
39
+ this.updateInputBoxFocus();
40
+ }
41
+ setReplaceInputBoxFocus(replaceInputBoxFocus) {
42
+ this.replaceInputBoxFocus.set(replaceInputBoxFocus);
43
+ this.updateInputBoxFocus();
44
+ }
45
+ setPatternIncludesInputBoxFocus(patternIncludesInputBoxFocus) {
46
+ this.patternIncludesInputBoxFocus.set(patternIncludesInputBoxFocus);
47
+ this.updateInputBoxFocus();
48
+ }
49
+ setPatternExcludesInputBoxFocus(patternExcludesInputBoxFocus) {
50
+ this.patternExcludesInputBoxFocus.set(patternExcludesInputBoxFocus);
51
+ this.updateInputBoxFocus();
52
+ }
53
+ updateInputBoxFocus() {
54
+ this.inputBoxFocus.set(this.searchInputBoxFocus.get() ||
55
+ this.replaceInputBoxFocus.get() ||
56
+ this.patternIncludesInputBoxFocus.get() ||
57
+ this.patternExcludesInputBoxFocus.get());
58
+ }
59
+ get replaceActive() {
60
+ return this._replaceActive;
61
+ }
62
+ get hasSearchResult() {
63
+ return this._hasSearchResult;
64
+ }
65
+ init() {
66
+ this._searchViewletVisible = this.contextKeyService.createKey('searchViewletVisible', false);
67
+ this._searchViewletFocus = this.contextKeyService.createKey('searchViewletFocus', false);
68
+ this.inputBoxFocus = this.contextKeyService.createKey('inputBoxFocus', false);
69
+ this.searchInputBoxFocus = this.contextKeyService.createKey('searchInputBoxFocus', false);
70
+ this.replaceInputBoxFocus = this.contextKeyService.createKey('replaceInputBoxFocus', false);
71
+ this.patternIncludesInputBoxFocus = this.contextKeyService.createKey('patternIncludesInputBoxFocus', false);
72
+ this.patternExcludesInputBoxFocus = this.contextKeyService.createKey('patternExcludesInputBoxFocus', false);
73
+ this._replaceActive = this.contextKeyService.createKey('replaceActive', false);
74
+ this._hasSearchResult = this.contextKeyService.createKey('hasSearchResult', false);
75
+ }
76
+ };
77
+ __decorate([
78
+ (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
79
+ __metadata("design:type", Object)
80
+ ], SearchInWorkspaceContextKeyService.prototype, "contextKeyService", void 0);
81
+ __decorate([
82
+ (0, inversify_1.postConstruct)(),
83
+ __metadata("design:type", Function),
84
+ __metadata("design:paramtypes", []),
85
+ __metadata("design:returntype", void 0)
86
+ ], SearchInWorkspaceContextKeyService.prototype, "init", null);
87
+ SearchInWorkspaceContextKeyService = __decorate([
88
+ (0, inversify_1.injectable)()
89
+ ], SearchInWorkspaceContextKeyService);
90
+ exports.SearchInWorkspaceContextKeyService = SearchInWorkspaceContextKeyService;
91
91
  //# sourceMappingURL=search-in-workspace-context-key-service.js.map
@@ -1,11 +1,11 @@
1
- import { ViewContainer, ViewContainerTitleOptions, WidgetFactory, WidgetManager } from '@theia/core/lib/browser';
2
- export declare const SEARCH_VIEW_CONTAINER_ID = "search-view-container";
3
- export declare const SEARCH_VIEW_CONTAINER_TITLE_OPTIONS: ViewContainerTitleOptions;
4
- export declare class SearchInWorkspaceFactory implements WidgetFactory {
5
- readonly id = "search-view-container";
6
- protected searchWidgetOptions: ViewContainer.Factory.WidgetOptions;
7
- protected readonly viewContainerFactory: ViewContainer.Factory;
8
- protected readonly widgetManager: WidgetManager;
9
- createWidget(): Promise<ViewContainer>;
10
- }
1
+ import { ViewContainer, ViewContainerTitleOptions, WidgetFactory, WidgetManager } from '@theia/core/lib/browser';
2
+ export declare const SEARCH_VIEW_CONTAINER_ID = "search-view-container";
3
+ export declare const SEARCH_VIEW_CONTAINER_TITLE_OPTIONS: ViewContainerTitleOptions;
4
+ export declare class SearchInWorkspaceFactory implements WidgetFactory {
5
+ readonly id = "search-view-container";
6
+ protected searchWidgetOptions: ViewContainer.Factory.WidgetOptions;
7
+ protected readonly viewContainerFactory: ViewContainer.Factory;
8
+ protected readonly widgetManager: WidgetManager;
9
+ createWidget(): Promise<ViewContainer>;
10
+ }
11
11
  //# sourceMappingURL=search-in-workspace-factory.d.ts.map