@tidal-ts/terminal 0.7.0 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +40 -0
  2. package/package.json +9 -9
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @tidal-ts/terminal
2
+
3
+ A state machine (XState v5) for apps where users build their own charts. It
4
+ holds a chart's setup (rows, series, studies, axes and up to five saved
5
+ presets) and never its data: no fetching, no storage of its own, no drawing.
6
+ Its rows are what [`@tidal-ts/chart`](https://www.npmjs.com/package/@tidal-ts/chart)'s
7
+ `prepareChart` takes. Part of [tidal-ts](https://github.com/tidal-app/tidal-ts).
8
+
9
+ **Pre-1.0: pin an exact version.** Every `@tidal-ts/*` package ships on one
10
+ version number.
11
+
12
+ - [Docs](https://tidal-app.github.io/tidal-ts/docs/packages/terminal/)
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm install --save-exact @tidal-ts/terminal @tidal-ts/chart @tidal-ts/core
18
+ npm install xstate @xstate/react
19
+ ```
20
+
21
+ Plus the pond peers `@tidal-ts/chart` needs (see its README).
22
+
23
+ ## The shape
24
+
25
+ ```tsx
26
+ import { TerminalProvider, useRows, useAddStudy } from '@tidal-ts/terminal';
27
+
28
+ <TerminalProvider initialRows={rows} catalog={metrics} storage={presetStorage} palette={colours}>
29
+ <YourChartAndControls />
30
+ </TerminalProvider>;
31
+ ```
32
+
33
+ The host supplies the starting rows, the metrics a user may add, where presets
34
+ are saved, and the colours new series take. Hooks read state (`useRows`,
35
+ `useAxisRanges`, …) and send one kind of change each (`useAddStudy`,
36
+ `useMoveToAxis`, `useSavePreset`, …). The machine's rules are exported as
37
+ plain functions (`allowedAxes`, `studyOfferable`, …) so your menus can grey
38
+ out what it would refuse.
39
+
40
+ MIT.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidal-ts/terminal",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "description": "The terminal machine — an XState v5 statechart that owns a chart's configuration (rows, series, studies, pairs, axes, presets) and never its data.",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/tidal-app/tidal-ts.git",
10
10
  "directory": "packages/terminal"
11
11
  },
12
- "homepage": "https://github.com/tidal-app/tidal-ts#readme",
12
+ "homepage": "https://tidal-app.github.io/tidal-ts/docs/packages/terminal/",
13
13
  "type": "module",
14
14
  "main": "dist/index.js",
15
15
  "types": "dist/index.d.ts",
@@ -36,17 +36,17 @@
36
36
  "xstate": "^5.28.0"
37
37
  },
38
38
  "dependencies": {
39
- "@tidal-ts/chart": "0.7.0",
40
- "@tidal-ts/core": "0.7.0"
39
+ "@tidal-ts/chart": "0.8.0",
40
+ "@tidal-ts/core": "0.8.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@pond-ts/charts": "^0.70.0",
44
- "@pond-ts/financial": "^0.70.0",
45
- "@pond-ts/process": "0.70.0",
46
- "@pond-ts/react": "^0.70.0",
43
+ "@pond-ts/charts": "^0.72.0",
44
+ "@pond-ts/financial": "^0.72.0",
45
+ "@pond-ts/process": "0.72.0",
46
+ "@pond-ts/react": "^0.72.0",
47
47
  "@types/react": "^18.3.18",
48
48
  "@xstate/react": "^6.1.0",
49
- "pond-ts": "^0.70.0",
49
+ "pond-ts": "^0.72.0",
50
50
  "react": "^18.3.1",
51
51
  "typescript": "^5.7.2",
52
52
  "vitest": "^2.1.8",