Web Runtime
Web Runtime 0.2.0
Release notes for Web Runtime 0.2.0.
2 changes — 2 features
Minor Changes
-
#75
97db55fThanks @dm-balakin! - Portals, and an overlay layer to render them in, inside the plugin's one view.soundor:uiaddsoverlayRoot: a second root that fills the view, laid out apart fromroot, drawn over all of root's content whatever itszIndex, and hit first, letting the pointer through where nothing in it takes it. Its events bubble up to it, not toroot. Tab moves through the content, then the overlay. The JUCE runtime draws both trees on its one Skia surface; the Web runtime keeps both in the plugin viewport, in one isolated stacking context.@soundor/reactaddsPortal,Portal.HostandcreatePortalHost(), built on the reconciler's portals: React context, state and effects survive.<Portal>renders into an overlay entry; entries stack in the order they open, so an overlay opened from another stacks above it.<Portal host={host}>renders exactly where<Portal.Host host={host}>is, inheriting its clipping and stacking; it renders nothing until the host mounts, follows it away and back, and showing one host in two places is an error.FocusScopecovers both trees, so portaled content that a scope renders belongs to it.
-
#72
64bdb5dThanks @dm-balakin! -soundor:uigets the coordinates, stacking and interaction that overlays and custom controls build on, the same in the JUCE and Web runtimes.- Pointer events add
pageX/pageY(relative to the plugin view) andlocationX/locationY(relative to the target), in logical pixels at any device or viewport scale.clientX/clientYandoffsetX/offsetYstay, with the same values. style.zIndex: an integer that stacks a node among its siblings for drawing and hit testing alike (equal values keep tree order, the later sibling on top). Every node stacks its own children; layout is not affected.- A
contextmenupointer event, which captures and bubbles, when the secondary button goes down. In the browser it bridges the DOM'scontextmenu; preventing it keeps the browser's own menu away.@soundor/reactaddsonContextMenuandonContextMenuCapture. pressable()andPressableaddonLongPress(the primary button helddelayLongPressms, 500 by default, without moving more than 10 px; noonPressfollows it), and their state addsfocused, from focus and blur.
- Pointer events add