Enhance transformed elements with default animation and custom CSS transformation options#659
Merged
Enhance transformed elements with default animation and custom CSS transformation options#659
Conversation
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.
Allow
nullas a valid value for the element animation configuration: This change introduces greater flexibility in configuring element animations. Previously, an animation configuration was required, but now users have the option to usenullto disable animations completely.Rename
super.registertoaddElmToRegistryin the base store's internal implementation: This modification updates the internal implementation of the base store to use the more descriptive method nameaddElmToRegistryinstead ofsuper.register. This improvement enhances code readability and clarity.Add a unit test for the
getParsedElmTransformfunction: This addition includes a new unit test to verify the behavior and correctness of thegetParsedElmTransformfunction. The test covers various scenarios and ensures that the function accurately parses and returns the transform matrix of the given element.Create the
CSSTransformproperty in theRegisterInputOptsinterface to allow users to specify CSS rules that will be applied to the element when it's interactively dragged: The inclusion of theCSSTransformproperty provides users with a convenient way to customize the visual appearance of interactive elements during dragging. By specifying CSS rules forCSSTransform, users can have precise control over various visual aspects, including background color, border styles, opacity, box-shadow, and more. These CSS rules are dynamically applied to the element while it is being transformed by dragging, and they are automatically removed when the element is settled in its new position. This enhancement enhances the overall user experience and allows for a more visually engaging dragging interaction.Add the
animationproperty to theRegisterInputOptsinterface, allowing users to specify configuration options for animations applied to transformed elements during dragging. Theanimationproperty accepts an object of typePartial<AnimationOpts>, which includes properties such as easing and duration to control the animation behavior. By default, animation is applied unless explicitly configured otherwise.type RegisterInputOpts = { id: string; readonly?: boolean; + animation?: Partial<AnimationOpts>; + CSSTransform?: CSSClass | CSSStyle; };Example:
In this example, we specify animation options by setting the
animationproperty to an object with the easing function set to "ease-in-out" and the duration set to 500 milliseconds. Additionally, we customize the CSS applied to the element during dragging by setting theCSSTransformproperty to an object with background color "#ff0000" and opacity 0.5.Please note that the
animationandCSSTransformproperties are optional, and you can omit them if you don't need to customize animations or apply specific CSS transformations during dragging.