@1337exp/taoux 0.16.0 → 0.17.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/CHANGELOG.md +206 -200
- package/README.md +151 -151
- package/README.ru.md +153 -153
- package/dist/history.d.ts +52 -3
- package/dist/history.js +65 -5
- package/dist/history.js.map +1 -1
- package/dist/undovue.d.ts +12 -2
- package/dist/undovue.js +26 -6
- package/dist/undovue.js.map +1 -1
- package/package.json +1 -1
- package/skills/taoux/SKILL.md +103 -103
package/CHANGELOG.md
CHANGED
|
@@ -1,200 +1,206 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.
|
|
4
|
-
|
|
5
|
-
Nothing to migrate: a
|
|
6
|
-
|
|
7
|
-
- **`
|
|
8
|
-
|
|
9
|
-
## 0.
|
|
10
|
-
|
|
11
|
-
Nothing to migrate: new
|
|
12
|
-
|
|
13
|
-
- **`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **`canvas`: `
|
|
21
|
-
|
|
22
|
-
## 0.
|
|
23
|
-
|
|
24
|
-
Nothing to migrate:
|
|
25
|
-
|
|
26
|
-
- **`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **`
|
|
34
|
-
|
|
35
|
-
## 0.12.
|
|
36
|
-
|
|
37
|
-
Nothing to migrate
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- **`
|
|
48
|
-
|
|
49
|
-
## 0.
|
|
50
|
-
|
|
51
|
-
Nothing to migrate:
|
|
52
|
-
|
|
53
|
-
- **`
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- **`
|
|
60
|
-
- **`
|
|
61
|
-
- **`
|
|
62
|
-
- **`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- **`
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- **`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
## 0.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- **`swiperow
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
## 0.5.
|
|
119
|
-
|
|
120
|
-
- **`
|
|
121
|
-
- **`swiperow`
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
## 0.5.
|
|
125
|
-
|
|
126
|
-
- **`swiperow
|
|
127
|
-
- **`swiperow
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- The
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
- The sandbox
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
- **`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
###
|
|
170
|
-
|
|
171
|
-
- **
|
|
172
|
-
- **
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
The
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- **
|
|
190
|
-
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- `
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
Nothing to migrate: new optional members of `History`; a history that does not use them behaves and saves exactly as before.
|
|
6
|
+
|
|
7
|
+
- **`history`: step labels, `seal()`, `dirty` / `markSaved()` and the `coalesceMs` option.** An editor that keeps its history on string snapshots (a figure, a model, an entity: the document is small and a step is the whole document) had to keep its own labels ("Undo: move layer"), its own end of a drag and its own "unsaved" next to `History`, because `History` merged only by time and knew nothing else. Now `commit(state, key, label)` names the step (a merged series keeps the label of its first edit; `undoLabel` and `redoLabel` read it), `seal()` ends a series of merged edits where the editor knows the gesture ended (a pointer was released), `new History(initial, limit, now, { coalesceMs: Infinity })` merges through any pause until `seal()` or another key, and `dirty` / `markSaved()` say whether the current snapshot is the saved one: it follows the position, so undoing back to the saved snapshot is clean again (the `session` flag `dirty` is unchanged: it is a flag, not a position). `save()` carries the labels only when there are some, and `restore` takes a history saved without them (a label that went through JSON as `null` comes back as `undefined`). The saved mark travels too: `HistoryState.saved` is written only when it is not the first snapshot, and `restore` without it takes the first snapshot as the saved one, so a history that never saved keeps its old plain shape and each document of a tabbed editor keeps its own `dirty`.
|
|
8
|
+
- **`undovue`: `useHistory` follows the new members.** `commit(state, key, label)`, `seal()`, `markSaved()` and the refs `undoLabel`, `redoLabel`, `dirty` (kept in step by every move of the wrapper and by `sync()`), so a menu item "Undo: …" and an "unsaved" mark update by themselves. `useUndoFlags` and `useUndoStack` are unchanged.
|
|
9
|
+
## 0.16.0
|
|
10
|
+
|
|
11
|
+
Nothing to migrate: a new component in an existing module.
|
|
12
|
+
|
|
13
|
+
- **`canvas`: `TaoxGuides`, the alignment guides of a drag drawn.** `snapToGuides` (module `guides`) only counted: how far to shift the dragged rectangle and which lines to draw, and every app that used it wrote the same small SVG layer (two apps did). `<TaoxGuides :lines="guides" />` takes that `lines` list and draws it: put it in the world of the canvas, over the nodes, as the lines are in world units. The thickness is in screen pixels whatever the zoom, clicks pass through, nothing is drawn while the list is empty. Look: `--tx-guide-color` (the bridge points it at `--tao-color-info`), `--tx-guide-width` (1) and `--tx-guide-dash` (a `stroke-dasharray`, solid by default). It is in `canvas.css` with the rest of the canvas.
|
|
14
|
+
|
|
15
|
+
## 0.15.0
|
|
16
|
+
|
|
17
|
+
Nothing to migrate: new optional members; without them links and keys behave as before.
|
|
18
|
+
|
|
19
|
+
- **`links`: `dash` and `width` per link.** A `LinkLine` (and the `preview`) may name its line style, `dash: 'solid' | 'dashed' | 'dotted'` (solid by default), and its thickness, `width` in screen pixels (default `--tx-link-width`, 2; one pixel more on hover and selection, as before). It was colour only, so an app that tells relations apart by line style drew its own SVG layer. The pattern is measured in line widths (`--tx-link-width` is a plain number): dashes `3w` with gaps `3w`, dots of one width with a gap of two widths between their centres, drawn with the round caps; and in screen pixels, so it does not change with the zoom, like the line. The arrowhead is a separate filled path and stays solid; the hit area is a separate transparent solid stroke, so the gaps of a dashed line are clickable. The preview keeps its own `6 4` dashes unless it names `dashed` or `dotted`. A link without the fields renders exactly as before. New type `LinkDash`.
|
|
20
|
+
- **`canvas`: `keys: 'window' | 'focus'` option, the scope of the canvas keys.** The canvas took Delete, Backspace, Escape and Ctrl+Z / Y from the whole window, so with a drawer or a text field beside it a key typed there reached the canvas and the app had to guard against it. With `keys: 'focus'` only an event whose target is inside the canvas root is taken (the root is focusable and takes focus on a press); typing in inputs, textareas, selects and contenteditable is never taken in either mode, and `claimsKey` is asked first. The default stays `'window'`: an app whose canvas is the whole page (`workspace`) needs keys without clicking it first.
|
|
21
|
+
|
|
22
|
+
## 0.14.0
|
|
23
|
+
|
|
24
|
+
Nothing to migrate: one optional member; without it the canvas behaves as before.
|
|
25
|
+
|
|
26
|
+
- **`canvas`: `inertia` option, the camera glides after a pan.** Dragging the camera was strictly 1:1: whatever distance the pointer went, the camera went, and it stopped the moment the pointer was released. With `inertia: true` (or `{ friction, minSpeed, maxSpeed }`) a pan that is released while still moving carries on and slows down smoothly, as in a map or a phone; a pointer held still for a moment before the release (`HOLD_STILL`, 90 ms) stops the camera at once, so a careful 1:1 drag is still there. The speed is measured over the last 40 ms (a flick starts from rest and speeds up, so a longer window would average the slow start in and a short push would not glide), decays exponentially (`friction` is the time constant, 140 ms) and the distance is the exact integral of it, so the glide does not depend on the frame rate. Only a clear flick glides: a release slower than `minSpeed` (0.4 px/ms) does not, so a careful drag, a small jerk or a tremor stays 1:1. A new press, the wheel and a zoom stop it; it is not run when the system asks for reduced motion. It applies to every pan of the canvas (the middle and right buttons, a finger). The arithmetic is in `canvas/glide` (`releaseVelocity`, `glideStep`, exported and unit-tested).
|
|
27
|
+
|
|
28
|
+
## 0.13.0
|
|
29
|
+
|
|
30
|
+
Nothing to migrate: new optional members.
|
|
31
|
+
|
|
32
|
+
- **`history`: `save()` and `restore(state)`.** An editor with several documents (tabs, a project tree) wants an undo of its own for each: switching from one to another must not lose the steps of the first or give them to the second. `save()` returns the whole history (a copy of the snapshots and the position, plain data, `HistoryState`), `restore(state)` puts it back; a position outside the snapshots, or no snapshots, is a `RangeError`. A series of merged edits (the `key`) is not continued across a restore.
|
|
33
|
+
- **`session`: `saveHistory()` and `restoreHistory(state)`.** The same for a document session: when another document is shown, take the history of the one you leave (`saveHistory`), `load` the next with `resetHistory`, then give it its own (`restoreHistory`); `canUndo` and `canRedo` follow it. The document, `dirty` and the autosave are not touched, so the app keeps its own `dirty` per document if it wants it.
|
|
34
|
+
|
|
35
|
+
## 0.12.1
|
|
36
|
+
|
|
37
|
+
Nothing to migrate; the behaviour of `zip` does not change.
|
|
38
|
+
|
|
39
|
+
- **`zip`: checks that other checks already cover are gone, and the tests hold the rest.** The reader no longer repeats an absolute-path test (an empty first part of the path already refuses it), a stored-size test and a running total (the size of every file is verified against its declared one, so the total is the declared total, which is judged before unpacking). New tests pin what a mutation check showed to be unguarded: an end record that sits inside the archive comment, the file count of the record, a total-size refusal that comes before the rest of the archive is touched, a declared size bigger than the data with a matching CRC, a packed size running past the data, names that are not UTF-8 (refused with the UTF-8 flag, read as Latin-1 without it) and a date before 1980.
|
|
40
|
+
|
|
41
|
+
## 0.12.0
|
|
42
|
+
|
|
43
|
+
Nothing to migrate: a new module and new optional members.
|
|
44
|
+
|
|
45
|
+
- **New module `zip`: ZIP without libraries.** `createZip(entries, { date?, compress? })` writes an archive and `readZip(bytes, limits?)` reads one; both are async because the deflate is the browser's `CompressionStream` / `DecompressionStream` (`deflate-raw`). A project that is a folder of files (an editor with textures and documents) goes in one file this way, as a docx does. Writing: UTF-8 names; a file is deflated unless its name says it is already compressed (PNG, JPEG, WebP, audio, video, archives) and only when that makes it smaller (`compress: 'store'` keeps everything as it is); no ZIP64 (up to 65 535 files and 4 GiB). Reading goes by the central directory, so archives of any tool open, including those with sizes after the data; folders are skipped, names without the UTF-8 flag are read as Latin-1. An archive comes from outside, so reading is defensive: a name that would leave the folder it is unpacked into (`../x`, `/x`, a backslash, a control character, an empty part) is refused, the same name twice is refused, the CRC and the sizes are checked, and the limits (`maxEntries` 10 000, `maxEntryBytes` 512 MiB, `maxTotalBytes` 1 GiB, all overridable) are applied to the declared sizes before unpacking and to the real ones while unpacking, so a few KB that unpack into gigabytes are stopped. Every refusal is a `ZipError` with a `code` (`notZip`, `unsupported`, `corrupt`, `unsafeName`, `duplicate`, `tooMany`, `tooLarge`) for the interface to turn into text; encryption, ZIP64 and several disks are `unsupported`. `looksLikeZip(bytes)` tells an archive from a text file before opening it. Tested against an archive made by Python's `zipfile`.
|
|
46
|
+
- **`file`: `readBytesFile(file, limit?)`.** Reads a picked file as bytes (an archive, an image) with a size limit (`MAX_BINARY_FILE_BYTES`, 512 MiB), as `readTextFile` does for text: too large is refused before reading, a failed read is a result.
|
|
47
|
+
- **`session`: `dirty` and `markSaved()`.** A ref that tells whether the document changed since it was opened or last saved (an edit, undo, redo, a replacement by `load`); `markSaved()` clears it after the app wrote the document somewhere, and `load` with `resetHistory` starts clean. For an "unsaved" mark and a "leave the page?" guard. Undoing back to the saved state does not clear it (it is a flag, not a position in the history).
|
|
48
|
+
|
|
49
|
+
## 0.11.0
|
|
50
|
+
|
|
51
|
+
Nothing to migrate: one optional prop; without it the editor writes the same numbers as before.
|
|
52
|
+
|
|
53
|
+
- **`curveeditor`: a `formatT(t)` prop writes the time.** The editor's time is 0…1, and its axis and the tag of the selected point could only print that number, so a curve over years or seconds (a rate curve, an animation of 12 s) had to hide the labels with CSS and draw its own. `formatT` turns `t` into text on the time axis, on the tag of the selected point (`guides="values"`) and in the default point label for screen readers; the value axis and the points are not touched. `TaoxCurveField` forwards it to its plot. The tag background widens with the text.
|
|
54
|
+
|
|
55
|
+
## 0.10.0
|
|
56
|
+
|
|
57
|
+
Nothing to migrate: two optional host members; a host without them works as before.
|
|
58
|
+
|
|
59
|
+
- **`canvas`: a press on a label, a link or an ARIA checkbox / radio / switch inside a node belongs to it.** The canvas passed presses to `input`, `textarea`, `select`, `button` and left the rest to the drag, so a checkbox drawn as a `label` (TaoUI's `TaoCheckbox`) could not be ticked with a mouse: the press started dragging the node and the click never came.
|
|
60
|
+
- **`canvas`: a `background` prop: `grid` (default), `dots` or `none`.** Some people read a canvas with fewer details better: `dots` puts a dot at every crossing of the grid (every fifth one when zoomed far out), `none` leaves the plain colour. Only a look: snapping to the grid is the app's. The dots colour is `--tx-canvas-dot` (the bridge maps it).
|
|
61
|
+
- **`links`: the arrowhead is filled.** `.tx-links path { fill: none }` is more specific than `.tx-link-head { fill }`, so an arrowhead was drawn with no fill and was never seen; the line, shortened to run into it, stopped short of the node. The head rule is as specific now.
|
|
62
|
+
- **`curve`: `linkPointAt(a, aSide, b, bSide, t = 0.5)`.** A point on the curve of `linkShape`: the middle of a link for a label, a handle or a marker.
|
|
63
|
+
- **`canvas`: a double click on a link tells what was under the pointer.** `ActivateTarget` of kind `link` has `element`, the element under the pointer, so an app that draws something on a link (a label) can tell a double click on it from one on the line (which puts a point).
|
|
64
|
+
- **New module `guides`: smart guides for dragging.** `snapToGuides(moving, others, threshold, options?)` compares the edges and the centre of the dragged rectangle with those of the other rectangles, per axis, and returns `{ dx, dy, lines }`: how far to shift it so that the nearest pair coincides (within the threshold, in world units; divide a screen threshold by the zoom) and the lines to draw, one per coinciding position, shared by every rectangle that lies on it. Edges and centres can be switched off in `options`. Plain numbers, no DOM and no Vue; collecting the rectangles, applying the shift and drawing stay with the app.
|
|
65
|
+
- **`sortable` in a scaled canvas.** The offsets were measured in screen px and drawn as CSS px, so a list inside a zoomed canvas (a checklist in a node) lagged or ran ahead of the pointer at any zoom but 100%. The scale is measured from the item (rect size over `offsetHeight`) when the drag starts and the offsets are divided by it; the scrolled distance of the list is multiplied by it. At zoom 1 nothing changes.
|
|
66
|
+
- **`camera`: `fitCamera(rect, size, padding?, limits?)`.** The camera that shows a whole rectangle in a view, centred, with air around, zoom clamped to the limits (with `max: 1`: fit but never enlarge). "Zoom to fit" of every canvas editor was a few lines each app wrote again.
|
|
67
|
+
- **`canvas`: a context menu hook.** A right click without dragging used to open the node palette and nothing else. `host.contextMenu(screen, world, target)` is asked first, with what lies under the pointer (`{ kind: 'node', nodeId }`, `{ kind: 'link', id }` or `{ kind: 'empty' }`); return true after showing your menu, false (or have no member) and the palette opens as before. A right button that was dragged still pans and asks nothing. On touch a finger held still on a node or a link (the long press) asks the same, with the same targets; held on an empty place it asks with `{ kind: 'empty' }` and opens the palette unless you return true. Without the member nothing changes (the palette on an empty place, nothing on a node).
|
|
68
|
+
- **`canvas`: a "place" tool.** A toolbar with "Note", "Frame", "Text" tools needs the canvas to say where the next click landed. `host.placing` (readonly boolean) arms it; while it is true, a left press on the canvas calls `host.placeAt(screen, world)` and does nothing else (no selection, no frame, no drag); it also lands over a node and over a field inside one (the tool was just chosen, a note under the cursor must not swallow the click); the right and middle buttons still pan. Disarming the tool (after one placement, on Esc) is the app's business. Both members are needed: without `placeAt` the flag is ignored.
|
|
69
|
+
|
|
70
|
+
## 0.9.0
|
|
71
|
+
|
|
72
|
+
Migrate: `curvefield` and `swiperow` now take their colours from the bridge like the other modules, so import `@1337exp/taoux/taoui.css` with them (`curvefield` drew the plot in TaoUI colours by itself, `swiperow` read the TaoUI tone tokens). Without it they use the built-in dark defaults. `swiperow` without the bridge has a 12px radius (it was the TaoUI panel radius).
|
|
73
|
+
|
|
74
|
+
- **The TaoUI bridge is a contract.** `theme/taoui.css` is the only file that names a `--tao-*` token; the modules read `--tx-*` with a fallback. `tests/bridge.test.ts` checks that no file in `src/` names `--tao-*`, that every themed variable (colour, tone, radius) the components read is mapped, and that the bridge points only at tokens the installed TaoUI defines.
|
|
75
|
+
- **Corner radius through the bridge.** New `--tx-curve-radius`, `--tx-gradient-radius`, `--tx-canvas-radius` (defaults 4px, 4px, 6px, as before) mapped to `--tao-radius-control`; `--tx-swipe-radius` is mapped to `--tao-radius-panel`.
|
|
76
|
+
- **`swiperow`: the action tone and the focus ring have variables.** `--tx-swipe-tone`, `--tx-swipe-tone-text`, `--tx-swipe-armed-text`, `--tx-swipe-accent`; the bridge maps the tone on the action element.
|
|
77
|
+
- **`curveeditor`: the label of zero stays bright.** The brightness of the end labels of the value axis was decided by their place in the list, so a new label below zero took the colour from it while the scale was rescaling; now zero keeps it.
|
|
78
|
+
|
|
79
|
+
## 0.8.0
|
|
80
|
+
|
|
81
|
+
Nothing to migrate: one new function; `downloadText` keeps its signature and result.
|
|
82
|
+
|
|
83
|
+
- **`file`: `downloadBlob(filename, data, mime?)`.** `downloadText` could only save a string, so an app that makes bytes (a ZIP, a PNG) wrote its own copy of the temporary-link dance. `downloadBlob` takes any `BlobPart` (`Uint8Array`, `Blob`, string); without `mime` a `Blob` keeps its own type and anything else is `application/octet-stream`. `downloadText` is now a thin call to it.
|
|
84
|
+
- **`file`: the download link is in the document while it is clicked.** Some browsers follow a link only if it is attached; the link is added to the body for the click and removed right after (`downloadText` gets this too).
|
|
85
|
+
|
|
86
|
+
## 0.7.1
|
|
87
|
+
|
|
88
|
+
Nothing to migrate: three options, all off by default; an app that does not pass them works as before.
|
|
89
|
+
|
|
90
|
+
- **`canvas`: a selection frame that picks only what lies wholly inside.** `options.marquee: 'contain'` (default `'intersect'`, as before). In a level editor a frame drawn over a few objects also touched the ground under them and picked it; with `contain` only the nodes inside the frame are selected (a container still counts by its strip).
|
|
91
|
+
- **`canvas` and `camera`: your own zoom range.** The wheel and the pinch were clamped to 0.2…2 by constants, too narrow for a world thousands of units long. `options.zoom: { min?, max? }` sets the range of the canvas; `zoomAt(cam, sx, sy, factor, limits?)` takes it too, and `zoomLimits(partial)` / `clampZoom(z, limits?)` / `ZOOM_LIMITS` are exported. `session` takes the same `zoom` so a loaded view is clamped to the same range.
|
|
92
|
+
- **`canvas`: the app can keep a key from the canvas.** The canvas listens to Delete, Backspace, Escape and Ctrl+Z / Y on the whole window, so a tool that used Backspace (drop the last point of a path) also deleted the selection. `host.claimsKey(event)` is asked first; returning true leaves the key to the app.
|
|
93
|
+
|
|
94
|
+
## 0.7.0
|
|
95
|
+
|
|
96
|
+
Nothing to migrate: a new module, nothing existing changes.
|
|
97
|
+
|
|
98
|
+
- **New module `undovue`: reactive `canUndo` / `canRedo` for `UndoStack` and `History`.** Both are plain classes whose flags are getters, so an app that wants the Undo and Redo items of a menu to switch on and off had to keep two refs and a `syncFlags()` by hand (every project that uses `undo` or `history` did). `useUndoStack(optionsOrStack)` and `useHistory(initialOrHistory)` wrap the class and keep `canUndo` / `canRedo` (read-only refs) in step after `record`, `undo`, `redo`, `clear`, `commit`, `reset`; `useHistory` also fits `historyCommands` as a source. For a stack you already made (a factory of yours, a store), `useUndoFlags(source)` gives the refs and `sync()`. The classes themselves are not touched.
|
|
99
|
+
|
|
100
|
+
## 0.6.0
|
|
101
|
+
|
|
102
|
+
- **New module `tour`: the model of a guided tour of a page.** `createTour({ steps, available, onEnd })` is a plain state machine without Vue: `start`, `next`, `prev`, `goTo`, `skip`, `finish`, `setSteps`, `subscribe`. A step is `{ id, ...yours }`; one that `available` refuses (its target is not on the page) is jumped over in both directions, and `first` / `last` say whether there is anywhere to go, and `position` / `total` count only the steps that can be shown (for a "2 of 4" that does not count the skipped ones). A tour ends once as `done` or `skipped`. `useTour` is the same with refs for a component, `createTourMemory(key)` remembers that a tour was seen. It draws nothing: the spotlight and the card belong to the app or to TaoUI.
|
|
103
|
+
|
|
104
|
+
## 0.5.6
|
|
105
|
+
|
|
106
|
+
- **`swiperow`: an open row does not click through.** The row that stayed open on its actions still had a live face: a tap on the sliver of it that is left opened the item, and the press outside that closed the row went on to a click on whatever lay under the finger (another row opened). Now a click on the open row only closes it and does not reach its content, and the click after a press outside is swallowed once (a mail app does the same). `:swallow-outside-click="false"` lets the outside click through after the row has closed. A press that gives no click (a scroll) lets go of the guard after 0.6 s. The action buttons work as before.
|
|
107
|
+
- **`swiperow`: a row mounted open** (`open` true from the start) closes on a press outside it too; the listener was only added when `open` changed.
|
|
108
|
+
|
|
109
|
+
## 0.5.5
|
|
110
|
+
|
|
111
|
+
- **`swiperow` stays under a floating bar.** The face of a row has `z-index: 1`, and the row had no stacking context of its own, so the faces took part in the stacking of the whole page and were drawn over a floating `TaoNav` (its glass pill included): the text of the rows showed over the menu. The row is `isolation: isolate` now, and the face counts inside it only.
|
|
112
|
+
- **`swiperow` `tabbable`.** `:tabbable="false"` takes the action buttons out of the Tab order (`tabindex="-1"`), for an app with its own keyboard path to the same actions (arrows, Delete, a menu key); they still run by a click or a swipe. On by default.
|
|
113
|
+
|
|
114
|
+
## 0.5.4
|
|
115
|
+
|
|
116
|
+
- **`swiperow`: Tab from the start action to an end one.** The start side stayed shown and won, so the end action that got the focus stayed hidden under the row (it came out only after the window lost and got back the focus). An action that gets the focus now shows its side and only its side; the focus on the row's own content shows neither.
|
|
117
|
+
|
|
118
|
+
## 0.5.3
|
|
119
|
+
|
|
120
|
+
- **`sortable` no longer gives a page a scroll.** Its live region stood absolute at the end of the body, so on a page exactly the window's height it hung a pixel below and the page scrolled by 1px. It is fixed at the corner of the window now.
|
|
121
|
+
- **`swiperow` takes its colour from `--tx-swipe-bg`.** The face of the row and the ground its actions are tinted on were the raised surface with no way to change them, so a row right on the page showed a lighter edge at its corners. `--tx-swipe-bg` (the raised surface by default) sets both: `var(--tao-color-bg)` for a row on the page. The TaoUI bridge (`taoui.css`) maps it. `--tx-swipe-radius` and `--tx-swipe-gap` now work from an element around the row too: they were set on the row itself, so a value on its list was overridden.
|
|
122
|
+
- **[docs/swiperow.md](docs/swiperow.md):** the variables of the row, and how to test a swipe automatically: synthetic pointer events go to `.tx-swipe__front`, in several moves (the first one past the slop only decides the swipe and becomes the zero point), with the window keeping the focus; a Playwright example with real touches.
|
|
123
|
+
|
|
124
|
+
## 0.5.2
|
|
125
|
+
|
|
126
|
+
- **`swiperow` without the full swipe.** `:full-swipe="false"` turned the long pull off, but the row hit a hard stop at one and a half times the open actions, and the middle actions still shrank as if the last were about to run. Now a pull past the open actions meets a spring (the row follows ever slower, up to half their width more), the actions grow side by side, and on release the row rests open: nothing runs.
|
|
127
|
+
- **`swiperow` selects nothing by accident.** The actions are buttons, so a press or a pull over them never selects their labels (nor opens the long-press callout on iOS); while a row is pulled nothing is selected, and with `mouse` a press-and-move on the row drags it instead of selecting its text.
|
|
128
|
+
- Sandbox: the task list has no full swipe.
|
|
129
|
+
|
|
130
|
+
## 0.5.1
|
|
131
|
+
|
|
132
|
+
- **`swiperow`: the actions show without a jump.** The icon and the label always stand where they end up (nothing pops into the layout, so the heights stay), and only their opacity follows the width of their block: the icon fades in first, the label later, once the block holds it. The start action is one line from the start edge, the icon first. A short fade covers the moment the row settles by itself. The `action` slot gets the block's `width`.
|
|
133
|
+
- **`swiperow`: nothing behind, nothing trailing.** On a long pull to the end the start action showed at the start edge: its panel kept a 6px padding and did not clip. The panel clips now and the gap is the button's margin, so at width 0 nothing of it is left (the keyboard still reaches it). Under the finger the actions trailed the row (their widths eased all the time the full swipe was armed, and the icons and labels faded with a delay): now they follow in the same frame, and only the moment the full swipe arms or disarms eases the widths.
|
|
134
|
+
- **`swiperow`: the middle actions give way instead of the widths jumping.** Up to the open width the end actions grow evenly, as before. Past it the actions between the row and the last one stop at their width and shrink back, smoothly, to slivers (`SWIPE_SLIVER_PX`, 32px) a fifth of the row past the full-swipe threshold, and the last action takes the room they give up; further on they stay slivers, a visible link, and a pull back opens them out the same way. `endWidths` is one continuous function of the pull (the `armed` argument is kept but no longer used), so the eased switch when the full swipe armed is gone too.
|
|
135
|
+
- **A held gesture lets go when the window loses the focus.** Alt-Tab or a screenshot tool often swallow the `pointerup` of a press that was held: a swipe row stayed pulled and a dragged list item stayed lifted when the user came back. `TaoxSwipeRow` and `useSortable` now end the gesture on a window blur, a hidden page or `pagehide`, and the row or the item goes back to rest, as TaoUI's carousel and slider do. The listener is exported as `listenFocusLoss` from `gestures`.
|
|
136
|
+
- `swiperow`: the icon and the label of an end action sit a little closer (gap 2px, icon 20px), not pressed to the edges of a short row.
|
|
137
|
+
- The sandbox has a second list with no start action: those rows go only to the left.
|
|
138
|
+
- The sandbox mail list sets the actions per row: a newsletter has More, Unsubscribe, Delete; a letter from a person only More and Delete.
|
|
139
|
+
- **Docs:** «Why TaoUX» tells what it is now (gestures and lists, undo by records, storage across tabs, the tiers, the skill), and the skill's description names the new modules. A `taoux-dev` skill for working in the repository (`.claude/skills`, now tracked).
|
|
140
|
+
|
|
141
|
+
## 0.5.0
|
|
142
|
+
|
|
143
|
+
- **New module `swiperow` (tier 2, Vue, on TaoUI): `TaoxSwipeRow`, a list row a finger slides sideways, as in a mail app.** To the start (right) one action is behind the row: a pull past its threshold (96px, or a third of a narrow row; or flung that way past half of it) runs it on release and the row comes back, as read / unread. To the end (left) the actions grow out evenly from slivers to their width and the row rests open on them (`v-model:open`), by the nearest stop or a fling; a pull back, a touch outside or an action closes it. Pulled far (60% of the width), the full swipe is armed: the last action takes nearly the whole row, the others shrink to slivers, and the release runs it (delete; `fullSwipe: false` turns it off). Armed actions buzz where the phone can. A vertical move stays the page's scroll; a mouse drags only with `mouse`; the click at the end of a swipe does not reach the row; Tab reaches the actions and opens their side. The gesture is `SwipeTracker` of `gestures`; the decisions are pure and exported (`swipeRowRelease`, `armedAt`, `endWidths`, `clampOffset`). Import `@1337exp/taoux/swiperow.css`. A sandbox page shows a mail list.
|
|
144
|
+
- The sandbox and the tests now run on TaoUI 5.6.2 (dev dependency; the peer range stays `^5.0.0`).
|
|
145
|
+
|
|
146
|
+
- **New module `sortable` (tier 1, Vue): reorder a list by a grip, with the pointer and the keyboard.** `useSortable(listRef, { onMove })` listens on the list; the markup is yours: `data-sortable-item` on each item, in order, and `data-sortable-handle` on a focusable grip inside it (a TaoButton with `icon="tao-grip"`). The pointer: press the grip, the item follows and the others make room (by its size and the gap), the list (or the page) scrolls at its edge through `edgescroll`, release drops it, Esc puts it back; past the ends it is drawn no further than the end (it would stretch the scrolled area and run away with the edge scroll) and lands in the last place. The keyboard: Space or Enter lifts, ↑ ↓ (← → with `axis: 'x'`) move one place, Space / Enter drop, Esc returns it where it started, Tab drops it where it is; a live region of its own says where the item is (`sortableTextsEn` / `sortableTextsRu`, or your `texts`, a function follows the language). The list stays the app's: `onMove(from, to)`, and `moveItem(list, from, to)` makes the moved copy. While moving, the item carries `data-sortable-dragging` or `data-sortable-lifted` for your styles. Pure helpers `sortTarget` and `sortShifts` are exported and tested. A sandbox page shows it with TaoUI.
|
|
147
|
+
|
|
148
|
+
## 0.4.0
|
|
149
|
+
|
|
150
|
+
- **New module `undo` (tier 0): undo and redo by records.** `UndoStack` keeps steps made of only the records they touched (`before` and `after` images), not snapshots of the whole document as `History` does, so a step costs what it changed, and an undo after a sync does not roll back what another device has just changed. `diffRecords(prev, next, id)` makes a step from two lists (records are immutable, found by identity); `record(entry, key?)` merges quick edits with one key within `coalesceMs` (3 s) into one step; `undo(current)` / `redo(current)` take the current list and return the next one. Two hooks carry what only the app knows: `revive(image, now)` stamps a returned record as new (`updatedAt: now`), and `vanish(record, now)` marks a record the step created as gone instead of erasing it (a tombstone; without it the record is dropped). A record that comes back takes its old place (a step keeps where its records stood, `beforeAt` / `afterAt`), so a note removed from the middle returns to the middle and «delete all» undone is the same list in the same order; the nearest place if the list changed meanwhile. The merge window slides with every edit, so typing without a pause stays one step; `coalesceMaxMs` caps how long a merged step may grow (no cap by default). It came out of Next Up's `core/undo.ts`; nothing else changes.
|
|
151
|
+
|
|
152
|
+
## 0.3.0
|
|
153
|
+
|
|
154
|
+
Additions for apps that are not canvas editors (a list of notes); everything that was there works as before, nothing to migrate.
|
|
155
|
+
|
|
156
|
+
- **`ids`: `uuid()`** — a random UUID v4 for records that are stored or synced. `crypto.randomUUID` where there is one; outside a secure context (plain http on a LAN address) the same v4 from `crypto.getRandomValues`. `uid()` stays for ids inside one document: its counter restarts on every load, which its comment now says.
|
|
157
|
+
- **`storage`:** `createSavedStorage` returns a `KeyStorage`, still a `SavedStorage` (it fits `createDocumentSession` as before), with `tryWrite(text)` → `{ ok: false, reason: 'quota' | 'denied' | 'unknown' }` (`write` stays a boolean), `remove()`, and `subscribe(listener)`: another tab of the site changed, removed or cleared the key. `storageFailure(error)` is exported too.
|
|
158
|
+
- **`session`:** `camera` is optional — a document without a canvas view (a list) gets `undefined` in `serialize`, and a `view` from `parse` is ignored. `countItems` is the new name of `countNodes`; the old name is still read.
|
|
159
|
+
- **`gestures`: `SwipeTracker` and `settleOpen`.** The tracker tells a swipe along its axis from a scroll across it (inside `SWIPE_SLOP_PX` nothing is decided, a diagonal goes to the page), follows the offset from where the row already stands without a jump by the slop, and measures the release speed over the last 100 ms. `settleOpen(release, { start?, end? })` says where a released row rests: a fling goes on one stop in its direction (an open row flung back closes rather than flying to the other side), otherwise the nearest stop.
|
|
160
|
+
|
|
161
|
+
## 0.2.2
|
|
162
|
+
|
|
163
|
+
- **`file`:** `downloadText(filename, text, mime?)` takes the type of the file (it was always `application/json`), and the new `readTextFile(file, limit?)` is its pair: it reads a picked file as text, refuses a file above `MAX_FILE_BYTES` before reading it, and returns `{ ok: false, error: 'tooLarge' | 'unreadable' }` instead of throwing. Nothing to migrate.
|
|
164
|
+
|
|
165
|
+
## 0.2.0
|
|
166
|
+
|
|
167
|
+
TaoUI 5.0 is out, and TaoUX follows it, with two new modules for the TaoUI menu bar.
|
|
168
|
+
|
|
169
|
+
### Modules
|
|
170
|
+
|
|
171
|
+
- **A skill for AI assistants** ships in the package: `skills/taoux/SKILL.md` (the modules, the TaoUI bridge, commands and hotkeys with the menu bar, the usual mistakes). `tests/skill.test.ts` keeps it naming every module.
|
|
172
|
+
- **New `hotkeys`** (tier 0): `parseHotkey` (`Mod+Shift+Z`, aliases, the plus key; a typo throws), `matchHotkey` (`Mod` is ⌘ on Apple and Ctrl elsewhere; a non-Latin layout and Option on a Mac match by the physical key, the digit row too), `formatHotkey` (`Ctrl+Shift+Z` / `⇧⌘Z` in Apple's ⌃⌥⇧⌘ order), `normalizeHotkey`, `isReservedHotkey` (⌘W, ⌘T, ⌘N, Ctrl+Tab; ⌘Q on a Mac, Alt+F4 elsewhere, ⌘R in Safari), `bindHotkeys` (on any element; text fields keep plain keys and text editing by default).
|
|
173
|
+
- **New `commands`** (tier 1): `createCommands` — a registry of commands with `label`, `shortcut`, `icon`, `enabled`, `checked`, `group`, `run`; `toMenu(layout)` builds the menu tree for `TaoMenubar`, `TaoDropdownMenu` and `TaoContextMenu` (the same shape as TaoUI's `TaoMenuItem`, held by a type test, with no dependency on TaoUI); `bind` listens to the shortcuts (a disabled command swallows its key); `check` lists reserved and duplicate shortcuts; `historyCommands` gives Undo / Redo that disable themselves (a document session fits as is).
|
|
174
|
+
|
|
175
|
+
### TaoUI
|
|
176
|
+
|
|
177
|
+
- **Built and tested against TaoUI 5.0.0** (peer range `^5.0.0`, optional). TaoUI 5 is ESM-only; its styles moved into `tokens/`, `themes/` and `contexts/`, and `TaoTimeline` is now `TaoScrubber`.
|
|
178
|
+
- **The bridge is unchanged for you:** the 13 `--tao-color-*` tokens it points at are the same. Its test no longer depends on one TaoUI file name: it reads every stylesheet of the installed TaoUI, so a future reshuffle cannot break it for the wrong reason.
|
|
179
|
+
- The sandbox, the docs and the consumer smoke test use `TaoScrubber`.
|
|
180
|
+
- `npm run smoke` accepts `TAOUI_TARBALL=<file.tgz>` to test against a TaoUI that is not published yet.
|
|
181
|
+
|
|
182
|
+
## 0.1.0
|
|
183
|
+
|
|
184
|
+
The first public release.
|
|
185
|
+
|
|
186
|
+
### Modules
|
|
187
|
+
|
|
188
|
+
- **Primitives:** `camera`, `history`, `storage`, `file`, `snap`, `wheel`, `edgescroll`, `gestures`, `touch`, `curve`, `ids`, `ease`, `num`, `i18n`.
|
|
189
|
+
- **Composite:** `session`, `palette`, `pins`, `playback` (`createPlayback`, `usePlayback`), and the Vue modules `links`, `canvas`, `curveeditor`, `gradienteditor`.
|
|
190
|
+
- **Tier 2, on TaoUI:** `curvefield` (`TaoxCurveField`): a curve with time, value, transition (`ease`), snapping, remove and reset fields.
|
|
191
|
+
- **Curve editor:** grid, snapping, bounds, decimals, auto-scroll at the edge, per-segment easing with Bezier handles, guides (`off`, `lines`, `values`), keyboard.
|
|
192
|
+
|
|
193
|
+
### TaoUI
|
|
194
|
+
|
|
195
|
+
- **The TaoUI bridge:** `import '@1337exp/taoux/taoui.css'` points every `--tx-*` colour variable at a `--tao-*` token, so the editors follow the TaoUI theme (dark, light, your own). Plain CSS, zero specificity, no dependency on TaoUI. `tests/bridge.test.ts` keeps it complete.
|
|
196
|
+
- Built and tested against TaoUI 3.3.1 (peer range `^3.2.1`, optional).
|
|
197
|
+
|
|
198
|
+
### Packaging
|
|
199
|
+
|
|
200
|
+
- `sideEffects` lists the CSS files, so bundlers keep `import '@1337exp/taoux/canvas.css'`.
|
|
201
|
+
- `npm run smoke` installs the packed tarball into a throwaway Vue + Vite app next to TaoUI, imports every module by its public path and builds it (also runs in CI).
|
|
202
|
+
|
|
203
|
+
### Sandbox
|
|
204
|
+
|
|
205
|
+
- English and Russian, a dark / light switch, relative paths for hosting in a sub-folder (`npm run sandbox:build`).
|
|
206
|
+
- `npm run media` captures the screenshots and clips in `docs/media` from the sandbox.
|