gesso-core 0.3.0 → 0.4.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,96 @@
1
1
  # gesso-core
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - **Scroll layers: a scrolled container is shifted, not redrawn.** On Canvas2D,
8
+ when a frame's only change is a scroll container's offset by a whole number of
9
+ device pixels, the renderer copies the pixels it already drew inside it over by
10
+ the scroll distance and redraws only the strip that came into view —
11
+ pixel-for-pixel identical to a full redraw, and several times cheaper in
12
+ software rendering. A layer is built only after the container has scrolled on a
13
+ few quiet frames running (`scrollLayerSettleFrames`, default 3), so a
14
+ virtualised list that mounts rows as it scrolls never builds one. Anything else
15
+ — a fractional smooth-wheel offset, a zoom, content that changes as it scrolls,
16
+ a caret or video inside — is drawn directly as before.
17
+ `Canvas2DRendererOptions.scrollLayers` turns it off. WebGPU is unchanged.
18
+
19
+ **Pictures that change every frame are no longer rasterised every frame.** On
20
+ Canvas2D, a painter's recording whose drawing changed this frame is replayed
21
+ straight onto the frame and rasterised only once it has held still for four
22
+ frames, so a live layer is never turned into a bitmap it throws away. A picture
23
+ seen for the first time, resized or re-themed is still rasterised at once.
24
+ `PaintStats` counts the replays as `direct`.
25
+
26
+ **A held mouse click is still a click.** A mouse press held past the long-press
27
+ delay lost its Click, so a deliberate, slow press on a button did nothing. A
28
+ mouse long press is now claimed only when a listener takes it (`preventDefault`
29
+ on `LongPress`) or it moves into a Drag. A finger's hold is claimed as before.
30
+
31
+ **`overscrollBehavior="contain"` keeps the wheel in a mounted app.** It was read
32
+ from the tree's topmost node, which in a mounted app is the runtime's wrapper,
33
+ not the app's root, and mid-chain it was honoured only on scroll containers. It
34
+ is now honoured on any ancestor of the target, so a pan-and-zoom canvas can keep
35
+ a ctrl-wheel or trackpad pinch from zooming the page.
36
+
37
+ ## 0.4.0
38
+
39
+ ### Minor Changes
40
+
41
+ - **`DoubleClick`, dispatched after a second Click on the same node.** The pointer
42
+ controller pairs Clicks on the same node within 500 ms and 4 px — the window the
43
+ editing and selection controllers already use for a word — and dispatches
44
+ `DoubleClick` after the second, as the DOM's `dblclick` follows its `click`. A
45
+ press that became a drag or was cancelled spends the pair.
46
+
47
+ `onDoubleClick` on any element; `fireEvent` gains `doubleClick` and
48
+ `contextMenu`.
49
+
50
+ - **A menu opened at a point stays on the screen.** A context menu's point was a
51
+ top and a left and nothing more, so a menu asked for near the bottom or right
52
+ edge opened off the screen.
53
+
54
+ The layout engine gains `anchorPoint`, a point placed beside as an anchor of no
55
+ size would be — the same flip and clamp — and overlays a `point` option that
56
+ uses it. `Menu`'s `at` opens below and to the right of the point, and above or
57
+ to the left when there is no room.
58
+
59
+ Found by a spreadsheet's status bar, whose menu opened below the window.
60
+
61
+ ### Patch Changes
62
+
63
+ - **An absolute box past its containing block keeps its explicit size.** With no
64
+ room left on an axis, the loose constraint an absolute child was measured under
65
+ came out `(0, 0)`, which reads as tight, and a box with an explicit width or
66
+ height was laid out at zero on that axis — where one pixel of room would have
67
+ left it whole.
68
+
69
+ An explicit size is the box's own, as in CSS; the block no longer caps it.
70
+
71
+ - **The browser shells post OS file drops.** The `fileDrop` message, its shape and
72
+ the session that turns it into an ordinary drag have existed since drop targets
73
+ did, and nothing posted one: a zone accepting `gesso/files` could be written and
74
+ never reached.
75
+
76
+ `attachFileDrop` is the shell half, shared by `createApp`'s worker shell and
77
+ `createSyncApp`'s single-thread one because it is the same four DOM events
78
+ either way. It answers drags that carry files and no others, prevents the
79
+ default on every `dragover` (which is what tells a browser the drop is wanted)
80
+ and on `drop` (or the tab is replaced by the file), and reads the bytes before
81
+ posting the drop. The worker shell transfers the buffers rather than copying
82
+ them; a drop whose files cannot be read is reported as a leave, so no zone stays
83
+ lit waiting. `GessoRuntime.applyFileDrop` hands the message to the tree's drag
84
+ session.
85
+
86
+ The core half was wrong in a way no spec could have caught: `applyFileDrop` began
87
+ a drag with the files of `enter` and, on `drop`, only moved it, so a zone
88
+ received the payload the drag started with. A browser lets a page see the _types_
89
+ of dragged files and nothing else until they are let go, so that payload has
90
+ empty names and no bytes — every file dropped from a desktop would have arrived
91
+ unopenable. The spec that covered it sent the same files on both phases, which is
92
+ the one shape a browser never produces. It now sends what one does.
93
+
3
94
  ## 0.3.0
4
95
 
5
96
  ### Minor Changes