Update dependency animejs to v4 #314
Draft
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 contains the following updates:
3.2.1->4.2.2Release Notes
juliangarnier/anime (animejs)
v4.2.2Compare Source
Fixes
createMotionPath(): Fix a bug introduced inv4.2.1that wrapped the target back to 0 when reaching 1 (#1104)
v4.2.1Compare Source
New features
createMotionPath(): Add an offset parameter (#1037) (@TheHyrox)createDraggable(): Add adragThresholdparameter (#1091) (@craig-jennings)Changes
.reset(softReset): ThesoftResetparameter type is now aBooleaninstead of an intcreateDraggable(): The drag threshold is now 3px with a mouse and 7px with touch instead of 3px everywhereFixes
animate()throwing Typescript error (#1043)Docs
.reset()chaptersv4.2.0Compare Source
Breaking Changes
interpolate()(use the simplifiedlerp()instead)lerp()(use the framerate dependent damping functiondamp()instead)utils.set()now computes the variable value instead of setting the var name. To set the variable name without conversion, use a function-based value (x: () => var(--value)) or use the nativeelement.style.setProperty('--value')linear(),irregular(),steps()andcubicBezier()have been removed from the core and must be imported separatelyNew Features
bounceparameter to control the strength of the springdurationparameter to define the perceived duration of the springonCompletecallback called when the spring currentTime hits the perceived durationwaapi.animate()built-in eases are now on par with the JSanimate()method, plus all native WAAPI easing parameterspersistparameter to control whether the animation should be canceled on finishanimate(target, { x: 'var(--x, 100px)' }))createSeededRandom()to generate pre-seeded pseudo-random utility functionsBug Fixes
animation.revert()not properly reverting multi-target animations styles when targets have different starting style valuesborder-radius,stroke-width) not being properly revertedanimation.cancel()not properly committing styles before cancelinganimation.revert()not properly reverting multi-target animation styles and not overriding newly added stylesreversed: truenot updating on playtl.call()not being fired in some cases (#1088)Changes
stagger()has been moved to/utilsbut still available globally viaimport { stagger } from 'animejs'waapi.convertEase()values are now rounded to 4 decimals (previously no rounding)massminimum value is now clamped to 1stiffnessminimum allowed value is now 0dampingminimum allowed value is now 0Ease Backdefault overshoot value is now 1.7 (previously 1.70158)@types/nodedependency for type checking (#1069)build,dev,dev:test,test:browser,test:node,open:examplesDeprecated
text.split()deprecated, usesplitText()ortext.splitText()insteadcreateSpring()deprecated, usespring()insteadv4.1.4Compare Source
Bug fixes
v4.1.3Compare Source
Improvements
Bug fixes
onUpdateandonSettlecallbacks not triggered when only updating the x axis (#1045)composition: 'replace'not controlled by a Timelineengine.timeUnit = 's'that affected tweens compositionTypes
WAAPIAnimationtype to theRevertibletypestagger()function return type is now inferred from the input value typeSpringParamsTimelinePositionTimelineAnimationPositionWAAPITweenValueWAAPIFunctionValueWAAPIKeyframeValueWAAPICallbackWAAPITweenOptionsWAAPIAnimationOptionsWAAPIAnimationParamsScrollThresholdValueScrollThresholdParamScrollObserverAxisCallbackScrollThresholdCallbackScrollObserverParamsv4.1.2Compare Source
Bug fixes
onCompletecallback not called on reversed timelines (#378)onScoll()not properly handling SVG targets by usinggetBoundingClientRect()for size and offset calculation instead ofoffsetTop/offsetLeft(#1021)animation.refresh()(#1025)draggable.disable()now properly disable the drag without interrupting animations. The old behavior is still possible by chaining methods like thisdraggable.disable().stop().reverse()and other parameters (#1012)v4.1.1Compare Source
Bug fixes
TextSplitter
split.addEffect()was called after the split html reset when using.refresh()Docs
utilsimport in Stagger grid axis #1048v4.1.0Compare Source
Breaking changes
Types
StaggerParameters→StaggerParamsNew Features
text.split()The major new feature of this release is the new
text.split()method, an easy to use, fully-featured, lightweight and performant modern text splitter for JavaScript.It does all the following in only 7KB:
.addEffect()methodBasic Usage
Check out the full documentation for text.split() here http://animejs.com/documentation/text/split
New
Scopemethodsscope.addOnce()Adds a constructor to a Scope that is only called once, allowing you to execute code once and add scoped animations that won't be reverted between media query changes.
scope.keepTime()Adds a constructor
Functionthat recreates a Timer, Animation, or Timeline between media query changes while keeping track of its current time, allowing to seamlessly update an animation's parameters without breaking the playback state.Check out the full documentation for text.split() here http://animejs.com/documentation/scope/scope-methods/addonce
New
utilsmethodsutils.keepTime()Returns a
Functionthat recreates aTimer,Animation, orTimelinewhile keeping track of its current time, allowing to seamlessly update an animation's parameters without breaking the playback state.New
stagger()settingsuseandtotalparametersThe new
useandtotalparameters allow defining custom staggering order:Random
fromparameterYou can now define
'random' to thefromparameter of thestagger()`` function to define a random staggered order:Improvements and bug fixes
Animation, Timer, Timeline
.refresh()only updates thefromNumbersvalue when the value is defined as a function based valueDocs
v4.0.2Compare Source
Fixes
Timer
.stretch(). (#1005)SVG
stroke-linecapdefined in a stylesheet overriding attributes defined bycreateDrawable(). (#1002)createDrawable()line effect issues when the attribute / propertyvector-effectis set to"non-scaling-stroke". (#793)WAAPI
complete()method is called before the animation plays. (#1001)animate()properties. (#1000)Draggable
.revert()not properly reverting the draggable internalAnimatable, keeping the x and y styles defined. (#997)onSettle()triggering on theonCompletecallback of the x property, before the y property has updated, causing the draggable to sometimes not go back to its initial position. (#997)Types
v4.0.1Compare Source
Fixes
createScoperoot param type forReactRef(#971) thanks @Jimmydaleclevelandv4.0.0Compare Source
A complete rewrite of Anime.js, with a modular, ESM-first API, improved performance, and TONS of new features.
animejs-v4-release-video.mp4
Timer
createTimer(options)Schedules and controls timed function callbacks that can be used as a replacement to
setTimeout()orsetInterval(), keeping animations and callbacks in sync.This is the base class that both Animation and Timeline inherit from.
duration,delay,loop,loopDelay,frameRate,playbackRateplay(),pause(),resume(),restart(),cancel(),seek(),stretch(),then()Animation
animate(targets, options)New parameters:
fromparameter{ from: .5, to: .5, ease: 'inOut(3)' }playbackEase: Apply easing to overall animation progresscomposition: Control how animations interact with existing ones:"replace": Override existing animations (default)"blend": Combine additively with existing animations"none": Run independently without affecting othersmodifier: Function to transform animation values during renderframeRate: Control the max fps of the animationkeyframes: More flexible keyframes system with four different syntaxes:Improvements
New callbacks:
onBeforeUpdate: Called before each animation updateonRender: Triggered when animation values are updated and appliedonLoop: Triggered when animation completes an iterationonPause: Called when animation is paused, either manually or when interrupted by an other animationNew methods:
refresh(): Update all function-based values with new statesrevert(): Restore all animated properties to their original valuescomplete(): Immediately complete the animationstretch(newDuration): Scale animation to new durationthen(callback): Simpler Promise handlingTimeline
createTimeline(options)Better children defaults definition with a dedicated
defaultsparameter.Children loop and direction parameters are now correctly taken into account, and will be counted in the total duration of the timeline, allowing seeking trough the different iterations.
New methods:
set(target, params, position): Set properties instantly at positioncall(function, position): Execute callback at timeline positionsync(animation, position): Synchronize external animation with timelinelabel(name, position): Create named markers for referencingremove(targets, propertyName): Remove specific animationsrefresh(): Update all function-based valuesNew position syntax:
"labelName""<"(end) and"<<"(start)"+=100","-=50","*=1.5"Animatable
createAnimatable(target, properties)Efficiently animates target properties, making it an ideal replacement for
[animate()](https://animejs.com/documentation/animation)and[utils.set()](https://animejs.com/documentation/utilities/set)in situations where values change frequently, such as cursor events or animation loops.Draggable
createDraggable(target, options)Adds draggable capabilities to DOM Elements with physics, constraints, and callbacks.
ScrollObserver
onScroll(options)Triggers and synchronises Timer, Animation and Timeline instances on scroll.
Scope
createScope(options)Anime.js instances declared inside a Scope can react to media queries, use custom root elements, share default parameters, and be reverted in batch, streamlining work in responsive and component-based environments.
SVG
svgEnhanced SVG animation helpers.
New methods:
morphTo(path, precision): Shape morphing between SVG pathscreateMotionPath(path): Move elements along SVG pathscreateDrawable(selector, start, end): Control SVG path drawingStagger
stagger(options)The
stagger()function can now be used as a Timeline time position.Utils
utilsUtility functions for DOM manipulation, math operations, and animation helpers, that can be easily chained together.
WAAPI
waapi.animate(targets, options)Create Native browser WAAPI powered animations with the simplicity of Anime.js.
Easing System
New easing functions:
linear(x1, x2, x3, ...): Multi-point linear interpolationirregular(length, randomness): Random stepped easingin(power),out(power),inOut(power): Parameterized power functionsSpring
createSpring(options)New spring syntax with Object parameters.
Engine Configuration
engineEasier global settings configuration
engine.defaults: Set default animation parametersengine.timeUnit: Choose between seconds or millisecondsengine.precision: Control decimal precision for animated values globallyengine.pauseOnDocumentHidden: Control if animations pause when tab is inactivev3.2.2Compare Source
Bug fixes
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.