Soundor
Engine

Engine 0.6.0

Release notes for Engine 0.6.0.

All Engine releases

8 changes — 7 features, 1 fix

Minor Changes

  • #201 54ed098 Thanks @dm-balakin! - A resizable editor's limits are now what it asks for. By default it opens at its size and only grows, without a maximum: minWidth/minHeight default to the opening size, and maxWidth/maxHeight to Infinity (which a config may also write). The limits, and the aspect ratio of an editor that scales (editor.keepAspectRatio, default true), are offered to hosts that ask and kept by the Standalone and the web host's handle; a host that sets a larger window or another shape regardless (Ardour) gets it, the minimum only held. editor.fit decides what the UI does in such a window, for every resizable editor: 'contain', the default, lays it out at most at its maximum (or, scaling, at its zoom, capped by the maximum) in the middle, with bands of the editor's background; 'cover' lays it out over the whole window, viewSize().safeArea (and useViewSize()) saying where the part it was made for is. The web host applies the same rules in ?embed, where the page owns the size, and hides its handle where the limits allow no other size. soundor:ui adds editorSize() and subscribeEditorSize(), the editor's actual size in its own logical pixels, told once per change whoever resized it. EditorConfig is now a union that allows fit only with resizable: true and keepAspectRatio only with resize: 'scale' (validation rejects fit: 'cover' and keepAspectRatio: true elsewhere), and reports a maximum below the opening size; ResolvedEditorConfig always has both, and DEFAULT_EDITOR_LIMITS is gone. In tests, testView.resize({ safeArea }) sets the safe area and testEditor.resize() the editor's size.

  • #201 bffc8ea Thanks @dm-balakin! - soundor:ui gains requestEditorSize(width, height): plugin code asks for another editor size, any finite one, held to the editor's limits (and, scaling, its aspect ratio), which the host gives or not; it returns the size asked of the host, or null where none can be; editorSize().resizable says whether it can ask (false for a fixed editor and in ?embed). Pointer events gain screenX/screenY, the pointer on the screen in the editor's pixels, so a resize grip drawn by the UI measures its drag in units the resize does not change. The JUCE editor applies requests with setSize() after the UI's code ran, telling the host, and keeps later requests to a minimum or maximum the host showed by giving another size in place of one asked for (Ardour's window), so a grip does not spring back at every step; the Web host resizes its viewport as its handle does. The test runtime simulates requests (testEditor.requests(), editor: { resizable, minWidth, …, aspectRatio, applyRequests }). An editor that scales keeping its aspect ratio is given the size at its ratio nearest to the one asked for, by a request or by the Web host's handle, whatever its size is, so a corner dragged narrower and taller no longer grows and shrinks in turn. The Basic and Orbit examples draw a grip of their own.

  • #206 2a5caa9 Thanks @dm-balakin! - Focus rings that show only for the keyboard, and outlines to draw them with. node.focusVisible (soundor:ui) is CSS's :focus-visible: focus a pointer press gave is not shown until a key is pressed (not a shortcut nor a modifier on its own), focus moved by Tab, assistive technology or code after a key is, and a text input's always is. Every runtime decides it by the same rules, the web runtime too rather than by the browser's. A focusvisiblechange event (React: onFocusVisibleChange) fires whenever it changes, FocusEvent.focusVisible says what it is, and pressable()'s state and React's PressableState have focusVisible. The new styles outlineWidth, outlineColor and outlineOffset draw a line around a node as CSS's outline: outside its border, following its corners, taking no room in layout and not hit, so a ring can appear without moving anything.

  • #194 003c103 Thanks @dm-balakin! - Support bundled SVG assets through Image with the existing content-addressed asset IDs and TypeScript imports. Native images cache bounded Skia SVG documents and render them at the effective physical resolution; Web images use the browser's image decoder. Preserve Image sizing and resize modes, with documented SVG intrinsic-size fallbacks and compatibility limits.

  • #194 6a5482e Thanks @dm-balakin! - Build Skia's SVG document renderer with private static Expat and primitive shaping. Add a bounded, self-contained document parser with external resources disabled. SVG images and the React API follow in separate changes.

  • #194 6a677ac Thanks @dm-balakin! - Add soundor:ui createSvg and the bounded, atomic SVG scene protocol v1. SVG roots are Yoga leaves with normal input and accessibility. Native scenes retain Skia geometry with shared path caching and damage tracking; Web scenes use native SVG elements. Add scene update, path parse and draw counters to native benchmark reports. This protocol requires engine 0.6.0 or later; React components follow through the existing React package.

  • #186 96ef938 Thanks @dm-balakin! - useViewSize() in @soundor/react returns the plugin view's { width, height } in logical pixels and its scale (device pixels per logical pixel), and re-renders when they change: the user resized the editor, a web host's embedding iframe changed size, or the view moved to a display of another density. It never re-renders for an unchanged size and does not poll. Underneath, soundor:ui has subscribeViewSize(listener), and viewSize() is now the same frozen object until the size changes, so the pair works with useSyncExternalStore. The JUCE runtime tells subscribers once per change, on the editor's tick before the frame at the new size; the web runtime measures the view with the ResizeObserver that already updates hover, follows the page's pixel density and the host's scaling. In tests the view starts at the project's editor size, and testView.resize() changes it; the simulated viewSize() no longer throws.

Patch Changes

  • #192 c0420b2 Thanks @dm-balakin! - The JUCE and web runtimes lay out more styles the same. Natively, a box with no room (in a container squeezed to zero) keeps its content's size rather than its padding's (Yoga's shortcut for it is patched out), and a fixed width or height counts in a parent sized by its content after its min*/max* clamp. In the browser, flex: n (or a fixed flexBasis) adds only its basis to a row sized by its content, and aspectRatio wins over the stretch as in Yoga (with both sizes given, the one along the parent's direction stays). In the browser, a hidden node's (or its children's) layout is all zeros and its getBoundingClientRect() at its nearest shown ancestor, as natively, rather than at the page's corner. The cases that still differ are listed in the web runtime's guide, "Where layout differs".

On this page