@pioneercompany/app-sdk 0.1.2 → 0.2.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 +14 -7
- package/dist/client/index.d.ts +3 -9
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -9
- package/dist/client/index.js.map +1 -1
- package/dist/client/theme.d.ts +59 -0
- package/dist/client/theme.d.ts.map +1 -0
- package/dist/client/theme.js +392 -0
- package/dist/client/theme.js.map +1 -0
- package/dist-cjs/client/index.d.ts +3 -9
- package/dist-cjs/client/index.d.ts.map +1 -1
- package/dist-cjs/client/index.js +9 -10
- package/dist-cjs/client/index.js.map +1 -1
- package/dist-cjs/client/theme.d.ts +59 -0
- package/dist-cjs/client/theme.d.ts.map +1 -0
- package/dist-cjs/client/theme.js +396 -0
- package/dist-cjs/client/theme.js.map +1 -0
- package/docs/contract.md +27 -15
- package/docs/theme.md +56 -0
- package/fixtures/protocol.json +603 -17
- package/package.json +1 -1
- package/src/client/index.ts +11 -17
- package/src/client/theme.ts +418 -0
package/docs/theme.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Complete application theme (SDK 0.2)
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
const app = await connectApp();
|
|
5
|
+
app.theme.subscribe(theme => {
|
|
6
|
+
theme.mode; // "light" | "dark"
|
|
7
|
+
theme.colors.success; // resolved current CSS color
|
|
8
|
+
theme.colors.tab_bar;
|
|
9
|
+
theme.colors.scrollbar_thumb;
|
|
10
|
+
theme.light_theme.colors["base.blue.light"];
|
|
11
|
+
theme.dark_theme.colors["success.background"];
|
|
12
|
+
theme.dark_theme["font.size"];
|
|
13
|
+
theme.dark_theme.highlight;
|
|
14
|
+
theme.tokens.background; // solid color + native background data
|
|
15
|
+
theme.semantic_tokens; // complete colors/radius/spacing/etc.
|
|
16
|
+
theme.highlight_theme;
|
|
17
|
+
theme.font_family;
|
|
18
|
+
theme.mono_font_family;
|
|
19
|
+
theme.radius;
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The message is `{ type: "pioneer.theme", theme: { ... } }`. `theme.current` is that
|
|
24
|
+
complete snapshot, not a selected color palette. It is recursively immutable and
|
|
25
|
+
retains every serializable field, including future fields unknown to this SDK.
|
|
26
|
+
Both Light and Dark configs are included regardless of which mode is active.
|
|
27
|
+
Config color keys use the original dotted spelling from the theme-file schema;
|
|
28
|
+
resolved current colors use native ThemeColor names. Config values can be null
|
|
29
|
+
when inherited. Use resolved `theme.colors` to render the current appearance.
|
|
30
|
+
|
|
31
|
+
The exported `Theme`, `ThemeColors`, `ThemeConfig` and `ThemeConfigColors` types
|
|
32
|
+
cover the complete known schema. `THEME_COLOR_KEYS` lists all 139 resolved color
|
|
33
|
+
roles, and `THEME_CONFIG_COLOR_KEYS` lists all 140 theme-file roles from the pinned
|
|
34
|
+
GPUI schema, including every color in Pioneer's theme template. Open JSON index
|
|
35
|
+
signatures preserve access to future keys without requiring another transport
|
|
36
|
+
change. Native delivery serializes the theme directly; those SDK lists validate
|
|
37
|
+
and describe known fields, and never filter unknown fields out of a snapshot.
|
|
38
|
+
|
|
39
|
+
Font sizes and radii are numeric pixels. Colors serialized by native GPUI use
|
|
40
|
+
`#RRGGBBAA`; other CSS color strings are accepted for resolved colors. Native
|
|
41
|
+
background/gradient and highlighting objects are retained as JSON data. SDK
|
|
42
|
+
performs no CSS injection or implicit conversion of native drawing structures.
|
|
43
|
+
|
|
44
|
+
## Migrating from 0.1
|
|
45
|
+
|
|
46
|
+
| Previous | 0.2 |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `theme.appearance` | `theme.mode` |
|
|
49
|
+
| `theme.background` / `foreground` / `border` | `theme.colors.background` / `foreground` / `border` |
|
|
50
|
+
| `theme.muted` | `theme.colors.muted_foreground` |
|
|
51
|
+
| `theme.accent` / `theme["accent-foreground"]` | `theme.colors.primary` / `primary_foreground` |
|
|
52
|
+
| `theme.success`, `warning`, `danger`, `info` | `theme.colors.success`, `warning`, `danger`, `info` |
|
|
53
|
+
|
|
54
|
+
No flat aliases or old-palette adapter are provided. Use the updated Desktop
|
|
55
|
+
bridge and SDK 0.2 together. Outside Pioneer, `theme.current` remains null until a
|
|
56
|
+
complete valid snapshot arrives; applications own any standalone defaults.
|