@1337exp/taoux 0.16.0 → 0.18.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 CHANGED
@@ -1,151 +1,153 @@
1
- <h1 align="center">TaoUX</h1>
2
-
3
- <p align="center">
4
- <b>Interaction building blocks for Vue apps.</b><br>
5
- Import only what you need, bring your own design.
6
- </p>
7
-
8
- <p align="center">
9
- <a href="https://www.npmjs.com/package/@1337exp/taoux"><img src="https://img.shields.io/npm/v/@1337exp/taoux?color=cb3837&logo=npm" alt="npm"></a>
10
- <a href="https://github.com/1337exp/taoux/actions/workflows/ci.yml"><img src="https://github.com/1337exp/taoux/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
11
- <a href="https://github.com/1337exp/taoux/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@1337exp/taoux?style=flat" alt="license"></a>
12
- <img src="https://img.shields.io/badge/Vue-3-42b883?logo=vuedotjs&logoColor=white" alt="Vue 3">
13
- <img src="https://img.shields.io/badge/types-included-3178c6?logo=typescript&logoColor=white" alt="TypeScript">
14
- </p>
15
-
16
- <p align="center">
17
- <b>English</b> · <a href="https://github.com/1337exp/taoux/blob/main/README.ru.md">Русский</a> ·
18
- <a href="#with-taoui">With TaoUI</a> ·
19
- <a href="#modules">Modules</a> ·
20
- <a href="#sandbox">Sandbox</a> ·
21
- <a href="CHANGELOG.md">Changelog</a>
22
- </p>
23
-
24
- <p align="center">
25
- <img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/screenshots/overview-dark.webp" alt="TaoUX curve editors in the dark theme" width="860">
26
- </p>
27
-
28
- ## Why TaoUX
29
-
30
- - **Pay for what you use.** Every module is its own subpath import with its own entry point: `import { zoomAt } from '@1337exp/taoux/camera'`. `sideEffects` is declared, the rest tree-shakes; there is no root entry, so nothing you did not import reaches the bundle.
31
- - **Logic first, tested without a browser.** The core of a module (camera maths, undo, easing, playback, where a swiped row comes to rest) is plain TypeScript, unit-tested with no DOM. The Vue parts are thin shells on top.
32
- - **Fingers and keys alike.** Taps, long presses, pinches and swipes that tell a swipe from a scroll; lists reordered by a grip (`sortable`) and rows slid aside for their actions (`swiperow`), each with a keyboard path and a live region for a screen reader.
33
- - **For apps, not only editors.** Undo by records that is safe next to a sync (`undo`), autosave that never throws and hears other tabs (`storage`), UUIDs for stored records, typed i18n, commands and hotkeys that build the menus.
34
- - **Your design, or TaoUI in one line.** Components take `--tx-*` CSS variables with dark defaults; `import '@1337exp/taoux/taoui.css'` makes them follow the TaoUI theme and palettes. [Details below.](#with-taoui)
35
- - **Layers you can rely on.** Primitives import nothing, composites only primitives, and only the fields (`curvefield`, `swiperow`) touch TaoUI: a test reads the imports and keeps it so.
36
- - **Ready for AI assistants.** The package ships a skill that names every module and the usual mistakes, so an assistant writes TaoUX code instead of guessing.
37
-
38
- <table>
39
- <tr>
40
- <td width="50%"><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/curveeditor.webp" alt="Curve editor: dragging and adding points"><br><sub><b>curveeditor</b> — grid, snapping, bounds, Bezier handles, keyboard</sub></td>
41
- <td width="50%"><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/gradienteditor.webp" alt="Gradient editor: adding and moving stops"><br><sub><b>gradienteditor</b> — stops, handles, <code>gradientCss</code></sub></td>
42
- </tr>
43
- <tr>
44
- <td><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/playback.webp" alt="Playback: TaoScrubber driven by usePlayback"><br><sub><b>playback</b> — time, loop, speed, seeking; <code>usePlayback</code> + TaoUI <code>TaoScrubber</code></sub></td>
45
- <td><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/curvefield.webp" alt="TaoxCurveField: a curve with TaoUI fields"><br><sub><b>curvefield</b> — a curve with TaoUI fields in one component</sub></td>
46
- </tr>
47
- </table>
48
-
49
- ## Install
50
-
51
- ```bash
52
- npm install @1337exp/taoux
53
- npm install @1337exp/taoui # optional: only for curvefield, swiperow and the TaoUI bridge
54
- ```
55
-
56
- Peers: `vue ^3.4` (for the Vue modules) and, optionally, `@1337exp/taoui ^5.0.0`. Modules without Vue need nothing.
57
- ESM only. Import by subpath; there is no root entry on purpose, so nothing you do not import can end up in your bundle.
58
-
59
- ## With TaoUI
60
-
61
- TaoUX and [TaoUI](https://www.npmjs.com/package/@1337exp/taoui) are two separate packages: TaoUX has no buttons or fields of its own, TaoUI knows nothing about TaoUX. Joining them takes two things, and the first is one line:
62
-
63
- ```ts
64
- import '@1337exp/taoui/styles.css';
65
- import '@1337exp/taoux/taoui.css'; // the bridge: --tx-* → --tao-*, the editors follow the TaoUI theme
66
- import '@1337exp/taoux/curveeditor.css'; // styles of a Vue module are imported explicitly
67
- ```
68
-
69
- `taoui.css` is plain CSS with zero specificity and no dependency on TaoUI, so any rule of yours wins. Values then travel through `v-model`: `usePlayback` drives `TaoScrubber`, a TaoUI field edits a curve point, a TaoUI slider sets the opacity of a gradient stop. With code: [docs/taoui.md](docs/taoui.md). Without the bridge the editors keep their dark defaults; `TaoxCurveField` and `TaoxSwipeRow` need it too. The bridge is a contract: the only file that names `--tao-*` tokens.
70
-
71
- <a id="modules"></a>
72
-
73
- ## Modules
74
-
75
- Every module is its own subpath import, so only what you actually use ends up in the build:
76
-
77
- ```ts
78
- import { zoomAt } from '@1337exp/taoux/camera';
79
- import { History } from '@1337exp/taoux/history';
80
- ```
81
-
82
- | Module | What it does | Depends on |
83
- |---|---|---|
84
- | `camera` | canvas camera: pan, zoom around the cursor, screen ↔ world | nothing |
85
- | `history` | undo/redo on string snapshots, rapid edits merged into one step; `save()` / `restore()` take a whole history out and put it back (a document each) | nothing |
86
- | `undo` | undo/redo by records, not snapshots: a step keeps only the records it touched, so it is small and an undo after a sync does not roll back another device's edits; quick edits merge (`UndoStack`, `diffRecords`) | nothing |
87
- | `hotkeys` | shortcuts: `parseHotkey('Mod+Shift+Z')`, `matchHotkey` (Mod = ⌘ / Ctrl, non-Latin layouts by the physical key), `formatHotkey` (`Ctrl+Shift+Z` / `⇧⌘Z`), `isReservedHotkey` (⌘W, ⌘T, ⌘Q…), `bindHotkeys` on an element | DOM (for `bindHotkeys`) |
88
- | `storage` | autosave to localStorage without exceptions; `tryWrite` (why it failed: quota / denied), `remove`, `subscribe` (another tab changed the key) | nothing |
89
- | `file` | download bytes or text as a file (`downloadBlob`, `downloadText`, any `mime`), read a picked file as text or as bytes with a size limit | DOM |
90
- | `zip` | ZIP without libraries: `createZip(entries)` (deflates what is not already compressed) and `readZip(bytes, limits?)` (central directory, CRC, size limits that hold against zip bombs, names that leave the folder refused; `ZipError` with a `code`), `looksLikeZip` | nothing (needs `CompressionStream`) |
91
- | `snap` | soft snapping to a grid with a threshold that follows the camera zoom | nothing |
92
- | `wheel` | wheel/trackpad → pan or zoom (like Figma) | nothing |
93
- | `guides` | smart guides for dragging (as in Figma): `snapToGuides(rect, others, threshold)` compares edges and centres with the other rectangles and returns the shift that puts them together and the lines to draw (`TaoxGuides` from `canvas` draws them) | nothing |
94
- | `edgescroll` | auto-scroll speed near an edge and a ready loop, `createEdgeScroller` (canvas, curve editors, any drag) | nothing |
95
- | `gestures` | touch gestures: tap, double tap, long press, pinch, swipe (`SwipeTracker` + `settleOpen` for a row that slides open); `listenFocusLoss` ends a held gesture when the window loses the focus | nothing |
96
- | `touch` | `coarse`: is there a coarse pointer (a finger) | vue (peer) |
97
- | `curve` | link paths: bezier between pins, arrowheads of constant screen size | nothing |
98
- | `ids` | `uuid()` for records that are stored or synced; `uid(prefix, taken)` for ids inside one document | nothing |
99
- | `ease` | easing functions between curve points: 8 families × in / out / in-out, `linear`, `step`, cubic Bezier; `easeValue`, `isEase` (the editor draws with it, a runtime evaluates with it) | nothing |
100
- | `num` | small numeric helpers: `clamp`, `roundTo`, `snapTo`, `niceStep`, `ticks` (shared by the curve, gradient and playback modules) | nothing |
101
- | `sortable` (Vue) | reorder a list by a grip and by the keyboard: `useSortable(listRef, { onMove })`, `data-sortable-item` / `data-sortable-handle`; the others make room, the list scrolls at its edge, Esc puts it back, a live region tells a screen reader; `moveItem` | vue (peer) |
102
- | `session` | document lifecycle: history, autosave, files, restore, notices, `dirty` / `markSaved()`, `saveHistory()` / `restoreHistory()` for an editor with several documents; a canvas camera is optional (`countItems`) | vue (peer) |
103
- | `commands` | a registry of commands (label, shortcut, `enabled`, `checked`, `run`): `toMenu(layout)` builds a `TaoMenuItem[]` tree for `TaoMenubar` / `TaoContextMenu`, `bind` listens to the same shortcuts, `historyCommands` gives Undo / Redo that disable themselves, `check` finds reserved and duplicate shortcuts | DOM (for `bind`) |
104
- | `palette` | search and groups of nodes for a palette | nothing |
105
- | `links` (Vue) | links layer: SVG from ready geometry, `--tx-link-*` | vue (peer) |
106
- | `canvas` (Vue) | canvas: mouse and touch gestures, wheel, auto-scroll, keys; the `CanvasHost` contract | vue (peer) |
107
- | `curveeditor` (Vue) | curve editor plot: grid, snapping, bounds, decimals, auto-scroll at the edge; point operations; per-segment transitions with Bezier handles; `formatT` writes the 0…1 time as years, seconds…; keyboard (Tab, arrows, Shift, Insert, Delete) | vue (peer) |
108
- | `swiperow` (Vue, tier 2) | `TaoxSwipeRow`: a list row a finger slides sideways, as in a mail app: to the start one action that runs past a threshold (read / unread), to the end actions that grow out and stay open, a long pull runs the last one (delete); TaoUI icons and tones, `@action="id => …"`; Tab reaches the actions | vue, **@1337exp/taoui** (peer) |
109
- | `curvefield` (Vue, tier 2) | `TaoxCurveField`: a curve with fields on TaoUI components: point time and value, transition to the next point (`ease`), snapping, remove and reset; labels come from the app | vue, **@1337exp/taoui** (peer) |
110
- | `gradienteditor` (Vue) | gradient bar with stop handles; stop operations, `gradientCss`; keyboard (Tab, arrows, Home/End, Insert, Delete) | vue (peer) |
111
- | `playback` | playback model: time, pause, loop, speed, seeking; `createPlayback` without Vue and `usePlayback` for a component | vue (peer, for `usePlayback`) |
112
- | `tour` | a guided tour of a page, step by step: `createTour` without Vue (jumps over steps whose target is gone, ends as `done` or `skipped`), `useTour` for a component, `createTourMemory` so it shows once | vue (peer, for `useTour`), storage |
113
- | `undovue` | `undo` and `history` for Vue: `useUndoStack` and `useHistory` keep `canUndo` / `canRedo` as refs after every move (for `historyCommands` and the menu); `useUndoFlags(source)` + `sync()` for a stack you already have | vue (peer) |
114
- | `pins` | row pin positions measured from the DOM: `usePinMeasure`, `createPinRegistry` | vue (peer) |
115
- | `i18n` | typed i18n: `createI18n({ locales, fallback, storageKey })` | vue (peer, optional) |
116
-
117
- Vue modules (`links`, `canvas`, `curveeditor`, `curvefield`, `gradienteditor`, `swiperow`) need their styles imported explicitly: `import '@1337exp/taoux/canvas.css'`. Composite modules (session, commands, palette, links, canvas, pins, curveeditor, gradienteditor, playback, tour, undovue) import only primitives. Tier 2, fields (`curvefield`, `swiperow`), assemble composites into a ready field on TaoUI components: it is the only tier allowed to import TaoUI, which is why `@1337exp/taoui` is an optional peer dependency. `curvefield` needs both `curveeditor.css` and `curvefield.css`. The `tiers.test.ts` test guards all of that. The swipe row, its variables and how to test a swipe are in [docs/swiperow.md](docs/swiperow.md) ([Русский](docs/swiperow.ru.md)). The canvas contract is described in [docs/canvas.md](docs/canvas.md) ([Русский](docs/canvas.ru.md)); transitions between curve points are in [docs/ease.md](docs/ease.md) ([Русский](docs/ease.ru.md)).
118
-
119
- The rule: a module lands here when a second project needs it. A module's core knows nothing about Vue or the DOM unless that is its job.
120
-
121
- **For AI assistants:** the package ships a skill, `skills/taoux/SKILL.md`: how the modules fit together and the mistakes to avoid. Point your assistant at it (Claude Code: copy the folder into `.claude/skills/`).
122
-
123
- ## Development
124
-
125
- ```bash
126
- npm install
127
- npm test # vitest
128
- npm run typecheck
129
- npm run build # dist/ (vite + tsc declarations)
130
- npm run smoke # pack, install into a throwaway app next to TaoUI, build it
131
- npm run sandbox # the sandbox: http://localhost:5300, pages from sandbox/
132
- npm run dev # watch: rebuild JS and declarations
133
- ```
134
-
135
- A new module is a file `src/<name>.ts` (or a folder with `index.ts`) and an entry in `exports` in `package.json`; the `exports.test.ts` test makes sure they match. More in [CONTRIBUTING.md](CONTRIBUTING.md).
136
-
137
- Working against a local checkout instead of npm: put `"@1337exp/taoux": "file:../taoux"` into the project's `package.json` (edits are visible at once after `npm run dev` here). Then the consumer's `vite.config.ts` needs `resolve: { dedupe: ['vue'] }` and its `tsconfig.json` needs `"vue": ["./node_modules/vue"]` in `paths`, otherwise the linked package gets its own copy of Vue and reactivity breaks. A normal install from npm needs none of this.
138
-
139
- ## Sandbox
140
-
141
- The `sandbox/` folder is a demo and a testing ground: pages import the modules straight from `src/`, with no build. It holds `curveeditor`, `curvefield`, `gradienteditor`, `slider`, `color`, `playback`, `sortable`, `swiperow` and `tour`, with an EN / RU switch and a dark / light switch (the TaoUI theme, through the bridge). A new page is `sandbox/<name>.html` + `.ts` + a demo `.vue` and a link in `sandbox/index.html`. `npm run sandbox:build` makes a static copy with relative paths, ready for any folder (for example `/sandbox/taoux/`).
142
-
143
- Screenshots and clips in this README come from the sandbox: see [docs/media](docs/media/README.md).
144
-
145
- ## Contributing
146
-
147
- Issues and pull requests are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md). Security reports: [SECURITY.md](SECURITY.md).
148
-
149
- ## License
150
-
151
- [MIT](LICENSE) © 2026 1337exp
1
+ <h1 align="center">TaoUX</h1>
2
+
3
+ <p align="center">
4
+ <b>Interaction building blocks for Vue apps.</b><br>
5
+ Import only what you need, bring your own design.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/@1337exp/taoux"><img src="https://img.shields.io/npm/v/@1337exp/taoux?color=cb3837&logo=npm" alt="npm"></a>
10
+ <a href="https://github.com/1337exp/taoux/actions/workflows/ci.yml"><img src="https://github.com/1337exp/taoux/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
11
+ <a href="https://github.com/1337exp/taoux/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@1337exp/taoux?style=flat" alt="license"></a>
12
+ <img src="https://img.shields.io/badge/Vue-3-42b883?logo=vuedotjs&logoColor=white" alt="Vue 3">
13
+ <img src="https://img.shields.io/badge/types-included-3178c6?logo=typescript&logoColor=white" alt="TypeScript">
14
+ </p>
15
+
16
+ <p align="center">
17
+ <b>English</b> · <a href="https://github.com/1337exp/taoux/blob/main/README.ru.md">Русский</a> ·
18
+ <a href="#with-taoui">With TaoUI</a> ·
19
+ <a href="#modules">Modules</a> ·
20
+ <a href="#sandbox">Sandbox</a> ·
21
+ <a href="CHANGELOG.md">Changelog</a>
22
+ </p>
23
+
24
+ <p align="center">
25
+ <img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/screenshots/overview-dark.webp" alt="TaoUX curve editors in the dark theme" width="860">
26
+ </p>
27
+
28
+ ## Why TaoUX
29
+
30
+ - **Pay for what you use.** Every module is its own subpath import with its own entry point: `import { zoomAt } from '@1337exp/taoux/camera'`. `sideEffects` is declared, the rest tree-shakes; there is no root entry, so nothing you did not import reaches the bundle.
31
+ - **Logic first, tested without a browser.** The core of a module (camera maths, undo, easing, playback, where a swiped row comes to rest) is plain TypeScript, unit-tested with no DOM. The Vue parts are thin shells on top.
32
+ - **Fingers and keys alike.** Taps, long presses, pinches and swipes that tell a swipe from a scroll; lists reordered by a grip (`sortable`) and rows slid aside for their actions (`swiperow`), each with a keyboard path and a live region for a screen reader.
33
+ - **For apps, not only editors.** Undo by records that is safe next to a sync (`undo`), autosave that never throws and hears other tabs (`storage`), UUIDs for stored records, typed i18n, commands and hotkeys that build the menus.
34
+ - **Your design, or TaoUI in one line.** Components take `--tx-*` CSS variables with dark defaults; `import '@1337exp/taoux/taoui.css'` makes them follow the TaoUI theme and palettes. [Details below.](#with-taoui)
35
+ - **Layers you can rely on.** Primitives import nothing, composites only primitives, and only the fields (`curvefield`, `swiperow`) touch TaoUI: a test reads the imports and keeps it so.
36
+ - **Ready for AI assistants.** The package ships a skill that names every module and the usual mistakes, so an assistant writes TaoUX code instead of guessing.
37
+
38
+ <table>
39
+ <tr>
40
+ <td width="50%"><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/curveeditor.webp" alt="Curve editor: dragging and adding points"><br><sub><b>curveeditor</b> — grid, snapping, bounds, Bezier handles, keyboard</sub></td>
41
+ <td width="50%"><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/gradienteditor.webp" alt="Gradient editor: adding and moving stops"><br><sub><b>gradienteditor</b> — stops, handles, <code>gradientCss</code></sub></td>
42
+ </tr>
43
+ <tr>
44
+ <td><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/playback.webp" alt="Playback: TaoScrubber driven by usePlayback"><br><sub><b>playback</b> — time, loop, speed, seeking; <code>usePlayback</code> + TaoUI <code>TaoScrubber</code></sub></td>
45
+ <td><img src="https://raw.githubusercontent.com/1337exp/taoux/main/docs/media/clips/curvefield.webp" alt="TaoxCurveField: a curve with TaoUI fields"><br><sub><b>curvefield</b> — a curve with TaoUI fields in one component</sub></td>
46
+ </tr>
47
+ </table>
48
+
49
+ ## Install
50
+
51
+ ```bash
52
+ npm install @1337exp/taoux
53
+ npm install @1337exp/taoui # optional: only for curvefield, swiperow and the TaoUI bridge
54
+ ```
55
+
56
+ Peers: `vue ^3.4` (for the Vue modules) and, optionally, `@1337exp/taoui ^5.0.0`. Modules without Vue need nothing.
57
+ ESM only. Import by subpath; there is no root entry on purpose, so nothing you do not import can end up in your bundle.
58
+
59
+ ## With TaoUI
60
+
61
+ TaoUX and [TaoUI](https://www.npmjs.com/package/@1337exp/taoui) are two separate packages: TaoUX has no buttons or fields of its own, TaoUI knows nothing about TaoUX. Joining them takes two things, and the first is one line:
62
+
63
+ ```ts
64
+ import '@1337exp/taoui/styles.css';
65
+ import '@1337exp/taoux/taoui.css'; // the bridge: --tx-* → --tao-*, the editors follow the TaoUI theme
66
+ import '@1337exp/taoux/curveeditor.css'; // styles of a Vue module are imported explicitly
67
+ ```
68
+
69
+ `taoui.css` is plain CSS with zero specificity and no dependency on TaoUI, so any rule of yours wins. Values then travel through `v-model`: `usePlayback` drives `TaoScrubber`, a TaoUI field edits a curve point, a TaoUI slider sets the opacity of a gradient stop. With code: [docs/taoui.md](docs/taoui.md). Without the bridge the editors keep their dark defaults; `TaoxCurveField` and `TaoxSwipeRow` need it too. The bridge is a contract: the only file that names `--tao-*` tokens.
70
+
71
+ <a id="modules"></a>
72
+
73
+ ## Modules
74
+
75
+ Every module is its own subpath import, so only what you actually use ends up in the build:
76
+
77
+ ```ts
78
+ import { zoomAt } from '@1337exp/taoux/camera';
79
+ import { History } from '@1337exp/taoux/history';
80
+ ```
81
+
82
+ | Module | What it does | Depends on |
83
+ |---|---|---|
84
+ | `camera` | canvas camera: pan, zoom around the cursor, screen ↔ world | nothing |
85
+ | `history` | undo/redo on string snapshots, rapid edits merged into one step (by time, or until `seal()`); step labels (`undoLabel`, `redoLabel`); `dirty` / `markSaved()` by position; `save()` / `restore()` take a whole history out and put it back (a document each) | nothing |
86
+ | `undo` | undo/redo by records, not snapshots: a step keeps only the records it touched, so it is small and an undo after a sync does not roll back another device's edits; quick edits merge (`UndoStack`, `diffRecords`) | nothing |
87
+ | `hotkeys` | shortcuts: `parseHotkey('Mod+Shift+Z')`, `matchHotkey` (Mod = ⌘ / Ctrl, non-Latin layouts by the physical key), `formatHotkey` (`Ctrl+Shift+Z` / `⇧⌘Z`), `isReservedHotkey` (⌘W, ⌘T, ⌘Q…), `bindHotkeys` on an element | DOM (for `bindHotkeys`) |
88
+ | `storage` | autosave to localStorage without exceptions; `tryWrite` (why it failed: quota / denied), `remove`, `subscribe` (another tab changed the key) | nothing |
89
+ | `file` | download bytes or text as a file (`downloadBlob`, `downloadText`, any `mime`), read a picked file as text or as bytes with a size limit | DOM |
90
+ | `zip` | ZIP without libraries: `createZip(entries)` (deflates what is not already compressed) and `readZip(bytes, limits?)` (central directory, CRC, size limits that hold against zip bombs, names that leave the folder refused; `ZipError` with a `code`), `looksLikeZip` | nothing (needs `CompressionStream`) |
91
+ | `snap` | soft snapping to a grid with a threshold that follows the camera zoom | nothing |
92
+ | `wheel` | wheel/trackpad → pan or zoom (like Figma) | nothing |
93
+ | `guides` | smart guides for dragging (as in Figma): `snapToGuides(rect, others, threshold)` compares edges and centres with the other rectangles and returns the shift that puts them together and the lines to draw (`TaoxGuides` from `canvas` draws them) | nothing |
94
+ | `edgescroll` | auto-scroll speed near an edge and a ready loop, `createEdgeScroller` (canvas, curve editors, any drag) | nothing |
95
+ | `gestures` | touch gestures: tap, double tap, long press, pinch, swipe (`SwipeTracker` + `settleOpen` for a row that slides open); `listenFocusLoss` ends a held gesture when the window loses the focus | nothing |
96
+ | `touch` | `coarse`: is there a coarse pointer (a finger) | vue (peer) |
97
+ | `curve` | link paths: bezier between pins, arrowheads of constant screen size | nothing |
98
+ | `ids` | `uuid()` for records that are stored or synced; `uid(prefix, taken)` for ids inside one document | nothing |
99
+ | `ease` | easing functions between curve points: 8 families × in / out / in-out, `linear`, `step`, cubic Bezier; `easeValue`, `isEase` (the editor draws with it, a runtime evaluates with it) | nothing |
100
+ | `num` | small numeric helpers: `clamp`, `roundTo`, `snapTo`, `niceStep`, `ticks` (shared by the curve, gradient and playback modules) | nothing |
101
+ | `sortable` (Vue) | reorder a list by a grip and by the keyboard: `useSortable(listRef, { onMove })`, `data-sortable-item` / `data-sortable-handle`; the others make room, the list scrolls at its edge, Esc puts it back, a live region tells a screen reader; `moveItem` | vue (peer) |
102
+ | `session` | document lifecycle: history, autosave, files, restore, notices, `dirty` / `markSaved()`, `saveHistory()` / `restoreHistory()` for an editor with several documents; a canvas camera is optional (`countItems`) | vue (peer) |
103
+ | `commands` | a registry of commands (label, shortcut, `enabled`, `checked`, `run`): `toMenu(layout)` builds a `TaoMenuItem[]` tree for `TaoMenubar` / `TaoContextMenu`, `bind` listens to the same shortcuts, `historyCommands` gives Undo / Redo that disable themselves, `check` finds reserved and duplicate shortcuts | DOM (for `bind`) |
104
+ | `palette` | search and groups of nodes for a palette | nothing |
105
+ | `links` (Vue) | links layer: SVG from ready geometry, `--tx-link-*` | vue (peer) |
106
+ | `canvas` (Vue) | canvas: mouse and touch gestures, wheel, auto-scroll, keys; the `CanvasHost` contract | vue (peer) |
107
+ | `curveeditor` (Vue) | curve editor plot: grid, snapping, bounds, decimals, auto-scroll at the edge; point operations; per-segment transitions with Bezier handles; `formatT` writes the 0…1 time as years, seconds…; keyboard (Tab, arrows, Shift, Insert, Delete) | vue (peer) |
108
+ | `curveops` | the point operations and `sampleCurve(points, t)` of a curve with no Vue: for a game, a worker, a build step | none |
109
+ | `swiperow` (Vue, tier 2) | `TaoxSwipeRow`: a list row a finger slides sideways, as in a mail app: to the start one action that runs past a threshold (read / unread), to the end actions that grow out and stay open, a long pull runs the last one (delete); TaoUI icons and tones, `@action="id => …"`; Tab reaches the actions | vue, **@1337exp/taoui** (peer) |
110
+ | `curvefield` (Vue, tier 2) | `TaoxCurveField`: a curve with fields on TaoUI components: point time and value, transition to the next point (`ease`), snapping, remove and reset; labels come from the app | vue, **@1337exp/taoui** (peer) |
111
+ | `gradienteditor` (Vue) | gradient bar with stop handles; stop operations, `gradientCss`; keyboard (Tab, arrows, Home/End, Insert, Delete) | vue (peer) |
112
+ | `playback` | playback model: time, pause, loop, speed, seeking; `createPlayback` without Vue and `usePlayback` for a component | vue (peer, for `usePlayback`) |
113
+ | `tour` | a guided tour of a page, step by step: `createTour` without Vue (jumps over steps whose target is gone, ends as `done` or `skipped`), `useTour` for a component, `createTourMemory` so it shows once | vue (peer, for `useTour`), storage |
114
+ | `commandsvue` | `commands` in a Vue app: `useCommands(registry, { add })` adds the commands of a component (and removes them with it), listens to the shortcuts while it is mounted, `menu(layout)` is a `computed` that follows the state, `onSelect(item)` is the `@select` of a menu (it takes the item TaoUI 6 emits and runs `item.id`) | vue (peer) |
115
+ | `undovue` | `undo` and `history` for Vue: `useUndoStack` and `useHistory` keep `canUndo` / `canRedo` (and, for `useHistory`, `undoLabel` / `redoLabel` / `dirty`) as refs after every move (for `historyCommands` and the menu); `useUndoFlags(source)` + `sync()` for a stack you already have | vue (peer) |
116
+ | `pins` | row pin positions measured from the DOM: `usePinMeasure`, `createPinRegistry` | vue (peer) |
117
+ | `i18n` | typed i18n: `createI18n({ locales, fallback, storageKey })` | vue (peer, optional) |
118
+
119
+ Vue modules (`links`, `canvas`, `curveeditor`, `curvefield`, `gradienteditor`, `swiperow`) need their styles imported explicitly: `import '@1337exp/taoux/canvas.css'`. Composite modules (session, commands, palette, links, canvas, pins, curveeditor, gradienteditor, playback, tour, undovue) import only primitives. Tier 2, fields (`curvefield`, `swiperow`), assemble composites into a ready field on TaoUI components: it is the only tier allowed to import TaoUI, which is why `@1337exp/taoui` is an optional peer dependency. `curvefield` needs both `curveeditor.css` and `curvefield.css`. The `tiers.test.ts` test guards all of that. The swipe row, its variables and how to test a swipe are in [docs/swiperow.md](docs/swiperow.md) ([Русский](docs/swiperow.ru.md)). The canvas contract is described in [docs/canvas.md](docs/canvas.md) ([Русский](docs/canvas.ru.md)); transitions between curve points are in [docs/ease.md](docs/ease.md) ([Русский](docs/ease.ru.md)).
120
+
121
+ The rule: a module lands here when a second project needs it. A module's core knows nothing about Vue or the DOM unless that is its job.
122
+
123
+ **For AI assistants:** the package ships a skill, `skills/taoux/SKILL.md`: how the modules fit together and the mistakes to avoid. Point your assistant at it (Claude Code: copy the folder into `.claude/skills/`).
124
+
125
+ ## Development
126
+
127
+ ```bash
128
+ npm install
129
+ npm test # vitest
130
+ npm run typecheck
131
+ npm run build # dist/ (vite + tsc declarations)
132
+ npm run smoke # pack, install into a throwaway app next to TaoUI, build it
133
+ npm run sandbox # the sandbox: http://localhost:5300, pages from sandbox/
134
+ npm run dev # watch: rebuild JS and declarations
135
+ ```
136
+
137
+ A new module is a file `src/<name>.ts` (or a folder with `index.ts`) and an entry in `exports` in `package.json`; the `exports.test.ts` test makes sure they match. More in [CONTRIBUTING.md](CONTRIBUTING.md).
138
+
139
+ Working against a local checkout instead of npm: put `"@1337exp/taoux": "file:../taoux"` into the project's `package.json` (edits are visible at once after `npm run dev` here). Then the consumer's `vite.config.ts` needs `resolve: { dedupe: ['vue'] }` and its `tsconfig.json` needs `"vue": ["./node_modules/vue"]` in `paths`, otherwise the linked package gets its own copy of Vue and reactivity breaks. A normal install from npm needs none of this.
140
+
141
+ ## Sandbox
142
+
143
+ The `sandbox/` folder is a demo and a testing ground: pages import the modules straight from `src/`, with no build. It holds `curveeditor`, `curvefield`, `gradienteditor`, `slider`, `color`, `playback`, `sortable`, `swiperow` and `tour`, with an EN / RU switch and a dark / light switch (the TaoUI theme, through the bridge). A new page is `sandbox/<name>.html` + `.ts` + a demo `.vue` and a link in `sandbox/index.html`. `npm run sandbox:build` makes a static copy with relative paths, ready for any folder (for example `/sandbox/taoux/`).
144
+
145
+ Screenshots and clips in this README come from the sandbox: see [docs/media](docs/media/README.md).
146
+
147
+ ## Contributing
148
+
149
+ Issues and pull requests are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md). Security reports: [SECURITY.md](SECURITY.md).
150
+
151
+ ## License
152
+
153
+ [MIT](LICENSE) © 2026 1337exp