@codingame/monaco-vscode-view-status-bar-service-override 20.1.1 → 20.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-view-status-bar-service-override",
3
- "version": "20.1.1",
3
+ "version": "20.2.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - view-status-bar service-override",
6
6
  "keywords": [],
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-0cc5da60-f921-59b9-bd8c-a018e93c0a6f-common": "20.1.1",
19
- "@codingame/monaco-vscode-622c0cca-d5fa-59b6-b730-0715afcf93ee-common": "20.1.1",
20
- "@codingame/monaco-vscode-85886bdb-61c5-52f1-8eb7-d1d32f6f8cbd-common": "20.1.1",
21
- "@codingame/monaco-vscode-api": "20.1.1"
18
+ "@codingame/monaco-vscode-0cc5da60-f921-59b9-bd8c-a018e93c0a6f-common": "20.2.0",
19
+ "@codingame/monaco-vscode-622c0cca-d5fa-59b6-b730-0715afcf93ee-common": "20.2.0",
20
+ "@codingame/monaco-vscode-85886bdb-61c5-52f1-8eb7-d1d32f6f8cbd-common": "20.2.0",
21
+ "@codingame/monaco-vscode-api": "20.2.0"
22
22
  },
23
23
  "main": "index.js",
24
24
  "module": "index.js",
@@ -1,3 +1,8 @@
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
+
1
6
  .monaco-workbench .part.statusbar {
2
7
  box-sizing: border-box;
3
8
  cursor: default;
@@ -7,18 +12,24 @@
7
12
  display: flex;
8
13
  overflow: hidden;
9
14
  }
15
+
10
16
  .monaco-workbench:not(.reduce-motion) .part.statusbar {
11
17
  transition: background-color 0.15s ease-out;
12
18
  }
19
+
13
20
  .monaco-workbench.mac:not(.fullscreen) .part.statusbar:focus {
21
+ /* Rounded corners to make focus outline appear properly (unless fullscreen) */
14
22
  border-bottom-right-radius: 5px;
15
23
  border-bottom-left-radius: 5px;
16
24
  }
17
25
  .monaco-workbench.mac:not(.fullscreen).macos-bigsur-or-newer .part.statusbar:focus {
26
+ /* macOS Big Sur increased rounded corners size */
18
27
  border-bottom-right-radius: 10px;
19
28
  border-bottom-left-radius: 10px;
20
29
  }
30
+
21
31
  .monaco-workbench .part.statusbar:not(:focus).status-border-top::after {
32
+ /* Top border only visible unless focused to make room for focus outline */
22
33
  content: '';
23
34
  position: absolute;
24
35
  top: 0;
@@ -29,17 +40,21 @@
29
40
  width: 100%;
30
41
  height: 1px;
31
42
  }
43
+
32
44
  .monaco-workbench .part.statusbar > .left-items,
33
45
  .monaco-workbench .part.statusbar > .right-items {
34
46
  display: flex;
35
47
  }
48
+
36
49
  .monaco-workbench .part.statusbar > .right-items {
37
- flex-wrap: wrap;
38
- flex-direction: row-reverse;
50
+ flex-wrap: wrap; /* overflow elements by wrapping */
51
+ flex-direction: row-reverse; /* let the elements to the left wrap first */
39
52
  }
53
+
40
54
  .monaco-workbench .part.statusbar > .left-items {
41
- flex-grow: 1;
55
+ flex-grow: 1; /* left items push right items to the far right end */
42
56
  }
57
+
43
58
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item {
44
59
  display: inline-block;
45
60
  line-height: 22px;
@@ -48,16 +63,19 @@
48
63
  max-width: 40vw;
49
64
  font-variant-numeric: tabular-nums;
50
65
  }
66
+
51
67
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak {
52
68
  position: relative;
53
69
  }
70
+
54
71
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak > .status-bar-item-beak-container {
55
72
  position: absolute;
56
- left: calc(50% - 5px);
73
+ left: calc(50% - 5px); /* centering relative to parent */
57
74
  top: -5px;
58
75
  width: 10px;
59
76
  height: 5px;
60
77
  }
78
+
61
79
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak > .status-bar-item-beak-container:before {
62
80
  content: '';
63
81
  position: fixed;
@@ -66,17 +84,22 @@
66
84
  border-left: 5px solid transparent;
67
85
  border-right: 5px solid transparent;
68
86
  }
87
+
69
88
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.left.first-visible-item {
70
- padding-left: 7px;
89
+ padding-left: 7px; /* Add padding to the most left status bar item */
71
90
  }
91
+
72
92
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.right.last-visible-item {
73
- margin-right: 7px;
93
+ margin-right: 7px; /* Add margin to the most right status bar item. Margin is used to position beak properly. */
74
94
  }
95
+
96
+ /* Tweak appearance for items with background to improve hover feedback */
75
97
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-background-color.left.first-visible-item,
76
98
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-background-color.right.last-visible-item {
77
99
  padding-right: 0;
78
100
  padding-left: 0;
79
101
  }
