Releases: alexmacarthur/typeit
Allow Queues to Be Rebuilt After reset()
As an instance is being reset using .reset()
, you can now completely rebuild the queue, replacing it with a totally new set of commands. For example:
const instance = new TypeIt("#element", {
speed: 75
})
.type("This is my initial text!")
.go();
instance.reset(i => {
i
.type("But this will be typed the second time... ")
.break()
.type("completely replacing the original queue.");
});
instance.go();
Simplify Parsing by Leveraging DOM APIs Better
Until now, TypeIt relied on a less-than-ideal means of parsing strings into HTML nodes, converting each of those nodes into a representation for typing, and then printing those representations to a page. This version switches to using a TreeWalker to generate the queue TypeIt needs to type, which now just contains HTML nodes themselves, with no messy representation around them.
This makes for:
- more efficient string parsing
- more efficient printing of characters to a page
- generally less complexity throughout the library
- a 5-7% reduction in gzipped bundle size
Fix Types
TypeIt's option types were not correctly being exposed through typeit-react. This release fixes that.
Migrate to Vite
Migrated from Microbundle to Vite for bundling, which led to a ~18% drop in the UMD bundle size. 🎉
Update Dependencies + `postinstall` Script
Not much exciting here. Just some dependency updates, and switching over from a Node to bash for the postinstall script.
move() Bug Fix
When a number of steps was being passed to .move()
that was outside the range of typed characters, unexpected weirdness was occurring. This released fixes that bug. Passing values beyond the lower or upper range of typed characters will no longer cause any execution problems, but instead just work.
Callback Fixes
There were a couple of issues occurring with TypeIt's callback methods.
More Versatile than Ever.
v8 introduces a host of new features & enhancements, and with limited breaking changes. For a full changelog, see here:
Fix Looping Bug
A bug was causing a delay to gradually increase as animations looped over and over again. This releases fixes that bug, simplifying the internal loop logic along the way.
Don't Remove Cursor Node's Children Expectedly
There was a bug that was removing a custom cursor children during deletion. This release properly ignores the cursor and its children correctly, so that they're preserved throughout the animation.