@workbench-kit/react 0.0.2-prototype.0.2.25 → 0.0.2-prototype.0.2.26

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": "@workbench-kit/react",
3
- "version": "0.0.2-prototype.0.2.25",
3
+ "version": "0.0.2-prototype.0.2.26",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -63,15 +63,15 @@
63
63
  "@vscode/codicons": "^0.0.45",
64
64
  "remark-gfm": "^4.0.1",
65
65
  "rehype-sanitize": "^6.0.0",
66
- "@workbench-kit/jdw": "0.0.2-prototype.0.2.25",
67
- "@workbench-kit/monaco": "0.0.2-prototype.0.2.25",
68
- "@workbench-kit/platform": "0.0.2-prototype.0.2.25",
69
- "@workbench-kit/runtime": "0.0.2-prototype.0.2.25",
70
- "@workbench-kit/contracts": "0.0.2-prototype.0.2.25",
71
- "@workbench-kit/adapters": "0.0.2-prototype.0.2.25",
72
- "@workbench-kit/services": "0.0.2-prototype.0.2.25",
73
- "@workbench-kit/tokens": "0.0.2-prototype.0.2.25",
74
- "@workbench-kit/workspace": "0.0.2-prototype.0.2.25"
66
+ "@workbench-kit/contracts": "0.0.2-prototype.0.2.26",
67
+ "@workbench-kit/monaco": "0.0.2-prototype.0.2.26",
68
+ "@workbench-kit/jdw": "0.0.2-prototype.0.2.26",
69
+ "@workbench-kit/platform": "0.0.2-prototype.0.2.26",
70
+ "@workbench-kit/adapters": "0.0.2-prototype.0.2.26",
71
+ "@workbench-kit/runtime": "0.0.2-prototype.0.2.26",
72
+ "@workbench-kit/workspace": "0.0.2-prototype.0.2.26",
73
+ "@workbench-kit/tokens": "0.0.2-prototype.0.2.26",
74
+ "@workbench-kit/services": "0.0.2-prototype.0.2.26"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "react": "^19.0.0",
@@ -13,6 +13,7 @@ import {
13
13
  import type { ContextMenuItem } from '../../overlay/ContextMenu';
14
14
 
15
15
  export const WORKBENCH_OPEN_SETTINGS_COMMAND_ID = 'workbench.openSettings';
16
+ export const WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID = 'workbench.toggleFocusMode';
16
17
  export const WORKBENCH_TOGGLE_PRIMARY_SIDEBAR_COMMAND_ID = 'workbench.togglePrimarySidebar';
17
18
  export const WORKBENCH_EDITOR_SAVE_COMMAND_ID = 'editor.save';
18
19
  export const WORKBENCH_EDITOR_DISCARD_CHANGES_COMMAND_ID = 'editor.discardChanges';
@@ -54,9 +55,11 @@ export interface WorkbenchShellCommandActivity<TActivityId extends string = stri
54
55
  }
55
56
 
56
57
  export interface WorkbenchShellCommandContext<TActivityId extends string = string> {
58
+ isFocusModeActive?: boolean | undefined;
57
59
  isPrimarySidebarVisible: boolean;
58
60
  openSettings: () => void;
59
61
  showActivity: (activityId: TActivityId) => void;
62
+ toggleFocusMode?: (() => void) | undefined;
60
63
  togglePrimarySidebar: () => void;
61
64
  }
62
65
 
@@ -96,6 +99,7 @@ function applyWorkbenchCommandOverrides<TContext>(
96
99
 
97
100
  export interface WorkbenchShellCommandPresetOptions<TActivityId extends string = string> {
98
101
  activities: WorkbenchShellCommandActivity<TActivityId>[];
102
+ includeFocusModeToggle?: boolean | undefined;
99
103
  includeSettings?: boolean | undefined;
100
104
  includeSidebarToggle?: boolean | undefined;
101
105
  menuSeparatorId?: string | undefined;
@@ -159,6 +163,7 @@ export function getWorkbenchShowActivityCommandId(activityId: string) {
159
163
 
160
164
  export function createWorkbenchShellCommands<TActivityId extends string>({
161
165
  activities,
166
+ includeFocusModeToggle = true,
162
167
  includeSettings = true,
163
168
  includeSidebarToggle = true,
164
169
  settingsIcon = 'codicon-settings-gear',
@@ -179,6 +184,19 @@ export function createWorkbenchShellCommands<TActivityId extends string>({
179
184
 
180
185
  const shellCommands: CommandDefinition<WorkbenchShellCommandContext<TActivityId>>[] = [];
181
186
 
187
+ if (includeFocusModeToggle) {
188
+ shellCommands.push({
189
+ id: WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID,
190
+ icon: 'codicon-screen-full',
191
+ isEnabled: ({ toggleFocusMode }) => toggleFocusMode !== undefined,
192
+ label: ({ isFocusModeActive }) =>
193
+ isFocusModeActive ? 'Exit Focus Mode' : 'Enter Focus Mode',
194
+ run: ({ toggleFocusMode }) => toggleFocusMode?.(),
195
+ shortcut: 'Ctrl/Cmd+Shift+F11',
196
+ title: 'Toggle Focus Mode',
197
+ });
198
+ }
199
+
182
200
  if (includeSidebarToggle) {
183
201
  shellCommands.push({
184
202
  id: WORKBENCH_TOGGLE_PRIMARY_SIDEBAR_COMMAND_ID,
@@ -207,6 +225,7 @@ export function createWorkbenchShellCommands<TActivityId extends string>({
207
225
 
208
226
  export function createWorkbenchShellMenuEntries<TActivityId extends string>({
209
227
  activities,
228
+ includeFocusModeToggle = true,
210
229
  includeSettings = true,
211
230
  includeSidebarToggle = true,
212
231
  menuSeparatorId = 'workbench-shell-separator',
@@ -223,6 +242,15 @@ export function createWorkbenchShellMenuEntries<TActivityId extends string>({
223
242
  );
224
243
  const shellEntries: CommandMenuEntry<WorkbenchShellCommandContext<TActivityId>>[] = [];
225
244
 
245
+ if (includeFocusModeToggle) {
246
+ shellEntries.push(
247
+ commandMenuEntry<WorkbenchShellCommandContext<TActivityId>>(
248
+ WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID,
249
+ { surfaces: [WORKBENCH_COMMAND_SURFACE_ACTIVITY_BAR] },
250
+ ),
251
+ );
252
+ }
253
+
226
254
  if (includeSidebarToggle) {
227
255
  shellEntries.push(
228
256
  commandMenuEntry<WorkbenchShellCommandContext<TActivityId>>(
@@ -311,6 +311,7 @@ export {
311
311
  WORKBENCH_COMMAND_SURFACE_SETTINGS,
312
312
  WORKBENCH_COMMAND_SURFACE_WORKSPACE,
313
313
  WORKBENCH_OPEN_SETTINGS_COMMAND_ID,
314
+ WORKBENCH_TOGGLE_FOCUS_MODE_COMMAND_ID,
314
315
  WORKBENCH_SEARCH_COPY_RESULT_PATH_COMMAND_ID,
315
316
  WORKBENCH_SEARCH_DELETE_RESULT_COMMAND_ID,
316
317
  WORKBENCH_SEARCH_OPEN_RESULT_COMMAND_ID,