Releases: smastrom/notivue
v1.4.3 - v1.4.4
Release notes - v1.4.3
What's changed
NotivueSwipe - Improved stream pausing/resuming after touch interactions. Interactions that may trigger a clear or a position reset will now schedule the resumal using debounce instead of immediately performing it.
This gives an overall better UX by avoiding that:
- Siblings notifications are cleared just right after releasing or clearing the target notification via swipe (if their duration expires at that moment).
- Siblings notifications are cleared while clicking a target's excluded element (close button).
While this behavior worked great with mouse interactions because the stream is always paused on hover, it wasn't really suitable for touch interactions.
Affected interactions and debounce timings:
- Tapping on excluded elements (close buttons) will now pause and resume the stream after 1.4s.
- Swiping and releasing a notification not enough to be cleared will resume timeouts after 1s.
- Tapping and releasing a notification will now pause an resume timeouts after 1s.
NotivueSwipe - Fix isPointerInside
computation, which paused the stream after releasing a notification if the mouse pointer was still hovering a notification.
NotivueCore - Added will-change: transform
when repositioning the notifications. This improves performance on Android Firefox which was the only environment "suffering" from it since the last minor release.
Release notes - v1.4.4
Fixed a regression introduced in v1.4.3 where the transition data computation failed in nuxt middlewares or initial page load.
Time elapsed between v1.4.3 and v1.4.4: 1 hour and 30 minutes.
v1.4.2
Release notes
What's new
Notivue, NotivueKeyboard - Both exported components are now wrapped in a ClientOnly
component by default. Before this release, this was only applied to the Nuxt module auto-imported components.
Provenance Statements - Notivue is now published via GitHub actions using provenance statements introduced by NPM this month in order to improve supply-chain security and transparency.
What's changed
Notivue Core - Configuration properties have been converted from shallow refs to refs. This reduces a bit the bundle size and removes the requirement of calling triggerRef
when updating nested properties such as config.notifications.global
.
Nuxt Module - Streamlined type modules declaration and removed client-only versions of Notivue and NotivueKeyboard as they're now unneccessary.
NotivueKeyboard - Lowered the default value of maxAnnouncements
prop from 3 to 2.
Package - The bundled output now only includes JavaScript APIs not greater than ES2015.
v1.4.1
v1.4.0
Release notes
New
- Core - Updated default enter/leave animations with a more visually appealing pair. If you still wish to use the previous ones, paste this code in a new css file and replace:
import 'notivue/animations.css'
with your file path. - Built-in Notifications - Added an elevation effect to the close button on hover.
Fixed
- Core - Replaced
0
to0.01
in anytranslate/scale/rotate
keyframe transform property. This fixes a lightningcss bug that occurs if it is used by the end-user as css minifier (via Vite config). - NotivueSwipe - Fixed a bug where the notification width was not computed properly if using
transform: scale < 1
in enter animations, causing notifications to be cleared earlier. - NotivueKeyboard - Fixed a typo that caused event listeners to not be removed in the
onBeforeUnmount
hook. - Built-in Notifications - Fixed a bug where inline-end/start paddings and margins were not applied properly with
dir=rtl
. - Nuxt Module - Hardcoded
Animations
andPosition
types in the module declaration as imported types do not work within Nuxt module declaration.
Changed
- Core - Refactored the logic to get/set
prefers-reduced-motion
andtransitionData
. They are now only updated when appropriate, improving performance. - Notivue - Refactored the logic to add the
clearAll
class to the wrapper element. Now this is done the "vue-way" by passing a reactive value to the attribute, instead of usingclassList.add
. - NotivueSwipe - NotivueSwipe now doesn't call anymore
item.clear
method when the swipe threshold is met. Instead it first transitions the opacity to 0, then it callsitem.destroy
. This ensures that the leave animation is never called while providing an overall better UX. - Core - Streamlined the store by removing some unnecessary code, reducing by little the bundle size.
v1.3.3
What's changed
- Fixed a regression introduced in v1.3.0 where repositioning was not invoked properly when an element was pushed from the queue.
- Removed unnecessary configuration watcher in
createNotivue
.
Other
- Improve monorepo deps structure
- Refactor pushProxy / createPush to improve readability
v1.3.2
Release Notes
What's new
NotivueSwipe - You can now choose which method to call when clearing the notification via the new destroy
prop. By default is set to false
which means that the leave animation will be played when clearing.
What's fixed
Notivue Core - Fixed a bug where queued promises were not updated properly due to a regression introduced in v1.3.0 - #21
v1.3.1
Release notes
What's new
Nuxt Module
Add addPlugin
boolean to module options. This won't initialize the notivue store via createNotivue
leaving to you the implementation while still providing auto imports. Can be used for example, to export the push reference if using ssr: false
.
What's changed
Notivue Core
The push object is now frozen to prevent accidental tampering.
What's fixed
Nuxt Module
Hardcoded configuration types which were not retained when imported from outside.
v1.3.0
What's new
1. Direct push
in single-page apps
Starting from this release, you can now push notifications from any file/component without worrying about calling usePush
in the setup function of a Vue component (only in single-page apps).
You should now be able to call push
from virutally anywhere in your client-code as long as such code is used in the Vue App.
While usePush
and notivue
can still be used as usual and updating to 1.3.0
won't break your code, you should update it as follows:
- import { notivue } from 'notivue'
+ import { createNotivue } from 'notivue'
const app = createApp(App)
// app.use(...), app.use(...), ...
// Place it at THE END of the app.use() chain, just right before app.mount()
- app.use(notivue)
+ export const push = createNotivue(app)
Remember to state export const push...
at the end of your plugins chain, just right before calling app.mount()
.
Then in any file, component or template:
- import { usePush } from 'notivue'
+ import { push } from './main'
push.success('Something good has been pushed!)
Check the documentation website on how to configure
push
auto-import.
2. Nuxt Module
Notivue now ships with a nuxt module that you can add to your nuxt config, it provides automatic plugin installation, auto imports and built-in client-only mounting of Notivue root components.
Migration:
-
Update to latest via
pnpm add notivue@latest
-
Delete
plugins/notivue.client.ts
and any auto-import previously configured via files or nuxt config. -
Install the module:
export default defineNuxtConfig({
modules: ['notivue/nuxt'],
css: [
'notivue/notifications.css',
'notivue/animations.css'
],
notivue: {
// Options
}
})
- Delete the
<ClientOnly>
wrapper around Notivue components and most important, any component import:
<script setup>
- import { Notivue, Notifications } from 'notivue'
- <ClientOnly>
<Notivue v-slot="item">
<Notifications :item="item" />
</Notivue>
- </ClientOnly>
- Restart your dev server with:
npx nuxi cleanup && npx nuxi dev
Please note that
usePush
must still be used on Nuxt installations.
3. Add onAutoClear
and onManualClear
push callbacks
push.success({
message: 'This is a sucess message',
props: { isCustom: true },
onAutoClear(item) {
console.log(item.props.isCustom, item.message) // true, 'This is a sucess message'
},
onManualClear(item) {
console.log(item.props.isCustom, item.message) // true, 'This is a sucess message'
},
})
v1.2.4
Release notes
What's new
Notivue Core
You can now pass a ref to both message
and title
push options. This allows to create notifications like this one:
const message = ref('Begin uploading...')
push.promise(message) // or push.promise({ message, title...
message.value = 'Uploading file 1/4'
// ...
Built-in Notifications
Add hideClose
prop, which is by default set to false. This can be handy if you're lazy, and you don't want to import, clone and edit the icons
object.
NotivueKeyboard
Add maxAnnouncements
prop, which is by default set to 3
. Leave notifications that announce the exit from the stream and the ability to re-enter using the combination key are now pushed only the first three times.
What's improved
Built-in Notifications
- Set the default width of the notification container to
auto
. After taking a look at the projects using Notivue, I noticed that the majority of the users are pushing notifications with very short messages.
If you prefer to have a fixed min-width, replicate the previous behavior by setting the variable --nv-min-width
to your theme:
<Notifications
:item="item"
:theme="{ ...materialTheme, '--nv-min-width': '360px' }"
/>
- For the same reason, increased default font size from
0.925
to1
rems and default spacing from0.5
to0.625
rems. - Slightly darkened
materialTheme
background colors to improve accessibility and match WCAG 2 Contrast and Color Requirements.
What's fixed
NotivueKeyboard
- Fix leave announcements to be pushed to the stream if pressing Tab after focusing the stream with a device different from the keyboard.