Version Packages#7
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@react-pixel-ui/core@2.2.0
Minor Changes
#6
911fbb0Thanks @Todari! - Core engine overhaul: real PNG compression, full CSS color support, gradient correctness, and graceful degradation.Performance
generatePixelArtacceptsoptions.want: 'styles' | 'composite' | 'both'so consumers skip generating the PNG they discard (~2× faster for gradient cases). Default'both'keeps backward compatibility.generatePixelArtresults are cached in a small LRU keyed by inputs — hover/theme/re-render churn no longer regenerates identical art. Treat returned objects as immutable.Color parsing
lime,navy,teal,tomato,gold,rebeccapurple, … no longer fail to parse).color(srgb … ),color(srgb-linear …), andcolor(display-p3 …)— Chromium serializes computedcolor-mix()results ascolor(srgb …), socolor-mix()now works end-to-end through<Pixel>/usePixelRef.rgb()/rgba()patterns are anchored, so colors embedded in unsupported values (e.g.conic-gradient(rgb(255,0,0), …)) are no longer misparsed as a solid color.Gradients
linear-gradient(to right in oklab, …)no longer silently falls back toto bottom.turn,rad, andgradare converted correctly (previously onlydegworked).to top right, …) now resolve to the aspect-ratio-dependent "magic corner" angle per CSS spec via the newresolveGradientAngle(gradient, width, height)export, instead of a fixed 45° multiple.red 0% 50%) expand into two stops, preserving hard color edges.pxpositions or one unparseable stop no longer corrupt the whole gradient (the-1position sentinel can no longer leak into sampling).Correctness & safety
generatePixelShadowno longer forces zero offsets topixelSize—box-shadow: 0 4px 0stays a straight shadow instead of turning diagonal. Offsets snap to the nearest grid line; all-zero shadows are skipped entirely.generateCompositePixelImagekeeps the interior transparent for border-only elements (previously it filled the content area with the border color), and returnsnullwhen a background is present but unparseable (url(),conic-gradient(), …) so consumers can leave the original styling untouched.parseComputedStylesresolves percentageborder-radius(e.g.border-radius: 50%avatars) against the element size via a new optionalsizeparameter, and handles elliptical two-value radii.parseBoxShadowdetects theinsetkeyword anywhere in the serialization — real browsers put it at the END in computed styles, so inset shadows were previously converted into outer drop-shadows. Multiple shadows are split correctly and the first non-inset one is used.pixelSize—pixelSize: 0no longer hangs the tab (infinite loop) or throwsRangeError.Packaging
moduleResolution: node16/nodenextnow get the ESM declaration file (index.d.mts) via per-conditionexportstypes — fixes the attw "Masquerading as CJS" failure and wrong CJS-interop type errors.@react-pixel-ui/react@2.2.0
Minor Changes
#6
911fbb0Thanks @Todari! - React layer fixes: stable DOM across re-measures, resize awareness, StrictMode-safe observers, working responsive mode, and API hardening.<Pixel>display: contentswhile measuring), so uncontrolled<input>values, focus, and selection survive.ResizeObservernow watches the child: responsive/percentage-width elements re-measure when their size changes (stale absolute-px clip-paths are regenerated), and elements that mount at zero size (insidedisplay: nonetabs/accordions) get pixel art as soon as they become visible — previously they never did.url()images,conic-gradient()) are left untouched instead of being replaced withbackground: none+ a transparent PNG (elements no longer go invisible or flash solid red).box-shadowis only cleared when it is actually replaced by a pixel shadow — inset-only shadows are preserved.usePixelRefbox-shadowget their pixelated drop-shadow again — the hook only readwrapperStyle.filter, which the composer only sets when a border wrapper is needed, so shadows were silently deleted. When the element has no clip-path the filter now applies to the element itself instead of its parent.<Pixel>for unparseable backgrounds.<PixelBox>responsivemode actually works now: the component no longer pins its own measured fallback (200×100) as inline px width/height, which made the ResizeObserver only ever read back the forced size. Size the box with your own CSS (style={{ width: '100%', height: 120 }}) and the pixel art follows it. Measurement uses the border box.className,style, and other HTML props now consistently land on the root element (previouslystylelanded on the inner content div when a border was used, somarginetc. silently did nothing).<PixelButton>variantvalues fall back toprimarywith a dev warning instead of crashing with aTypeError.<button>defaults totype="button"so dropping it into a form no longer submits the form; an explicittypeprop still wins.Misc
PixelConfigProviderno longer crashes when rendered without aconfigprop (it is now optional).usePixelArtmemoizes by the radius values, so inline per-corner arrays (borderRadius={[8,8,0,0]}) no longer regenerate the art on every parent re-render; it also skips generating the unused composite PNG.PixelBox/PixelButtonexpose properdisplayNames in React DevTools (no morePixelBox2).moduleResolution: node16/nodenextget the ESM declaration file via per-conditionexportstypes, and the"use client"banner no longer shifts source maps by one line.Patch Changes
911fbb0]: