@theia/preferences 1.67.0-next.56 → 1.67.0-next.86
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/lib/browser/folder-preference-provider.d.ts +23 -0
- package/lib/browser/folder-preference-provider.d.ts.map +1 -0
- package/lib/browser/folder-preference-provider.js +57 -0
- package/lib/browser/folder-preference-provider.js.map +1 -0
- package/lib/browser/folders-preferences-provider.d.ts +27 -0
- package/lib/browser/folders-preferences-provider.d.ts.map +1 -0
- package/lib/browser/folders-preferences-provider.js +237 -0
- package/lib/browser/folders-preferences-provider.js.map +1 -0
- package/lib/browser/frontend-preference-storage.d.ts +20 -0
- package/lib/browser/frontend-preference-storage.d.ts.map +1 -0
- package/lib/browser/frontend-preference-storage.js +63 -0
- package/lib/browser/frontend-preference-storage.js.map +1 -0
- package/lib/browser/index.d.ts +5 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +23 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/monaco-jsonc-editor.d.ts +10 -0
- package/lib/browser/monaco-jsonc-editor.d.ts.map +1 -0
- package/lib/browser/monaco-jsonc-editor.js +73 -0
- package/lib/browser/monaco-jsonc-editor.js.map +1 -0
- package/lib/browser/package.spec.d.ts +1 -0
- package/lib/browser/package.spec.d.ts.map +1 -0
- package/lib/browser/package.spec.js +26 -0
- package/lib/browser/package.spec.js.map +1 -0
- package/lib/browser/preference-bindings.d.ts +4 -0
- package/lib/browser/preference-bindings.d.ts.map +1 -0
- package/lib/browser/preference-bindings.js +49 -0
- package/lib/browser/preference-bindings.js.map +1 -0
- package/lib/browser/preference-frontend-contribution.d.ts +9 -0
- package/lib/browser/preference-frontend-contribution.d.ts.map +1 -0
- package/lib/browser/preference-frontend-contribution.js +45 -0
- package/lib/browser/preference-frontend-contribution.js.map +1 -0
- package/lib/browser/preference-frontend-module.d.ts +7 -0
- package/lib/browser/preference-frontend-module.d.ts.map +1 -0
- package/lib/browser/preference-frontend-module.js +67 -0
- package/lib/browser/preference-frontend-module.js.map +1 -0
- package/lib/browser/preference-open-handler.d.ts +10 -0
- package/lib/browser/preference-open-handler.d.ts.map +1 -0
- package/lib/browser/preference-open-handler.js +57 -0
- package/lib/browser/preference-open-handler.js.map +1 -0
- package/lib/browser/preference-transaction-manager.d.ts +98 -0
- package/lib/browser/preference-transaction-manager.d.ts.map +1 -0
- package/lib/browser/preference-transaction-manager.js +279 -0
- package/lib/browser/preference-transaction-manager.js.map +1 -0
- package/lib/browser/preference-tree-model.d.ts +60 -0
- package/lib/browser/preference-tree-model.d.ts.map +1 -0
- package/lib/browser/preference-tree-model.js +247 -0
- package/lib/browser/preference-tree-model.js.map +1 -0
- package/lib/browser/preferences-contribution.d.ts +35 -0
- package/lib/browser/preferences-contribution.d.ts.map +1 -0
- package/lib/browser/preferences-contribution.js +263 -0
- package/lib/browser/preferences-contribution.js.map +1 -0
- package/lib/browser/preferences-json-schema-contribution.d.ts +17 -0
- package/lib/browser/preferences-json-schema-contribution.d.ts.map +1 -0
- package/lib/browser/preferences-json-schema-contribution.js +84 -0
- package/lib/browser/preferences-json-schema-contribution.js.map +1 -0
- package/lib/browser/preferences-monaco-contribution.d.ts +2 -0
- package/lib/browser/preferences-monaco-contribution.d.ts.map +1 -0
- package/lib/browser/preferences-monaco-contribution.js +28 -0
- package/lib/browser/preferences-monaco-contribution.js.map +1 -0
- package/lib/browser/util/preference-layout.d.ts +23 -0
- package/lib/browser/util/preference-layout.d.ts.map +1 -0
- package/lib/browser/util/preference-layout.js +441 -0
- package/lib/browser/util/preference-layout.js.map +1 -0
- package/lib/browser/util/preference-scope-command-manager.d.ts +18 -0
- package/lib/browser/util/preference-scope-command-manager.d.ts.map +1 -0
- package/lib/browser/util/preference-scope-command-manager.js +80 -0
- package/lib/browser/util/preference-scope-command-manager.js.map +1 -0
- package/lib/browser/util/preference-tree-generator.d.ts +48 -0
- package/lib/browser/util/preference-tree-generator.d.ts.map +1 -0
- package/lib/browser/util/preference-tree-generator.js +277 -0
- package/lib/browser/util/preference-tree-generator.js.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.d.ts +12 -0
- package/lib/browser/util/preference-tree-label-provider.d.ts.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.js +74 -0
- package/lib/browser/util/preference-tree-label-provider.js.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.spec.d.ts +2 -0
- package/lib/browser/util/preference-tree-label-provider.spec.d.ts.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.spec.js +90 -0
- package/lib/browser/util/preference-tree-label-provider.spec.js.map +1 -0
- package/lib/browser/util/preference-types.d.ts +69 -0
- package/lib/browser/util/preference-types.d.ts.map +1 -0
- package/lib/browser/util/preference-types.js +133 -0
- package/lib/browser/util/preference-types.js.map +1 -0
- package/lib/browser/views/components/preference-array-input.d.ts +29 -0
- package/lib/browser/views/components/preference-array-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-array-input.js +176 -0
- package/lib/browser/views/components/preference-array-input.js.map +1 -0
- package/lib/browser/views/components/preference-boolean-input.d.ts +18 -0
- package/lib/browser/views/components/preference-boolean-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-boolean-input.js +75 -0
- package/lib/browser/views/components/preference-boolean-input.js.map +1 -0
- package/lib/browser/views/components/preference-file-input.d.ts +30 -0
- package/lib/browser/views/components/preference-file-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-file-input.js +103 -0
- package/lib/browser/views/components/preference-file-input.js.map +1 -0
- package/lib/browser/views/components/preference-json-input.d.ts +20 -0
- package/lib/browser/views/components/preference-json-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-json-input.js +86 -0
- package/lib/browser/views/components/preference-json-input.js.map +1 -0
- package/lib/browser/views/components/preference-markdown-renderer.d.ts +15 -0
- package/lib/browser/views/components/preference-markdown-renderer.d.ts.map +1 -0
- package/lib/browser/views/components/preference-markdown-renderer.js +86 -0
- package/lib/browser/views/components/preference-markdown-renderer.js.map +1 -0
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts +49 -0
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts.map +1 -0
- package/lib/browser/views/components/preference-node-renderer-creator.js +122 -0
- package/lib/browser/views/components/preference-node-renderer-creator.js.map +1 -0
- package/lib/browser/views/components/preference-node-renderer.d.ts +118 -0
- package/lib/browser/views/components/preference-node-renderer.d.ts.map +1 -0
- package/lib/browser/views/components/preference-node-renderer.js +442 -0
- package/lib/browser/views/components/preference-node-renderer.js.map +1 -0
- package/lib/browser/views/components/preference-null-input.d.ts +16 -0
- package/lib/browser/views/components/preference-null-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-null-input.js +59 -0
- package/lib/browser/views/components/preference-null-input.js.map +1 -0
- package/lib/browser/views/components/preference-number-input.d.ts +35 -0
- package/lib/browser/views/components/preference-number-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-number-input.js +174 -0
- package/lib/browser/views/components/preference-number-input.js.map +1 -0
- package/lib/browser/views/components/preference-select-input.d.ts +29 -0
- package/lib/browser/views/components/preference-select-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-select-input.js +131 -0
- package/lib/browser/views/components/preference-select-input.js.map +1 -0
- package/lib/browser/views/components/preference-string-input.d.ts +18 -0
- package/lib/browser/views/components/preference-string-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-string-input.js +85 -0
- package/lib/browser/views/components/preference-string-input.js.map +1 -0
- package/lib/browser/views/preference-editor-widget.d.ts +75 -0
- package/lib/browser/views/preference-editor-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-editor-widget.js +391 -0
- package/lib/browser/views/preference-editor-widget.js.map +1 -0
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts +55 -0
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-scope-tabbar-widget.js +337 -0
- package/lib/browser/views/preference-scope-tabbar-widget.js.map +1 -0
- package/lib/browser/views/preference-searchbar-widget.d.ts +54 -0
- package/lib/browser/views/preference-searchbar-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-searchbar-widget.js +163 -0
- package/lib/browser/views/preference-searchbar-widget.js.map +1 -0
- package/lib/browser/views/preference-tree-widget.d.ts +20 -0
- package/lib/browser/views/preference-tree-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-tree-widget.js +106 -0
- package/lib/browser/views/preference-tree-widget.js.map +1 -0
- package/lib/browser/views/preference-widget-bindings.d.ts +4 -0
- package/lib/browser/views/preference-widget-bindings.d.ts.map +1 -0
- package/lib/browser/views/preference-widget-bindings.js +91 -0
- package/lib/browser/views/preference-widget-bindings.js.map +1 -0
- package/lib/browser/views/preference-widget.d.ts +38 -0
- package/lib/browser/views/preference-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-widget.js +120 -0
- package/lib/browser/views/preference-widget.js.map +1 -0
- package/lib/browser/workspace-file-preference-provider.d.ts +24 -0
- package/lib/browser/workspace-file-preference-provider.d.ts.map +1 -0
- package/lib/browser/workspace-file-preference-provider.js +103 -0
- package/lib/browser/workspace-file-preference-provider.js.map +1 -0
- package/lib/browser/workspace-preference-provider.d.ts +36 -0
- package/lib/browser/workspace-preference-provider.d.ts.map +1 -0
- package/lib/browser/workspace-preference-provider.js +147 -0
- package/lib/browser/workspace-preference-provider.js.map +1 -0
- package/lib/common/abstract-resource-preference-provider.d.ts +69 -0
- package/lib/common/abstract-resource-preference-provider.d.ts.map +1 -0
- package/lib/common/abstract-resource-preference-provider.js +207 -0
- package/lib/common/abstract-resource-preference-provider.js.map +1 -0
- package/lib/common/abstract-resource-preference-provider.spec.d.ts +2 -0
- package/lib/common/abstract-resource-preference-provider.spec.d.ts.map +1 -0
- package/lib/common/abstract-resource-preference-provider.spec.js +84 -0
- package/lib/common/abstract-resource-preference-provider.spec.js.map +1 -0
- package/lib/common/cli-preferences.d.ts +6 -0
- package/lib/common/cli-preferences.d.ts.map +1 -0
- package/lib/common/cli-preferences.js +21 -0
- package/lib/common/cli-preferences.js.map +1 -0
- package/lib/common/jsonc-editor.d.ts +10 -0
- package/lib/common/jsonc-editor.d.ts.map +1 -0
- package/lib/common/jsonc-editor.js +68 -0
- package/lib/common/jsonc-editor.js.map +1 -0
- package/lib/common/section-preference-provider.d.ts +20 -0
- package/lib/common/section-preference-provider.d.ts.map +1 -0
- package/lib/common/section-preference-provider.js +84 -0
- package/lib/common/section-preference-provider.js.map +1 -0
- package/lib/common/user-configs-preference-provider.d.ts +24 -0
- package/lib/common/user-configs-preference-provider.d.ts.map +1 -0
- package/lib/common/user-configs-preference-provider.js +134 -0
- package/lib/common/user-configs-preference-provider.js.map +1 -0
- package/lib/common/user-preference-provider.d.ts +14 -0
- package/lib/common/user-preference-provider.d.ts.map +1 -0
- package/lib/common/user-preference-provider.js +37 -0
- package/lib/common/user-preference-provider.js.map +1 -0
- package/lib/node/backend-preference-storage.d.ts +34 -0
- package/lib/node/backend-preference-storage.d.ts.map +1 -0
- package/lib/node/backend-preference-storage.js +100 -0
- package/lib/node/backend-preference-storage.js.map +1 -0
- package/lib/node/preference-backend-module.d.ts +4 -0
- package/lib/node/preference-backend-module.d.ts.map +1 -0
- package/lib/node/preference-backend-module.js +41 -0
- package/lib/node/preference-backend-module.js.map +1 -0
- package/lib/node/preference-bindings.d.ts +3 -0
- package/lib/node/preference-bindings.d.ts.map +1 -0
- package/lib/node/preference-bindings.js +33 -0
- package/lib/node/preference-bindings.js.map +1 -0
- package/lib/node/preference-cli-contribution.d.ts +11 -0
- package/lib/node/preference-cli-contribution.d.ts.map +1 -0
- package/lib/node/preference-cli-contribution.js +48 -0
- package/lib/node/preference-cli-contribution.js.map +1 -0
- package/package.json +8 -8
- package/src/browser/style/index.css +29 -28
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 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.PreferenceMenus = exports.PreferencesCommands = exports.Preference = void 0;
|
|
19
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
var Preference;
|
|
22
|
+
(function (Preference) {
|
|
23
|
+
let EditorCommandArgs;
|
|
24
|
+
(function (EditorCommandArgs) {
|
|
25
|
+
function is(prefObject) {
|
|
26
|
+
return !!prefObject && 'id' in prefObject && 'value' in prefObject;
|
|
27
|
+
}
|
|
28
|
+
EditorCommandArgs.is = is;
|
|
29
|
+
})(EditorCommandArgs = Preference.EditorCommandArgs || (Preference.EditorCommandArgs = {}));
|
|
30
|
+
Preference.Node = Symbol('Preference.Node');
|
|
31
|
+
let TreeNode;
|
|
32
|
+
(function (TreeNode) {
|
|
33
|
+
TreeNode.is = (node) => 'depth' in node;
|
|
34
|
+
TreeNode.isTopLevel = (node) => {
|
|
35
|
+
const { group, id } = TreeNode.getGroupAndIdFromNodeId(node.id);
|
|
36
|
+
return group === id;
|
|
37
|
+
};
|
|
38
|
+
TreeNode.getGroupAndIdFromNodeId = (nodeId) => {
|
|
39
|
+
const separator = nodeId.indexOf('@');
|
|
40
|
+
const group = nodeId.substring(0, separator);
|
|
41
|
+
const id = nodeId.substring(separator + 1, nodeId.length);
|
|
42
|
+
return { group, id };
|
|
43
|
+
};
|
|
44
|
+
})(TreeNode = Preference.TreeNode || (Preference.TreeNode = {}));
|
|
45
|
+
let CompositeTreeNode;
|
|
46
|
+
(function (CompositeTreeNode) {
|
|
47
|
+
CompositeTreeNode.is = (node) => !LeafNode.is(node);
|
|
48
|
+
})(CompositeTreeNode = Preference.CompositeTreeNode || (Preference.CompositeTreeNode = {}));
|
|
49
|
+
let LeafNode;
|
|
50
|
+
(function (LeafNode) {
|
|
51
|
+
LeafNode.is = (node) => 'preference' in node && !!node.preference.data;
|
|
52
|
+
LeafNode.getType = (node) => LeafNode.is(node)
|
|
53
|
+
? Array.isArray(node.preference.data.type) ? node.preference.data.type[0] : node.preference.data.type
|
|
54
|
+
: undefined;
|
|
55
|
+
})(LeafNode = Preference.LeafNode || (Preference.LeafNode = {}));
|
|
56
|
+
Preference.getValueInScope = (preferenceInfo, scope) => {
|
|
57
|
+
if (!preferenceInfo) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
switch (scope) {
|
|
61
|
+
case core_1.PreferenceScope.User:
|
|
62
|
+
return preferenceInfo.globalValue;
|
|
63
|
+
case core_1.PreferenceScope.Workspace:
|
|
64
|
+
return preferenceInfo.workspaceValue;
|
|
65
|
+
case core_1.PreferenceScope.Folder:
|
|
66
|
+
return preferenceInfo.workspaceFolderValue;
|
|
67
|
+
default:
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
;
|
|
72
|
+
Preference.DEFAULT_SCOPE = {
|
|
73
|
+
scope: core_1.PreferenceScope.User,
|
|
74
|
+
uri: undefined,
|
|
75
|
+
activeScopeIsFolder: false
|
|
76
|
+
};
|
|
77
|
+
})(Preference || (exports.Preference = Preference = {}));
|
|
78
|
+
var PreferencesCommands;
|
|
79
|
+
(function (PreferencesCommands) {
|
|
80
|
+
PreferencesCommands.OPEN_PREFERENCES_JSON_TOOLBAR = {
|
|
81
|
+
id: 'preferences:openJson.toolbar',
|
|
82
|
+
iconClass: 'codicon codicon-json'
|
|
83
|
+
};
|
|
84
|
+
PreferencesCommands.COPY_JSON_NAME = core_1.Command.toDefaultLocalizedCommand({
|
|
85
|
+
id: 'preferences:copyJson.name',
|
|
86
|
+
label: 'Copy Setting ID'
|
|
87
|
+
});
|
|
88
|
+
PreferencesCommands.RESET_PREFERENCE = core_1.Command.toDefaultLocalizedCommand({
|
|
89
|
+
id: 'preferences:reset',
|
|
90
|
+
label: 'Reset Setting'
|
|
91
|
+
});
|
|
92
|
+
PreferencesCommands.COPY_JSON_VALUE = core_1.Command.toDefaultLocalizedCommand({
|
|
93
|
+
id: 'preferences:copyJson.value',
|
|
94
|
+
label: 'Copy Setting as JSON',
|
|
95
|
+
});
|
|
96
|
+
PreferencesCommands.OPEN_USER_PREFERENCES = core_1.Command.toDefaultLocalizedCommand({
|
|
97
|
+
id: 'workbench.action.openGlobalSettings',
|
|
98
|
+
category: browser_1.CommonCommands.PREFERENCES_CATEGORY,
|
|
99
|
+
label: 'Open User Settings',
|
|
100
|
+
});
|
|
101
|
+
PreferencesCommands.OPEN_WORKSPACE_PREFERENCES = core_1.Command.toDefaultLocalizedCommand({
|
|
102
|
+
id: 'workbench.action.openWorkspaceSettings',
|
|
103
|
+
category: browser_1.CommonCommands.PREFERENCES_CATEGORY,
|
|
104
|
+
label: 'Open Workspace Settings',
|
|
105
|
+
});
|
|
106
|
+
PreferencesCommands.OPEN_FOLDER_PREFERENCES = core_1.Command.toDefaultLocalizedCommand({
|
|
107
|
+
id: 'workbench.action.openFolderSettings',
|
|
108
|
+
category: browser_1.CommonCommands.PREFERENCES_CATEGORY,
|
|
109
|
+
label: 'Open Folder Settings'
|
|
110
|
+
});
|
|
111
|
+
PreferencesCommands.OPEN_USER_PREFERENCES_JSON = core_1.Command.toDefaultLocalizedCommand({
|
|
112
|
+
id: 'workbench.action.openSettingsJson',
|
|
113
|
+
category: browser_1.CommonCommands.PREFERENCES_CATEGORY,
|
|
114
|
+
label: 'Open Settings (JSON)'
|
|
115
|
+
});
|
|
116
|
+
PreferencesCommands.OPEN_WORKSPACE_PREFERENCES_JSON = core_1.Command.toDefaultLocalizedCommand({
|
|
117
|
+
id: 'workbench.action.openWorkspaceSettingsFile',
|
|
118
|
+
category: browser_1.CommonCommands.PREFERENCES_CATEGORY,
|
|
119
|
+
label: 'Open Workspace Settings (JSON)',
|
|
120
|
+
});
|
|
121
|
+
PreferencesCommands.OPEN_FOLDER_PREFERENCES_JSON = core_1.Command.toDefaultLocalizedCommand({
|
|
122
|
+
id: 'workbench.action.openFolderSettingsFile',
|
|
123
|
+
category: browser_1.CommonCommands.PREFERENCES_CATEGORY,
|
|
124
|
+
label: 'Open Folder Settings (JSON)',
|
|
125
|
+
});
|
|
126
|
+
})(PreferencesCommands || (exports.PreferencesCommands = PreferencesCommands = {}));
|
|
127
|
+
var PreferenceMenus;
|
|
128
|
+
(function (PreferenceMenus) {
|
|
129
|
+
PreferenceMenus.PREFERENCE_EDITOR_CONTEXT_MENU = ['preferences:editor.contextMenu'];
|
|
130
|
+
PreferenceMenus.PREFERENCE_EDITOR_COPY_ACTIONS = [...PreferenceMenus.PREFERENCE_EDITOR_CONTEXT_MENU, 'preferences:editor.contextMenu.copy'];
|
|
131
|
+
PreferenceMenus.FOLDER_SCOPE_MENU_PATH = ['preferences:scope.menu'];
|
|
132
|
+
})(PreferenceMenus || (exports.PreferenceMenus = PreferenceMenus = {}));
|
|
133
|
+
//# sourceMappingURL=preference-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-types.js","sourceRoot":"","sources":["../../../src/browser/util/preference-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;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,cAAO,CAAC,yBAAyB,CAAC;QAC7E,EAAE,EAAE,4CAA4C;QAChD,QAAQ,EAAE,wBAAc,CAAC,oBAAoB;QAC7C,KAAK,EAAE,gCAAgC;KAC1C,CAAC,CAAC;IAEU,gDAA4B,GAAG,cAAO,CAAC,yBAAyB,CAAC;QAC1E,EAAE,EAAE,yCAAyC;QAC7C,QAAQ,EAAE,wBAAc,CAAC,oBAAoB;QAC7C,KAAK,EAAE,6BAA6B;KACvC,CAAC,CAAC;AACP,CAAC,EAtDgB,mBAAmB,mCAAnB,mBAAmB,QAsDnC;AAED,IAAiB,eAAe,CAI/B;AAJD,WAAiB,eAAe;IACf,8CAA8B,GAAa,CAAC,gCAAgC,CAAC,CAAC;IAC9E,8CAA8B,GAAa,CAAC,GAAG,gBAAA,8BAA8B,EAAE,qCAAqC,CAAC,CAAC;IACtH,sCAAsB,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACrE,CAAC,EAJgB,eAAe,+BAAf,eAAe,QAI/B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
2
|
+
import { Preference } from '../../util/preference-types';
|
|
3
|
+
import { PreferenceLeafNodeRenderer, PreferenceNodeRenderer } from './preference-node-renderer';
|
|
4
|
+
import { PreferenceLeafNodeRendererContribution } from './preference-node-renderer-creator';
|
|
5
|
+
export declare class PreferenceArrayInputRenderer extends PreferenceLeafNodeRenderer<string[], HTMLInputElement> {
|
|
6
|
+
existingValues: Map<string, {
|
|
7
|
+
node: HTMLElement;
|
|
8
|
+
index: number;
|
|
9
|
+
}>;
|
|
10
|
+
wrapper: HTMLElement;
|
|
11
|
+
inputWrapper: HTMLElement;
|
|
12
|
+
protected createInteractable(parent: HTMLElement): void;
|
|
13
|
+
protected getFallbackValue(): string[];
|
|
14
|
+
protected createExistingValue(value: string): HTMLElement;
|
|
15
|
+
protected createInput(): HTMLElement;
|
|
16
|
+
protected doHandleValueChange(): void;
|
|
17
|
+
protected removeItem(value: string): void;
|
|
18
|
+
protected handleEnter(e: KeyboardEvent): void;
|
|
19
|
+
protected addItem(): void;
|
|
20
|
+
protected getOrderedValues(): string[];
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class PreferenceArrayInputRendererContribution extends PreferenceLeafNodeRendererContribution {
|
|
24
|
+
static ID: string;
|
|
25
|
+
id: string;
|
|
26
|
+
canHandleLeafNode(node: Preference.LeafNode): number;
|
|
27
|
+
createLeafNodeRenderer(container: interfaces.Container): PreferenceNodeRenderer;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=preference-array-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-array-input.d.ts","sourceRoot":"","sources":["../../../../src/browser/views/components/preference-array-input.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAc,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAE5F,qBACa,4BAA6B,SAAQ,0BAA0B,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC;IACpG,cAAc;cAA2B,WAAW;eAAS,MAAM;OAAM;IACzE,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,WAAW,CAAC;IAE1B,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAiBvD,SAAS,CAAC,gBAAgB,IAAI,MAAM,EAAE;IAItC,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAqBzD,SAAS,CAAC,WAAW,IAAI,WAAW;IAwBpC,SAAS,CAAC,mBAAmB,IAAI,IAAI;IA0BrC,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IASzC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAO7C,SAAS,CAAC,OAAO,IAAI,IAAI;IAWzB,SAAS,CAAC,gBAAgB,IAAI,MAAM,EAAE;IAM7B,OAAO,IAAI,IAAI;CAI3B;AAED,qBACa,wCAAyC,SAAQ,sCAAsC;IAChG,MAAM,CAAC,EAAE,SAAqC;IAC9C,EAAE,SAA+C;IAEjD,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,GAAG,MAAM;IAKpD,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,GAAG,sBAAsB;CAGlF"}
|
|
@@ -0,0 +1,176 @@
|
|
|
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
|
+
var PreferenceArrayInputRendererContribution_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.PreferenceArrayInputRendererContribution = exports.PreferenceArrayInputRenderer = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const preference_types_1 = require("../../util/preference-types");
|
|
24
|
+
const preference_node_renderer_1 = require("./preference-node-renderer");
|
|
25
|
+
const preference_node_renderer_creator_1 = require("./preference-node-renderer-creator");
|
|
26
|
+
let PreferenceArrayInputRenderer = class PreferenceArrayInputRenderer extends preference_node_renderer_1.PreferenceLeafNodeRenderer {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
this.existingValues = new Map();
|
|
30
|
+
}
|
|
31
|
+
createInteractable(parent) {
|
|
32
|
+
const wrapper = document.createElement('ul');
|
|
33
|
+
wrapper.classList.add('preference-array');
|
|
34
|
+
this.wrapper = wrapper;
|
|
35
|
+
const currentValue = this.getValue();
|
|
36
|
+
if (Array.isArray(currentValue)) {
|
|
37
|
+
for (const [index, value] of currentValue.entries()) {
|
|
38
|
+
const node = this.createExistingValue(value);
|
|
39
|
+
wrapper.appendChild(node);
|
|
40
|
+
this.existingValues.set(value, { node, index });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const inputWrapper = this.createInput();
|
|
44
|
+
wrapper.appendChild(inputWrapper);
|
|
45
|
+
parent.appendChild(wrapper);
|
|
46
|
+
}
|
|
47
|
+
getFallbackValue() {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
createExistingValue(value) {
|
|
51
|
+
const existingValue = document.createElement('li');
|
|
52
|
+
existingValue.classList.add('preference-array-element');
|
|
53
|
+
const valueWrapper = document.createElement('span');
|
|
54
|
+
valueWrapper.classList.add('preference-array-element-val');
|
|
55
|
+
valueWrapper.textContent = value;
|
|
56
|
+
existingValue.appendChild(valueWrapper);
|
|
57
|
+
const iconWrapper = document.createElement('span');
|
|
58
|
+
iconWrapper.classList.add('preference-array-element-btn', 'remove-btn');
|
|
59
|
+
const handler = this.removeItem.bind(this, value);
|
|
60
|
+
iconWrapper.onclick = handler;
|
|
61
|
+
iconWrapper.onkeydown = handler;
|
|
62
|
+
iconWrapper.setAttribute('role', 'button');
|
|
63
|
+
iconWrapper.tabIndex = 0;
|
|
64
|
+
existingValue.appendChild(iconWrapper);
|
|
65
|
+
const icon = document.createElement('i');
|
|
66
|
+
icon.classList.add(...(0, browser_1.codiconArray)('close'));
|
|
67
|
+
iconWrapper.appendChild(icon);
|
|
68
|
+
return existingValue;
|
|
69
|
+
}
|
|
70
|
+
createInput() {
|
|
71
|
+
const inputWrapper = document.createElement('li');
|
|
72
|
+
this.inputWrapper = inputWrapper;
|
|
73
|
+
const input = document.createElement('input');
|
|
74
|
+
inputWrapper.appendChild(input);
|
|
75
|
+
this.interactable = input;
|
|
76
|
+
input.classList.add('preference-array-input', 'theia-input');
|
|
77
|
+
input.type = 'text';
|
|
78
|
+
input.placeholder = 'Add Value...';
|
|
79
|
+
input.spellcheck = false;
|
|
80
|
+
input.onkeydown = this.handleEnter.bind(this);
|
|
81
|
+
input.setAttribute('aria-label', 'Preference String Input');
|
|
82
|
+
const iconWrapper = document.createElement('span');
|
|
83
|
+
inputWrapper.appendChild(iconWrapper);
|
|
84
|
+
iconWrapper.classList.add('preference-array-element-btn', ...(0, browser_1.codiconArray)('add'));
|
|
85
|
+
iconWrapper.setAttribute('role', 'button');
|
|
86
|
+
const handler = this.addItem.bind(this);
|
|
87
|
+
iconWrapper.onclick = handler;
|
|
88
|
+
iconWrapper.onkeydown = handler;
|
|
89
|
+
iconWrapper.tabIndex = 0;
|
|
90
|
+
iconWrapper.setAttribute('aria-label', 'Submit Preference Input');
|
|
91
|
+
return inputWrapper;
|
|
92
|
+
}
|
|
93
|
+
doHandleValueChange() {
|
|
94
|
+
var _a;
|
|
95
|
+
this.updateInspection();
|
|
96
|
+
const values = (_a = this.getValue()) !== null && _a !== void 0 ? _a : [];
|
|
97
|
+
const newValues = new Set(...values);
|
|
98
|
+
for (const [value, row] of this.existingValues.entries()) {
|
|
99
|
+
if (!newValues.has(value)) {
|
|
100
|
+
row.node.remove();
|
|
101
|
+
this.existingValues.delete(value);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (const [index, value] of values.entries()) {
|
|
105
|
+
let row = this.existingValues.get(value);
|
|
106
|
+
if (row) {
|
|
107
|
+
row.index = index;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
row = { node: this.createExistingValue(value), index };
|
|
111
|
+
this.existingValues.set(value, row);
|
|
112
|
+
}
|
|
113
|
+
if (this.wrapper.children[index] !== row.node) {
|
|
114
|
+
this.wrapper.children[index].insertAdjacentElement('beforebegin', row.node);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
this.updateModificationStatus();
|
|
118
|
+
}
|
|
119
|
+
removeItem(value) {
|
|
120
|
+
const row = this.existingValues.get(value);
|
|
121
|
+
if (row) {
|
|
122
|
+
row.node.remove();
|
|
123
|
+
this.existingValues.delete(value);
|
|
124
|
+
this.setPreferenceImmediately(this.getOrderedValues());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
handleEnter(e) {
|
|
128
|
+
if (e.key === 'Enter') {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
this.addItem();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
addItem() {
|
|
134
|
+
const newItem = this.interactable.value;
|
|
135
|
+
if (newItem && !this.existingValues.has(newItem)) {
|
|
136
|
+
const node = this.createExistingValue(newItem);
|
|
137
|
+
this.inputWrapper.insertAdjacentElement('beforebegin', node);
|
|
138
|
+
this.existingValues.set(newItem, { node, index: this.existingValues.size });
|
|
139
|
+
this.setPreferenceImmediately(this.getOrderedValues());
|
|
140
|
+
}
|
|
141
|
+
this.interactable.value = '';
|
|
142
|
+
}
|
|
143
|
+
getOrderedValues() {
|
|
144
|
+
return Array.from(this.existingValues.entries())
|
|
145
|
+
.sort(([, a], [, b]) => a.index - b.index)
|
|
146
|
+
.map(([value]) => value);
|
|
147
|
+
}
|
|
148
|
+
dispose() {
|
|
149
|
+
this.existingValues.clear();
|
|
150
|
+
super.dispose();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
exports.PreferenceArrayInputRenderer = PreferenceArrayInputRenderer;
|
|
154
|
+
exports.PreferenceArrayInputRenderer = PreferenceArrayInputRenderer = tslib_1.__decorate([
|
|
155
|
+
(0, inversify_1.injectable)()
|
|
156
|
+
], PreferenceArrayInputRenderer);
|
|
157
|
+
let PreferenceArrayInputRendererContribution = PreferenceArrayInputRendererContribution_1 = class PreferenceArrayInputRendererContribution extends preference_node_renderer_creator_1.PreferenceLeafNodeRendererContribution {
|
|
158
|
+
constructor() {
|
|
159
|
+
super(...arguments);
|
|
160
|
+
this.id = PreferenceArrayInputRendererContribution_1.ID;
|
|
161
|
+
}
|
|
162
|
+
canHandleLeafNode(node) {
|
|
163
|
+
var _a;
|
|
164
|
+
const type = preference_types_1.Preference.LeafNode.getType(node);
|
|
165
|
+
return type === 'array' && ((_a = node.preference.data.items) === null || _a === void 0 ? void 0 : _a.type) === 'string' ? 2 : 0;
|
|
166
|
+
}
|
|
167
|
+
createLeafNodeRenderer(container) {
|
|
168
|
+
return container.get(PreferenceArrayInputRenderer);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
exports.PreferenceArrayInputRendererContribution = PreferenceArrayInputRendererContribution;
|
|
172
|
+
PreferenceArrayInputRendererContribution.ID = 'preference-array-input-renderer';
|
|
173
|
+
exports.PreferenceArrayInputRendererContribution = PreferenceArrayInputRendererContribution = PreferenceArrayInputRendererContribution_1 = tslib_1.__decorate([
|
|
174
|
+
(0, inversify_1.injectable)()
|
|
175
|
+
], PreferenceArrayInputRendererContribution);
|
|
176
|
+
//# sourceMappingURL=preference-array-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-array-input.js","sourceRoot":"","sources":["../../../../src/browser/views/components/preference-array-input.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7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AE,CAAC;QAC5B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ,CAAA;AAtIY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CAsIxC;AAGM,IAAM,wCAAwC,gDAA9C,MAAM,wCAAyC,SAAQ,yEAAsC;IAA7F;;QAEH,OAAE,GAAG,0CAAwC,CAAC,EAAE,CAAC;IAUrD,CAAC;IARG,iBAAiB,CAAC,IAAyB;;QACvC,MAAM,IAAI,GAAG,6BAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO,IAAI,KAAK,OAAO,IAAI,CAAA,MAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAqB,0CAAE,IAAI,MAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED,sBAAsB,CAAC,SAA+B;QAClD,OAAO,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IACvD,CAAC;;AAXQ,4FAAwC;AAC1C,2CAAE,GAAG,iCAAiC,AAApC,CAAqC;mDADrC,wCAAwC;IADpD,IAAA,sBAAU,GAAE;GACA,wCAAwC,CAYpD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
2
|
+
import { Preference } from '../../util/preference-types';
|
|
3
|
+
import { PreferenceLeafNodeRenderer, PreferenceNodeRenderer } from './preference-node-renderer';
|
|
4
|
+
import { PreferenceLeafNodeRendererContribution } from './preference-node-renderer-creator';
|
|
5
|
+
export declare class PreferenceBooleanInputRenderer extends PreferenceLeafNodeRenderer<boolean, HTMLInputElement> {
|
|
6
|
+
protected createInteractable(parent: HTMLElement): void;
|
|
7
|
+
protected getAdditionalNodeClassnames(): Iterable<string>;
|
|
8
|
+
protected getFallbackValue(): false;
|
|
9
|
+
protected handleUserInteraction(): Promise<void>;
|
|
10
|
+
protected doHandleValueChange(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class PreferenceBooleanInputRendererContribution extends PreferenceLeafNodeRendererContribution {
|
|
13
|
+
static ID: string;
|
|
14
|
+
id: string;
|
|
15
|
+
canHandleLeafNode(node: Preference.LeafNode): number;
|
|
16
|
+
createLeafNodeRenderer(container: interfaces.Container): PreferenceNodeRenderer;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=preference-boolean-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-boolean-input.d.ts","sourceRoot":"","sources":["../../../../src/browser/views/components/preference-boolean-input.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAc,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAE5F,qBACa,8BAA+B,SAAQ,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACrG,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;cAUpC,2BAA2B,IAAI,QAAQ,CAAC,MAAM,CAAC;IAIlE,SAAS,CAAC,gBAAgB,IAAI,KAAK;IAInC,SAAS,CAAC,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD,SAAS,CAAC,mBAAmB,IAAI,IAAI;CASxC;AAED,qBACa,0CAA2C,SAAQ,sCAAsC;IAClG,MAAM,CAAC,EAAE,SAAuC;IAChD,EAAE,SAAiD;IAEnD,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,GAAG,MAAM;IAIpD,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,GAAG,sBAAsB;CAGlF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
var PreferenceBooleanInputRendererContribution_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.PreferenceBooleanInputRendererContribution = exports.PreferenceBooleanInputRenderer = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
+
const preference_types_1 = require("../../util/preference-types");
|
|
23
|
+
const preference_node_renderer_1 = require("./preference-node-renderer");
|
|
24
|
+
const preference_node_renderer_creator_1 = require("./preference-node-renderer-creator");
|
|
25
|
+
let PreferenceBooleanInputRenderer = class PreferenceBooleanInputRenderer extends preference_node_renderer_1.PreferenceLeafNodeRenderer {
|
|
26
|
+
createInteractable(parent) {
|
|
27
|
+
const interactable = document.createElement('input');
|
|
28
|
+
this.interactable = interactable;
|
|
29
|
+
interactable.type = 'checkbox';
|
|
30
|
+
interactable.classList.add('theia-input');
|
|
31
|
+
interactable.defaultChecked = Boolean(this.getValue());
|
|
32
|
+
interactable.onchange = this.handleUserInteraction.bind(this);
|
|
33
|
+
parent.appendChild(interactable);
|
|
34
|
+
}
|
|
35
|
+
getAdditionalNodeClassnames() {
|
|
36
|
+
return ['boolean'];
|
|
37
|
+
}
|
|
38
|
+
getFallbackValue() {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
handleUserInteraction() {
|
|
42
|
+
return this.setPreferenceImmediately(this.interactable.checked);
|
|
43
|
+
}
|
|
44
|
+
doHandleValueChange() {
|
|
45
|
+
const currentValue = this.interactable.checked;
|
|
46
|
+
this.updateInspection();
|
|
47
|
+
const newValue = Boolean(this.getValue());
|
|
48
|
+
this.updateModificationStatus(newValue);
|
|
49
|
+
if (newValue !== currentValue && document.activeElement !== this.interactable) {
|
|
50
|
+
this.interactable.checked = newValue;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.PreferenceBooleanInputRenderer = PreferenceBooleanInputRenderer;
|
|
55
|
+
exports.PreferenceBooleanInputRenderer = PreferenceBooleanInputRenderer = tslib_1.__decorate([
|
|
56
|
+
(0, inversify_1.injectable)()
|
|
57
|
+
], PreferenceBooleanInputRenderer);
|
|
58
|
+
let PreferenceBooleanInputRendererContribution = PreferenceBooleanInputRendererContribution_1 = class PreferenceBooleanInputRendererContribution extends preference_node_renderer_creator_1.PreferenceLeafNodeRendererContribution {
|
|
59
|
+
constructor() {
|
|
60
|
+
super(...arguments);
|
|
61
|
+
this.id = PreferenceBooleanInputRendererContribution_1.ID;
|
|
62
|
+
}
|
|
63
|
+
canHandleLeafNode(node) {
|
|
64
|
+
return preference_types_1.Preference.LeafNode.getType(node) === 'boolean' ? 2 : 0;
|
|
65
|
+
}
|
|
66
|
+
createLeafNodeRenderer(container) {
|
|
67
|
+
return container.get(PreferenceBooleanInputRenderer);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.PreferenceBooleanInputRendererContribution = PreferenceBooleanInputRendererContribution;
|
|
71
|
+
PreferenceBooleanInputRendererContribution.ID = 'preference-boolean-input-renderer';
|
|
72
|
+
exports.PreferenceBooleanInputRendererContribution = PreferenceBooleanInputRendererContribution = PreferenceBooleanInputRendererContribution_1 = tslib_1.__decorate([
|
|
73
|
+
(0, inversify_1.injectable)()
|
|
74
|
+
], PreferenceBooleanInputRendererContribution);
|
|
75
|
+
//# sourceMappingURL=preference-boolean-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-boolean-input.js","sourceRoot":"","sources":["../../../../src/browser/views/components/preference-boolean-input.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;AAEhF,4DAAsE;AACtE,kEAAyD;AACzD,yEAAgG;AAChG,yFAA4F;AAGrF,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,qDAAqD;IAC3F,kBAAkB,CAAC,MAAmB;QAC5C,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,YAAY,CAAC,IAAI,GAAG,UAAU,CAAC;QAC/B,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC1C,YAAY,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvD,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IACrC,CAAC;IAEkB,2BAA2B;QAC1C,OAAO,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC;IAES,gBAAgB;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAES,qBAAqB;QAC3B,OAAO,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC;IAES,mBAAmB;QACzB,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,YAAY,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YAC5E,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,QAAQ,CAAC;QACzC,CAAC;IACL,CAAC;CACJ,CAAA;AAhCY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAgC1C;AAGM,IAAM,0CAA0C,kDAAhD,MAAM,0CAA2C,SAAQ,yEAAsC;IAA/F;;QAEH,OAAE,GAAG,4CAA0C,CAAC,EAAE,CAAC;IASvD,CAAC;IAPG,iBAAiB,CAAC,IAAyB;QACvC,OAAO,6BAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,sBAAsB,CAAC,SAA+B;QAClD,OAAO,SAAS,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IACzD,CAAC;;AAVQ,gGAA0C;AAC5C,6CAAE,GAAG,mCAAmC,AAAtC,CAAuC;qDADvC,0CAA0C;IADtD,IAAA,sBAAU,GAAE;GACA,0CAA0C,CAWtD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
2
|
+
import { OpenFileDialogProps } from '@theia/filesystem/lib/browser';
|
|
3
|
+
import { FileDialogService } from '@theia/filesystem/lib/browser/file-dialog/file-dialog-service';
|
|
4
|
+
import { Preference } from '../../util/preference-types';
|
|
5
|
+
import { PreferenceNodeRenderer } from './preference-node-renderer';
|
|
6
|
+
import { PreferenceLeafNodeRendererContribution } from './preference-node-renderer-creator';
|
|
7
|
+
import { PreferenceStringInputRenderer } from './preference-string-input';
|
|
8
|
+
export interface FileNodeTypeDetails {
|
|
9
|
+
isFilepath: true;
|
|
10
|
+
selectionProps?: Partial<OpenFileDialogProps>;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace FileNodeTypeDetails {
|
|
13
|
+
function is(typeDetails: unknown): typeDetails is FileNodeTypeDetails;
|
|
14
|
+
}
|
|
15
|
+
export declare class PreferenceSingleFilePathInputRendererContribution extends PreferenceLeafNodeRendererContribution {
|
|
16
|
+
static ID: string;
|
|
17
|
+
id: string;
|
|
18
|
+
canHandleLeafNode(node: Preference.LeafNode): number;
|
|
19
|
+
createLeafNodeRenderer(container: interfaces.Container): PreferenceNodeRenderer;
|
|
20
|
+
}
|
|
21
|
+
export declare class PreferenceSingleFilePathInputRenderer extends PreferenceStringInputRenderer {
|
|
22
|
+
fileDialogService: FileDialogService;
|
|
23
|
+
get typeDetails(): FileNodeTypeDetails;
|
|
24
|
+
protected createInputWrapper(): HTMLElement;
|
|
25
|
+
protected createInteractable(parent: HTMLElement): void;
|
|
26
|
+
protected createBrowseButton(parent: HTMLElement): void;
|
|
27
|
+
protected browse(): Promise<void>;
|
|
28
|
+
protected setPreferenceImmediately(value: string): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=preference-file-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-file-input.d.ts","sourceRoot":"","sources":["../../../../src/browser/views/components/preference-file-input.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAsB,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAC;AAElG,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,IAAI,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjD;AAED,yBAAiB,mBAAmB,CAAC;IACjC,SAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW,IAAI,mBAAmB,CAE3E;CACJ;AAED,qBACa,iDAAkD,SAAQ,sCAAsC;IACzG,MAAM,CAAC,EAAE,SAAgD;IACzD,EAAE,SAAwD;IAE1D,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,GAAG,MAAM;IAKpD,sBAAsB,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,GAAG,sBAAsB;CAGlF;AAED,qBACa,qCAAsC,SAAQ,6BAA6B;IACzD,iBAAiB,EAAE,iBAAiB,CAAC;IAEhE,IAAI,WAAW,IAAI,mBAAmB,CAErC;IAED,SAAS,CAAC,kBAAkB,IAAI,WAAW;cAMxB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAWhE,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;cAYvC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;cASpB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI5E"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 EclipseSource 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 PreferenceSingleFilePathInputRendererContribution_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.PreferenceSingleFilePathInputRenderer = exports.PreferenceSingleFilePathInputRendererContribution = exports.FileNodeTypeDetails = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const common_1 = require("@theia/core/lib/common");
|
|
22
|
+
const nls_1 = require("@theia/core/lib/common/nls");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
const file_dialog_service_1 = require("@theia/filesystem/lib/browser/file-dialog/file-dialog-service");
|
|
25
|
+
const browser_1 = require("@theia/workspace/lib/browser");
|
|
26
|
+
const preference_node_renderer_creator_1 = require("./preference-node-renderer-creator");
|
|
27
|
+
const preference_string_input_1 = require("./preference-string-input");
|
|
28
|
+
var FileNodeTypeDetails;
|
|
29
|
+
(function (FileNodeTypeDetails) {
|
|
30
|
+
function is(typeDetails) {
|
|
31
|
+
return (0, common_1.isObject)(typeDetails) && !!typeDetails.isFilepath;
|
|
32
|
+
}
|
|
33
|
+
FileNodeTypeDetails.is = is;
|
|
34
|
+
})(FileNodeTypeDetails || (exports.FileNodeTypeDetails = FileNodeTypeDetails = {}));
|
|
35
|
+
let PreferenceSingleFilePathInputRendererContribution = PreferenceSingleFilePathInputRendererContribution_1 = class PreferenceSingleFilePathInputRendererContribution extends preference_node_renderer_creator_1.PreferenceLeafNodeRendererContribution {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.id = PreferenceSingleFilePathInputRendererContribution_1.ID;
|
|
39
|
+
}
|
|
40
|
+
canHandleLeafNode(node) {
|
|
41
|
+
var _a;
|
|
42
|
+
const typeDetails = node.preference.data.typeDetails;
|
|
43
|
+
return FileNodeTypeDetails.is(typeDetails) && !((_a = typeDetails.selectionProps) === null || _a === void 0 ? void 0 : _a.canSelectMany) ? 5 : 0;
|
|
44
|
+
}
|
|
45
|
+
createLeafNodeRenderer(container) {
|
|
46
|
+
return container.get(PreferenceSingleFilePathInputRenderer);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.PreferenceSingleFilePathInputRendererContribution = PreferenceSingleFilePathInputRendererContribution;
|
|
50
|
+
PreferenceSingleFilePathInputRendererContribution.ID = 'preference-single-file-path-input-renderer';
|
|
51
|
+
exports.PreferenceSingleFilePathInputRendererContribution = PreferenceSingleFilePathInputRendererContribution = PreferenceSingleFilePathInputRendererContribution_1 = tslib_1.__decorate([
|
|
52
|
+
(0, inversify_1.injectable)()
|
|
53
|
+
], PreferenceSingleFilePathInputRendererContribution);
|
|
54
|
+
let PreferenceSingleFilePathInputRenderer = class PreferenceSingleFilePathInputRenderer extends preference_string_input_1.PreferenceStringInputRenderer {
|
|
55
|
+
get typeDetails() {
|
|
56
|
+
return this.preferenceNode.preference.data.typeDetails;
|
|
57
|
+
}
|
|
58
|
+
createInputWrapper() {
|
|
59
|
+
const inputWrapper = document.createElement('div');
|
|
60
|
+
inputWrapper.classList.add('preference-file-container');
|
|
61
|
+
return inputWrapper;
|
|
62
|
+
}
|
|
63
|
+
createInteractable(parent) {
|
|
64
|
+
const inputWrapper = this.createInputWrapper();
|
|
65
|
+
super.createInteractable(inputWrapper);
|
|
66
|
+
this.interactable.classList.add('preference-file-input');
|
|
67
|
+
this.createBrowseButton(inputWrapper);
|
|
68
|
+
parent.appendChild(inputWrapper);
|
|
69
|
+
}
|
|
70
|
+
createBrowseButton(parent) {
|
|
71
|
+
const button = document.createElement('button');
|
|
72
|
+
button.classList.add('theia-button', 'main', 'preference-file-button');
|
|
73
|
+
button.textContent = nls_1.nls.localize('theia/core/file/browse', 'Browse');
|
|
74
|
+
const handler = this.browse.bind(this);
|
|
75
|
+
button.onclick = handler;
|
|
76
|
+
button.onkeydown = handler;
|
|
77
|
+
button.tabIndex = 0;
|
|
78
|
+
button.setAttribute('aria-label', 'Submit Preference Input');
|
|
79
|
+
parent.appendChild(button);
|
|
80
|
+
}
|
|
81
|
+
async browse() {
|
|
82
|
+
var _a;
|
|
83
|
+
const selectionProps = this.typeDetails.selectionProps;
|
|
84
|
+
const title = ((_a = selectionProps === null || selectionProps === void 0 ? void 0 : selectionProps.title) !== null && _a !== void 0 ? _a : selectionProps === null || selectionProps === void 0 ? void 0 : selectionProps.canSelectFolders) ? browser_1.WorkspaceCommands.OPEN_FOLDER.dialogLabel : browser_1.WorkspaceCommands.OPEN_FILE.dialogLabel;
|
|
85
|
+
const selection = await this.fileDialogService.showOpenDialog({ title, ...selectionProps });
|
|
86
|
+
if (selection) {
|
|
87
|
+
this.setPreferenceImmediately(selection.path.fsPath());
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
setPreferenceImmediately(value) {
|
|
91
|
+
this.interactable.value = value;
|
|
92
|
+
return super.setPreferenceImmediately(value);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.PreferenceSingleFilePathInputRenderer = PreferenceSingleFilePathInputRenderer;
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, inversify_1.inject)(file_dialog_service_1.FileDialogService),
|
|
98
|
+
tslib_1.__metadata("design:type", Object)
|
|
99
|
+
], PreferenceSingleFilePathInputRenderer.prototype, "fileDialogService", void 0);
|
|
100
|
+
exports.PreferenceSingleFilePathInputRenderer = PreferenceSingleFilePathInputRenderer = tslib_1.__decorate([
|
|
101
|
+
(0, inversify_1.injectable)()
|
|
102
|
+
], PreferenceSingleFilePathInputRenderer);
|
|
103
|
+
//# sourceMappingURL=preference-file-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-file-input.js","sourceRoot":"","sources":["../../../../src/browser/views/components/preference-file-input.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;AAEhF,mDAAkD;AAClD,oDAAiD;AACjD,4DAA8E;AAE9E,uGAAkG;AAClG,0DAAiE;AAGjE,yFAA4F;AAC5F,uEAA0E;AAO1E,IAAiB,mBAAmB,CAInC;AAJD,WAAiB,mBAAmB;IAChC,SAAgB,EAAE,CAAC,WAAoB;QACnC,OAAO,IAAA,iBAAQ,EAAsB,WAAW,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;IAClF,CAAC;IAFe,sBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,mBAAmB,mCAAnB,mBAAmB,QAInC;AAGM,IAAM,iDAAiD,yDAAvD,MAAM,iDAAkD,SAAQ,yEAAsC;IAAtG;;QAEH,OAAE,GAAG,mDAAiD,CAAC,EAAE,CAAC;IAU9D,CAAC;IARG,iBAAiB,CAAC,IAAyB;;QACvC,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;QACrD,OAAO,mBAAmB,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA,MAAA,WAAW,CAAC,cAAc,0CAAE,aAAa,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC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
|
2
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
3
|
+
import { CommandService } from '@theia/core/lib/common';
|
|
4
|
+
import { Preference } from '../../util/preference-types';
|
|
5
|
+
import { JSONValue } from '@theia/core/shared/@lumino/coreutils';
|
|
6
|
+
import { PreferenceLeafNodeRendererContribution } from './preference-node-renderer-creator';
|
|
7
|
+
export declare class PreferenceJSONLinkRenderer extends PreferenceLeafNodeRenderer<JSONValue, HTMLAnchorElement> {
|
|
8
|
+
protected readonly commandService: CommandService;
|
|
9
|
+
protected createInteractable(parent: HTMLElement): void;
|
|
10
|
+
protected getFallbackValue(): JSONValue;
|
|
11
|
+
protected doHandleValueChange(): void;
|
|
12
|
+
protected handleUserInteraction(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class PreferenceJSONLinkRendererContribution extends PreferenceLeafNodeRendererContribution {
|
|
15
|
+
static ID: string;
|
|
16
|
+
id: string;
|
|
17
|
+
canHandleLeafNode(_node: Preference.LeafNode): number;
|
|
18
|
+
createLeafNodeRenderer(container: interfaces.Container): PreferenceNodeRenderer;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=preference-json-input.d.ts.map
|