@preset.nz/pom 0.1.5 → 0.1.6

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 CHANGED
@@ -37,6 +37,24 @@ await channel.run('value.set', { at: '/threads/warp', key: 'thread.tension', val
37
37
  - **Hooks**, through `useSyncExternalStore`: `useNode(id)`, `useNodeAt(path)`, `useChildren(id, order)` and `useStatus()`, under a `<PomProvider mirror={mirror}>`. A hook returns the same object until its own node changes.
38
38
  - **Wire types** (`Row`, `View`, `Update`, `Status`, `Ran`, ...) follow the Rust structs. The tests read the Rust goldens, so a shape that moves in one half fails the other's build.
39
39
 
40
+ ## Words for people
41
+
42
+ A type and its values may carry words for people. The core stores them and never reads them; they reach `Schema` (and `wire.ts`) only when given.
43
+
44
+ ```rust
45
+ NodeType::new("echo")
46
+ .label("Echo")
47
+ .summary("Repeats what it hears, quieter each time.")
48
+ .group("effect")
49
+ .float("echo.time", 1.0..=2000.0, 250.0)
50
+ .described("Time", "How long before it repeats.") // the value just added
51
+ .unit("ms")
52
+ ```
53
+
54
+ `ValueSpec` has the same `label`, `description`, `described` and `unit` builders, for values passed whole (`.value(...)`, `.bindable([...])`). An int value can also carry `.names(&["Off", "Half", "Full"])`, display names for its steps from the range's minimum; the docs show them as the range and the default. The docs scale a `%` value ×100 (stored 0.3 reads "30%") and show `Hz` and `ms` from 1000 up as `kHz` and `s`. Read them back from `NodeType::label_text`, `summary_text` and `group_tag`, or from `ValueSpec`'s fields.
55
+
56
+ The pages themselves come from [preset-docs](https://github.com/preset-nz/preset-docs), which reads a `Schema` with its `rhizome` feature (`Catalogue::from(&schema)`). It moved out of this repo on 2026-10-14, so a change to how pages read doesn't wait on a rhizome release.
57
+
40
58
  ## Tests
41
59
 
42
60
  `just check` runs `check-rust` (fmt, clippy and every suite) and `check-ts` (tsc, Biome and vitest), then the licence check.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preset.nz/pom",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "The webview client of rhizome-pom-tauri: an ordered command channel, a read-only mirror of the document and React hooks over it.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,12 +28,12 @@
28
28
  "@testing-library/react": "^16",
29
29
  "@types/node": "^24",
30
30
  "@types/react": "^19",
31
+ "@types/react-dom": "^19",
31
32
  "jsdom": "^27",
32
33
  "lefthook": "^2.1.17",
33
34
  "react": "^19",
34
35
  "react-dom": "^19",
35
- "@types/react-dom": "^19",
36
- "typescript": "^5.8.3",
36
+ "typescript": "^7.0.2",
37
37
  "vitest": "^4.1.11"
38
38
  }
39
39
  }
package/src-ts/wire.ts CHANGED
@@ -95,6 +95,16 @@ export interface ValueSchema {
95
95
  shape?: Shape;
96
96
  /** The range's max is a control's end, not a limit. Absent when false. */
97
97
  soft_max?: boolean;
98
+ /** What a person calls the value. Absent when the app gave none. */
99
+ label?: string;
100
+ /** One sentence on what the value does. */
101
+ description?: string;
102
+ /** A short unit shown after the number, such as `Hz`. */
103
+ unit?: string;
104
+ /** Display names for an int value's steps, in order from the range's minimum. */
105
+ names?: string[];
106
+ /** Display labels for some of the choices, by choice. Absent when none. */
107
+ choice_labels?: Record<string, string>;
98
108
  }
99
109
 
100
110
  /** rhizome-core `CategorySchema`. */
@@ -106,6 +116,14 @@ export interface CategorySchema {
106
116
  /** rhizome-core `TypeSchema`. */
107
117
  export interface TypeSchema {
108
118
  name: string;
119
+ /** What a person calls the type. Absent when the app gave none. */
120
+ label?: string;
121
+ /** One sentence on what a node of this type is. */
122
+ summary?: string;
123
+ /** The app's free tag for sorting its types, such as `effect`. */
124
+ group?: string;
125
+ /** What the node is to someone browsing, such as `colour`; beside `group`. Absent when the app gave none. */
126
+ category?: string;
109
127
  categories?: string[];
110
128
  values?: ValueSchema[];
111
129
  refs?: string[];