102
+
80
103
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item > .statusbar-item-label {
81
104
  cursor: pointer;
82
105
  display: flex;
@@ -84,102 +107,137 @@
84
107
  margin-right: 3px;
85
108
  margin-left: 3px;
86
109
  padding: 0 5px 0 5px;
87
- white-space: pre;
110
+ white-space: pre; /* gives some degree of styling */
88
111
  align-items: center;
89
112
  text-overflow: ellipsis;
90
113
  overflow: hidden;
91
- outline-width: 0px;
114
+ outline-width: 0px; /* do not render focus outline, we already have background */
92
115
  }
116
+
93
117
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.compact-left > .statusbar-item-label {
94
118
  margin-left: 0;
95
- margin-right: 5px;
119
+ margin-right: 5px; /* +2px because padding is smaller and we want to preserve spacing between items */
96
120
  padding: 0 3px;
97
121
  }
122
+
98
123
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.compact-right > .statusbar-item-label {
99
- margin-left: 5px;
124
+ margin-left: 5px; /* +2px because padding is smaller and we want to preserve spacing between items */
100
125
  margin-right: 0;
101
126
  padding: 0 3px;
102
127
  }
128
+
103
129
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.compact-left.compact-right > .statusbar-item-label {
104
130
  margin-left: 0;
105
131
  margin-right:0;
106
132
  }
133
+
107
134
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-background-color > .statusbar-item-label {
108
135
  margin-left: 0;
109
136
  margin-right: 0;
110
137
  padding-left: 10px;
111
138
  padding-right: 10px;
112
139
  }
140
+
113
141
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.compact-left.has-background-color > .statusbar-item-label {
114
142
  padding-left: 3px;
115
143
  padding-right: 10px;
116
144
  }
145
+
117
146
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.compact-right.has-background-color > .statusbar-item-label {
118
147
  padding-left: 10px;
119
148
  padding-right: 3px;
120
149
  }
150
+
121
151
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item > a:hover:not(.disabled) {
122
152
  text-decoration: none;
123
153
  color: var(--vscode-statusBarItem-hoverForeground);
124
154
  }
155
+
125
156
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item > a.disabled {
126
157
  cursor: default;
127
158
  }
159
+
128
160
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item span.codicon {
129
161
  text-align: center;
130
162
  font-size: 14px;
131
163
  color: inherit;
132
164
  }
165
+
133
166
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item a:active:not(.disabled) {
134
167
  outline: 1px solid var(--vscode-contrastActiveBorder) !important;
135
168
  outline-offset: -1px;
136
169
  }
170
+
137
171
  .monaco-workbench:not(.hc-light):not(.hc-black) .part.statusbar > .items-container > .statusbar-item a:active:not(.disabled) {
138
172
  background-color: var(--vscode-statusBarItem-activeBackground) !important;
139
173
  }
174
+
140
175
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item a:hover:not(.disabled) {
141
176
  outline: 1px dashed var(--vscode-contrastActiveBorder);
142
177
  outline-offset: -1px;
143
178
  }
179
+
144
180
  .monaco-workbench:not(.hc-light):not(.hc-black) .part.statusbar > .items-container > .statusbar-item a:hover:not(.disabled) {
145
181
  background-color: var(--vscode-statusBarItem-hoverBackground);
146
182
  }
183
+
184
+ /** Status bar entry item kinds */
185
+
147
186
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.warning-kind {
148
187
  color: var(--vscode-statusBarItem-warningForeground);
149
188
  background-color: var(--vscode-statusBarItem-warningBackground);
150
189
  }
190
+
151
191
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.warning-kind a:hover:not(.disabled) {
152
192
  color: var(--vscode-statusBarItem-warningHoverForeground);
153
193
  background-color: var(--vscode-statusBarItem-warningHoverBackground) !important;
154
194
  }
195
+
155
196
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.error-kind {
156
197
  color: var(--vscode-statusBarItem-errorForeground);
157
198
  background-color: var(--vscode-statusBarItem-errorBackground);
158
199
  }
200
+
159
201
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.error-kind a:hover:not(.disabled) {
160
202
  color: var(--vscode-statusBarItem-errorHoverForeground);
161
203
  background-color: var(--vscode-statusBarItem-errorHoverBackground) !important;
162
204
  }
205
+
163
206
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.prominent-kind {
164
207
  color: var(--vscode-statusBarItem-prominentForeground);
165
208
  background-color: var(--vscode-statusBarItem-prominentBackground);
166
209
  }
