@workbench-kit/react 0.0.2-prototype.0.2.40 → 0.0.2-prototype.0.2.41
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 +10 -10
- package/src/workbench/theme/themePresets.ts +37 -63
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-kit/react",
|
|
3
|
-
"version": "0.0.2-prototype.0.2.
|
|
3
|
+
"version": "0.0.2-prototype.0.2.41",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"@vscode/codicons": "^0.0.45",
|
|
74
74
|
"remark-gfm": "^4.0.1",
|
|
75
75
|
"rehype-sanitize": "^6.0.0",
|
|
76
|
-
"@workbench-kit/
|
|
77
|
-
"@workbench-kit/
|
|
78
|
-
"@workbench-kit/
|
|
79
|
-
"@workbench-kit/
|
|
80
|
-
"@workbench-kit/
|
|
81
|
-
"@workbench-kit/
|
|
82
|
-
"@workbench-kit/tokens": "0.0.2-prototype.0.2.
|
|
83
|
-
"@workbench-kit/workspace": "0.0.2-prototype.0.2.
|
|
84
|
-
"@workbench-kit/
|
|
76
|
+
"@workbench-kit/contracts": "0.0.2-prototype.0.2.41",
|
|
77
|
+
"@workbench-kit/adapters": "0.0.2-prototype.0.2.41",
|
|
78
|
+
"@workbench-kit/monaco": "0.0.2-prototype.0.2.41",
|
|
79
|
+
"@workbench-kit/runtime": "0.0.2-prototype.0.2.41",
|
|
80
|
+
"@workbench-kit/platform": "0.0.2-prototype.0.2.41",
|
|
81
|
+
"@workbench-kit/services": "0.0.2-prototype.0.2.41",
|
|
82
|
+
"@workbench-kit/tokens": "0.0.2-prototype.0.2.41",
|
|
83
|
+
"@workbench-kit/workspace": "0.0.2-prototype.0.2.41",
|
|
84
|
+
"@workbench-kit/jdw": "0.0.2-prototype.0.2.41"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"react": "^19.0.0",
|
|
@@ -1,59 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DARK_THEME_PRESET_MANIFEST,
|
|
3
|
+
DARK_THEME_PRESET_OPTIONS,
|
|
4
|
+
DEFAULT_DARK_THEME_PRESET,
|
|
5
|
+
DEFAULT_LIGHT_THEME_PRESET,
|
|
6
|
+
LIGHT_THEME_PRESET_MANIFEST,
|
|
7
|
+
LIGHT_THEME_PRESET_OPTIONS,
|
|
8
|
+
WORKBENCH_COLOR_SCHEME_OPTIONS,
|
|
9
|
+
isDarkThemePresetId,
|
|
10
|
+
isLightThemePresetId,
|
|
11
|
+
type DarkThemePresetId,
|
|
12
|
+
type LightThemePresetId,
|
|
13
|
+
type ThemePresetId,
|
|
14
|
+
type WorkbenchColorSchemePreference,
|
|
15
|
+
type WorkbenchThemePresetManifestEntry,
|
|
16
|
+
type WorkbenchThemePresetOption,
|
|
17
|
+
} from '@workbench-kit/contracts/theme-presets';
|
|
18
|
+
|
|
1
19
|
import { resolveWorkbenchTheme, type ResolvedWorkbenchTheme } from './theme';
|
|
2
|
-
import type { WorkbenchTheme } from '../shell/standalone';
|
|
3
20
|
import { applyWorkbenchShellAttributes } from '../shell/shellPresets';
|
|
4
21
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
] as const satisfies readonly WorkbenchThemePresetManifestEntry[];
|
|
25
|
-
|
|
26
|
-
export type LightThemePresetId = (typeof LIGHT_THEME_PRESET_MANIFEST)[number]['id'];
|
|
27
|
-
export type DarkThemePresetId = (typeof DARK_THEME_PRESET_MANIFEST)[number]['id'];
|
|
28
|
-
export type ThemePresetId = LightThemePresetId | DarkThemePresetId;
|
|
29
|
-
|
|
30
|
-
export const DEFAULT_LIGHT_THEME_PRESET: LightThemePresetId = 'skyblue';
|
|
31
|
-
export const DEFAULT_DARK_THEME_PRESET: DarkThemePresetId = 'purple';
|
|
32
|
-
|
|
33
|
-
export type WorkbenchColorSchemePreference = 'system' | WorkbenchTheme;
|
|
34
|
-
|
|
35
|
-
export const WORKBENCH_COLOR_SCHEME_OPTIONS: WorkbenchThemePresetOption<WorkbenchColorSchemePreference>[] =
|
|
36
|
-
[
|
|
37
|
-
{ id: 'system', label: 'System' },
|
|
38
|
-
{ id: 'light', label: 'Light' },
|
|
39
|
-
{ id: 'dark', label: 'Dark' },
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
export interface WorkbenchThemePresetOption<TId extends string = string> {
|
|
43
|
-
id: TId;
|
|
44
|
-
label: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const LIGHT_THEME_PRESET_OPTIONS: WorkbenchThemePresetOption<LightThemePresetId>[] =
|
|
48
|
-
LIGHT_THEME_PRESET_MANIFEST.map((entry) => ({ id: entry.id, label: entry.label }));
|
|
49
|
-
|
|
50
|
-
export const DARK_THEME_PRESET_OPTIONS: WorkbenchThemePresetOption<DarkThemePresetId>[] =
|
|
51
|
-
DARK_THEME_PRESET_MANIFEST.map((entry) => ({ id: entry.id, label: entry.label }));
|
|
52
|
-
|
|
53
|
-
const LIGHT_THEME_PRESET_IDS = new Set<string>(
|
|
54
|
-
LIGHT_THEME_PRESET_MANIFEST.map((entry) => entry.id),
|
|
55
|
-
);
|
|
56
|
-
const DARK_THEME_PRESET_IDS = new Set<string>(DARK_THEME_PRESET_MANIFEST.map((entry) => entry.id));
|
|
22
|
+
export {
|
|
23
|
+
DARK_THEME_PRESET_MANIFEST,
|
|
24
|
+
DARK_THEME_PRESET_OPTIONS,
|
|
25
|
+
DEFAULT_DARK_THEME_PRESET,
|
|
26
|
+
DEFAULT_LIGHT_THEME_PRESET,
|
|
27
|
+
LIGHT_THEME_PRESET_MANIFEST,
|
|
28
|
+
LIGHT_THEME_PRESET_OPTIONS,
|
|
29
|
+
WORKBENCH_COLOR_SCHEME_OPTIONS,
|
|
30
|
+
isDarkThemePresetId,
|
|
31
|
+
isLightThemePresetId,
|
|
32
|
+
};
|
|
33
|
+
export type {
|
|
34
|
+
DarkThemePresetId,
|
|
35
|
+
LightThemePresetId,
|
|
36
|
+
ThemePresetId,
|
|
37
|
+
WorkbenchColorSchemePreference,
|
|
38
|
+
WorkbenchThemePresetManifestEntry,
|
|
39
|
+
WorkbenchThemePresetOption,
|
|
40
|
+
};
|
|
57
41
|
|
|
58
42
|
export interface WorkbenchThemePresetSelection {
|
|
59
43
|
/** A built-in preset id, or a contributed theme id with a matching `mode`. */
|
|
@@ -61,16 +45,6 @@ export interface WorkbenchThemePresetSelection {
|
|
|
61
45
|
darkPreset: string;
|
|
62
46
|
}
|
|
63
47
|
|
|
64
|
-
export function isLightThemePresetId(
|
|
65
|
-
value: string | null | undefined,
|
|
66
|
-
): value is LightThemePresetId {
|
|
67
|
-
return value != null && LIGHT_THEME_PRESET_IDS.has(value);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function isDarkThemePresetId(value: string | null | undefined): value is DarkThemePresetId {
|
|
71
|
-
return value != null && DARK_THEME_PRESET_IDS.has(value);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
48
|
export function resolveActiveThemePreset(
|
|
75
49
|
resolvedTheme: ResolvedWorkbenchTheme,
|
|
76
50
|
selection: WorkbenchThemePresetSelection,
|