@1337exp/taoux 0.2.1 → 0.4.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.
@@ -25,18 +25,19 @@ shells, and TaoUX has **no buttons or fields of its own**. Pair it with TaoUI fo
25
25
  |---|---|
26
26
  | `camera` | pan, zoom around the cursor, screen ↔ world (`zoomAt`) |
27
27
  | `history` | `new History(snapshot)`: undo / redo on string snapshots, rapid edits with one `key` merged into one step |
28
- | `session` | `createDocumentSession(...)`: history + autosave + files + restore + notices for one document; `canUndo` / `canRedo` refs |
28
+ | `undo` | `new UndoStack({ id, revive, vanish? })`: undo / redo of a list of records by steps that keep only the touched ones (`diffRecords(prev, next, id)` makes a step; a returned record takes its old place); right for a list that is edited and synced, where `History` would store the whole list per step and an undo would roll back a sync. `coalesceMaxMs` caps a merged step of typing |
29
+ | `session` | `createDocumentSession(...)`: history + autosave + files + restore + notices for one document; `canUndo` / `canRedo` refs. `camera` is optional (a list, not a canvas); count with `countItems` (`countNodes` is its old name) |
29
30
  | `commands` | `createCommands([...])`: one registry for menus, shortcuts and palettes (see below) |
30
31
  | `hotkeys` | `parseHotkey('Mod+Shift+Z')`, `matchHotkey`, `formatHotkey` (`Ctrl+Shift+Z` / `⇧⌘Z`), `isReservedHotkey`, `bindHotkeys(element, map)` |
31
- | `storage` | autosave to localStorage that never throws |
32
- | `file` | download text as a file, with a size limit |
32
+ | `storage` | autosave to localStorage that never throws; `tryWrite` gives the reason (`quota` / `denied`), `remove`, `subscribe` for changes from other tabs |
33
+ | `file` | `downloadText(name, text, mime?)`; `readTextFile(file, limit?)` reads a picked file, refusing a big one |
33
34
  | `snap` | soft snapping to a grid, threshold follows the zoom |
34
35
  | `wheel` | wheel / trackpad → pan or zoom, like Figma (zoom only with Ctrl / ⌘ or a pinch) |
35
36
  | `edgescroll` | auto-scroll near an edge while dragging (`createEdgeScroller`) |
36
- | `gestures` | tap, double tap, long press, pinch |
37
+ | `gestures` | tap, double tap, long press, pinch; `SwipeTracker` (swipe vs scroll) + `settleOpen` (where a released row rests) |
37
38
  | `touch` | `coarse`: is the pointer a finger |
38
39
  | `curve` | link paths: Bezier between pins, arrowheads of constant screen size |
39
- | `ids` | `uid(prefix, taken)` |
40
+ | `ids` | `uuid()` for stored / synced records; `uid(prefix, taken)` restarts from zero on every load, only for ids inside one document |
40
41
  | `ease` | easing between curve points (8 families × in / out / in-out, `linear`, `step`, cubic Bezier), `easeValue` |
41
42
  | `num` | `clamp`, `roundTo`, `snapTo`, `niceStep`, `ticks` |
42
43
  | `palette` | search and groups for a palette of nodes |
@@ -88,6 +89,7 @@ onBeforeUnmount(() => unbind());
88
89
  - Importing from `@1337exp/taoux` (no root entry) or from `dist/` paths.
89
90
  - Forgetting the module CSS (`curveeditor.css`…) or the bridge `taoui.css`: the editor renders unstyled or dark.
90
91
  - Calling `toMenu` outside `computed`: the menu does not follow the state.
92
+ - Using `History` for a list of records that is synced: its snapshots are the whole list, and an undo after a sync rolls back the other device's edits. Use `undo` (`UndoStack`), and stamp a returned record as new in `revive`.
91
93
  - Keeping editor state outside `history` / `session` and then wondering why Undo skips it: commit a snapshot after
92
94
  every edit (`session.commit(key)` or `recorded(fn)`).
93
95
  - Offering a reserved shortcut (⌘W, ⌘T, ⌘N, Ctrl+Tab): the browser takes it before the page.