@codingame/monaco-vscode-search-service-override 1.82.4 → 1.82.5-next.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/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/override/vs/workbench/contrib/notebook/browser/notebookEditor.js +3 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +3 -0
- package/package.json +2 -2
- package/search.d.ts +5 -0
- package/search.js +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +160 -0
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +761 -0
- package/vscode/src/vs/workbench/contrib/search/browser/media/anythingQuickAccess.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/search/browser/media/searchview.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearchContributions.js +9 -0
- package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +222 -0
- package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +234 -0
- package/vscode/src/vs/workbench/contrib/search/browser/replaceContributions.js +9 -0
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +226 -0
- package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +514 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +48 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsCopy.js +206 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +356 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +460 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsRemoveReplace.js +367 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsSymbol.js +36 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +24 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +309 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +43 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +41 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +60 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +385 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +1918 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +638 -0
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +222 -0
- package/vscode/src/vs/workbench/contrib/search/common/cacheState.js +87 -0
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +68 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +13 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/media/searchEditor.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js +478 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +702 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +189 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +300 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.js +137 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +270 -0
- package/vscode/src/vs/workbench/services/search/common/searchService.js +372 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
+
|
|
3
|
+
export { n as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function __decorate(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
}
|
|
7
|
+
function __param(paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { __decorate, __param };
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from './search.js';
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from './search.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ConfirmResult;
|
|
2
|
+
( (function(ConfirmResult) {
|
|
3
|
+
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
+
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
+
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
+
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
+
|
|
8
|
+
export { ConfirmResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-search-service-override",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.5-next.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.82.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.82.5-next.0",
|
|
22
22
|
"monaco-editor": "0.43.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/search.d.ts
ADDED
package/search.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
2
|
+
import { ISearchService } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
3
|
+
import { SearchService } from './vscode/src/vs/workbench/services/search/common/searchService.js';
|
|
4
|
+
import { ISearchViewModelWorkbenchService, SearchViewModelWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/search/browser/searchModel';
|
|
5
|
+
import { ISearchHistoryService, SearchHistoryService } from 'vscode/vscode/vs/workbench/contrib/search/common/searchHistoryService';
|
|
6
|
+
import { IReplaceService } from 'vscode/vscode/vs/workbench/contrib/search/browser/replace';
|
|
7
|
+
import { ReplaceService } from './vscode/src/vs/workbench/contrib/search/browser/replaceService.js';
|
|
8
|
+
import './vscode/src/vs/workbench/contrib/search/browser/search.contribution.js';
|
|
9
|
+
import './vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.contribution.js';
|
|
10
|
+
|
|
11
|
+
function getServiceOverride() {
|
|
12
|
+
return {
|
|
13
|
+
[( ISearchService.toString())]: new SyncDescriptor(SearchService, [], true),
|
|
14
|
+
[( ISearchViewModelWorkbenchService.toString())]: new SyncDescriptor(SearchViewModelWorkbenchService, [], true),
|
|
15
|
+
[( ISearchHistoryService.toString())]: new SyncDescriptor(SearchHistoryService, [], true),
|
|
16
|
+
[( IReplaceService.toString())]: new SyncDescriptor(ReplaceService, [], true)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { getServiceOverride as default };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
|
|
4
|
+
class NotebookFindFilters extends Disposable {
|
|
5
|
+
get markupInput() {
|
|
6
|
+
return this._markupInput;
|
|
7
|
+
}
|
|
8
|
+
set markupInput(value) {
|
|
9
|
+
if (this._markupInput !== value) {
|
|
10
|
+
this._markupInput = value;
|
|
11
|
+
this._onDidChange.fire({ markupInput: value });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
get markupPreview() {
|
|
15
|
+
return this._markupPreview;
|
|
16
|
+
}
|
|
17
|
+
set markupPreview(value) {
|
|
18
|
+
if (this._markupPreview !== value) {
|
|
19
|
+
this._markupPreview = value;
|
|
20
|
+
this._onDidChange.fire({ markupPreview: value });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
get codeInput() {
|
|
24
|
+
return this._codeInput;
|
|
25
|
+
}
|
|
26
|
+
set codeInput(value) {
|
|
27
|
+
if (this._codeInput !== value) {
|
|
28
|
+
this._codeInput = value;
|
|
29
|
+
this._onDidChange.fire({ codeInput: value });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
get codeOutput() {
|
|
33
|
+
return this._codeOutput;
|
|
34
|
+
}
|
|
35
|
+
set codeOutput(value) {
|
|
36
|
+
if (this._codeOutput !== value) {
|
|
37
|
+
this._codeOutput = value;
|
|
38
|
+
this._onDidChange.fire({ codeOutput: value });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
constructor(markupInput, markupPreview, codeInput, codeOutput) {
|
|
42
|
+
super();
|
|
43
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
44
|
+
this.onDidChange = this._onDidChange.event;
|
|
45
|
+
this._markupInput = true;
|
|
46
|
+
this._markupPreview = true;
|
|
47
|
+
this._codeInput = true;
|
|
48
|
+
this._codeOutput = true;
|
|
49
|
+
this._markupInput = markupInput;
|
|
50
|
+
this._markupPreview = markupPreview;
|
|
51
|
+
this._codeInput = codeInput;
|
|
52
|
+
this._codeOutput = codeOutput;
|
|
53
|
+
this._initialMarkupInput = markupInput;
|
|
54
|
+
this._initialMarkupPreview = markupPreview;
|
|
55
|
+
this._initialCodeInput = codeInput;
|
|
56
|
+
this._initialCodeOutput = codeOutput;
|
|
57
|
+
}
|
|
58
|
+
isModified() {
|
|
59
|
+
return (this._markupInput !== this._initialMarkupInput
|
|
60
|
+
|| this._markupPreview !== this._initialMarkupPreview
|
|
61
|
+
|| this._codeInput !== this._initialCodeInput
|
|
62
|
+
|| this._codeOutput !== this._initialCodeOutput);
|
|
63
|
+
}
|
|
64
|
+
update(v) {
|
|
65
|
+
this._markupInput = v.markupInput;
|
|
66
|
+
this._markupPreview = v.markupPreview;
|
|
67
|
+
this._codeInput = v.codeInput;
|
|
68
|
+
this._codeOutput = v.codeOutput;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { NotebookFindFilters };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import n from '../../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = ".monaco-workbench .simple-fr-find-part-wrapper{background-color:var(--vscode-editorWidget-background)!important;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);max-width:calc(100% - 64px);overflow:hidden;padding:0 var(--notebook-find-horizontal-padding);position:absolute;right:18px;top:-45px;transition:top .2s linear;visibility:hidden;width:var(--notebook-find-width);z-index:10}.monaco-workbench.reduce-motion .simple-fr-find-part-wrapper{transition:top 0ms linear}.monaco-workbench .notebookOverlay .simple-fr-find-part-wrapper.visible{z-index:100}.monaco-workbench .simple-fr-find-part,.monaco-workbench .simple-fr-replace-part{align-items:center;display:flex;margin:0 0 0 17px;padding:4px;pointer-events:all;position:relative;top:0;z-index:10}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress{height:2px;position:absolute;width:100%}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress .monaco-progress-container{height:2px;top:0!important;z-index:100!important}.monaco-workbench .simple-fr-find-part-wrapper .find-replace-progress .monaco-progress-container .progress-bit{height:2px}.monaco-workbench .simple-fr-find-part-wrapper .monaco-findInput{width:224px}.monaco-workbench .simple-fr-find-part-wrapper .button{align-items:center;background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;justify-content:center;margin-left:3px;width:20px}.monaco-workbench .simple-fr-find-part-wrapper.visible .simple-fr-find-part{visibility:visible}.monaco-workbench .simple-fr-find-part-wrapper .toggle{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:center;margin-left:0;pointer-events:all;position:absolute;top:0;width:18px}.monaco-workbench .simple-fr-find-part-wrapper.visible{visibility:visible}.monaco-workbench .simple-fr-find-part-wrapper.visible-transition{top:0}.monaco-workbench .simple-fr-find-part .monaco-findInput{flex:1}.monaco-workbench .simple-fr-find-part .button{background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;margin-left:3px;min-width:20px;width:20px}.monaco-workbench .simple-fr-find-part-wrapper .button.disabled{cursor:default;opacity:.3}.monaco-workbench .simple-fr-find-part-wrapper .monaco-custom-toggle.disabled{background-color:inherit!important;cursor:default;opacity:.3;pointer-events:none;user-select:none;-webkit-user-select:none}.monaco-workbench .simple-fr-find-part-wrapper .find-filter-button{box-sizing:border-box;color:inherit;cursor:pointer;float:left;margin-left:2px;user-select:none;-webkit-user-select:none}.find-filter-button .monaco-action-bar .action-label{padding:0}.monaco-workbench .simple-fr-find-part .monaco-inputbox>.ibwrapper>.input,.monaco-workbench .simple-fr-replace-part .monaco-inputbox>.ibwrapper>.input{height:24px}.monaco-workbench .simple-fr-find-part-wrapper .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}";
|
|
4
|
+
n(css,{});
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import './notebookFindReplaceWidget.css.js';
|
|
4
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
5
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
6
|
+
import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
7
|
+
import { registerThemingParticipant } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
8
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
9
|
+
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
10
|
+
import { Separator, Action, ActionRunner } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
11
|
+
import { DropdownMenuActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js';
|
|
12
|
+
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
13
|
+
import { filterIcon } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsIcons';
|
|
14
|
+
import { isSafari } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
15
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
16
|
+
|
|
17
|
+
registerIcon('find-filter', Codicon.filter, ( nls.localize('findFilterIcon', 'Icon for Find Filter in find widget.')));
|
|
18
|
+
const NOTEBOOK_FIND_FILTERS = ( nls.localize('notebook.find.filter.filterAction', "Find Filters"));
|
|
19
|
+
const NOTEBOOK_FIND_IN_MARKUP_INPUT = ( nls.localize('notebook.find.filter.findInMarkupInput', "Markdown Source"));
|
|
20
|
+
const NOTEBOOK_FIND_IN_MARKUP_PREVIEW = ( nls.localize('notebook.find.filter.findInMarkupPreview', "Rendered Markdown"));
|
|
21
|
+
const NOTEBOOK_FIND_IN_CODE_INPUT = ( nls.localize('notebook.find.filter.findInCodeInput', "Code Cell Source"));
|
|
22
|
+
const NOTEBOOK_FIND_IN_CODE_OUTPUT = ( nls.localize('notebook.find.filter.findInCodeOutput', "Code Cell Output"));
|
|
23
|
+
const NOTEBOOK_FIND_WIDGET_INITIAL_WIDTH = 318;
|
|
24
|
+
const NOTEBOOK_FIND_WIDGET_INITIAL_HORIZONTAL_PADDING = 4;
|
|
25
|
+
let NotebookFindFilterActionViewItem = class NotebookFindFilterActionViewItem extends DropdownMenuActionViewItem {
|
|
26
|
+
constructor(filters, action, actionRunner, contextMenuService) {
|
|
27
|
+
super(action, { getActions: () => this.getActions() }, contextMenuService, {
|
|
28
|
+
actionRunner,
|
|
29
|
+
classNames: action.class,
|
|
30
|
+
anchorAlignmentProvider: () => 1
|
|
31
|
+
});
|
|
32
|
+
this.filters = filters;
|
|
33
|
+
}
|
|
34
|
+
render(container) {
|
|
35
|
+
super.render(container);
|
|
36
|
+
this.updateChecked();
|
|
37
|
+
}
|
|
38
|
+
getActions() {
|
|
39
|
+
const markdownInput = {
|
|
40
|
+
checked: this.filters.markupInput,
|
|
41
|
+
class: undefined,
|
|
42
|
+
enabled: true,
|
|
43
|
+
id: 'findInMarkdownInput',
|
|
44
|
+
label: NOTEBOOK_FIND_IN_MARKUP_INPUT,
|
|
45
|
+
run: async () => {
|
|
46
|
+
this.filters.markupInput = !this.filters.markupInput;
|
|
47
|
+
},
|
|
48
|
+
tooltip: ''
|
|
49
|
+
};
|
|
50
|
+
const markdownPreview = {
|
|
51
|
+
checked: this.filters.markupPreview,
|
|
52
|
+
class: undefined,
|
|
53
|
+
enabled: true,
|
|
54
|
+
id: 'findInMarkdownInput',
|
|
55
|
+
label: NOTEBOOK_FIND_IN_MARKUP_PREVIEW,
|
|
56
|
+
run: async () => {
|
|
57
|
+
this.filters.markupPreview = !this.filters.markupPreview;
|
|
58
|
+
},
|
|
59
|
+
tooltip: ''
|
|
60
|
+
};
|
|
61
|
+
const codeInput = {
|
|
62
|
+
checked: this.filters.codeInput,
|
|
63
|
+
class: undefined,
|
|
64
|
+
enabled: true,
|
|
65
|
+
id: 'findInCodeInput',
|
|
66
|
+
label: NOTEBOOK_FIND_IN_CODE_INPUT,
|
|
67
|
+
run: async () => {
|
|
68
|
+
this.filters.codeInput = !this.filters.codeInput;
|
|
69
|
+
},
|
|
70
|
+
tooltip: ''
|
|
71
|
+
};
|
|
72
|
+
const codeOutput = {
|
|
73
|
+
checked: this.filters.codeOutput,
|
|
74
|
+
class: undefined,
|
|
75
|
+
enabled: true,
|
|
76
|
+
id: 'findInCodeOutput',
|
|
77
|
+
label: NOTEBOOK_FIND_IN_CODE_OUTPUT,
|
|
78
|
+
run: async () => {
|
|
79
|
+
this.filters.codeOutput = !this.filters.codeOutput;
|
|
80
|
+
},
|
|
81
|
+
tooltip: '',
|
|
82
|
+
dispose: () => null
|
|
83
|
+
};
|
|
84
|
+
if (isSafari) {
|
|
85
|
+
return [
|
|
86
|
+
markdownInput,
|
|
87
|
+
codeInput
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return [
|
|
92
|
+
markdownInput,
|
|
93
|
+
markdownPreview,
|
|
94
|
+
( new Separator()),
|
|
95
|
+
codeInput,
|
|
96
|
+
codeOutput,
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
updateChecked() {
|
|
101
|
+
this.element.classList.toggle('checked', this._action.checked);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
NotebookFindFilterActionViewItem = ( __decorate([
|
|
105
|
+
( __param(3, IContextMenuService))
|
|
106
|
+
], NotebookFindFilterActionViewItem));
|
|
107
|
+
class NotebookFindInputFilterButton extends Disposable {
|
|
108
|
+
constructor(filters, contextMenuService, instantiationService, options, tooltip = NOTEBOOK_FIND_FILTERS) {
|
|
109
|
+
super();
|
|
110
|
+
this.filters = filters;
|
|
111
|
+
this.contextMenuService = contextMenuService;
|
|
112
|
+
this.instantiationService = instantiationService;
|
|
113
|
+
this._actionbar = null;
|
|
114
|
+
this._toggleStyles = options.toggleStyles;
|
|
115
|
+
this._filtersAction = ( new Action(
|
|
116
|
+
'notebookFindFilterAction',
|
|
117
|
+
tooltip,
|
|
118
|
+
'notebook-filters ' + ThemeIcon.asClassName(filterIcon)
|
|
119
|
+
));
|
|
120
|
+
this._filtersAction.checked = false;
|
|
121
|
+
this._filterButtonContainer = dom.$('.find-filter-button');
|
|
122
|
+
this._filterButtonContainer.classList.add('monaco-custom-toggle');
|
|
123
|
+
this.createFilters(this._filterButtonContainer);
|
|
124
|
+
}
|
|
125
|
+
get container() {
|
|
126
|
+
return this._filterButtonContainer;
|
|
127
|
+
}
|
|
128
|
+
get width() {
|
|
129
|
+
return 2 + 2 + 2 + 16 ;
|
|
130
|
+
}
|
|
131
|
+
applyStyles(filterChecked) {
|
|
132
|
+
const toggleStyles = this._toggleStyles;
|
|
133
|
+
this._filterButtonContainer.style.border = '1px solid transparent';
|
|
134
|
+
this._filterButtonContainer.style.borderRadius = '3px';
|
|
135
|
+
this._filterButtonContainer.style.borderColor = (filterChecked && toggleStyles.inputActiveOptionBorder) || '';
|
|
136
|
+
this._filterButtonContainer.style.color = (filterChecked && toggleStyles.inputActiveOptionForeground) || 'inherit';
|
|
137
|
+
this._filterButtonContainer.style.backgroundColor = (filterChecked && toggleStyles.inputActiveOptionBackground) || '';
|
|
138
|
+
}
|
|
139
|
+
createFilters(container) {
|
|
140
|
+
this._actionbar = this._register(( new ActionBar(container, {
|
|
141
|
+
actionViewItemProvider: action => {
|
|
142
|
+
if (action.id === this._filtersAction.id) {
|
|
143
|
+
return this.instantiationService.createInstance(NotebookFindFilterActionViewItem, this.filters, action, ( new ActionRunner()));
|
|
144
|
+
}
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
})));
|
|
148
|
+
this._actionbar.push(this._filtersAction, { icon: true, label: false });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
registerThemingParticipant((theme, collector) => {
|
|
152
|
+
collector.addRule(`
|
|
153
|
+
.notebook-editor {
|
|
154
|
+
--notebook-find-width: ${NOTEBOOK_FIND_WIDGET_INITIAL_WIDTH}px;
|
|
155
|
+
--notebook-find-horizontal-padding: ${NOTEBOOK_FIND_WIDGET_INITIAL_HORIZONTAL_PADDING}px;
|
|
156
|
+
}
|
|
157
|
+
`);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
export { NotebookFindInputFilterButton };
|