@timmo001/groundwork-report 0.9.40 → 0.10.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/package.json +3 -3
- package/src/client.ts +12 -13
- package/src/page.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timmo001/groundwork-report",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Groundwork's report page: one self-contained HTML file built from blocks, with every theme and the desktop's Omarchy theme",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"format:check": "prettier --check ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@timmo001/groundwork-tokens": "0.
|
|
39
|
-
"@timmo001/groundwork-ui": "0.
|
|
38
|
+
"@timmo001/groundwork-tokens": "0.10.1",
|
|
39
|
+
"@timmo001/groundwork-ui": "0.10.1",
|
|
40
40
|
"effect": "4.1.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
package/src/client.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
coreThemeChoices,
|
|
13
13
|
optionalThemeChoices,
|
|
14
14
|
pageTheme,
|
|
15
|
+
themeOptions,
|
|
15
16
|
type ThemeChoice,
|
|
16
17
|
type ThemeMode,
|
|
17
18
|
} from "@timmo001/groundwork-tokens/page";
|
|
@@ -44,7 +45,6 @@ const page = pageTheme({
|
|
|
44
45
|
key: config.key,
|
|
45
46
|
themes: [...coreThemeChoices, ...optionalThemeChoices, ...desktopChoices],
|
|
46
47
|
defaultTheme: config.defaultTheme,
|
|
47
|
-
followOmarchy: false,
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
// A desktop theme is solved the first time it's picked, then cached so the
|
|
@@ -97,23 +97,22 @@ page.subscribe((state) => applyDesktop(state.theme));
|
|
|
97
97
|
const picker = document.querySelector("gw-theme-picker");
|
|
98
98
|
|
|
99
99
|
if (picker !== null) {
|
|
100
|
+
// The report's own theme first, then the other core themes, then the
|
|
101
|
+
// optional ones grouped by the palette they come from, such as Catppuccin
|
|
102
|
+
const builtIn = themeOptions([
|
|
103
|
+
...coreThemeChoices.filter(({ id }) => id === config.defaultTheme),
|
|
104
|
+
...coreThemeChoices.filter(({ id }) => id !== config.defaultTheme),
|
|
105
|
+
...optionalThemeChoices,
|
|
106
|
+
]);
|
|
107
|
+
|
|
100
108
|
const render = () => {
|
|
101
|
-
const { mode, theme, omarchy } = page.state();
|
|
109
|
+
const { mode, theme, only, omarchy } = page.state();
|
|
102
110
|
|
|
103
111
|
picker.mode = mode;
|
|
104
112
|
picker.theme = theme;
|
|
113
|
+
picker.scheme = only ?? "";
|
|
105
114
|
picker.themes = [
|
|
106
|
-
...
|
|
107
|
-
value: id,
|
|
108
|
-
label: name,
|
|
109
|
-
group: "Core",
|
|
110
|
-
})),
|
|
111
|
-
// Grouped by the palette they come from, such as Catppuccin
|
|
112
|
-
...optionalThemeChoices.map(({ id, name, family }) => ({
|
|
113
|
-
value: id,
|
|
114
|
-
label: name,
|
|
115
|
-
group: family ?? "More themes",
|
|
116
|
-
})),
|
|
115
|
+
...builtIn,
|
|
117
116
|
// Themes translated from the machine the page was made on: the Omarchy
|
|
118
117
|
// theme in use, which reads `Omarchy (Tokyo Night)`, then the rest,
|
|
119
118
|
// such as `Nord (Omarchy)` or `Ghostty (Ghostty)`
|
package/src/page.ts
CHANGED
|
@@ -104,7 +104,7 @@ export const reportPage = (options: ReportPageOptions) => {
|
|
|
104
104
|
/>
|
|
105
105
|
<title>${options.title}</title>
|
|
106
106
|
<script>
|
|
107
|
-
${raw(inline(themeBootScript({ key, defaultTheme
|
|
107
|
+
${raw(inline(themeBootScript({ key, defaultTheme }) + desktopBootScript(key), "script"))};
|
|
108
108
|
</script>
|
|
109
109
|
<style>
|
|
110
110
|
${raw(inline(options.assets.css, "style"))}
|