@opensumi/ide-theme 2.21.13 → 2.22.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.
Files changed (117) hide show
  1. package/lib/browser/icon-theme-data.js.map +1 -1
  2. package/lib/browser/icon-theme-store.js.map +1 -1
  3. package/lib/browser/icon.service.d.ts +3 -1
  4. package/lib/browser/icon.service.d.ts.map +1 -1
  5. package/lib/browser/icon.service.js +56 -24
  6. package/lib/browser/icon.service.js.map +1 -1
  7. package/lib/browser/index.js.map +1 -1
  8. package/lib/browser/semantic-tokens-registry.js.map +1 -1
  9. package/lib/browser/style.service.js.map +1 -1
  10. package/lib/browser/theme-data.js +7 -7
  11. package/lib/browser/theme-data.js.map +1 -1
  12. package/lib/browser/theme-store.js.map +1 -1
  13. package/lib/browser/theme.contribution.js +3 -3
  14. package/lib/browser/theme.contribution.js.map +1 -1
  15. package/lib/browser/workbench.theme.service.js +2 -2
  16. package/lib/browser/workbench.theme.service.js.map +1 -1
  17. package/lib/common/color-tokens/basic-color.d.ts +1 -1
  18. package/lib/common/color-tokens/basic-color.d.ts.map +1 -1
  19. package/lib/common/color-tokens/editor.d.ts +13 -0
  20. package/lib/common/color-tokens/editor.d.ts.map +1 -1
  21. package/lib/common/color-tokens/editor.js +35 -1
  22. package/lib/common/color-tokens/editor.js.map +1 -1
  23. package/lib/common/color.js +40 -40
  24. package/lib/common/color.js.map +1 -1
  25. package/lib/common/mocks/theme.service.js.map +1 -1
  26. package/lib/common/plistParser.js +40 -40
  27. package/lib/common/plistParser.js.map +1 -1
  28. package/lib/common/semantic-tokens-registry.d.ts +7 -7
  29. package/lib/common/semantic-tokens-registry.d.ts.map +1 -1
  30. package/lib/common/theme.service.d.ts +26 -6
  31. package/lib/common/theme.service.d.ts.map +1 -1
  32. package/lib/common/theme.service.js.map +1 -1
  33. package/package.json +11 -10
  34. package/src/browser/default-theme.ts +547 -0
  35. package/src/browser/icon-theme-data.ts +294 -0
  36. package/src/browser/icon-theme-store.ts +38 -0
  37. package/src/browser/icon.less +15 -0
  38. package/src/browser/icon.service.ts +457 -0
  39. package/src/browser/index.ts +45 -0
  40. package/src/browser/semantic-tokens-registry.ts +217 -0
  41. package/src/browser/style.service.ts +51 -0
  42. package/src/browser/theme-data.ts +719 -0
  43. package/src/browser/theme-store.ts +95 -0
  44. package/src/browser/theme.contribution.ts +343 -0
  45. package/src/browser/workbench.theme.service.ts +703 -0
  46. package/src/common/color-registry.ts +52 -0
  47. package/src/common/color-tokens/activity-bar.ts +122 -0
  48. package/src/common/color-tokens/badge.ts +31 -0
  49. package/src/common/color-tokens/base.ts +90 -0
  50. package/src/common/color-tokens/basic-color.ts +9 -0
  51. package/src/common/color-tokens/breadcrumb.ts +60 -0
  52. package/src/common/color-tokens/button.ts +69 -0
  53. package/src/common/color-tokens/charts.ts +68 -0
  54. package/src/common/color-tokens/checkbox.ts +23 -0
  55. package/src/common/color-tokens/custom/actionbar.ts +51 -0
  56. package/src/common/color-tokens/custom/activity-bar.ts +16 -0
  57. package/src/common/color-tokens/custom/badge.ts +30 -0
  58. package/src/common/color-tokens/custom/base.ts +111 -0
  59. package/src/common/color-tokens/custom/button.ts +359 -0
  60. package/src/common/color-tokens/custom/checkbox.ts +36 -0
  61. package/src/common/color-tokens/custom/decoration.ts +71 -0
  62. package/src/common/color-tokens/custom/editor.ts +27 -0
  63. package/src/common/color-tokens/custom/extension.ts +9 -0
  64. package/src/common/color-tokens/custom/icon.ts +30 -0
  65. package/src/common/color-tokens/custom/index.ts +26 -0
  66. package/src/common/color-tokens/custom/input.ts +48 -0
  67. package/src/common/color-tokens/custom/menu.ts +61 -0
  68. package/src/common/color-tokens/custom/modal.ts +57 -0
  69. package/src/common/color-tokens/custom/notification.ts +16 -0
  70. package/src/common/color-tokens/custom/panel.ts +112 -0
  71. package/src/common/color-tokens/custom/popover.ts +28 -0
  72. package/src/common/color-tokens/custom/select.ts +155 -0
  73. package/src/common/color-tokens/custom/settings.ts +32 -0
  74. package/src/common/color-tokens/custom/statusbar.ts +16 -0
  75. package/src/common/color-tokens/custom/tab.ts +31 -0
  76. package/src/common/color-tokens/custom/tooltip.ts +55 -0
  77. package/src/common/color-tokens/custom/tree.ts +106 -0
  78. package/src/common/color-tokens/debug.ts +103 -0
  79. package/src/common/color-tokens/debugToolbar.ts +134 -0
  80. package/src/common/color-tokens/dropdown.ts +27 -0
  81. package/src/common/color-tokens/editor.ts +945 -0
  82. package/src/common/color-tokens/index.ts +35 -0
  83. package/src/common/color-tokens/input.ts +105 -0
  84. package/src/common/color-tokens/list-tree.ts +205 -0
  85. package/src/common/color-tokens/menu-bar.ts +43 -0
  86. package/src/common/color-tokens/menu.ts +53 -0
  87. package/src/common/color-tokens/merge-conflict.ts +145 -0
  88. package/src/common/color-tokens/minimap.ts +99 -0
  89. package/src/common/color-tokens/notification.ts +169 -0
  90. package/src/common/color-tokens/panel.ts +177 -0
  91. package/src/common/color-tokens/pick-view.ts +96 -0
  92. package/src/common/color-tokens/picker.ts +15 -0
  93. package/src/common/color-tokens/progress-bar.ts +12 -0
  94. package/src/common/color-tokens/quick-input.ts +57 -0
  95. package/src/common/color-tokens/scrollbar.ts +42 -0
  96. package/src/common/color-tokens/settings.ts +126 -0
  97. package/src/common/color-tokens/sidebar.ts +121 -0
  98. package/src/common/color-tokens/snippet.ts +33 -0
  99. package/src/common/color-tokens/status-bar.ts +350 -0
  100. package/src/common/color-tokens/tab.ts +346 -0
  101. package/src/common/color-tokens/testing.ts +105 -0
  102. package/src/common/color-tokens/text.ts +41 -0
  103. package/src/common/color-tokens/title-bar.ts +62 -0
  104. package/src/common/color-tokens/toolbar.ts +28 -0
  105. package/src/common/color-tokens/welcome-page.ts +27 -0
  106. package/src/common/color.ts +647 -0
  107. package/src/common/default-themes.ts +273 -0
  108. package/src/common/event.ts +9 -0
  109. package/src/common/index.ts +8 -0
  110. package/src/common/mocks/theme.service.ts +55 -0
  111. package/src/common/plistParser.ts +525 -0
  112. package/src/common/semantic-tokens-registry.ts +439 -0
  113. package/src/common/style.ts +9 -0
  114. package/src/common/theme.service.ts +363 -0
  115. package/src/common/themeCompatibility.ts +95 -0
  116. package/src/common/utils.ts +195 -0
  117. package/src/index.ts +1 -0
