Releases: 3rChuss/react-canvas-masker
Releases · 3rChuss/react-canvas-masker
Release v.1.2.0
Added
- initialMask prop: Added
initialMask?: stringprop toMaskEditorto pre-load a mask provided as a base64 data URL (e.g., saved fromtoMask()), enabling resuming editing sessions or switching between saved masks.- The mask is applied once per unique value (to avoid redundant re-applications).
- When applied it overwrites the current mask canvas, saves the state in history (so undo/redo works from that base), and notifies
onMaskChangeimmediately.
- Storybook demo: Added a reliable "Pre-load existing mask" story demonstrating save → clear → load workflow (includes a forced reload mechanism so the same mask value can be re-applied).
- Tests: Added tests (Vitest + Testing Library) to validate
initialMaskbehavior and subsequent editing.
Changed
- Package version bumped to
1.2.0.