@floegence/floe-webapp-core 0.38.0 → 0.39.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/dist/components/editor/CodeEditor.js +61 -59
- package/dist/components/editor/index.d.ts +2 -1
- package/dist/components/editor/monacoTheme.d.ts +17 -0
- package/dist/components/editor/monacoTheme.js +23 -0
- package/dist/context/FloeConfigContext.d.ts +6 -0
- package/dist/context/ThemeContext.d.ts +6 -1
- package/dist/context/ThemeContext.js +81 -50
- package/dist/editor.js +13 -10
- package/dist/floe.css +1 -0
- package/dist/full.js +804 -792
- package/dist/index.js +148 -136
- package/dist/styles/themes/index.d.ts +30 -0
- package/dist/styles/themes/index.js +36 -25
- package/dist/styles/themes/presets.d.ts +84 -0
- package/dist/styles/themes/presets.js +859 -0
- package/dist/styles.css +1 -1
- package/dist/themes/shell-presets.generated.css +1281 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,142 +1,154 @@
|
|
|
1
1
|
import { FloeProvider as r } from "./app/FloeProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import { floeColorTokenCategories as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
2
|
+
import { applyShellThemeAttribute as i, applyTheme as s, builtInThemes as n, getSystemTheme as m, isThemeType as a, mergeThemeTokenMaps as l, resolveThemeTokenOverrides as p, resolveThemeTokens as f, syncThemeTokenOverrides as d } from "./styles/themes/index.js";
|
|
3
|
+
import { floeColorTokenCategories as g, floeDesignTokens as u, floeFontFamilyTokens as c, floeMotionTokens as x, floeRadiusTokens as C, floeSharedCssVariables as h, floeSpacingTokens as y, floeThemeColorVariables as S, floeTypographyTokens as F, getFloeColorTokenValue as v } from "./styles/tokens.js";
|
|
4
|
+
import { BUILT_IN_SHELL_THEME_DEFAULTS as k, REQUIRED_SHELL_THEME_TOKENS as I, assertUniqueThemePresetNames as R, builtInShellThemePresets as D, createShellThemePreset as E, getShellThemePresetsForMode as L, normalizeShellThemeSelection as _, presetSupportsMode as b, resolveShellThemePresetName as N } from "./styles/themes/presets.js";
|
|
5
|
+
import { CommandProvider as A, createCommandService as M, useCommand as B } from "./context/CommandContext.js";
|
|
6
|
+
import { ComponentRegistryProvider as G, createComponentRegistry as H, hasComponentRegistryContext as U, useComponentContextFactory as W, useComponentRegistry as K, useOptionalComponentRegistry as V } from "./context/ComponentRegistry.js";
|
|
7
|
+
import { DEFAULT_FLOE_CONFIG as Q, FloeConfigProvider as q, useFloeConfig as Y, useResolvedFloeConfig as j } from "./context/FloeConfigContext.js";
|
|
8
|
+
import { DeckProvider as X, createDeckService as Z, useDeck as $ } from "./context/DeckContext.js";
|
|
9
|
+
import { FLOE_GEOMETRY_SURFACE_ATTR as oe, FLOE_HOT_INTERACTION_ATTR as re, startHotInteraction as te } from "./utils/hotInteraction.js";
|
|
10
|
+
import { FileBrowserDragProvider as se, hasFileBrowserDragContext as ne, useFileBrowserDrag as me } from "./context/FileBrowserDragContext.js";
|
|
11
|
+
import { LayoutProvider as le, createLayoutService as pe, useLayout as fe } from "./context/LayoutContext.js";
|
|
12
|
+
import { NotificationContainer as Te, NotificationProvider as ge, createNotificationService as ue, useNotification as ce } from "./context/NotificationContext.js";
|
|
13
|
+
import { ThemeProvider as Ce, createThemeService as he, useTheme as ye } from "./context/ThemeContext.js";
|
|
14
|
+
import { ViewActivationProvider as Fe, useViewActivation as ve } from "./context/ViewActivationContext.js";
|
|
15
|
+
import { WidgetRegistryProvider as ke, createWidgetRegistry as Ie, useWidgetRegistry as Re } from "./context/WidgetRegistry.js";
|
|
16
|
+
import { WidgetStateProvider as Ee, useCurrentWidgetId as Le, useWidgetState as _e, useWidgetStateContext as be } from "./context/WidgetStateContext.js";
|
|
17
|
+
import { applyDragDelta as Oe, applyResizeDelta as Ae, getGridCellSize as Me, pixelDeltaToGridDelta as Be, positionToGridArea as we, snapToGrid as Ge } from "./utils/gridLayout.js";
|
|
18
|
+
import { checkCollision as Ue, constrainPosition as We, findFreePosition as Ke, hasCollision as Ve, sameGridPosition as ze } from "./utils/gridCollision.js";
|
|
19
|
+
import { cn as qe } from "./utils/cn.js";
|
|
20
|
+
import { createSimpleContext as je } from "./context/createSimpleContext.js";
|
|
21
|
+
import { createUIFirstSelection as Xe } from "./utils/uiFirstSelection.js";
|
|
22
|
+
import { deferAfterPaint as $e, deferNonBlocking as eo } from "./utils/defer.js";
|
|
23
|
+
import { duration as ro, easing as to, fadeIn as io, listContainer as so, listItem as no, panelResize as mo, popIn as ao, scaleIn as lo, sidebarVariants as po, slideInFromBottom as fo, slideInFromLeft as To, slideInFromRight as go, slideInFromTop as uo, springConfig as co } from "./utils/animations.js";
|
|
24
|
+
import { formatKeybind as Co, isMacLikePlatform as ho, isPrimaryModKeyPressed as yo, matchKeybind as So, parseKeybind as Fo } from "./utils/keybind.js";
|
|
25
|
+
import { isTypingElement as Po, shouldIgnoreHotkeys as ko } from "./utils/dom.js";
|
|
26
|
+
import { lockBodyStyle as Ro } from "./utils/bodyStyleLock.js";
|
|
27
|
+
import { registerCommandContributions as Eo, useCommandContributions as Lo } from "./hooks/useCommandContributions.js";
|
|
28
|
+
import { useDebounce as bo } from "./hooks/useDebounce.js";
|
|
29
|
+
import { useDeckDrag as Oo } from "./hooks/useDeckDrag.js";
|
|
30
|
+
import { useFileBrowserDropTarget as Mo, useFileBrowserItemDrag as Bo } from "./hooks/useFileBrowserDrag.js";
|
|
31
|
+
import { useKeybind as Go } from "./hooks/useKeybind.js";
|
|
32
|
+
import { useMediaQuery as Uo } from "./hooks/useMediaQuery.js";
|
|
33
|
+
import { usePersisted as Ko } from "./hooks/usePersisted.js";
|
|
34
|
+
import { useResizeObserver as zo } from "./hooks/useResizeObserver.js";
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
k as BUILT_IN_SHELL_THEME_DEFAULTS,
|
|
37
|
+
A as CommandProvider,
|
|
38
|
+
G as ComponentRegistryProvider,
|
|
39
|
+
Q as DEFAULT_FLOE_CONFIG,
|
|
40
|
+
X as DeckProvider,
|
|
41
|
+
oe as FLOE_GEOMETRY_SURFACE_ATTR,
|
|
42
|
+
re as FLOE_HOT_INTERACTION_ATTR,
|
|
43
|
+
se as FileBrowserDragProvider,
|
|
44
|
+
q as FloeConfigProvider,
|
|
43
45
|
r as FloeProvider,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
46
|
+
le as LayoutProvider,
|
|
47
|
+
Te as NotificationContainer,
|
|
48
|
+
ge as NotificationProvider,
|
|
49
|
+
I as REQUIRED_SHELL_THEME_TOKENS,
|
|
50
|
+
Ce as ThemeProvider,
|
|
51
|
+
Fe as ViewActivationProvider,
|
|
52
|
+
ke as WidgetRegistryProvider,
|
|
53
|
+
Ee as WidgetStateProvider,
|
|
54
|
+
Oe as applyDragDelta,
|
|
55
|
+
Ae as applyResizeDelta,
|
|
56
|
+
i as applyShellThemeAttribute,
|
|
57
|
+
s as applyTheme,
|
|
58
|
+
R as assertUniqueThemePresetNames,
|
|
59
|
+
D as builtInShellThemePresets,
|
|
60
|
+
n as builtInThemes,
|
|
61
|
+
Ue as checkCollision,
|
|
62
|
+
qe as cn,
|
|
63
|
+
We as constrainPosition,
|
|
64
|
+
M as createCommandService,
|
|
65
|
+
H as createComponentRegistry,
|
|
66
|
+
Z as createDeckService,
|
|
67
|
+
pe as createLayoutService,
|
|
68
|
+
ue as createNotificationService,
|
|
69
|
+
E as createShellThemePreset,
|
|
70
|
+
je as createSimpleContext,
|
|
71
|
+
he as createThemeService,
|
|
72
|
+
Xe as createUIFirstSelection,
|
|
73
|
+
Ie as createWidgetRegistry,
|
|
74
|
+
$e as deferAfterPaint,
|
|
75
|
+
eo as deferNonBlocking,
|
|
76
|
+
ro as duration,
|
|
77
|
+
to as easing,
|
|
78
|
+
io as fadeIn,
|
|
79
|
+
Ke as findFreePosition,
|
|
80
|
+
g as floeColorTokenCategories,
|
|
81
|
+
u as floeDesignTokens,
|
|
75
82
|
c as floeFontFamilyTokens,
|
|
76
83
|
x as floeMotionTokens,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
84
|
+
C as floeRadiusTokens,
|
|
85
|
+
h as floeSharedCssVariables,
|
|
86
|
+
y as floeSpacingTokens,
|
|
87
|
+
S as floeThemeColorVariables,
|
|
88
|
+
F as floeTypographyTokens,
|
|
89
|
+
Co as formatKeybind,
|
|
90
|
+
v as getFloeColorTokenValue,
|
|
91
|
+
Me as getGridCellSize,
|
|
92
|
+
L as getShellThemePresetsForMode,
|
|
93
|
+
m as getSystemTheme,
|
|
94
|
+
Ve as hasCollision,
|
|
95
|
+
U as hasComponentRegistryContext,
|
|
96
|
+
ne as hasFileBrowserDragContext,
|
|
97
|
+
ho as isMacLikePlatform,
|
|
98
|
+
yo as isPrimaryModKeyPressed,
|
|
99
|
+
a as isThemeType,
|
|
100
|
+
Po as isTypingElement,
|
|
101
|
+
so as listContainer,
|
|
102
|
+
no as listItem,
|
|
103
|
+
Ro as lockBodyStyle,
|
|
104
|
+
So as matchKeybind,
|
|
105
|
+
l as mergeThemeTokenMaps,
|
|
106
|
+
_ as normalizeShellThemeSelection,
|
|
107
|
+
mo as panelResize,
|
|
108
|
+
Fo as parseKeybind,
|
|
109
|
+
Be as pixelDeltaToGridDelta,
|
|
110
|
+
ao as popIn,
|
|
111
|
+
we as positionToGridArea,
|
|
112
|
+
b as presetSupportsMode,
|
|
113
|
+
Eo as registerCommandContributions,
|
|
114
|
+
N as resolveShellThemePresetName,
|
|
115
|
+
p as resolveThemeTokenOverrides,
|
|
116
|
+
f as resolveThemeTokens,
|
|
117
|
+
ze as sameGridPosition,
|
|
118
|
+
lo as scaleIn,
|
|
119
|
+
ko as shouldIgnoreHotkeys,
|
|
120
|
+
po as sidebarVariants,
|
|
121
|
+
fo as slideInFromBottom,
|
|
122
|
+
To as slideInFromLeft,
|
|
123
|
+
go as slideInFromRight,
|
|
124
|
+
uo as slideInFromTop,
|
|
125
|
+
Ge as snapToGrid,
|
|
126
|
+
co as springConfig,
|
|
127
|
+
te as startHotInteraction,
|
|
128
|
+
d as syncThemeTokenOverrides,
|
|
129
|
+
B as useCommand,
|
|
130
|
+
Lo as useCommandContributions,
|
|
131
|
+
W as useComponentContextFactory,
|
|
132
|
+
K as useComponentRegistry,
|
|
133
|
+
Le as useCurrentWidgetId,
|
|
134
|
+
bo as useDebounce,
|
|
135
|
+
$ as useDeck,
|
|
136
|
+
Oo as useDeckDrag,
|
|
137
|
+
me as useFileBrowserDrag,
|
|
138
|
+
Mo as useFileBrowserDropTarget,
|
|
139
|
+
Bo as useFileBrowserItemDrag,
|
|
140
|
+
Y as useFloeConfig,
|
|
141
|
+
Go as useKeybind,
|
|
142
|
+
fe as useLayout,
|
|
143
|
+
Uo as useMediaQuery,
|
|
144
|
+
ce as useNotification,
|
|
145
|
+
V as useOptionalComponentRegistry,
|
|
146
|
+
Ko as usePersisted,
|
|
147
|
+
zo as useResizeObserver,
|
|
148
|
+
j as useResolvedFloeConfig,
|
|
149
|
+
ye as useTheme,
|
|
150
|
+
ve as useViewActivation,
|
|
151
|
+
Re as useWidgetRegistry,
|
|
152
|
+
_e as useWidgetState,
|
|
153
|
+
be as useWidgetStateContext
|
|
142
154
|
};
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export type ThemeType = 'light' | 'dark' | 'system';
|
|
2
|
+
export type FloeThemePresetMode = 'light' | 'dark' | 'both';
|
|
2
3
|
export type FloeThemeTokenMap = Partial<Record<`--${string}`, string>>;
|
|
4
|
+
export interface FloeMonacoTokenRule {
|
|
5
|
+
token: string;
|
|
6
|
+
foreground: string;
|
|
7
|
+
fontStyle?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FloeMonacoThemeDefinition {
|
|
10
|
+
base: 'vs' | 'vs-dark';
|
|
11
|
+
inherit: boolean;
|
|
12
|
+
rules: readonly FloeMonacoTokenRule[];
|
|
13
|
+
colors: Readonly<Record<string, string>>;
|
|
14
|
+
}
|
|
3
15
|
export interface FloeThemeTokenOverrides {
|
|
4
16
|
shared?: FloeThemeTokenMap;
|
|
5
17
|
light?: FloeThemeTokenMap;
|
|
@@ -9,6 +21,19 @@ export interface FloeThemePreset {
|
|
|
9
21
|
name: string;
|
|
10
22
|
displayName: string;
|
|
11
23
|
description?: string;
|
|
24
|
+
mode?: FloeThemePresetMode;
|
|
25
|
+
/** Uses the base light.css/dark.css tokens without shell-level overrides. */
|
|
26
|
+
inheritsBaseTokens?: boolean;
|
|
27
|
+
preview?: {
|
|
28
|
+
background: string;
|
|
29
|
+
surface: string;
|
|
30
|
+
primary: string;
|
|
31
|
+
sidebar?: string;
|
|
32
|
+
border?: string;
|
|
33
|
+
colors: readonly [string, string, string, string, string];
|
|
34
|
+
};
|
|
35
|
+
/** Optional Monaco definitions keyed by resolved light/dark mode. */
|
|
36
|
+
monaco?: Partial<Record<'light' | 'dark', FloeMonacoThemeDefinition>>;
|
|
12
37
|
tokens?: FloeThemeTokenOverrides;
|
|
13
38
|
}
|
|
14
39
|
export interface ThemeTarget {
|
|
@@ -21,6 +46,8 @@ export interface ThemeTarget {
|
|
|
21
46
|
setProperty: (property: string, value: string) => void;
|
|
22
47
|
removeProperty: (property: string) => void;
|
|
23
48
|
};
|
|
49
|
+
setAttribute?: (qualifiedName: string, value: string) => void;
|
|
50
|
+
removeAttribute?: (qualifiedName: string) => void;
|
|
24
51
|
}
|
|
25
52
|
export interface FloeTheme {
|
|
26
53
|
name: string;
|
|
@@ -28,9 +55,12 @@ export interface FloeTheme {
|
|
|
28
55
|
type: 'light' | 'dark';
|
|
29
56
|
}
|
|
30
57
|
export declare const builtInThemes: FloeTheme[];
|
|
58
|
+
export declare function isThemeType(value: unknown): value is ThemeType;
|
|
31
59
|
export declare function getSystemTheme(): 'light' | 'dark';
|
|
32
60
|
export declare function resolveThemeTokenOverrides(tokens: FloeThemeTokenOverrides | undefined, resolvedTheme: 'light' | 'dark'): FloeThemeTokenMap;
|
|
33
61
|
export declare function mergeThemeTokenMaps(...maps: Array<FloeThemeTokenMap | undefined>): FloeThemeTokenMap;
|
|
34
62
|
export declare function resolveThemeTokens(resolvedTheme: 'light' | 'dark', ...tokenSources: Array<FloeThemeTokenOverrides | undefined>): FloeThemeTokenMap;
|
|
35
63
|
export declare function applyTheme(theme: ThemeType, target?: ThemeTarget): void;
|
|
64
|
+
export declare function applyShellThemeAttribute(presetName: string | undefined, target?: ThemeTarget): void;
|
|
36
65
|
export declare function syncThemeTokenOverrides(tokens: FloeThemeTokenMap | undefined, previousTokenNames?: Iterable<string>, target?: ThemeTarget): string[];
|
|
66
|
+
export * from './presets';
|
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
const
|
|
1
|
+
const f = [
|
|
2
2
|
{ name: "light", displayName: "Light", type: "light" },
|
|
3
3
|
{ name: "dark", displayName: "Dark", type: "dark" }
|
|
4
4
|
];
|
|
5
|
-
function
|
|
5
|
+
function h(e) {
|
|
6
|
+
return e === "light" || e === "dark" || e === "system";
|
|
7
|
+
}
|
|
8
|
+
function m() {
|
|
6
9
|
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7
10
|
}
|
|
8
|
-
function
|
|
11
|
+
function i(e) {
|
|
9
12
|
if (e) return e;
|
|
10
13
|
if (!(typeof document > "u"))
|
|
11
14
|
return document.documentElement;
|
|
12
15
|
}
|
|
13
|
-
function
|
|
16
|
+
function c(e, n) {
|
|
14
17
|
return {
|
|
15
18
|
...e?.shared ?? {},
|
|
16
|
-
...
|
|
19
|
+
...n === "light" ? e?.light ?? {} : e?.dark ?? {}
|
|
17
20
|
};
|
|
18
21
|
}
|
|
19
22
|
function u(...e) {
|
|
20
23
|
return Object.assign({}, ...e.filter(Boolean));
|
|
21
24
|
}
|
|
22
|
-
function
|
|
23
|
-
return u(
|
|
25
|
+
function d(e, ...n) {
|
|
26
|
+
return u(
|
|
27
|
+
...n.map((t) => c(t, e))
|
|
28
|
+
);
|
|
24
29
|
}
|
|
25
|
-
function
|
|
26
|
-
const t =
|
|
30
|
+
function y(e, n) {
|
|
31
|
+
const t = i(n);
|
|
27
32
|
if (!t) return;
|
|
28
|
-
const o = e === "system" ?
|
|
33
|
+
const o = e === "system" ? m() : e;
|
|
29
34
|
t.classList.remove("light", "dark"), t.classList.add(o), t.style.colorScheme = o;
|
|
30
35
|
}
|
|
31
|
-
function p(e,
|
|
32
|
-
const
|
|
36
|
+
function p(e, n) {
|
|
37
|
+
const t = i(n);
|
|
38
|
+
t && (e ? t.setAttribute?.("data-floe-shell-theme", e) : t.removeAttribute?.("data-floe-shell-theme"));
|
|
39
|
+
}
|
|
40
|
+
function T(e, n = [], t) {
|
|
41
|
+
const o = i(t);
|
|
33
42
|
if (!o) return [];
|
|
34
|
-
const
|
|
35
|
-
const [, s] =
|
|
43
|
+
const l = Object.entries(e ?? {}).filter((r) => {
|
|
44
|
+
const [, s] = r;
|
|
36
45
|
return typeof s == "string" && s.length > 0;
|
|
37
|
-
}), a = new Set(
|
|
38
|
-
for (const
|
|
39
|
-
a.has(
|
|
40
|
-
for (const [
|
|
41
|
-
o.style.setProperty(
|
|
46
|
+
}), a = new Set(l.map(([r]) => r));
|
|
47
|
+
for (const r of n)
|
|
48
|
+
a.has(r) || o.style.removeProperty(r);
|
|
49
|
+
for (const [r, s] of l)
|
|
50
|
+
o.style.setProperty(r, s);
|
|
42
51
|
return [...a];
|
|
43
52
|
}
|
|
44
53
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
p as applyShellThemeAttribute,
|
|
55
|
+
y as applyTheme,
|
|
56
|
+
f as builtInThemes,
|
|
57
|
+
m as getSystemTheme,
|
|
58
|
+
h as isThemeType,
|
|
48
59
|
u as mergeThemeTokenMaps,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
c as resolveThemeTokenOverrides,
|
|
61
|
+
d as resolveThemeTokens,
|
|
62
|
+
T as syncThemeTokenOverrides
|
|
52
63
|
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { FloeThemePreset, FloeThemePresetMode } from './index';
|
|
2
|
+
export type FloeShellThemeMode = 'light' | 'dark';
|
|
3
|
+
export interface FloeShellThemeSelection {
|
|
4
|
+
version: 1;
|
|
5
|
+
light?: string;
|
|
6
|
+
dark?: string;
|
|
7
|
+
}
|
|
8
|
+
export type FloeShellThemeDefaults = Partial<Record<FloeShellThemeMode, string>>;
|
|
9
|
+
type ShellThemeTokenName = '--background' | '--foreground' | '--primary' | '--primary-foreground' | '--secondary' | '--secondary-foreground' | '--muted' | '--muted-foreground' | '--accent' | '--accent-foreground' | '--border' | '--input' | '--ring' | '--chrome-border' | '--top-bar-border' | '--activity-bar-border' | '--bottom-bar-border' | '--terminal-panel-border' | '--card' | '--card-foreground' | '--popover' | '--popover-foreground' | '--success' | '--success-foreground' | '--warning' | '--warning-foreground' | '--error' | '--error-foreground' | '--info' | '--info-foreground' | '--highlight-block-info-accent' | '--highlight-block-warning-accent' | '--highlight-block-success-accent' | '--highlight-block-error-accent' | '--highlight-block-note-accent' | '--highlight-block-tip-accent' | '--sidebar' | '--sidebar-foreground' | '--sidebar-primary' | '--sidebar-primary-foreground' | '--sidebar-accent' | '--sidebar-accent-foreground' | '--sidebar-border' | '--sidebar-ring' | '--activity-bar' | '--activity-bar-foreground' | '--activity-bar-foreground-active' | '--activity-bar-badge' | '--activity-bar-badge-foreground' | '--terminal-background' | '--terminal-foreground' | '--chart-1' | '--chart-2' | '--chart-3' | '--chart-4' | '--chart-5' | '--selection-bg' | '--selection-fg' | '--selection-on-primary-bg' | '--selection-on-primary-fg' | '--selection-code-bg' | '--selection-code-fg';
|
|
10
|
+
export declare const REQUIRED_SHELL_THEME_TOKENS: readonly ShellThemeTokenName[];
|
|
11
|
+
interface ShellThemePaletteDefinition {
|
|
12
|
+
name: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
description: string;
|
|
15
|
+
mode: FloeShellThemeMode;
|
|
16
|
+
background: string;
|
|
17
|
+
foreground: string;
|
|
18
|
+
card: string;
|
|
19
|
+
muted: string;
|
|
20
|
+
mutedForeground: string;
|
|
21
|
+
primary: string;
|
|
22
|
+
primaryForeground: string;
|
|
23
|
+
border: string;
|
|
24
|
+
input: string;
|
|
25
|
+
sidebar: string;
|
|
26
|
+
terminalBackground: string;
|
|
27
|
+
terminalForeground: string;
|
|
28
|
+
selectionBackground: string;
|
|
29
|
+
selectionForeground: string;
|
|
30
|
+
chart: readonly [string, string, string, string, string];
|
|
31
|
+
syntax?: {
|
|
32
|
+
comment: string;
|
|
33
|
+
keyword: string;
|
|
34
|
+
string: string;
|
|
35
|
+
number: string;
|
|
36
|
+
type: string;
|
|
37
|
+
function: string;
|
|
38
|
+
constant: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function createShellThemePreset(definition: ShellThemePaletteDefinition): FloeThemePreset;
|
|
42
|
+
export declare const builtInShellThemePresets: readonly [{
|
|
43
|
+
inheritsBaseTokens: true;
|
|
44
|
+
tokens: undefined;
|
|
45
|
+
name: string;
|
|
46
|
+
displayName: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
mode?: FloeThemePresetMode;
|
|
49
|
+
preview?: {
|
|
50
|
+
background: string;
|
|
51
|
+
surface: string;
|
|
52
|
+
primary: string;
|
|
53
|
+
sidebar?: string;
|
|
54
|
+
border?: string;
|
|
55
|
+
colors: readonly [string, string, string, string, string];
|
|
56
|
+
};
|
|
57
|
+
monaco?: Partial<Record<"light" | "dark", import("./index").FloeMonacoThemeDefinition>>;
|
|
58
|
+
}, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, {
|
|
59
|
+
inheritsBaseTokens: true;
|
|
60
|
+
tokens: undefined;
|
|
61
|
+
name: string;
|
|
62
|
+
displayName: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
mode?: FloeThemePresetMode;
|
|
65
|
+
preview?: {
|
|
66
|
+
background: string;
|
|
67
|
+
surface: string;
|
|
68
|
+
primary: string;
|
|
69
|
+
sidebar?: string;
|
|
70
|
+
border?: string;
|
|
71
|
+
colors: readonly [string, string, string, string, string];
|
|
72
|
+
};
|
|
73
|
+
monaco?: Partial<Record<"light" | "dark", import("./index").FloeMonacoThemeDefinition>>;
|
|
74
|
+
}, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset, FloeThemePreset];
|
|
75
|
+
export declare const BUILT_IN_SHELL_THEME_DEFAULTS: {
|
|
76
|
+
readonly light: "classic-light";
|
|
77
|
+
readonly dark: "classic-dark";
|
|
78
|
+
};
|
|
79
|
+
export declare function presetSupportsMode(preset: FloeThemePreset, mode: FloeShellThemeMode): boolean;
|
|
80
|
+
export declare function getShellThemePresetsForMode(presets: readonly FloeThemePreset[], mode: FloeShellThemeMode): readonly FloeThemePreset[];
|
|
81
|
+
export declare function assertUniqueThemePresetNames(presets: readonly FloeThemePreset[]): void;
|
|
82
|
+
export declare function resolveShellThemePresetName(presets: readonly FloeThemePreset[], mode: FloeShellThemeMode, preferredName?: string, defaultName?: string): string | undefined;
|
|
83
|
+
export declare function normalizeShellThemeSelection(value: unknown, presets: readonly FloeThemePreset[], defaults?: FloeShellThemeDefaults): FloeShellThemeSelection;
|
|
84
|
+
export {};
|