@uni-design-system/uni-mcp 4.4.0 → 4.6.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/README.md +28 -0
- package/dist/{chunk-252ZWTTU.js → chunk-GT3T5DVX.js} +2022 -352
- package/dist/chunk-GT3T5DVX.js.map +1 -0
- package/dist/http.js +28 -4
- package/dist/http.js.map +1 -1
- package/dist/server.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-252ZWTTU.js.map +0 -1
package/README.md
CHANGED
|
@@ -82,8 +82,25 @@ tokens, never by hardcoding hex values in components.
|
|
|
82
82
|
| `list-themes` | theme templates |
|
|
83
83
|
| `get-theme-template` | **style overrides** (→ Emotion CSS) and **component options** (→ props), kept distinct |
|
|
84
84
|
| `generate-uni-theme` | complete WCAG-AA light+dark `uni-theme.ts` from brand hex color(s), with vibe/scheme/shape options, provider registration snippet, and contrast report |
|
|
85
|
+
| `generate-runtime-theme` | the same generated theme as validated JSON for `registerTheme()` — applies immediately, no file, no rebuild |
|
|
86
|
+
| `get-runtime-theme` | a theme that ships with Uni (`LightTheme`, `DarkTheme`) as a registerable `UniTheme` |
|
|
87
|
+
| `create-icon-tokens` | convert raw SVG into `currentColor`-masked theme icon tokens |
|
|
85
88
|
| `search` | keyword search across components, tokens, themes, guidelines |
|
|
86
89
|
|
|
90
|
+
### Which theme tool?
|
|
91
|
+
|
|
92
|
+
`generate-uni-theme` brands an app **permanently**: it returns an editable
|
|
93
|
+
`uni-theme.ts` that becomes the source of truth, so later restyling means
|
|
94
|
+
editing that file. The two `*-runtime-theme` tools return theme **data** for
|
|
95
|
+
`ThemeService.registerTheme(theme, { select: true })` — use them when a theme
|
|
96
|
+
should apply immediately with no build step (brand previews, per-tenant
|
|
97
|
+
theming, generated UI). `get-theme-template` neither brands nor applies: it
|
|
98
|
+
reports a theme's token values for inspection.
|
|
99
|
+
|
|
100
|
+
Runtime theme payloads omit the 61 built-in icons — ~71% of a serialized
|
|
101
|
+
theme, and bytes every uni-core consumer already ships. `ThemeService` restores
|
|
102
|
+
them on registration; outside Angular, call `hydrateTheme()` from uni-core.
|
|
103
|
+
|
|
87
104
|
Resources: `uni://meta`, `uni://components/{id}`, `uni://tokens/{id}`,
|
|
88
105
|
`uni://themes/{id}`, `uni://guidelines/{id}`.
|
|
89
106
|
|
|
@@ -94,6 +111,17 @@ endpoint — useful when you'd rather not run node processes per client.
|
|
|
94
111
|
|
|
95
112
|
- `GET /health` → status + index counts (used by Render's health check)
|
|
96
113
|
- `POST /mcp` → JSON-RPC (Streamable HTTP, stateless)
|
|
114
|
+
- `GET /themes` → the ids available as runtime theme JSON
|
|
115
|
+
- `GET /themes/{id}.json` → one registerable theme, same payload as `get-runtime-theme`
|
|
116
|
+
|
|
117
|
+
The theme routes are the registry channel for apps that fetch a theme without
|
|
118
|
+
speaking MCP. They are public, read-only and CORS-enabled so a browser can
|
|
119
|
+
fetch them directly; `/mcp` stays token-guarded and same-origin.
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
const { themes } = await fetch('https://uni-mcp.onrender.com/themes/DarkTheme.json').then((r) => r.json());
|
|
123
|
+
themeService.registerTheme(themes[0].theme, { select: true });
|
|
124
|
+
```
|
|
97
125
|
|
|
98
126
|
Client config:
|
|
99
127
|
|