@theia/toolbar 1.45.1 → 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 (53) hide show
  1. package/README.md +32 -32
  2. package/lib/browser/abstract-toolbar-contribution.d.ts +16 -16
  3. package/lib/browser/abstract-toolbar-contribution.js +68 -68
  4. package/lib/browser/application-shell-with-toolbar-override.d.ts +15 -15
  5. package/lib/browser/application-shell-with-toolbar-override.js +101 -101
  6. package/lib/browser/codicons.d.ts +1 -1
  7. package/lib/browser/codicons.js +20 -20
  8. package/lib/browser/font-awesome-icons.d.ts +1 -1
  9. package/lib/browser/font-awesome-icons.js +20 -20
  10. package/lib/browser/package.spec.js +18 -18
  11. package/lib/browser/toolbar-command-contribution.d.ts +25 -25
  12. package/lib/browser/toolbar-command-contribution.js +211 -211
  13. package/lib/browser/toolbar-command-quick-input-service.d.ts +19 -19
  14. package/lib/browser/toolbar-command-quick-input-service.js +112 -112
  15. package/lib/browser/toolbar-constants.d.ts +23 -23
  16. package/lib/browser/toolbar-constants.js +75 -75
  17. package/lib/browser/toolbar-controller.d.ts +34 -34
  18. package/lib/browser/toolbar-controller.js +186 -186
  19. package/lib/browser/toolbar-defaults.d.ts +3 -3
  20. package/lib/browser/toolbar-defaults.js +60 -60
  21. package/lib/browser/toolbar-frontend-module.d.ts +4 -4
  22. package/lib/browser/toolbar-frontend-module.js +25 -25
  23. package/lib/browser/toolbar-icon-selector-dialog.d.ts +65 -65
  24. package/lib/browser/toolbar-icon-selector-dialog.js +235 -235
  25. package/lib/browser/toolbar-interfaces.d.ts +45 -45
  26. package/lib/browser/toolbar-interfaces.js +42 -42
  27. package/lib/browser/toolbar-preference-contribution.d.ts +9 -9
  28. package/lib/browser/toolbar-preference-contribution.js +34 -34
  29. package/lib/browser/toolbar-preference-schema.d.ts +5 -5
  30. package/lib/browser/toolbar-preference-schema.js +73 -73
  31. package/lib/browser/toolbar-storage-provider.d.ts +47 -47
  32. package/lib/browser/toolbar-storage-provider.js +357 -357
  33. package/lib/browser/toolbar.d.ts +56 -56
  34. package/lib/browser/toolbar.js +380 -380
  35. package/package.json +11 -11
  36. package/src/browser/abstract-toolbar-contribution.tsx +53 -53
  37. package/src/browser/application-shell-with-toolbar-override.ts +98 -98
  38. package/src/browser/codicons.ts +18 -18
  39. package/src/browser/font-awesome-icons.ts +18 -18
  40. package/src/browser/package.spec.ts +19 -19
  41. package/src/browser/style/toolbar.css +255 -255
  42. package/src/browser/toolbar-command-contribution.ts +211 -211
  43. package/src/browser/toolbar-command-quick-input-service.ts +86 -86
  44. package/src/browser/toolbar-constants.ts +79 -79
  45. package/src/browser/toolbar-controller.ts +185 -185
  46. package/src/browser/toolbar-defaults.ts +58 -58
  47. package/src/browser/toolbar-frontend-module.ts +30 -30
  48. package/src/browser/toolbar-icon-selector-dialog.tsx +296 -296
  49. package/src/browser/toolbar-interfaces.ts +76 -76
  50. package/src/browser/toolbar-preference-contribution.ts +38 -38
  51. package/src/browser/toolbar-preference-schema.ts +75 -75
  52. package/src/browser/toolbar-storage-provider.ts +352 -352
  53. package/src/browser/toolbar.tsx +424 -424