210
+
211
+ /**
212
+ * Using :not(.compact-right):not(.compact-left) here to improve the visual appearance
213
+ * when a prominent item uses `compact: true` with other items. The presence of the
214
+ * !important directive for `background-color` otherwise blocks our special hover handling
215
+ * code here:
216
+ * https://github.com/microsoft/vscode/blob/c2037f152b2bb3119ce1d87f52987776540dd57f/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts#L483-L505
217
+ *
218
+ * Note: this is currently only done for the prominent kind, but needs to be expanded if
219
+ * other kinds use compact feature.
220
+ */
167
221
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.prominent-kind:not(.compact-right):not(.compact-left) a:hover:not(.disabled) {
168
222
  color: var(--vscode-statusBarItem-prominentHoverForeground);
169
223
  background-color: var(--vscode-statusBarItem-prominentHoverBackground) !important;
170
224
  }
225
+
171
226
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.remote-kind {
172
227
  color: var(--vscode-statusBarItem-remoteForeground);
173
228
  background-color: var(--vscode-statusBarItem-remoteBackground);
174
229
  }
230
+
175
231
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.remote-kind a:hover:not(.disabled) {
176
232
  color: var(--vscode-statusBarItem-remoteHoverForeground);
177
233
  background-color: var(--vscode-statusBarItem-remoteHoverBackground) !important;
178
234
  }
235
+
179
236
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.offline-kind {
180
237
  color: var(--vscode-statusBarItem-offlineForeground);
181
238
  background-color: var(--vscode-statusBarItem-offlineBackground);
182
239
  }
240
+
183
241
  .monaco-workbench .part.statusbar > .items-container > .statusbar-item.offline-kind a:hover:not(.disabled) {
184
242
  color: var(--vscode-statusBarItem-offlineHoverForeground);
185
243
  background-color: var(--vscode-statusBarItem-offlineHoverBackground) !important;
@@ -12,20 +12,64 @@ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platf
12
12
  import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
13
13
  import { IView } from "@codingame/monaco-vscode-6980eeab-47bb-5a48-8e15-32caf0785565-common/vscode/vs/base/browser/ui/grid/grid";
14
14
  export interface IStatusbarEntryContainer extends IDisposable {
15
+ /**
16
+ * An event that is triggered when an entry's visibility is changed.
17
+ */
15
18
  readonly onDidChangeEntryVisibility: Event<{
16
19
  id: string;
17
20
  visible: boolean;
18
21
  }>;
22
+ /**
23
+ * Adds an entry to the statusbar with the given alignment and priority. Use the returned accessor
24
+ * to update or remove the statusbar entry.
25
+ *
26
+ * @param id identifier of the entry is needed to allow users to hide entries via settings
27
+ * @param alignment either LEFT or RIGHT side in the status bar
28
+ * @param priority items get arranged from highest priority to lowest priority from left to right
29
+ * in their respective alignment slot
30
+ */
19
31
  addEntry(entry: IStatusbarEntry, id: string, alignment: StatusbarAlignment, priority?: number | IStatusbarEntryPriority): IStatusbarEntryAccessor;
20
32
  addEntry(entry: IStatusbarEntry, id: string, alignment: StatusbarAlignment, priority?: number | IStatusbarEntryPriority | IStatusbarEntryLocation): IStatusbarEntryAccessor;
33
+ /**
34
+ * Adds an entry to the statusbar with the given alignment relative to another entry. Use the returned
35
+ * accessor to update or remove the statusbar entry.
36
+ *
37
+ * @param id identifier of the entry is needed to allow users to hide entries via settings
38
+ * @param alignment either LEFT or RIGHT side in the status bar
39
+ * @param location a reference to another entry to position relative to
40
+ */
21
41
  addEntry(entry: IStatusbarEntry, id: string, alignment: StatusbarAlignment, location?: IStatusbarEntryLocation): IStatusbarEntryAccessor;
42
+ /**
43
+ * Return if an entry is visible or not.
44
+ */
22
45
  isEntryVisible(id: string): boolean;
46
+ /**
47
+ * Allows to update an entry's visibility with the provided ID.
48
+ */
23
49
  updateEntryVisibility(id: string, visible: boolean): void;
50
+ /**
51
+ * Allows to override the appearance of an entry with the provided ID.
52
+ */
24
53
  overrideEntry(id: string, override: Partial<IStatusbarEntry>): IDisposable;
54
+ /**
55
+ * Focused the status bar. If one of the status bar entries was focused, focuses it directly.
56
+ */
25
57
  focus(preserveEntryFocus?: boolean): void;
58
+ /**
59
+ * Focuses the next status bar entry. If none focused, focuses the first.
60
+ */
26
61
  focusNextEntry(): void;
62
+ /**
63
+ * Focuses the previous status bar entry. If none focused, focuses the last.
64
+ */
27
65
  focusPreviousEntry(): void;
66
+ /**
67
+ * Returns true if a status bar entry is focused.
68
+ */
28
69
  isEntryFocused(): boolean;
70
+ /**
71
+ * Temporarily override statusbar style.
72
+ */
29
73
  overrideStyle(style: IStatusbarStyleOverride): IDisposable;
30
74
  }
31
75
  declare class StatusbarPart extends Part implements IStatusbarEntryContainer {