@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/index.js CHANGED
@@ -1,142 +1,154 @@
1
1
  import { FloeProvider as r } from "./app/FloeProvider.js";
2
- import { applyTheme as i, builtInThemes as s, getSystemTheme as n, mergeThemeTokenMaps as a, resolveThemeTokenOverrides as m, resolveThemeTokens as p, syncThemeTokenOverrides as l } from "./styles/themes/index.js";
3
- import { floeColorTokenCategories as d, floeDesignTokens as g, floeFontFamilyTokens as c, floeMotionTokens as x, floeRadiusTokens as T, floeSharedCssVariables as u, floeSpacingTokens as C, floeThemeColorVariables as y, floeTypographyTokens as v, getFloeColorTokenValue as F } from "./styles/tokens.js";
4
- import { CommandProvider as h, createCommandService as P, useCommand as R } from "./context/CommandContext.js";
5
- import { ComponentRegistryProvider as I, createComponentRegistry as S, hasComponentRegistryContext as b, useComponentContextFactory as O, useComponentRegistry as A, useOptionalComponentRegistry as E } from "./context/ComponentRegistry.js";
6
- import { DEFAULT_FLOE_CONFIG as B, FloeConfigProvider as N, useFloeConfig as _, useResolvedFloeConfig as w } from "./context/FloeConfigContext.js";
7
- import { DeckProvider as W, createDeckService as M, useDeck as V } from "./context/DeckContext.js";
8
- import { FLOE_GEOMETRY_SURFACE_ATTR as z, FLOE_HOT_INTERACTION_ATTR as H, startHotInteraction as U } from "./utils/hotInteraction.js";
9
- import { FileBrowserDragProvider as Y, hasFileBrowserDragContext as j, useFileBrowserDrag as q } from "./context/FileBrowserDragContext.js";
10
- import { LayoutProvider as X, createLayoutService as Z, useLayout as $ } from "./context/LayoutContext.js";
11
- import { NotificationContainer as oe, NotificationProvider as re, createNotificationService as te, useNotification as ie } from "./context/NotificationContext.js";
12
- import { ThemeProvider as ne, createThemeService as ae, useTheme as me } from "./context/ThemeContext.js";
13
- import { ViewActivationProvider as le, useViewActivation as fe } from "./context/ViewActivationContext.js";
14
- import { WidgetRegistryProvider as ge, createWidgetRegistry as ce, useWidgetRegistry as xe } from "./context/WidgetRegistry.js";
15
- import { WidgetStateProvider as ue, useCurrentWidgetId as Ce, useWidgetState as ye, useWidgetStateContext as ve } from "./context/WidgetStateContext.js";
16
- import { applyDragDelta as ke, applyResizeDelta as he, getGridCellSize as Pe, pixelDeltaToGridDelta as Re, positionToGridArea as De, snapToGrid as Ie } from "./utils/gridLayout.js";
17
- import { checkCollision as be, constrainPosition as Oe, findFreePosition as Ae, hasCollision as Ee, sameGridPosition as Le } from "./utils/gridCollision.js";
18
- import { cn as Ne } from "./utils/cn.js";
19
- import { createSimpleContext as we } from "./context/createSimpleContext.js";
20
- import { createUIFirstSelection as We } from "./utils/uiFirstSelection.js";
21
- import { deferAfterPaint as Ve, deferNonBlocking as Ke } from "./utils/defer.js";
22
- import { duration as He, easing as Ue, fadeIn as Qe, listContainer as Ye, listItem as je, panelResize as qe, popIn as Je, scaleIn as Xe, sidebarVariants as Ze, slideInFromBottom as $e, slideInFromLeft as eo, slideInFromRight as oo, slideInFromTop as ro, springConfig as to } from "./utils/animations.js";
23
- import { formatKeybind as so, isMacLikePlatform as no, isPrimaryModKeyPressed as ao, matchKeybind as mo, parseKeybind as po } from "./utils/keybind.js";
24
- import { isTypingElement as fo, shouldIgnoreHotkeys as go } from "./utils/dom.js";
25
- import { lockBodyStyle as xo } from "./utils/bodyStyleLock.js";
26
- import { registerCommandContributions as uo, useCommandContributions as Co } from "./hooks/useCommandContributions.js";
27
- import { useDebounce as vo } from "./hooks/useDebounce.js";
28
- import { useDeckDrag as ko } from "./hooks/useDeckDrag.js";
29
- import { useFileBrowserDropTarget as Po, useFileBrowserItemDrag as Ro } from "./hooks/useFileBrowserDrag.js";
30
- import { useKeybind as Io } from "./hooks/useKeybind.js";
31
- import { useMediaQuery as bo } from "./hooks/useMediaQuery.js";
32
- import { usePersisted as Ao } from "./hooks/usePersisted.js";
33
- import { useResizeObserver as Lo } from "./hooks/useResizeObserver.js";
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
- h as CommandProvider,
36
- I as ComponentRegistryProvider,
37
- B as DEFAULT_FLOE_CONFIG,
38
- W as DeckProvider,
39
- z as FLOE_GEOMETRY_SURFACE_ATTR,
40
- H as FLOE_HOT_INTERACTION_ATTR,
41
- Y as FileBrowserDragProvider,
42
- N as FloeConfigProvider,
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
- X as LayoutProvider,
45
- oe as NotificationContainer,
46
- re as NotificationProvider,
47
- ne as ThemeProvider,
48
- le as ViewActivationProvider,
49
- ge as WidgetRegistryProvider,
50
- ue as WidgetStateProvider,
51
- ke as applyDragDelta,
52
- he as applyResizeDelta,
53
- i as applyTheme,
54
- s as builtInThemes,
55
- be as checkCollision,
56
- Ne as cn,
57
- Oe as constrainPosition,
58
- P as createCommandService,
59
- S as createComponentRegistry,
60
- M as createDeckService,
61
- Z as createLayoutService,
62
- te as createNotificationService,
63
- we as createSimpleContext,
64
- ae as createThemeService,
65
- We as createUIFirstSelection,
66
- ce as createWidgetRegistry,
67
- Ve as deferAfterPaint,
68
- Ke as deferNonBlocking,
69
- He as duration,
70
- Ue as easing,
71
- Qe as fadeIn,
72
- Ae as findFreePosition,
73
- d as floeColorTokenCategories,
74
- g as floeDesignTokens,
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
- T as floeRadiusTokens,
78
- u as floeSharedCssVariables,
79
- C as floeSpacingTokens,
80
- y as floeThemeColorVariables,
81
- v as floeTypographyTokens,
82
- so as formatKeybind,
83
- F as getFloeColorTokenValue,
84
- Pe as getGridCellSize,
85
- n as getSystemTheme,
86
- Ee as hasCollision,
87
- b as hasComponentRegistryContext,
88
- j as hasFileBrowserDragContext,
89
- no as isMacLikePlatform,
90
- ao as isPrimaryModKeyPressed,
91
- fo as isTypingElement,
92
- Ye as listContainer,
93
- je as listItem,
94
- xo as lockBodyStyle,
95
- mo as matchKeybind,
96
- a as mergeThemeTokenMaps,
97
- qe as panelResize,
98
- po as parseKeybind,
99
- Re as pixelDeltaToGridDelta,
100
- Je as popIn,
101
- De as positionToGridArea,
102
- uo as registerCommandContributions,
103
- m as resolveThemeTokenOverrides,
104
- p as resolveThemeTokens,
105
- Le as sameGridPosition,
106
- Xe as scaleIn,
107
- go as shouldIgnoreHotkeys,
108
- Ze as sidebarVariants,
109
- $e as slideInFromBottom,
110
- eo as slideInFromLeft,
111
- oo as slideInFromRight,
112
- ro as slideInFromTop,
113
- Ie as snapToGrid,
114
- to as springConfig,
115
- U as startHotInteraction,
116
- l as syncThemeTokenOverrides,
117
- R as useCommand,
118
- Co as useCommandContributions,
119
- O as useComponentContextFactory,
120
- A as useComponentRegistry,
121
- Ce as useCurrentWidgetId,
122
- vo as useDebounce,
123
- V as useDeck,
124
- ko as useDeckDrag,
125
- q as useFileBrowserDrag,
126
- Po as useFileBrowserDropTarget,
127
- Ro as useFileBrowserItemDrag,
128
- _ as useFloeConfig,
129
- Io as useKeybind,
130
- $ as useLayout,
131
- bo as useMediaQuery,
132
- ie as useNotification,
133
- E as useOptionalComponentRegistry,
134
- Ao as usePersisted,
135
- Lo as useResizeObserver,
136
- w as useResolvedFloeConfig,
137
- me as useTheme,
138
- fe as useViewActivation,
139
- xe as useWidgetRegistry,
140
- ye as useWidgetState,
141
- ve as useWidgetStateContext
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 d = [
1
+ const f = [
2
2
  { name: "light", displayName: "Light", type: "light" },
3
3
  { name: "dark", displayName: "Dark", type: "dark" }
4
4
  ];
5
- function l() {
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 c(e) {
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 m(e, r) {
16
+ function c(e, n) {
14
17
  return {
15
18
  ...e?.shared ?? {},
16
- ...r === "light" ? e?.light ?? {} : e?.dark ?? {}
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 f(e, ...r) {
23
- return u(...r.map((t) => m(t, e)));
25
+ function d(e, ...n) {
26
+ return u(
27
+ ...n.map((t) => c(t, e))
28
+ );
24
29
  }
25
- function h(e, r) {
26
- const t = c(r);
30
+ function y(e, n) {
31
+ const t = i(n);
27
32
  if (!t) return;
28
- const o = e === "system" ? l() : e;
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, r = [], t) {
32
- const o = c(t);
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 i = Object.entries(e ?? {}).filter((n) => {
35
- const [, s] = n;
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(i.map(([n]) => n));
38
- for (const n of r)
39
- a.has(n) || o.style.removeProperty(n);
40
- for (const [n, s] of i)
41
- o.style.setProperty(n, s);
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
- h as applyTheme,
46
- d as builtInThemes,
47
- l as getSystemTheme,
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
- m as resolveThemeTokenOverrides,
50
- f as resolveThemeTokens,
51
- p as syncThemeTokenOverrides
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 {};