@@ -1,76 +1,76 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2022 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { interfaces } from '@theia/core/shared/inversify';
18
- import { ReactTabBarToolbarItem, TabBarToolbar, TabBarToolbarItem } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
19
-
20
- export enum ToolbarAlignment {
21
- LEFT = 'left',
22
- CENTER = 'center',
23
- RIGHT = 'right'
24
- }
25
-
26
- export interface ToolbarTreeSchema {
27
- items: {
28
- [key in ToolbarAlignment]: ToolbarItem[][];
29
- };
30
- }
31
-
32
- export interface DeflatedToolbarTree {
33
- items: {
34
- [key in ToolbarAlignment]: ToolbarItemDeflated[][];
35
- };
36
- }
37
- export namespace ToolbarAlignmentString {
38
- export const is = (obj: unknown): obj is ToolbarAlignment => obj === ToolbarAlignment.LEFT
39
- || obj === ToolbarAlignment.CENTER
40
- || obj === ToolbarAlignment.RIGHT;
41
- }
42
-
43
- export interface ToolbarContributionProperties {
44
- toJSON(): DeflatedContributedToolbarItem;
45
- }
46
-
47
- export type ToolbarContribution = ReactTabBarToolbarItem & ToolbarContributionProperties;
48
-
49
- export const ToolbarContribution = Symbol('ToolbarContribution');
50
-
51
- export const Toolbar = Symbol('Toolbar');
52
- export const ToolbarFactory = Symbol('ToolbarFactory');
53
- export type Toolbar = TabBarToolbar;
54
-
55
- export type ToolbarItem = ToolbarContribution | TabBarToolbarItem;
56
- export interface DeflatedContributedToolbarItem { id: string; group: 'contributed' };
57
- export type ToolbarItemDeflated = DeflatedContributedToolbarItem | TabBarToolbarItem;
58
-
59
- export const LateInjector = Symbol('LateInjector');
60
-
61
- export const lateInjector = <T>(
62
- context: interfaces.Container,
63
- serviceIdentifier: interfaces.ServiceIdentifier<T>,
64
- ): T => context.get<T>(serviceIdentifier);
65
-
66
- export interface ToolbarItemPosition {
67
- alignment: ToolbarAlignment;
68
- groupIndex: number;
69
- itemIndex: number;
70
- }
71
-
72
- export enum IconSet {
73
- FA = 'fa',
74
- CODICON = 'codicon'
75
- }
76
-
1
+ // *****************************************************************************
2
+ // Copyright (C) 2022 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { interfaces } from '@theia/core/shared/inversify';
18
+ import { ReactTabBarToolbarItem, TabBarToolbar, TabBarToolbarItem } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
19
+
20
+ export enum ToolbarAlignment {
21
+ LEFT = 'left',
22
+ CENTER = 'center',
23
+ RIGHT = 'right'
24
+ }
25
+
26
+ export interface ToolbarTreeSchema {
27
+ items: {
28
+ [key in ToolbarAlignment]: ToolbarItem[][];
29
+ };
30
+ }
31
+
32
+ export interface DeflatedToolbarTree {
33
+ items: {
34
+ [key in ToolbarAlignment]: ToolbarItemDeflated[][];
35
+ };
36
+ }
37
+ export namespace ToolbarAlignmentString {
38
+ export const is = (obj: unknown): obj is ToolbarAlignment => obj === ToolbarAlignment.LEFT
39
+ || obj === ToolbarAlignment.CENTER
40
+ || obj === ToolbarAlignment.RIGHT;
41
+ }
42
+
43
+ export interface ToolbarContributionProperties {
44
+ toJSON(): DeflatedContributedToolbarItem;
45
+ }
46
+
47
+ export type ToolbarContribution = ReactTabBarToolbarItem & ToolbarContributionProperties;
48
+
49
+ export const ToolbarContribution = Symbol('ToolbarContribution');
50
+
51
+ export const Toolbar = Symbol('Toolbar');
52
+ export const ToolbarFactory = Symbol('ToolbarFactory');
53
+ export type Toolbar = TabBarToolbar;
54
+
55
+ export type ToolbarItem = ToolbarContribution | TabBarToolbarItem;
56
+ export interface DeflatedContributedToolbarItem { id: string; group: 'contributed' };
57
+ export type ToolbarItemDeflated = DeflatedContributedToolbarItem | TabBarToolbarItem;
58
+
59
+ export const LateInjector = Symbol('LateInjector');
60
+
61
+ export const lateInjector = <T>(
62
+ context: interfaces.Container,
63
+ serviceIdentifier: interfaces.ServiceIdentifier<T>,
64
+ ): T => context.get<T>(serviceIdentifier);
65
+
66
+ export interface ToolbarItemPosition {
67
+ alignment: ToolbarAlignment;
68
+ groupIndex: number;
69
+ itemIndex: number;
70
+ }
71
+
72
+ export enum IconSet {
73
+ FA = 'fa',
74
+ CODICON = 'codicon'
75
+ }
76
+
@@ -1,38 +1,38 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2022 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { PreferenceSchema, PreferenceProxy, PreferenceScope } from '@theia/core/lib/browser';
18
-
19
- export const TOOLBAR_ENABLE_PREFERENCE_ID = 'toolbar.showToolbar';
20
-
21
- export const ToolbarPreferencesSchema: PreferenceSchema = {
22
- type: 'object',
23
- properties: {
24
- [TOOLBAR_ENABLE_PREFERENCE_ID]: {
25
- 'type': 'boolean',
26
- 'description': 'Show toolbar',
27
- 'default': false,
28
- 'scope': PreferenceScope.Workspace,
29
- },
30
- },
31
- };
32
-
33
- class ToolbarPreferencesContribution {
34
- [TOOLBAR_ENABLE_PREFERENCE_ID]: boolean;
35
- }
36
-
37
- export const ToolbarPreferences = Symbol('ToolbarPreferences');
38
- export type ToolbarPreferences = PreferenceProxy<ToolbarPreferencesContribution>;
1
+ // *****************************************************************************
2
+ // Copyright (C) 2022 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { PreferenceSchema, PreferenceProxy, PreferenceScope } from '@theia/core/lib/browser';
18
+
19
+ export const TOOLBAR_ENABLE_PREFERENCE_ID = 'toolbar.showToolbar';
20
+
21
+ export const ToolbarPreferencesSchema: PreferenceSchema = {
22
+ type: 'object',
23
+ properties: {
24
+ [TOOLBAR_ENABLE_PREFERENCE_ID]: {
25
+ 'type': 'boolean',
26
+ 'description': 'Show toolbar',
27
+ 'default': false,
28
+ 'scope': PreferenceScope.Workspace,
29
+ },
30
+ },
31
+ };
32
+
33
+ class ToolbarPreferencesContribution {
34
+ [TOOLBAR_ENABLE_PREFERENCE_ID]: boolean;
35
+ }
36
+
37
+ export const ToolbarPreferences = Symbol('ToolbarPreferences');
38
+ export type ToolbarPreferences = PreferenceProxy<ToolbarPreferencesContribution>;
@@ -1,75 +1,75 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2022 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { IJSONSchema } from '@theia/core/lib/common/json-schema';
18
- import * as Ajv from '@theia/core/shared/ajv';
19
- import { DeflatedToolbarTree } from './toolbar-interfaces';
20
-
21
- const toolbarColumnGroup: IJSONSchema = {
22
- 'type': 'array',
23
- 'description': 'Array of subgroups for right toolbar column',
24
- 'items': {
25
- 'type': 'array',
26
- 'description': 'Grouping',
27
- 'items': {
28
- 'type': 'object',
29
- 'properties': {
30
- 'id': { 'type': 'string' },
31
- 'command': { 'type': 'string' },
32
- 'icon': { 'type': 'string' },
33
- 'tooltip': { 'type': 'string' },
34
- 'group': { 'enum': ['contributed'] },
35
- 'when': { 'type': 'string' },
36
- },
37
- 'required': [
38
- 'id',
39
- ],
40
- 'additionalProperties': false,
41
- }
42
- }
43
- };
44
-
45
- export const toolbarSchemaId = 'vscode://schemas/toolbar';
46
- export const toolbarConfigurationSchema: IJSONSchema = {
47
- // '$schema': 'https://json-schema.org/draft/2019-09/schema',
48
- '$id': 'vscode://schemas/indexing-grid',
49
- 'type': 'object',
50
- 'title': 'Toolbar',
51
- 'properties': {
52
- 'items': {
53
- 'type': 'object',
54
- 'properties': {
55
- 'left': toolbarColumnGroup,
56
- 'center': toolbarColumnGroup,
57
- 'right': toolbarColumnGroup,
58
- },
59
- 'required': [
60
- 'left',
61
- 'center',
62
- 'right'
63
- ],
64
- 'additionalProperties': false,
65
- }
66
- },
67
- 'required': [
68
- 'items'
69
- ]
70
- };
71
-
72
- const validator = new Ajv().compile(toolbarConfigurationSchema);
73
- export function isToolbarPreferences(candidate: unknown): candidate is DeflatedToolbarTree {
74
- return Boolean(validator(candidate));
75
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2022 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { IJSONSchema } from '@theia/core/lib/common/json-schema';
18
+ import * as Ajv from '@theia/core/shared/ajv';
19
+ import { DeflatedToolbarTree } from './toolbar-interfaces';
20
+
21
+ const toolbarColumnGroup: IJSONSchema = {
22
+ 'type': 'array',
23
+ 'description': 'Array of subgroups for right toolbar column',
24
+ 'items': {
25
+ 'type': 'array',
26
+ 'description': 'Grouping',
27
+ 'items': {
28
+ 'type': 'object',
29
+ 'properties': {
30
+ 'id': { 'type': 'string' },
31
+ 'command': { 'type': 'string' },
32
+ 'icon': { 'type': 'string' },
33
+ 'tooltip': { 'type': 'string' },
34
+ 'group': { 'enum': ['contributed'] },
35
+ 'when': { 'type': 'string' },
36
+ },
37
+ 'required': [
38
+ 'id',
39
+ ],
40
+ 'additionalProperties': false,
41
+ }
42
+ }
43
+ };
44
+
45
+ export const toolbarSchemaId = 'vscode://schemas/toolbar';
46
+ export const toolbarConfigurationSchema: IJSONSchema = {
47
+ // '$schema': 'https://json-schema.org/draft/2019-09/schema',
48
+ '$id': 'vscode://schemas/indexing-grid',
49
+ 'type': 'object',
50
+ 'title': 'Toolbar',
51
+ 'properties': {
52
+ 'items': {
53
+ 'type': 'object',
54
+ 'properties': {
55
+ 'left': toolbarColumnGroup,
56
+ 'center': toolbarColumnGroup,
57
+ 'right': toolbarColumnGroup,
58
+ },
59
+ 'required': [
60
+ 'left',
61
+ 'center',
62
+ 'right'
63
+ ],
64
+ 'additionalProperties': false,
65
+ }
66
+ },
67
+ 'required': [
68
+ 'items'
69
+ ]
70
+ };
71
+
72
+ const validator = new Ajv().compile(toolbarConfigurationSchema);
73
+ export function isToolbarPreferences(candidate: unknown): candidate is DeflatedToolbarTree {
74
+ return Boolean(validator(candidate));
75
+ }