@floegence/floe-webapp-core 0.34.0 → 0.35.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/layout/ActivityBar.js +32 -32
- package/dist/components/layout/BottomBar.js +19 -19
- package/dist/components/layout/MobileTabBar.js +29 -29
- package/dist/components/layout/Shell.d.ts +14 -0
- package/dist/components/layout/Shell.js +173 -144
- package/dist/components/layout/Sidebar.js +7 -7
- package/dist/components/layout/TopBar.js +18 -18
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/context/FloeConfigContext.d.ts +8 -1
- package/dist/context/ThemeContext.js +32 -27
- package/dist/floe.css +1 -0
- package/dist/full.js +601 -599
- package/dist/index.js +113 -111
- package/dist/styles/themes/index.d.ts +20 -1
- package/dist/styles/themes/index.js +34 -7
- package/dist/styles.css +1 -1
- package/dist/themes/dark.css +5 -0
- package/dist/themes/light.css +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,118 +1,120 @@
|
|
|
1
1
|
import { FloeProvider as r } from "./app/FloeProvider.js";
|
|
2
|
-
import { applyTheme as i, builtInThemes as n, getSystemTheme as s } from "./styles/themes/index.js";
|
|
3
|
-
import { CommandProvider as
|
|
4
|
-
import { ComponentRegistryProvider as
|
|
5
|
-
import { DEFAULT_FLOE_CONFIG as
|
|
6
|
-
import { DeckProvider as
|
|
7
|
-
import { FileBrowserDragProvider as
|
|
8
|
-
import { LayoutProvider as
|
|
9
|
-
import { NotificationContainer as
|
|
10
|
-
import { ThemeProvider as
|
|
11
|
-
import { ViewActivationProvider as
|
|
12
|
-
import { WidgetRegistryProvider as
|
|
13
|
-
import { WidgetStateProvider as
|
|
14
|
-
import { applyDragDelta as
|
|
15
|
-
import { checkCollision as
|
|
16
|
-
import { cn as
|
|
17
|
-
import { createSimpleContext as
|
|
18
|
-
import { deferAfterPaint as
|
|
19
|
-
import { duration as
|
|
20
|
-
import { formatKeybind as
|
|
21
|
-
import { isTypingElement as
|
|
22
|
-
import { lockBodyStyle as
|
|
23
|
-
import { registerCommandContributions as
|
|
24
|
-
import { useDebounce as
|
|
25
|
-
import { useDeckDrag as
|
|
26
|
-
import { useFileBrowserDropTarget as
|
|
27
|
-
import { useKeybind as
|
|
28
|
-
import { useMediaQuery as
|
|
29
|
-
import { usePersisted as
|
|
30
|
-
import { useResizeObserver as
|
|
2
|
+
import { applyTheme as i, builtInThemes as n, getSystemTheme as s, resolveThemeTokenOverrides as m, syncThemeTokenOverrides as a } from "./styles/themes/index.js";
|
|
3
|
+
import { CommandProvider as d, createCommandService as f, useCommand as l } from "./context/CommandContext.js";
|
|
4
|
+
import { ComponentRegistryProvider as x, createComponentRegistry as g, hasComponentRegistryContext as c, useComponentContextFactory as C, useComponentRegistry as y, useOptionalComponentRegistry as v } from "./context/ComponentRegistry.js";
|
|
5
|
+
import { DEFAULT_FLOE_CONFIG as D, FloeConfigProvider as T, useFloeConfig as P, useResolvedFloeConfig as h } from "./context/FloeConfigContext.js";
|
|
6
|
+
import { DeckProvider as R, createDeckService as S, useDeck as b } from "./context/DeckContext.js";
|
|
7
|
+
import { FileBrowserDragProvider as B, hasFileBrowserDragContext as w, useFileBrowserDrag as W } from "./context/FileBrowserDragContext.js";
|
|
8
|
+
import { LayoutProvider as N, createLayoutService as O, useLayout as A } from "./context/LayoutContext.js";
|
|
9
|
+
import { NotificationContainer as z, NotificationProvider as K, createNotificationService as E, useNotification as V } from "./context/NotificationContext.js";
|
|
10
|
+
import { ThemeProvider as H, createThemeService as M, useTheme as Q } from "./context/ThemeContext.js";
|
|
11
|
+
import { ViewActivationProvider as j, useViewActivation as q } from "./context/ViewActivationContext.js";
|
|
12
|
+
import { WidgetRegistryProvider as X, createWidgetRegistry as Y, useWidgetRegistry as Z } from "./context/WidgetRegistry.js";
|
|
13
|
+
import { WidgetStateProvider as ee, useCurrentWidgetId as oe, useWidgetState as re, useWidgetStateContext as te } from "./context/WidgetStateContext.js";
|
|
14
|
+
import { applyDragDelta as ne, applyResizeDelta as se, getGridCellSize as me, pixelDeltaToGridDelta as ae, positionToGridArea as pe, snapToGrid as de } from "./utils/gridLayout.js";
|
|
15
|
+
import { checkCollision as le, constrainPosition as ue, findFreePosition as xe, hasCollision as ge } from "./utils/gridCollision.js";
|
|
16
|
+
import { cn as Ce } from "./utils/cn.js";
|
|
17
|
+
import { createSimpleContext as ve } from "./context/createSimpleContext.js";
|
|
18
|
+
import { deferAfterPaint as De, deferNonBlocking as Te } from "./utils/defer.js";
|
|
19
|
+
import { duration as he, easing as Ie, fadeIn as Re, listContainer as Se, listItem as be, panelResize as ke, popIn as Be, scaleIn as we, sidebarVariants as We, slideInFromBottom as Le, slideInFromLeft as Ne, slideInFromRight as Oe, slideInFromTop as Ae, springConfig as Ge } from "./utils/animations.js";
|
|
20
|
+
import { formatKeybind as Ke, matchKeybind as Ee, parseKeybind as Ve } from "./utils/keybind.js";
|
|
21
|
+
import { isTypingElement as He, shouldIgnoreHotkeys as Me } from "./utils/dom.js";
|
|
22
|
+
import { lockBodyStyle as Ue } from "./utils/bodyStyleLock.js";
|
|
23
|
+
import { registerCommandContributions as qe, useCommandContributions as Je } from "./hooks/useCommandContributions.js";
|
|
24
|
+
import { useDebounce as Ye } from "./hooks/useDebounce.js";
|
|
25
|
+
import { useDeckDrag as $e } from "./hooks/useDeckDrag.js";
|
|
26
|
+
import { useFileBrowserDropTarget as oo, useFileBrowserItemDrag as ro } from "./hooks/useFileBrowserDrag.js";
|
|
27
|
+
import { useKeybind as io } from "./hooks/useKeybind.js";
|
|
28
|
+
import { useMediaQuery as so } from "./hooks/useMediaQuery.js";
|
|
29
|
+
import { usePersisted as ao } from "./hooks/usePersisted.js";
|
|
30
|
+
import { useResizeObserver as fo } from "./hooks/useResizeObserver.js";
|
|
31
31
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
d as CommandProvider,
|
|
33
|
+
x as ComponentRegistryProvider,
|
|
34
|
+
D as DEFAULT_FLOE_CONFIG,
|
|
35
|
+
R as DeckProvider,
|
|
36
|
+
B as FileBrowserDragProvider,
|
|
37
|
+
T as FloeConfigProvider,
|
|
38
38
|
r as FloeProvider,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
N as LayoutProvider,
|
|
40
|
+
z as NotificationContainer,
|
|
41
|
+
K as NotificationProvider,
|
|
42
|
+
H as ThemeProvider,
|
|
43
|
+
j as ViewActivationProvider,
|
|
44
|
+
X as WidgetRegistryProvider,
|
|
45
|
+
ee as WidgetStateProvider,
|
|
46
|
+
ne as applyDragDelta,
|
|
47
|
+
se as applyResizeDelta,
|
|
48
48
|
i as applyTheme,
|
|
49
49
|
n as builtInThemes,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
le as checkCollision,
|
|
51
|
+
Ce as cn,
|
|
52
|
+
ue as constrainPosition,
|
|
53
|
+
f as createCommandService,
|
|
54
|
+
g as createComponentRegistry,
|
|
55
|
+
S as createDeckService,
|
|
56
|
+
O as createLayoutService,
|
|
57
|
+
E as createNotificationService,
|
|
58
|
+
ve as createSimpleContext,
|
|
59
|
+
M as createThemeService,
|
|
60
|
+
Y as createWidgetRegistry,
|
|
61
|
+
De as deferAfterPaint,
|
|
62
|
+
Te as deferNonBlocking,
|
|
63
|
+
he as duration,
|
|
64
|
+
Ie as easing,
|
|
65
|
+
Re as fadeIn,
|
|
66
|
+
xe as findFreePosition,
|
|
67
|
+
Ke as formatKeybind,
|
|
68
|
+
me as getGridCellSize,
|
|
69
69
|
s as getSystemTheme,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Ye as
|
|
101
|
-
|
|
102
|
-
$e as
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
ro as
|
|
106
|
-
|
|
107
|
-
io as
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
70
|
+
ge as hasCollision,
|
|
71
|
+
c as hasComponentRegistryContext,
|
|
72
|
+
w as hasFileBrowserDragContext,
|
|
73
|
+
He as isTypingElement,
|
|
74
|
+
Se as listContainer,
|
|
75
|
+
be as listItem,
|
|
76
|
+
Ue as lockBodyStyle,
|
|
77
|
+
Ee as matchKeybind,
|
|
78
|
+
ke as panelResize,
|
|
79
|
+
Ve as parseKeybind,
|
|
80
|
+
ae as pixelDeltaToGridDelta,
|
|
81
|
+
Be as popIn,
|
|
82
|
+
pe as positionToGridArea,
|
|
83
|
+
qe as registerCommandContributions,
|
|
84
|
+
m as resolveThemeTokenOverrides,
|
|
85
|
+
we as scaleIn,
|
|
86
|
+
Me as shouldIgnoreHotkeys,
|
|
87
|
+
We as sidebarVariants,
|
|
88
|
+
Le as slideInFromBottom,
|
|
89
|
+
Ne as slideInFromLeft,
|
|
90
|
+
Oe as slideInFromRight,
|
|
91
|
+
Ae as slideInFromTop,
|
|
92
|
+
de as snapToGrid,
|
|
93
|
+
Ge as springConfig,
|
|
94
|
+
a as syncThemeTokenOverrides,
|
|
95
|
+
l as useCommand,
|
|
96
|
+
Je as useCommandContributions,
|
|
97
|
+
C as useComponentContextFactory,
|
|
98
|
+
y as useComponentRegistry,
|
|
99
|
+
oe as useCurrentWidgetId,
|
|
100
|
+
Ye as useDebounce,
|
|
101
|
+
b as useDeck,
|
|
102
|
+
$e as useDeckDrag,
|
|
103
|
+
W as useFileBrowserDrag,
|
|
104
|
+
oo as useFileBrowserDropTarget,
|
|
105
|
+
ro as useFileBrowserItemDrag,
|
|
106
|
+
P as useFloeConfig,
|
|
107
|
+
io as useKeybind,
|
|
108
|
+
A as useLayout,
|
|
109
|
+
so as useMediaQuery,
|
|
110
|
+
V as useNotification,
|
|
111
|
+
v as useOptionalComponentRegistry,
|
|
112
|
+
ao as usePersisted,
|
|
113
|
+
fo as useResizeObserver,
|
|
114
|
+
h as useResolvedFloeConfig,
|
|
115
|
+
Q as useTheme,
|
|
116
|
+
q as useViewActivation,
|
|
117
|
+
Z as useWidgetRegistry,
|
|
118
|
+
re as useWidgetState,
|
|
119
|
+
te as useWidgetStateContext
|
|
118
120
|
};
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
export type ThemeType = 'light' | 'dark' | 'system';
|
|
2
|
+
export type FloeThemeTokenMap = Partial<Record<`--${string}`, string>>;
|
|
3
|
+
export interface FloeThemeTokenOverrides {
|
|
4
|
+
shared?: FloeThemeTokenMap;
|
|
5
|
+
light?: FloeThemeTokenMap;
|
|
6
|
+
dark?: FloeThemeTokenMap;
|
|
7
|
+
}
|
|
8
|
+
export interface ThemeTarget {
|
|
9
|
+
classList: {
|
|
10
|
+
add: (...tokens: string[]) => void;
|
|
11
|
+
remove: (...tokens: string[]) => void;
|
|
12
|
+
};
|
|
13
|
+
style: {
|
|
14
|
+
colorScheme?: string;
|
|
15
|
+
setProperty: (property: string, value: string) => void;
|
|
16
|
+
removeProperty: (property: string) => void;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
2
19
|
export interface FloeTheme {
|
|
3
20
|
name: string;
|
|
4
21
|
displayName: string;
|
|
@@ -6,4 +23,6 @@ export interface FloeTheme {
|
|
|
6
23
|
}
|
|
7
24
|
export declare const builtInThemes: FloeTheme[];
|
|
8
25
|
export declare function getSystemTheme(): 'light' | 'dark';
|
|
9
|
-
export declare function
|
|
26
|
+
export declare function resolveThemeTokenOverrides(tokens: FloeThemeTokenOverrides | undefined, resolvedTheme: 'light' | 'dark'): FloeThemeTokenMap;
|
|
27
|
+
export declare function applyTheme(theme: ThemeType, target?: ThemeTarget): void;
|
|
28
|
+
export declare function syncThemeTokenOverrides(tokens: FloeThemeTokenMap | undefined, previousTokenNames?: Iterable<string>, target?: ThemeTarget): string[];
|
|
@@ -2,16 +2,43 @@ const d = [
|
|
|
2
2
|
{ name: "light", displayName: "Light", type: "light" },
|
|
3
3
|
{ name: "dark", displayName: "Dark", type: "dark" }
|
|
4
4
|
];
|
|
5
|
-
function
|
|
5
|
+
function l() {
|
|
6
6
|
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
function c(e) {
|
|
9
|
+
if (e) return e;
|
|
10
|
+
if (!(typeof document > "u"))
|
|
11
|
+
return document.documentElement;
|
|
12
|
+
}
|
|
13
|
+
function m(e, o) {
|
|
14
|
+
return {
|
|
15
|
+
...e?.shared ?? {},
|
|
16
|
+
...o === "light" ? e?.light ?? {} : e?.dark ?? {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function u(e, o) {
|
|
20
|
+
const r = c(o);
|
|
21
|
+
if (!r) return;
|
|
22
|
+
const n = e === "system" ? l() : e;
|
|
23
|
+
r.classList.remove("light", "dark"), r.classList.add(n), r.style.colorScheme = n;
|
|
24
|
+
}
|
|
25
|
+
function f(e, o = [], r) {
|
|
26
|
+
const n = c(r);
|
|
27
|
+
if (!n) return [];
|
|
28
|
+
const i = Object.entries(e ?? {}).filter((t) => {
|
|
29
|
+
const [, s] = t;
|
|
30
|
+
return typeof s == "string" && s.length > 0;
|
|
31
|
+
}), a = new Set(i.map(([t]) => t));
|
|
32
|
+
for (const t of o)
|
|
33
|
+
a.has(t) || n.style.removeProperty(t);
|
|
34
|
+
for (const [t, s] of i)
|
|
35
|
+
n.style.setProperty(t, s);
|
|
36
|
+
return [...a];
|
|
12
37
|
}
|
|
13
38
|
export {
|
|
14
|
-
|
|
39
|
+
u as applyTheme,
|
|
15
40
|
d as builtInThemes,
|
|
16
|
-
|
|
41
|
+
l as getSystemTheme,
|
|
42
|
+
m as resolveThemeTokenOverrides,
|
|
43
|
+
f as syncThemeTokenOverrides
|
|
17
44
|
};
|