@floegence/floe-webapp-core 0.56.3 → 0.56.7
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/chat/blocks/CodeBlock.d.ts +3 -0
- package/dist/components/chat/blocks/CodeBlock.js +62 -46
- package/dist/styles/themes/classicSemanticTokens.d.ts +138 -138
- package/dist/styles/themes/classicSemanticTokens.js +14 -13
- package/dist/styles/themes/presets.js +38 -36
- package/dist/styles/themes/progressTokens.d.ts +5 -0
- package/dist/styles/themes/progressTokens.js +72 -0
- package/dist/styles.css +1 -1
- package/dist/themes/dark.css +4 -0
- package/dist/themes/light.css +4 -0
- package/dist/themes/shell-presets.generated.css +96 -0
- package/dist/ui.css +6 -16
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createProgressTokens as b } from "./progressTokens.js";
|
|
2
|
+
import { DARK_WINDOW_TOKENS as B, LIGHT_WINDOW_TOKENS as A } from "./windowTokens.js";
|
|
2
3
|
import { CLASSIC_LIGHT_SEMANTIC_TOKENS as d, CLASSIC_DARK_SEMANTIC_TOKENS as F } from "./classicSemanticTokens.js";
|
|
3
|
-
const
|
|
4
|
+
const T = [
|
|
4
5
|
"--floe-window-background",
|
|
5
6
|
"--floe-window-foreground",
|
|
6
7
|
"--floe-window-muted-foreground",
|
|
@@ -70,7 +71,7 @@ const S = [
|
|
|
70
71
|
"--selection-code-bg",
|
|
71
72
|
"--selection-code-fg",
|
|
72
73
|
"--glow"
|
|
73
|
-
],
|
|
74
|
+
], E = {
|
|
74
75
|
success: "#287A4B",
|
|
75
76
|
successForeground: "#FFFFFF",
|
|
76
77
|
warning: "#835800",
|
|
@@ -81,7 +82,7 @@ const S = [
|
|
|
81
82
|
infoForeground: "#FFFFFF",
|
|
82
83
|
note: "#6847A0",
|
|
83
84
|
tip: "#1E6F73"
|
|
84
|
-
},
|
|
85
|
+
}, k = {
|
|
85
86
|
success: "#72D39C",
|
|
86
87
|
successForeground: "#07160E",
|
|
87
88
|
warning: "#F0C36A",
|
|
@@ -94,19 +95,19 @@ const S = [
|
|
|
94
95
|
tip: "#71C8C0"
|
|
95
96
|
};
|
|
96
97
|
function o(r) {
|
|
97
|
-
const e = r.mode === "light" ?
|
|
98
|
+
const e = r.mode === "light" ? E : k, n = r.mode === "light" ? { background: "#F4C95D", foreground: "#243447" } : {
|
|
98
99
|
background: r.background,
|
|
99
100
|
foreground: r.foreground
|
|
100
|
-
}, [t, c, u,
|
|
101
|
+
}, [t, c, u, i, s] = r.chart, a = r.syntax ?? {
|
|
101
102
|
comment: r.mutedForeground,
|
|
102
103
|
keyword: t,
|
|
103
104
|
string: c,
|
|
104
|
-
number:
|
|
105
|
+
number: i,
|
|
105
106
|
type: u,
|
|
106
107
|
function: s,
|
|
107
|
-
constant:
|
|
108
|
-
},
|
|
109
|
-
...r.mode === "dark" ?
|
|
108
|
+
constant: i
|
|
109
|
+
}, g = {
|
|
110
|
+
...r.mode === "dark" ? B : A,
|
|
110
111
|
"--background": r.background,
|
|
111
112
|
"--foreground": r.foreground,
|
|
112
113
|
"--primary": r.primary,
|
|
@@ -161,7 +162,7 @@ function o(r) {
|
|
|
161
162
|
"--chart-1": t,
|
|
162
163
|
"--chart-2": c,
|
|
163
164
|
"--chart-3": u,
|
|
164
|
-
"--chart-4":
|
|
165
|
+
"--chart-4": i,
|
|
165
166
|
"--chart-5": s,
|
|
166
167
|
"--selection-bg": r.selectionBackground,
|
|
167
168
|
"--selection-fg": r.selectionForeground,
|
|
@@ -173,8 +174,9 @@ function o(r) {
|
|
|
173
174
|
// selectionBackground so we don't inherit a near-white primary as glow source.
|
|
174
175
|
"--glow": r.glow ?? (r.mode === "light" ? r.primary : r.selectionBackground)
|
|
175
176
|
};
|
|
177
|
+
Object.assign(g, b(r.mode, g));
|
|
176
178
|
for (const [l, p] of Object.entries(r.fileIconColors ?? {}))
|
|
177
|
-
|
|
179
|
+
g[`--floe-file-icon-${l}`] = p;
|
|
178
180
|
return {
|
|
179
181
|
name: r.name,
|
|
180
182
|
displayName: r.displayName,
|
|
@@ -188,7 +190,7 @@ function o(r) {
|
|
|
188
190
|
border: r.border,
|
|
189
191
|
colors: r.chart
|
|
190
192
|
},
|
|
191
|
-
semanticTokens:
|
|
193
|
+
semanticTokens: g,
|
|
192
194
|
monaco: {
|
|
193
195
|
[r.mode]: {
|
|
194
196
|
base: r.mode === "light" ? "vs" : "vs-dark",
|
|
@@ -248,10 +250,10 @@ function o(r) {
|
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
},
|
|
251
|
-
tokens: r.mode === "light" ? { light:
|
|
253
|
+
tokens: r.mode === "light" ? { light: g } : { dark: g }
|
|
252
254
|
};
|
|
253
255
|
}
|
|
254
|
-
const
|
|
256
|
+
const y = {
|
|
255
257
|
...o({
|
|
256
258
|
name: "classic-light",
|
|
257
259
|
displayName: "Classic Light",
|
|
@@ -285,7 +287,7 @@ const k = {
|
|
|
285
287
|
inheritsBaseTokens: !0,
|
|
286
288
|
semanticTokens: d,
|
|
287
289
|
tokens: void 0
|
|
288
|
-
},
|
|
290
|
+
}, C = {
|
|
289
291
|
...o({
|
|
290
292
|
name: "classic-dark",
|
|
291
293
|
displayName: "Classic Dark",
|
|
@@ -319,8 +321,8 @@ const k = {
|
|
|
319
321
|
inheritsBaseTokens: !0,
|
|
320
322
|
semanticTokens: F,
|
|
321
323
|
tokens: void 0
|
|
322
|
-
},
|
|
323
|
-
|
|
324
|
+
}, h = [
|
|
325
|
+
y,
|
|
324
326
|
o({
|
|
325
327
|
name: "paper",
|
|
326
328
|
displayName: "Paper",
|
|
@@ -576,7 +578,7 @@ const k = {
|
|
|
576
578
|
constant: "#745500"
|
|
577
579
|
}
|
|
578
580
|
}),
|
|
579
|
-
|
|
581
|
+
C,
|
|
580
582
|
o({
|
|
581
583
|
name: "ink",
|
|
582
584
|
displayName: "Ink",
|
|
@@ -962,18 +964,18 @@ const k = {
|
|
|
962
964
|
constant: "#E9A4A0"
|
|
963
965
|
}
|
|
964
966
|
})
|
|
965
|
-
],
|
|
967
|
+
], x = {
|
|
966
968
|
light: "classic-light",
|
|
967
969
|
dark: "classic-dark"
|
|
968
970
|
};
|
|
969
|
-
function
|
|
971
|
+
function D(r, e) {
|
|
970
972
|
const n = r.mode ?? "both";
|
|
971
973
|
return n === "both" || n === e;
|
|
972
974
|
}
|
|
973
|
-
function
|
|
974
|
-
return r.filter((n) =>
|
|
975
|
+
function f(r, e) {
|
|
976
|
+
return r.filter((n) => D(n, e));
|
|
975
977
|
}
|
|
976
|
-
function
|
|
978
|
+
function w(r) {
|
|
977
979
|
const e = /* @__PURE__ */ new Set();
|
|
978
980
|
for (const n of r) {
|
|
979
981
|
if (e.has(n.name))
|
|
@@ -982,26 +984,26 @@ function f(r) {
|
|
|
982
984
|
}
|
|
983
985
|
}
|
|
984
986
|
function m(r, e, n, t) {
|
|
985
|
-
const c =
|
|
987
|
+
const c = f(r, e);
|
|
986
988
|
return n && c.some((u) => u.name === n) ? n : t && c.some((u) => u.name === t) ? t : c[0]?.name;
|
|
987
989
|
}
|
|
988
|
-
function
|
|
989
|
-
const t = typeof r == "object" && r !== null && !Array.isArray(r) ? r : void 0, c = t?.version === 1, u = c && typeof t.light == "string" ? t.light : void 0,
|
|
990
|
+
function L(r, e, n = {}) {
|
|
991
|
+
const t = typeof r == "object" && r !== null && !Array.isArray(r) ? r : void 0, c = t?.version === 1, u = c && typeof t.light == "string" ? t.light : void 0, i = c && typeof t.dark == "string" ? t.dark : void 0;
|
|
990
992
|
return {
|
|
991
993
|
version: 1,
|
|
992
994
|
light: m(e, "light", u, n.light),
|
|
993
|
-
dark: m(e, "dark",
|
|
995
|
+
dark: m(e, "dark", i, n.dark)
|
|
994
996
|
};
|
|
995
997
|
}
|
|
996
|
-
|
|
998
|
+
w(h);
|
|
997
999
|
export {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1000
|
+
x as BUILT_IN_SHELL_THEME_DEFAULTS,
|
|
1001
|
+
T as REQUIRED_SHELL_THEME_TOKENS,
|
|
1002
|
+
w as assertUniqueThemePresetNames,
|
|
1003
|
+
h as builtInShellThemePresets,
|
|
1002
1004
|
o as createShellThemePreset,
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1005
|
+
f as getShellThemePresetsForMode,
|
|
1006
|
+
L as normalizeShellThemeSelection,
|
|
1007
|
+
D as presetSupportsMode,
|
|
1006
1008
|
m as resolveShellThemePresetName
|
|
1007
1009
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FloeThemeTokenMap } from './index';
|
|
2
|
+
/** Derive static progress paint from the authored palette, for CSS and host metadata.
|
|
3
|
+
* All interpolation adds white in sRGB, so even antialiased glyph edges brighten.
|
|
4
|
+
* Neutral surfaces share a conservative contrast bound; no DOM sampling is needed. */
|
|
5
|
+
export declare function createProgressTokens(mode: 'light' | 'dark', tokens: Readonly<FloeThemeTokenMap>): FloeThemeTokenMap;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const g = (t) => (t /= 255) <= 0.04045 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4, u = (t) => t.map(g).reduce((r, a, n) => r + a * [0.2126, 0.7152, 0.0722][n], 0), M = (t, r) => (Math.max(u(t), u(r)) + 0.05) / (Math.min(u(t), u(r)) + 0.05), d = (t, r) => t.map((a) => Math.round(a + (255 - a) * r)), f = (t) => `rgb(${t.join(" ")})`;
|
|
2
|
+
function x(t) {
|
|
3
|
+
const [r, a, n] = t.map(g), s = Math.cbrt(0.4122214708 * r + 0.5363325363 * a + 0.0514459929 * n), o = Math.cbrt(0.2119034982 * r + 0.6806995451 * a + 0.1073969566 * n), m = Math.cbrt(0.0883024619 * r + 0.2817188376 * a + 0.6299787005 * n);
|
|
4
|
+
return [
|
|
5
|
+
0.2104542553 * s + 0.793617785 * o - 0.0040720468 * m,
|
|
6
|
+
1.9779984951 * s - 2.428592205 * o + 0.4505937099 * m,
|
|
7
|
+
0.0259040371 * s + 0.7827717662 * o - 0.808675766 * m
|
|
8
|
+
];
|
|
9
|
+
}
|
|
10
|
+
function P(t, r) {
|
|
11
|
+
const [, a, n] = x(t), s = Math.min(1, 0.03 / Math.max(Math.hypot(a, n), 1e-10)), o = a * s, m = n * s, c = (r + 0.3963377774 * o + 0.2158037573 * m) ** 3, l = (r - 0.1055613458 * o - 0.0638541728 * m) ** 3, h = (r - 0.0894841775 * o - 1.291485548 * m) ** 3;
|
|
12
|
+
return [
|
|
13
|
+
4.0767416621 * c - 3.3077115913 * l + 0.2309699292 * h,
|
|
14
|
+
-1.2684380046 * c + 2.6097574011 * l - 0.3413193965 * h,
|
|
15
|
+
-0.0041960863 * c - 0.7034186147 * l + 1.707614701 * h
|
|
16
|
+
].map(
|
|
17
|
+
(e) => Math.round(
|
|
18
|
+
Math.max(0, Math.min(1, e <= 31308e-7 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - 0.055)) * 255
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function b(t) {
|
|
23
|
+
let r = 0, a = 1;
|
|
24
|
+
for (let n = 0; n < 26; n++) {
|
|
25
|
+
const s = (r + a) / 2;
|
|
26
|
+
t(s) ? r = s : a = s;
|
|
27
|
+
}
|
|
28
|
+
return r;
|
|
29
|
+
}
|
|
30
|
+
function $(t, r) {
|
|
31
|
+
const a = (e) => {
|
|
32
|
+
const i = r[e];
|
|
33
|
+
if (!i || !/^#[\da-f]{6}$/iu.test(i))
|
|
34
|
+
throw new Error(`Progress palette requires an opaque hex color: ${e}`);
|
|
35
|
+
return [1, 3, 5].map((p) => parseInt(i.slice(p, p + 2), 16));
|
|
36
|
+
}, n = ["--background", "--card", "--muted", "--accent", "--popover", "--sidebar"].map(
|
|
37
|
+
(e) => a(e)
|
|
38
|
+
), s = (e, i) => n.every((p) => M(e, p) >= i);
|
|
39
|
+
let o = P(a("--foreground"), t === "dark" ? 0.69 : 0.2);
|
|
40
|
+
if (t === "dark")
|
|
41
|
+
for (; (!s(o, 4.55) || M(o, a("--background")) < 5) && o.some((e) => e < 255); )
|
|
42
|
+
o = o.map((e) => Math.min(255, e + 1));
|
|
43
|
+
const m = d(
|
|
44
|
+
o,
|
|
45
|
+
t === "dark" ? 1 : b((e) => s(d(o, e), 4.65))
|
|
46
|
+
);
|
|
47
|
+
let c = a("--primary");
|
|
48
|
+
const l = a("--primary-foreground");
|
|
49
|
+
let h = 0.28;
|
|
50
|
+
if (u(l) > u(c)) {
|
|
51
|
+
const e = b(
|
|
52
|
+
(i) => M(d(c.map((p) => Math.round(p * i)), h), l) >= 4.65
|
|
53
|
+
);
|
|
54
|
+
c = c.map((i) => Math.round(i * e));
|
|
55
|
+
} else {
|
|
56
|
+
const e = (i) => {
|
|
57
|
+
const p = x(c), k = x(d(c, i));
|
|
58
|
+
return Math.hypot(...p.map((y, w) => y - k[w]));
|
|
59
|
+
};
|
|
60
|
+
for (; e(1) < 0.105; ) c = c.map((i) => Math.floor(i * 0.99));
|
|
61
|
+
for (; e(h) < 0.105 && h < 1; ) h = Math.min(1, h + 5e-3);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
"--floe-progress-text-base": f(o),
|
|
65
|
+
"--floe-progress-text-peak": f(m),
|
|
66
|
+
"--floe-progress-primary-base": f(c),
|
|
67
|
+
"--floe-progress-primary-white-mix": `${(h * 100).toFixed(1)}%`
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
$ as createProgressTokens
|
|
72
|
+
};
|