- Modalish flow!!
- Dark Mode!!
- Countdown Module!!
- Svelte 3!!
- Support for DOM Element Text and Title!!
- Individual Packages for Core and Modules!!
PNotify 5 has breaking changes:
- The new modalish flow is the default flow. The default stack is configured to use it. To go back to the old behavior, use
PNotify.defaultStack.maxOpen = Infinity; PNotify.defaultStack.modal = false;. - Using the factory functions is required. Using the
newkeyword will break your notice. - IIFE scripts have been replaced with UMD scripts, since static methods and properties are now module exports.
- The
distfolder structure has changed. It's simpler now. All CSS and UMD scripts are right underdist.
- The
- The Buttons module has been integrated into PNotify Core. Everyone was using it anyway. All the options are the same (except for
classes), they're just core options now. - Modules dont alter PNotify Core anymore. Instead, they are only used when they are explicitly added to the
modulesoption.- Since they don't add themselves to PNotify anymore, the ones with a single option to toggle on/off, like Desktop, don't have that option anymore. If you don't want the functionality, don't include the module.
- The way you add them and their options is different. Now
modulesis aMap, where the module itself is the key, and the options are the value.
- Bootstrap styling, Glyphicon icons, and Font Awesome icons are now provided by modules, rather than being built in.
- The deprecated
remove(),removeAll(),cancelRemove(), etc. methods have been removed. (Useclose(),stack.close(),cancelClose().) - The
autoDisplayoption has been renamedautoOpen. - There is no longer a global array, and therefore, no longer
closeAll()andpositionAll()methods. - Stacks use a
Stackclass now.- Stacks now have
close()andposition()methods. - The stack option
overlayClosenow defaults to true.
- Stacks now have
notice.get()is no longer available.- Dark mode is enabled by default if the user has enabled it on their OS! Use
PNotify.defaults.mode = 'light';to remove this functionality. - The History module has been removed.
- The
showLast()andshowAll()methods are now theopenLast()andopen()methods of the Stack, respectively. - The
maxInStackoption has been replaced withstack.maxOpen. To use the old behavior, setstack.maxStrategyto 'close'.
- The
- The Callbacks module has been removed.
- The lifecycle events have been turned into actual events. You can use
notice.on('pnotify:beforeOpen')and the like.
- The lifecycle events have been turned into actual events. You can use
- The 'ui-pnotify' class and 'ui-pnotify-*' classes have been changed to just 'pnotify' and 'pnotify-*', respectively.
- The 'ui-pnotify' attribute has been changed to 'data-pnotify'.
- The
cornerClassoptions has been removed, as has theui-pnotify-sharpclass. If you wantborder-radius: 0;, just use a custom class. - Methods are no longer chainable. (Sorry.)
- It's built using Svelte 3, which has a slightly different component API than Svelte 2.
- The title is no longer an h4 element. It is now just a div.
- The deprecated NonBlock module has been removed.
- White space formatting has changed. HTML notices no longer use
white-space: pre-line;. Only regular text notices. But also titles do too now. notice.off(event, callback)is no longer needed.on()returns a function that will remove the listener when invoked.- Confirm module's events changed from
pnotify.confirmandpnotify.canceltopnotify:confirmandpnotify:cancel.- The event value for prompts moved from
event.valuetoevent.detail.value.
- The event value for prompts moved from
- The Mobile module now always styles notices. If you don't want styling, don't use the module.
- Animate.css support in legacy browsers has been removed.
- Some styling props and classes have changed, like pinDown, actionBar, etc.
- The styling class ending in '-element' has changed to '-elem'.
- Material styling is no longer a module, but rather just a CSS file.
- There is no longer a Compat module for running PNotify 3 code, and one will not be provided for running PNotify 4 code.
PNotify.stylingrenamed toPNotify.styles. (Only relevant for creating modules.)- The VERSION constant has been removed.
- The default labels for the sticker button has changed to 'Pin' and 'Unpin'.