@d0nj/dsh-ui-custom 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 d0nj
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,3 +1,83 @@
1
- # Temporary Holding Version
1
+ # @d0nj/dsh-ui-custom
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Theme presets, colour tokens, typography, and geometry for the DeepSeek Harness Web UI, edited live from a **Theme Studio** panel in Settings.
4
+
5
+ ## Why
6
+
7
+ The Harness ships one palette per mode. Restyling it otherwise means editing CSS that the next upgrade overwrites. This bundle registers complete themes through the existing `ctx.theme` seam and keeps your overrides in profile config, so a choice survives reloads, upgrades, and machine switches.
8
+
9
+ ## What you get
10
+
11
+ - **15 presets**, each defined for both light and dark: Midnight, Paper, High contrast, Dracula, Nord, Catppuccin Mocha, Gruvbox, One Dark, Solarized, Rosé Pine, Tokyo Night, Ayu Dark, GitHub Dark, Monokai, Mono.
12
+ - **14 colour tokens** — surfaces, borders, text, brand, and state colours — each overridable per mode.
13
+ - **Typography** per role: interface/body, code, and the sidebar terminal, including font stacks and separate sizes.
14
+ - **Geometry**: corner radius (0–24 px) and spacing density (compact, comfortable, spacious).
15
+ - **Theme Studio** panel with live preview, so changes apply without a restart.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ pnpm install
21
+ pnpm --filter @d0nj/dsh-ui-custom build
22
+ ```
23
+
24
+ Then install the package directory into a profile with the `plugin_manager` tool. The bundle patch inserts one row, `ui-custom`, which is also the settings namespace the panel reads.
25
+
26
+ A browser-half change needs `pnpm build` and a page reload; the Host runs in-process, so a Host-side change needs a Harness restart.
27
+
28
+ ## Configure
29
+
30
+ The stored document is the config for the `ui-custom` row:
31
+
32
+ ```yaml
33
+ - id: ui-custom
34
+ name: '@d0nj/dsh-ui-custom'
35
+ config:
36
+ basePreset: nord
37
+ tokens:
38
+ --dsw-alias-bg-base:
39
+ light: '#fafafa'
40
+ dark: '#111318'
41
+ typography:
42
+ textFontFamily: 'Inter, system-ui, sans-serif'
43
+ codeFontFamily: 'JetBrains Mono, monospace'
44
+ fontSize: 14
45
+ codeFontSize: 12
46
+ terminalFontSize: 13
47
+ geometry:
48
+ radius: 8
49
+ density: comfortable
50
+ ```
51
+
52
+ | Field | Default | Meaning |
53
+ |---|---|---|
54
+ | `basePreset` | `none` | Preset to build on, or `none` for the shipped theme |
55
+ | `tokens` | `{}` | Per-token overrides applied over the preset, keyed by CSS custom property |
56
+ | `typography` | built-in stacks | Font stacks per role; empty string keeps the built-in stack |
57
+ | `typography.fontSize` | `14` | Conversation text size in px |
58
+ | `typography.codeFontSize` | `11` | Code block size in px |
59
+ | `typography.terminalFontSize` | `13` | Sidebar terminal size in px |
60
+ | `geometry.radius` | `8` | Corner radius in px, 0–24 |
61
+ | `geometry.density` | `comfortable` | Spacing scale: `compact`, `comfortable`, `spacious` |
62
+
63
+ Every token override must set **both** `light` and `dark`. A token defined for one mode alone goes illegible when the palette flips, so the schema rejects it rather than trusting each caller to remember.
64
+
65
+ ## Behaviour worth knowing
66
+
67
+ - **Presets are real themes.** Each registers through `ctx.theme` with its own id. A preset id already taken by another bundle is reported and skipped, never fatal.
68
+ - **Overrides are one layer.** The panel writes a single `overrideTokens` layer, replaced wholesale on each change, so restyling never accumulates stale tokens.
69
+ - **Bad input warns, it does not throw.** An unknown preset, an implausible colour, or an out-of-range size is dropped and surfaced in the panel's warnings; the plugin always mounts.
70
+ - **Writes happen only on real changes.** Typography and token writes are compared first, so the shipped Appearance rows are not fought on every render.
71
+ - **Shipped presets clear WCAG AA** for body and secondary text against their own base surface, in both modes. The tests compute the contrast ratios rather than asserting a hand-checked number.
72
+
73
+ ## Tests
74
+
75
+ ```bash
76
+ pnpm test
77
+ ```
78
+
79
+ Catalog invariants, preset completeness across every token and both modes, resolver merge and override order, clamping and colour validation, and the contrast checks above. No network, no browser.
80
+
81
+ ## Deps
82
+
83
+ Peers: `@deepseek-ai/cordis ~4.0.5` and `@deepseek-ai/schemastery ~3.18.5`. The browser services (`dsh-client-ui-theme`, `-ui-settings`, `-ui-slots`) are supplied by the Host's runtime module table and are not npm dependencies. React arrives from the loader.
@@ -0,0 +1,22 @@
1
+ # Contributes the customization document and its defaults.
2
+ #
3
+ # The browser half reads this row's namespace ("ui-custom") through the settings
4
+ # client, so a choice made in Theme Studio persists here and survives a reload.
5
+ # Selecting the preset below is a starting point, not a requirement: the panel
6
+ # changes it through the same namespace.
7
+ - insert:
8
+ - id: ui-custom
9
+ name: '@d0nj/dsh-ui-custom'
10
+ config:
11
+ basePreset: none
12
+ tokens: {}
13
+ typography:
14
+ textFontFamily: ''
15
+ codeFontFamily: ''
16
+ terminalFontFamily: ''
17
+ fontSize: 14
18
+ codeFontSize: 11
19
+ terminalFontSize: 13
20
+ geometry:
21
+ radius: 8
22
+ density: comfortable