v0.170.0
Minor Changes
-
#1362
cc139397Thanks @tenphi! - AddeduseSchema()anduseHighContrast()— the JS answer to the@darkand@hcstates, for the two places a state map cannot reach: surfaces that take values rather than CSS (a Vega spec, a CodeMirror/Monaco theme, an iframe) and controls whose value is the ambient condition. Both follow the<html data-schema>/<html data-contrast>opt-in first andprefers-color-scheme/prefers-contrastsecond, exactly as the states do, and re-render on a change.resolveSchema(),resolveHighContrast()andsubscribeSchema()cover the same ground outside React. Styling still belongs in a state map. -
#1362
cc139397Thanks @tenphi! - Breaking: renamed theschemeterm toschemaacross the API, so one word names the concept thedata-schemaattribute and the@root(schema=…)state already use.renderColorTokens()/renderPaletteTokens()/RenderPaletteOptions: theschemeoption is nowschema—renderColorTokens({ schema: 'dark' }).<CubeLogo>/<CubeFullLogo>: theschemeprop is nowschema.- The probe's
tokenOptions.schemeis nowtokenOptions.schema, and thepnpm probeCLI flag--schemeis now--schema(--schema hcstill means light + high contrast).
No aliases: update the call sites.
Patch Changes
- #1364
9cf2d8d7Thanks @tenphi! -Board: pressing an interactive control inside a widget now always drops the selection.selectionCancelpromises that a press on an interactive descendant drops the selection, but the reset used to ride on the widget host's bubble-phaseonPointerDown— so it only happened for presses that actually reached the host. A control that callsstopPropagation()first (React Aria'susePressdoes by default, and charting libraries do it on the native event) or one that renders in a portal never got there, which is why a widget's gear button dropped the selection while the chart's own toolbar button silently left it standing. The reset now runs in the capture phase, both through React (so a portal declared inside the widget is still covered) and as a native listener on the host node itself (so a descendant that stops the native event cannot pre-empt it). Nothing is stopped or prevented in either handler, so every control keeps its press, its focus and its default behaviour. A press on content a widget portaled outside the board also no longer starts a marquee behind the overlay.