@floegence/floe-webapp-core 0.38.0 → 0.39.1
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/classicSemanticTokens.d.ts +2 -0
- package/dist/styles/themes/classicSemanticTokens.js +142 -0
- package/dist/styles/themes/index.d.ts +36 -0
- package/dist/styles/themes/index.js +36 -25
- package/dist/styles/themes/presets.d.ts +86 -0
- package/dist/styles/themes/presets.js +863 -0
- package/dist/styles.css +1 -1
- package/dist/themes/shell-presets.generated.css +1281 -0
- package/dist/themes.d.ts +2 -0
- package/dist/themes.js +11 -0
- package/package.json +7 -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
|
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
function a(h) {
|
|
2
|
+
const l = {}, c = (r, e = /* @__PURE__ */ new Set()) => {
|
|
3
|
+
const o = h[r];
|
|
4
|
+
if (!o || e.has(r)) return o;
|
|
5
|
+
const s = /^var\((--[\w-]+)\)$/u.exec(o)?.[1];
|
|
6
|
+
return s ? (e.add(r), c(s, e)) : o;
|
|
7
|
+
};
|
|
8
|
+
for (const r of Object.keys(h))
|
|
9
|
+
l[r] = c(r);
|
|
10
|
+
return Object.freeze(l);
|
|
11
|
+
}
|
|
12
|
+
const n = {
|
|
13
|
+
"--background": "hsl(34 24% 94%)",
|
|
14
|
+
"--foreground": "hsl(214 26% 17%)",
|
|
15
|
+
"--primary": "hsl(214 26% 17%)",
|
|
16
|
+
"--primary-foreground": "hsl(36 100% 99%)",
|
|
17
|
+
"--secondary": "hsl(36 15% 94%)",
|
|
18
|
+
"--secondary-foreground": "hsl(214 25% 25%)",
|
|
19
|
+
"--muted": "hsl(36 15% 94%)",
|
|
20
|
+
"--muted-foreground": "hsl(215 16% 42%)",
|
|
21
|
+
"--accent": "hsl(34 11% 88%)",
|
|
22
|
+
"--accent-foreground": "hsl(214 26% 17%)",
|
|
23
|
+
"--border": "hsl(35 13% 82%)",
|
|
24
|
+
"--input": "hsl(37 15% 76%)",
|
|
25
|
+
"--ring": "hsl(214 26% 17%)",
|
|
26
|
+
"--chrome-border": "hsl(33 11% 84%)",
|
|
27
|
+
"--top-bar-border": "var(--chrome-border)",
|
|
28
|
+
"--activity-bar-border": "var(--chrome-border)",
|
|
29
|
+
"--bottom-bar-border": "var(--chrome-border)",
|
|
30
|
+
"--terminal-panel-border": "var(--chrome-border)",
|
|
31
|
+
"--card": "hsl(36 100% 99%)",
|
|
32
|
+
"--card-foreground": "hsl(214 26% 17%)",
|
|
33
|
+
"--popover": "hsl(36 100% 99%)",
|
|
34
|
+
"--popover-foreground": "hsl(214 26% 17%)",
|
|
35
|
+
"--success": "oklch(0.68 0.16 150)",
|
|
36
|
+
"--success-foreground": "hsl(0 0% 100%)",
|
|
37
|
+
"--warning": "hsl(38 92% 50%)",
|
|
38
|
+
"--warning-foreground": "hsl(214 26% 17%)",
|
|
39
|
+
"--error": "oklch(0.65 0.2 25)",
|
|
40
|
+
"--error-foreground": "hsl(0 0% 100%)",
|
|
41
|
+
"--info": "hsl(217 91% 60%)",
|
|
42
|
+
"--info-foreground": "hsl(0 0% 100%)",
|
|
43
|
+
"--highlight-block-info-accent": "oklch(0.52 0.14 245)",
|
|
44
|
+
"--highlight-block-warning-accent": "oklch(0.62 0.16 65)",
|
|
45
|
+
"--highlight-block-success-accent": "oklch(0.55 0.14 155)",
|
|
46
|
+
"--highlight-block-error-accent": "oklch(0.55 0.16 25)",
|
|
47
|
+
"--highlight-block-note-accent": "oklch(0.52 0.16 285)",
|
|
48
|
+
"--highlight-block-tip-accent": "oklch(0.52 0.12 175)",
|
|
49
|
+
"--sidebar": "hsl(36 13% 92%)",
|
|
50
|
+
"--sidebar-foreground": "hsl(214 26% 17%)",
|
|
51
|
+
"--sidebar-primary": "hsl(214 26% 17%)",
|
|
52
|
+
"--sidebar-primary-foreground": "hsl(36 100% 99%)",
|
|
53
|
+
"--sidebar-accent": "hsl(34 11% 88%)",
|
|
54
|
+
"--sidebar-accent-foreground": "hsl(214 26% 17%)",
|
|
55
|
+
"--sidebar-border": "hsl(33 11% 84%)",
|
|
56
|
+
"--sidebar-ring": "hsl(214 26% 17%)",
|
|
57
|
+
"--activity-bar": "hsl(36 13% 92%)",
|
|
58
|
+
"--activity-bar-foreground": "hsl(215 16% 42%)",
|
|
59
|
+
"--activity-bar-foreground-active": "hsl(214 26% 17%)",
|
|
60
|
+
"--activity-bar-badge": "hsl(214 26% 17%)",
|
|
61
|
+
"--activity-bar-badge-foreground": "hsl(36 100% 99%)",
|
|
62
|
+
"--terminal-background": "hsl(214 26% 17%)",
|
|
63
|
+
"--terminal-foreground": "hsl(0 0% 92%)",
|
|
64
|
+
"--chart-1": "hsl(214 26% 17%)",
|
|
65
|
+
"--chart-2": "hsl(215 16% 42%)",
|
|
66
|
+
"--chart-3": "hsl(217 91% 60%)",
|
|
67
|
+
"--chart-4": "oklch(0.68 0.16 150)",
|
|
68
|
+
"--chart-5": "hsl(38 92% 50%)",
|
|
69
|
+
"--selection-bg": "hsl(217 91% 60%)",
|
|
70
|
+
"--selection-fg": "hsl(0 0% 100%)",
|
|
71
|
+
"--selection-on-primary-bg": "hsl(38 92% 50%)",
|
|
72
|
+
"--selection-on-primary-fg": "hsl(214 26% 17%)",
|
|
73
|
+
"--selection-code-bg": "hsl(212 100% 67%)",
|
|
74
|
+
"--selection-code-fg": "hsl(220 20% 8%)"
|
|
75
|
+
}, i = {
|
|
76
|
+
"--background": "hsl(222 30% 8%)",
|
|
77
|
+
"--foreground": "hsl(210 20% 98%)",
|
|
78
|
+
"--primary": "hsl(210 20% 98%)",
|
|
79
|
+
"--primary-foreground": "hsl(222 30% 10%)",
|
|
80
|
+
"--secondary": "hsl(220 25% 14%)",
|
|
81
|
+
"--secondary-foreground": "hsl(210 20% 98%)",
|
|
82
|
+
"--muted": "hsl(220 25% 14%)",
|
|
83
|
+
"--muted-foreground": "hsl(215 20% 60%)",
|
|
84
|
+
"--accent": "hsl(220 25% 16%)",
|
|
85
|
+
"--accent-foreground": "hsl(210 20% 98%)",
|
|
86
|
+
"--border": "hsl(220 20% 18%)",
|
|
87
|
+
"--input": "hsl(220 25% 14%)",
|
|
88
|
+
"--ring": "hsl(215 25% 70%)",
|
|
89
|
+
"--chrome-border": "var(--border)",
|
|
90
|
+
"--top-bar-border": "var(--chrome-border)",
|
|
91
|
+
"--activity-bar-border": "var(--chrome-border)",
|
|
92
|
+
"--bottom-bar-border": "var(--chrome-border)",
|
|
93
|
+
"--terminal-panel-border": "var(--chrome-border)",
|
|
94
|
+
"--card": "hsl(222 28% 10%)",
|
|
95
|
+
"--card-foreground": "hsl(210 20% 98%)",
|
|
96
|
+
"--popover": "hsl(222 28% 10%)",
|
|
97
|
+
"--popover-foreground": "hsl(210 20% 98%)",
|
|
98
|
+
"--success": "oklch(0.72 0.19 150)",
|
|
99
|
+
"--success-foreground": "hsl(222 30% 10%)",
|
|
100
|
+
"--warning": "oklch(0.82 0.16 80)",
|
|
101
|
+
"--warning-foreground": "hsl(222 30% 10%)",
|
|
102
|
+
"--error": "oklch(0.7 0.22 25)",
|
|
103
|
+
"--error-foreground": "hsl(0 0% 100%)",
|
|
104
|
+
"--info": "oklch(0.7 0.15 250)",
|
|
105
|
+
"--info-foreground": "hsl(0 0% 100%)",
|
|
106
|
+
"--highlight-block-info-accent": "oklch(0.62 0.12 240)",
|
|
107
|
+
"--highlight-block-warning-accent": "oklch(0.7 0.14 65)",
|
|
108
|
+
"--highlight-block-success-accent": "oklch(0.62 0.12 155)",
|
|
109
|
+
"--highlight-block-error-accent": "oklch(0.6 0.14 25)",
|
|
110
|
+
"--highlight-block-note-accent": "oklch(0.62 0.14 285)",
|
|
111
|
+
"--highlight-block-tip-accent": "oklch(0.6 0.1 175)",
|
|
112
|
+
"--sidebar": "hsl(222 28% 10%)",
|
|
113
|
+
"--sidebar-foreground": "hsl(210 20% 98%)",
|
|
114
|
+
"--sidebar-primary": "hsl(217 80% 55%)",
|
|
115
|
+
"--sidebar-primary-foreground": "hsl(0 0% 100%)",
|
|
116
|
+
"--sidebar-accent": "hsl(220 25% 16%)",
|
|
117
|
+
"--sidebar-accent-foreground": "hsl(210 20% 98%)",
|
|
118
|
+
"--sidebar-border": "hsl(220 20% 18%)",
|
|
119
|
+
"--sidebar-ring": "hsl(217 80% 55%)",
|
|
120
|
+
"--activity-bar": "hsl(222 30% 9%)",
|
|
121
|
+
"--activity-bar-foreground": "hsl(215 20% 55%)",
|
|
122
|
+
"--activity-bar-foreground-active": "hsl(210 20% 98%)",
|
|
123
|
+
"--activity-bar-badge": "hsl(217 80% 55%)",
|
|
124
|
+
"--activity-bar-badge-foreground": "hsl(0 0% 100%)",
|
|
125
|
+
"--terminal-background": "hsl(222 32% 7%)",
|
|
126
|
+
"--terminal-foreground": "hsl(210 15% 92%)",
|
|
127
|
+
"--chart-1": "hsl(210 20% 98%)",
|
|
128
|
+
"--chart-2": "hsl(215 20% 60%)",
|
|
129
|
+
"--chart-3": "oklch(0.7 0.15 250)",
|
|
130
|
+
"--chart-4": "oklch(0.72 0.19 150)",
|
|
131
|
+
"--chart-5": "oklch(0.82 0.16 80)",
|
|
132
|
+
"--selection-bg": "hsl(215 70% 50%)",
|
|
133
|
+
"--selection-fg": "hsl(0 0% 100%)",
|
|
134
|
+
"--selection-on-primary-bg": "hsl(215 80% 35%)",
|
|
135
|
+
"--selection-on-primary-fg": "hsl(0 0% 100%)",
|
|
136
|
+
"--selection-code-bg": "hsl(212 100% 67%)",
|
|
137
|
+
"--selection-code-fg": "hsl(220 20% 8%)"
|
|
138
|
+
}, t = a(n), d = a(i);
|
|
139
|
+
export {
|
|
140
|
+
d as CLASSIC_DARK_SEMANTIC_TOKENS,
|
|
141
|
+
t as CLASSIC_LIGHT_SEMANTIC_TOKENS
|
|
142
|
+
};
|
|
@@ -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,25 @@ 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
|
+
/**
|
|
36
|
+
* Complete resolved shell tokens for non-renderer adapters such as Electron's main process.
|
|
37
|
+
* Unlike `tokens`, this also contains the inherited Classic baseline without applying it as
|
|
38
|
+
* an inline renderer override.
|
|
39
|
+
*/
|
|
40
|
+
semanticTokens?: Readonly<FloeThemeTokenMap>;
|
|
41
|
+
/** Optional Monaco definitions keyed by resolved light/dark mode. */
|
|
42
|
+
monaco?: Partial<Record<'light' | 'dark', FloeMonacoThemeDefinition>>;
|
|
12
43
|
tokens?: FloeThemeTokenOverrides;
|
|
13
44
|
}
|
|
14
45
|
export interface ThemeTarget {
|
|
@@ -21,6 +52,8 @@ export interface ThemeTarget {
|
|
|
21
52
|
setProperty: (property: string, value: string) => void;
|
|
22
53
|
removeProperty: (property: string) => void;
|
|
23
54
|
};
|
|
55
|
+
setAttribute?: (qualifiedName: string, value: string) => void;
|
|
56
|
+
removeAttribute?: (qualifiedName: string) => void;
|
|
24
57
|
}
|
|
25
58
|
export interface FloeTheme {
|
|
26
59
|
name: string;
|
|
@@ -28,9 +61,12 @@ export interface FloeTheme {
|
|
|
28
61
|
type: 'light' | 'dark';
|
|
29
62
|
}
|
|
30
63
|
export declare const builtInThemes: FloeTheme[];
|
|
64
|
+
export declare function isThemeType(value: unknown): value is ThemeType;
|
|
31
65
|
export declare function getSystemTheme(): 'light' | 'dark';
|
|
32
66
|
export declare function resolveThemeTokenOverrides(tokens: FloeThemeTokenOverrides | undefined, resolvedTheme: 'light' | 'dark'): FloeThemeTokenMap;
|
|
33
67
|
export declare function mergeThemeTokenMaps(...maps: Array<FloeThemeTokenMap | undefined>): FloeThemeTokenMap;
|
|
34
68
|
export declare function resolveThemeTokens(resolvedTheme: 'light' | 'dark', ...tokenSources: Array<FloeThemeTokenOverrides | undefined>): FloeThemeTokenMap;
|
|
35
69
|
export declare function applyTheme(theme: ThemeType, target?: ThemeTarget): void;
|
|
70
|
+
export declare function applyShellThemeAttribute(presetName: string | undefined, target?: ThemeTarget): void;
|
|
36
71
|
export declare function syncThemeTokenOverrides(tokens: FloeThemeTokenMap | undefined, previousTokenNames?: Iterable<string>, target?: ThemeTarget): string[];
|
|
72
|
+
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
|
};
|