@weasel-js/core 0.7.0 → 0.7.1

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 CHANGED
@@ -1,5 +1,99 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - a3af158: Gestures are now keyed per pointer. `gestureIdFor` returned the literal string
8
+ `pointer-mouse` with nothing interpolated — despite its own docs promising
9
+ `pointer-<pointerId>` — so every pointer shared one in-flight handle slot and
10
+ two pointer gestures could not coexist. Pointer events carry `pointerId` now
11
+ and the id interpolates; events without one (synthetic probes, most tests)
12
+ still key to `pointer-mouse`.
13
+
14
+ That removes an accident the pinch path was relying on, so the multitouch
15
+ policy is stated rather than implied: when a second pointer lands, the
16
+ multitouch channel claims every pointer that hasn't already committed to a
17
+ gesture, suppressing both drags and taps from those pointers. A drag already in
18
+ flight keeps running — yanking a gesture away from someone who rested a palm is
19
+ worse than letting it finish.
20
+
21
+ `useTools` also reports routing conflicts now. `findConflicts` had been
22
+ written, tested, and never called, so the kit could detect its one class of
23
+ genuine routing ambiguity and never looked. It runs at registry assembly under
24
+ a dev guard and warns each conflict in the grammar the route was written in. It
25
+ warns and never throws: a consumer tool colliding with a kit tool can be
26
+ deliberate, since the loser may still take the gesture by declining through
27
+ `enabled()`.
28
+
29
+ - a3af158: Scenes with many shapes or much text draw far less work per frame. Two caches
30
+ the kit already had were missing on essentially every node of every frame,
31
+ because the values they key on were rebuilt each time.
32
+
33
+ The tessellation cache (`WeakMap<Path, Mesh>`) keys on `Path` identity, but
34
+ `kit:shape` allocated a fresh path for every ellipse, polygon and star on every
35
+ draw. Painters now memoize `paint` against the node, so the same path comes
36
+ back and the cache does its job: 1000 shape nodes went from 6.69 to 0.20
37
+ ms/frame through paint and tessellation.
38
+
39
+ Text layout is the larger one. `layoutRuns` — which walks every codepoint,
40
+ resolves a face per run, measures, wraps and places each glyph — ran per text
41
+ command per frame. It is now cached in the renderer, keyed on the resolved
42
+ runs. 200 wrapped paragraphs went from 31.8 to 0.06 ms/frame, 1000 short
43
+ labels from 12.5 to 0.42. The cache drops itself when a font becomes
44
+ available, so text still reflows the moment the real face lands.
45
+
46
+ Two contracts follow from this, for anyone writing a custom painter or calling
47
+ these directly:
48
+
49
+ - The array a painter's `paint` returns belongs to the painter. Treat it as
50
+ immutable and copy before appending — `defaultDrawOne` now does, for its
51
+ label overlay.
52
+ - `registerFont` now notifies `subscribeGlyphReady` when a family finishes
53
+ registering, so a font loaded mid-session repaints without waiting for an
54
+ unrelated redraw. `glyphGeneration()` is a new pull-based companion to that
55
+ signal, for caches that can't hold a subscription.
56
+
57
+ - 6af4806: Reorder: `Cmd/Ctrl+Shift+]` and `Cmd/Ctrl+Shift+[` now bring-to-front and
58
+ send-to-back. The shortcut every drawing app uses could never fire — modifier
59
+ matching is strict, so a binding without `shift` in its spec cannot match a
60
+ keystroke that holds it, which also made the shifted `'}'` / `'{'` characters
61
+ in those key lists unreachable. `Cmd+Alt+]` / `Cmd+Alt+[` remain as the
62
+ fallback for browsers that reserve `Cmd+Shift+[`/`]` for tab switching.
63
+
64
+ `BUNDLE_TOOLS.standard` no longer includes `pencil`. Freehand is a specialist
65
+ instrument rather than part of the everyday shape-drawing set; it is still in
66
+ `exhaustive`. Consumers wanting it back can pass `tools={{ pencil: true }}`
67
+ alongside the bundle.
68
+
69
+ - a3af158: Clicks now land on the shape a node actually paints, not on its bounding box.
70
+ The pose rect is the wrong answer for anything that isn't a rectangle: a click
71
+ in a star's notch, in the corner outside an ellipse, or in the blank half of a
72
+ text box went to the node that merely bounds that point, burying whatever was
73
+ really underneath. `picking: 'shape'` had been available since it shipped and
74
+ was opt-in only because flipping it changes what a click selects.
75
+
76
+ Ink counts too, not just the boundary. A shape whose interior isn't filled —
77
+ an outlined rect, a pencil stroke, a bare line — is now grabbable along its
78
+ outline and not through its empty middle, which is the opposite of what a fill
79
+ test alone answers. Painters declare this through the new `NodeShapeEntry.ink`;
80
+ one that declares none is treated as filled, the previous behavior.
81
+
82
+ Pass `geometry={{ picking: 'pose' }}` to `SceneCanvas` for the old rect
83
+ behavior. Painters with no silhouette are unaffected either way, so nothing
84
+ becomes unreachable.
85
+
86
+ - 2003597: Export `VERSION` — the kit version a build was compiled from, baked in at
87
+ build time. Apps can pair it with their own compile timestamp to report what
88
+ they're running (WeaselDraw now shows `0.7.0 · Jul 30` in its status bar).
89
+ - Updated dependencies [6af4806]
90
+ - Updated dependencies [a3af158]
91
+ - @weasel-js/font@0.7.1
92
+ - @weasel-js/geom@0.7.1
93
+ - @weasel-js/gestures@0.7.1
94
+ - @weasel-js/history@0.7.1
95
+ - @weasel-js/modes@0.7.1
96
+
3
97
  ## 0.7.0
4
98
 
5
99
  ### Minor Changes