Summary
Version 3.0.0 reworks avatar rendering to display only the central subject, fitted precisely into a bounding circle, and removes a range of decorative theme options in the process. React lock behavior is also made consistent across all selection paths.
Breaking Changes
- Removed the
decorationoption from every theme that had it (gems, weather, plants, birds, food, insects), and dropped the now-unusedsparkleColorfrom gems. - Removed additional theme parameters:
hasBubbles,hasPlants, andmagic. - Removed ambient framing overlays (ocean bubbles, dinosaur foliage, mythical magic) and floating decor baked into generators (weather glow auras and particles, phoenix/kitsune sparkles, plant soil bases). Subject-defining parts such as sun rays, lion mane, whale spout, comet tail, and rainbow arc are kept.
- Removed the
wrapeye style from aliens.
Features
- Avatars now render only the central subject, fitted into the inscribed bounding circle (radius 46) via the new
fitToCircleutility, replacing the hand-tuned per-type scale tables. - Added a fit-to-circle scaling utility that computes SVG content bounds analytically (honoring nested and element transforms, sampling curves, skipping non-drawn defs/clipPath, and accounting for stroke width), then scales and centers content into a padded inscribed circle so it never overflows.
- avatarka-react: Locked field values are now preserved when selecting an avatar from the gallery, consistent with manual theme switching and the Randomize button.
- avatarka-react: A locked field keeps its lock when its value changes, and a manual theme switch via the dropdown now preserves the theme lock and all field locks, carrying over locked values (such as
primaryColor) that also exist in the new theme.
Bug Fixes
- Bounded SVG arc (
A) path commands infitToCircleby sampling via the endpoint-to-center parameterization, so arched shapes like the rainbow no longer overflow the fit circle.
Documentation
- Corrected the stale
wrapSvgWithShapecomment to clarify that callers pre-size content withfitToCircleand the wrapper applies no clip. - Removed the dropped parameters (
decoration,sparkleColor,hasBubbles,hasPlants,magic) from the theme lists in the README.
Internal
- Added a no-overflow invariant test across all themes, now exercising every shape value of every theme (rather than relying on random seeds that may skip creature types).
- Added a regression test pinning the SVG transform composition order, and fixed a TypeScript index-access error in the exhaustive test.
- Regenerated SVG snapshots to reflect the new rendering.
Full Changelog: v2.0.0...v3.0.0
Release notes generated by herald v1.0.4