@@ -0,0 +1,273 @@
1
+ /* ---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ // Some code copied and modified from https://github.com/microsoft/vscode/blob/1.44.0/src/vs/editor/standalone/common/themes.ts
6
+
7
+ import {
8
+ editorActiveIndentGuides,
9
+ editorIndentGuides,
10
+ editorBackground,
11
+ editorForeground,
12
+ editorInactiveSelection,
13
+ editorSelectionHighlight,
14
+ } from './color-registry';
15
+ import { IStandaloneThemeData } from './theme.service';
16
+ // tslint:disable:variable-name
17
+ /* -------------------------------- Begin vs theme -------------------------------- */
18
+ export const vs: IStandaloneThemeData = {
19
+ base: 'vs',
20
+ inherit: false,
21
+ rules: [
22
+ { token: '', foreground: '000000', background: 'fffffe' },
23
+ { token: 'invalid', foreground: 'cd3131' },
24
+ { token: 'emphasis', fontStyle: 'italic' },
25
+ { token: 'strong', fontStyle: 'bold' },
26
+
27
+ { token: 'variable', foreground: '001188' },
28
+ { token: 'variable.predefined', foreground: '4864AA' },
29
+ { token: 'constant', foreground: 'dd0000' },
30
+ { token: 'comment', foreground: '008000' },
31
+ { token: 'number', foreground: '09885A' },
32
+ { token: 'number.hex', foreground: '3030c0' },
33
+ { token: 'regexp', foreground: '800000' },
34
+ { token: 'annotation', foreground: '808080' },
35
+ { token: 'type', foreground: '008080' },
36
+
37
+ { token: 'delimiter', foreground: '000000' },
38
+ { token: 'delimiter.html', foreground: '383838' },
39
+ { token: 'delimiter.xml', foreground: '0000FF' },
40
+
41
+ { token: 'tag', foreground: '800000' },
42
+ { token: 'tag.id.pug', foreground: '4F76AC' },
43
+ { token: 'tag.class.pug', foreground: '4F76AC' },
44
+ { token: 'meta.scss', foreground: '800000' },
45
+ { token: 'metatag', foreground: 'e00000' },
46
+ { token: 'metatag.content.html', foreground: 'FF0000' },
47
+ { token: 'metatag.html', foreground: '808080' },
48
+ { token: 'metatag.xml', foreground: '808080' },
49
+ { token: 'metatag.php', fontStyle: 'bold' },
50
+
51
+ { token: 'key', foreground: '863B00' },
52
+ { token: 'string.key.json', foreground: 'A31515' },
53
+ { token: 'string.value.json', foreground: '0451A5' },
54
+
55
+ { token: 'attribute.name', foreground: 'FF0000' },
56
+ { token: 'attribute.value', foreground: '0451A5' },
57
+ { token: 'attribute.value.number', foreground: '09885A' },
58
+ { token: 'attribute.value.unit', foreground: '09885A' },
59
+ { token: 'attribute.value.html', foreground: '0000FF' },
60
+ { token: 'attribute.value.xml', foreground: '0000FF' },
61
+
62
+ { token: 'string', foreground: 'A31515' },
63
+ { token: 'string.html', foreground: '0000FF' },
64
+ { token: 'string.sql', foreground: 'FF0000' },
65
+ { token: 'string.yaml', foreground: '0451A5' },
66
+
67
+ { token: 'keyword', foreground: '0000FF' },
68
+ { token: 'keyword.json', foreground: '0451A5' },
69
+ { token: 'keyword.flow', foreground: 'AF00DB' },
70
+ { token: 'keyword.flow.scss', foreground: '0000FF' },
71
+
72
+ { token: 'operator.scss', foreground: '666666' },
73
+ { token: 'operator.sql', foreground: '778899' },
74
+ { token: 'operator.swift', foreground: '666666' },
75
+ { token: 'predefined.sql', foreground: 'FF00FF' },
76
+ ],
77
+ colors: {
78
+ [editorBackground]: '#FFFFFE',
79
+ [editorForeground]: '#000000',
80
+ [editorInactiveSelection]: '#E5EBF1',
81
+ [editorIndentGuides]: '#D3D3D3',
82
+ [editorActiveIndentGuides]: '#939393',
83
+ [editorSelectionHighlight]: '#ADD6FF4D',
84
+ },
85
+ };
86
+ /* -------------------------------- End vs theme -------------------------------- */
87
+
88
+ /* -------------------------------- Begin vs-dark theme -------------------------------- */
89
+ export const vs_dark: IStandaloneThemeData = {
90
+ base: 'vs-dark',
91
+ inherit: false,
92
+ rules: [
93
+ { token: '', foreground: 'D4D4D4', background: '1E1E1E' },
94
+ { token: 'invalid', foreground: 'f44747' },
95
+ { token: 'emphasis', fontStyle: 'italic' },
96
+ { token: 'strong', fontStyle: 'bold' },
97
+
98
+ { token: 'variable', foreground: '74B0DF' },
99
+ { token: 'variable.predefined', foreground: '4864AA' },
100
+ { token: 'variable.parameter', foreground: '9CDCFE' },
101
+ { token: 'constant', foreground: '569CD6' },
102
+ { token: 'comment', foreground: '608B4E' },
103
+ { token: 'number', foreground: 'B5CEA8' },
104
+ { token: 'number.hex', foreground: '5BB498' },
105
+ { token: 'regexp', foreground: 'B46695' },
106
+ { token: 'annotation', foreground: 'cc6666' },
107
+ { token: 'type', foreground: '3DC9B0' },
108
+
109
+ { token: 'delimiter', foreground: 'DCDCDC' },
110
+ { token: 'delimiter.html', foreground: '808080' },
111
+ { token: 'delimiter.xml', foreground: '808080' },
112
+
113
+ { token: 'tag', foreground: '569CD6' },
114
+ { token: 'tag.id.pug', foreground: '4F76AC' },
115
+ { token: 'tag.class.pug', foreground: '4F76AC' },
116
+ { token: 'meta.scss', foreground: 'A79873' },
117
+ { token: 'meta.tag', foreground: 'CE9178' },
118
+ { token: 'metatag', foreground: 'DD6A6F' },
119
+ { token: 'metatag.content.html', foreground: '9CDCFE' },
120
+ { token: 'metatag.html', foreground: '569CD6' },
121
+ { token: 'metatag.xml', foreground: '569CD6' },
122
+ { token: 'metatag.php', fontStyle: 'bold' },
123
+
124
+ { token: 'key', foreground: '9CDCFE' },
125
+ { token: 'string.key.json', foreground: '9CDCFE' },
126
+ { token: 'string.value.json', foreground: 'CE9178' },
127
+
128
+ { token: 'attribute.name', foreground: '9CDCFE' },
129
+ { token: 'attribute.value', foreground: 'CE9178' },
130
+ { token: 'attribute.value.number.css', foreground: 'B5CEA8' },
131
+ { token: 'attribute.value.unit.css', foreground: 'B5CEA8' },
132
+ { token: 'attribute.value.hex.css', foreground: 'D4D4D4' },
133
+
134
+ { token: 'string', foreground: 'CE9178' },
135
+ { token: 'string.sql', foreground: 'FF0000' },
136
+
137
+ { token: 'keyword', foreground: '569CD6' },
138
+ { token: 'keyword.flow', foreground: 'C586C0' },
139
+ { token: 'keyword.json', foreground: 'CE9178' },
140
+ { token: 'keyword.flow.scss', foreground: '569CD6' },
141
+
142
+ { token: 'operator.scss', foreground: '909090' },
143
+ { token: 'operator.sql', foreground: '778899' },
144
+ { token: 'operator.swift', foreground: '909090' },
145
+ { token: 'predefined.sql', foreground: 'FF00FF' },
146
+ ],
147
+ colors: {
148
+ [editorBackground]: '#1E1E1E',
149
+ [editorForeground]: '#D4D4D4',
150
+ [editorInactiveSelection]: '#3A3D41',
151
+ [editorIndentGuides]: '#404040',
152
+ [editorActiveIndentGuides]: '#707070',
153
+ [editorSelectionHighlight]: '#ADD6FF26',
154
+ },
155
+ };
156
+ /* -------------------------------- End vs-dark theme -------------------------------- */
157
+
158
+ /* -------------------------------- Begin hc-black theme -------------------------------- */
159
+ export const hc_black: IStandaloneThemeData = {
160
+ base: 'hc-black',
161
+ inherit: false,
162
+ rules: [
163
+ { token: '', foreground: 'FFFFFF', background: '000000' },
164
+ { token: 'invalid', foreground: 'f44747' },
165
+ { token: 'emphasis', fontStyle: 'italic' },
166
+ { token: 'strong', fontStyle: 'bold' },
167
+
168
+ { token: 'variable', foreground: '1AEBFF' },
169
+ { token: 'variable.parameter', foreground: '9CDCFE' },
170
+ { token: 'constant', foreground: '569CD6' },
171
+ { token: 'comment', foreground: '608B4E' },
172
+ { token: 'number', foreground: 'FFFFFF' },
173
+ { token: 'regexp', foreground: 'C0C0C0' },
174
+ { token: 'annotation', foreground: '569CD6' },
175
+ { token: 'type', foreground: '3DC9B0' },
176
+
177
+ { token: 'delimiter', foreground: 'FFFF00' },
178
+ { token: 'delimiter.html', foreground: 'FFFF00' },
179
+
180
+ { token: 'tag', foreground: '569CD6' },
181
+ { token: 'tag.id.pug', foreground: '4F76AC' },
182
+ { token: 'tag.class.pug', foreground: '4F76AC' },
183
+ { token: 'meta', foreground: 'D4D4D4' },
184
+ { token: 'meta.tag', foreground: 'CE9178' },
185
+ { token: 'metatag', foreground: '569CD6' },
186
+ { token: 'metatag.content.html', foreground: '1AEBFF' },
187
+ { token: 'metatag.html', foreground: '569CD6' },
188
+ { token: 'metatag.xml', foreground: '569CD6' },
189
+ { token: 'metatag.php', fontStyle: 'bold' },
190
+
191
+ { token: 'key', foreground: '9CDCFE' },
192
+ { token: 'string.key', foreground: '9CDCFE' },
193
+ { token: 'string.value', foreground: 'CE9178' },
194
+
195
+ { token: 'attribute.name', foreground: '569CD6' },
196
+ { token: 'attribute.value', foreground: '3FF23F' },
197
+
198
+ { token: 'string', foreground: 'CE9178' },
199
+ { token: 'string.sql', foreground: 'FF0000' },
200
+
201
+ { token: 'keyword', foreground: '569CD6' },
202
+ { token: 'keyword.flow', foreground: 'C586C0' },
203
+
204
+ { token: 'operator.sql', foreground: '778899' },
205
+ { token: 'operator.swift', foreground: '909090' },
206
+ { token: 'predefined.sql', foreground: 'FF00FF' },
207
+ ],
208
+ colors: {
209
+ [editorBackground]: '#000000',
210
+ [editorForeground]: '#FFFFFF',
211
+ [editorIndentGuides]: '#FFFFFF',
212
+ [editorActiveIndentGuides]: '#FFFFFF',
213
+ },
214
+ };
215
+ /* -------------------------------- End hc-black theme -------------------------------- */
216
+ /* -------------------------------- Begin hc-light theme -------------------------------- */
217
+ export const hc_light: IStandaloneThemeData = {
218
+ base: 'hc-light',
219
+ inherit: false,
220
+ rules: [
221
+ { token: '', foreground: '292929', background: 'FFFFFF' },
222
+ { token: 'invalid', foreground: 'B5200D' },
223
+ { token: 'emphasis', fontStyle: 'italic' },
224
+ { token: 'strong', fontStyle: 'bold' },
225
+
226
+ { token: 'variable', foreground: '264F70' },
227
+ { token: 'variable.predefined', foreground: '4864AA' },
228
+ { token: 'constant', foreground: 'dd0000' },
229
+ { token: 'comment', foreground: '008000' },
230
+ { token: 'number', foreground: '098658' },
231
+ { token: 'number.hex', foreground: '3030c0' },
232
+ { token: 'regexp', foreground: '800000' },
233
+ { token: 'annotation', foreground: '808080' },
234
+ { token: 'type', foreground: '008080' },
235
+
236
+ { token: 'delimiter', foreground: '000000' },
237
+ { token: 'delimiter.html', foreground: '383838' },
238
+
239
+ { token: 'tag', foreground: '800000' },
240
+ { token: 'tag.id.pug', foreground: '4F76AC' },
241
+ { token: 'tag.class.pug', foreground: '4F76AC' },
242
+ { token: 'meta.scss', foreground: '800000' },
243
+ { token: 'metatag', foreground: 'e00000' },
244
+ { token: 'metatag.content.html', foreground: 'B5200D' },
245
+ { token: 'metatag.html', foreground: '808080' },
246
+ { token: 'metatag.xml', foreground: '808080' },
247
+ { token: 'metatag.php', fontStyle: 'bold' },
248
+
249
+ { token: 'key', foreground: '863B00' },
250
+ { token: 'string.key.json', foreground: 'A31515' },
251
+ { token: 'string.value.json', foreground: '0451A5' },
252
+
253
+ { token: 'attribute.name', foreground: '264F78' },
254
+ { token: 'attribute.value', foreground: '0451A5' },
255
+
256
+ { token: 'string', foreground: 'A31515' },
257
+ { token: 'string.sql', foreground: 'B5200D' },
258
+
259
+ { token: 'keyword', foreground: '0000FF' },
260
+ { token: 'keyword.flow', foreground: 'AF00DB' },
261
+
262
+ { token: 'operator.sql', foreground: '778899' },
263
+ { token: 'operator.swift', foreground: '666666' },
264
+ { token: 'predefined.sql', foreground: 'C700C7' },
265
+ ],
266
+ colors: {
267
+ [editorBackground]: '#FFFFFF',
268
+ [editorForeground]: '#292929',
269
+ [editorIndentGuides]: '#292929',
270
+ [editorActiveIndentGuides]: '#292929',
271
+ },
272
+ };
273
+ /* -------------------------------- End hc-light theme -------------------------------- */
@@ -0,0 +1,9 @@
1
+ import { BasicEvent } from '@opensumi/ide-core-common';
2
+
3
+ import { ITheme } from './theme.service';
4
+
5
+ export class ThemeChangedEvent extends BasicEvent<IThemeChangedEventPayload> {}
6
+
7
+ export interface IThemeChangedEventPayload {
8
+ theme: ITheme;
9
+ }
@@ -0,0 +1,8 @@
1
+ export * from './color';
2
+ export * from './color-registry';
3
+ export * from './default-themes';
4
+ export * from './event';
5
+ export * from './plistParser';
6
+ export * from './style';
7
+ export * from './theme.service';
8
+ export * from './themeCompatibility';
@@ -0,0 +1,55 @@
1
+ import { Injectable } from '@opensumi/di';
2
+ import { Emitter, Event, URI, IThemeColor, Deferred } from '@opensumi/ide-core-common';
3
+
4
+ import { ThemeContribution, ExtColorContribution, IThemeService, ITheme } from '../theme.service';
5
+
6
+ @Injectable()
7
+ export class MockThemeService implements IThemeService {
8
+ colorThemeLoaded: Deferred<void>;
9
+
10
+ public currentThemeId = 'dark';
11
+
12
+ private _onThemeChange = new Emitter<ITheme>();
13
+
14
+ get onThemeChange(): Event<ITheme> {
15
+ return this._onThemeChange.event;
16
+ }
17
+
18
+ registerThemes(themeContributions: ThemeContribution[], extPath: URI) {
19
+ return {
20
+ dispose: () => {},
21
+ };
22
+ }
23
+ async applyTheme(id: string) {
24
+ this.colorThemeLoaded.resolve();
25
+ throw new Error('Method not implemented.');
26
+ }
27
+
28
+ getAvailableThemeInfos() {
29
+ return [];
30
+ }
31
+
32
+ async getCurrentTheme() {
33
+ return {} as ITheme;
34
+ }
35
+
36
+ getCurrentThemeSync() {
37
+ return {} as ITheme;
38
+ }
39
+
40
+ getColor(id: string | IThemeColor | undefined) {
41
+ return '';
42
+ }
43
+
44
+ getColorVar(id: string | IThemeColor | undefined) {
45
+ return '';
46
+ }
47
+
48
+ registerColor(contribution: ExtColorContribution) {
49
+ throw new Error('Method not implemented.');
50
+ }
51
+
52
+ getColorClassNameByColorToken(colorId: string | IThemeColor): string {
53
+ throw new Error('Method not implemented.');
54
+ }
55
+ }