|
2 | 2 |
|
3 | 3 | ## New Features in v5!!
|
4 | 4 |
|
5 |
| -* [Modalish flow!!](https://sciactive.com/2020/02/11/the-modalish-notification-flow/) |
6 |
| -* Dark Mode!! |
7 |
| -* [Countdown Module!!](https://github.com/sciactive/pnotify#countdown-module) |
8 |
| -* Svelte 3!! |
9 |
| -* Support for DOM Element Text and Title!! |
10 |
| -* Individual Packages for Core and Modules!! |
| 5 | +- [Modalish flow!!](https://sciactive.com/2020/02/11/the-modalish-notification-flow/) |
| 6 | +- Dark Mode!! |
| 7 | +- [Countdown Module!!](https://github.com/sciactive/pnotify#countdown-module) |
| 8 | +- Svelte 3!! |
| 9 | +- Support for DOM Element Text and Title!! |
| 10 | +- Individual Packages for Core and Modules!! |
11 | 11 |
|
12 | 12 | **PNotify 5** has breaking changes:
|
13 | 13 |
|
14 | 14 | ## Major Breaking Changes
|
15 | 15 |
|
16 |
| -* 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;`. |
17 |
| -* Using the factory functions is required. Using the `new` keyword will break your notice. |
18 |
| -* IIFE scripts have been replaced with UMD scripts, since static methods and properties are now module exports. |
19 |
| - * The `dist` folder structure has changed. It's simpler now. All CSS and UMD scripts are right under `dist`. |
20 |
| -* 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. |
21 |
| -* Modules dont alter PNotify Core anymore. Instead, they are only used when they are explicitly added to the `modules` option. |
22 |
| - * 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. |
23 |
| - * The way you add them and their options is different. Now `modules` is a `Map`, where the module itself is the key, and the options are the value. |
24 |
| -* Bootstrap styling, Glyphicon icons, and Font Awesome icons are now provided by modules, rather than being built in. |
25 |
| -* The deprecated `remove()`, `removeAll()`, `cancelRemove()`, etc. methods have been removed. (Use `close()`, `stack.close()`, `cancelClose()`.) |
26 |
| -* The `autoDisplay` option has been renamed `autoOpen`. |
27 |
| -* There is no longer a global array, and therefore, no longer `closeAll()` and `positionAll()` methods. |
28 |
| -* Stacks use a `Stack` class now. |
29 |
| - * Stacks now have `close()` and `position()` methods. |
30 |
| - * The stack option `overlayClose` now defaults to true. |
31 |
| -* `notice.get()` is no longer available. |
32 |
| -* Dark mode is enabled by default if the user has enabled it on their OS! Use `PNotify.defaults.mode = 'light';` to remove this functionality. |
33 |
| -* The History module has been removed. |
34 |
| - * The `showLast()` and `showAll()` methods are now the `openLast()` and `open()` methods of the Stack, respectively. |
35 |
| - * The `maxInStack` option has been replaced with `stack.maxOpen`. To use the old behavior, set `stack.maxStrategy` to 'close'. |
36 |
| -* The Callbacks module has been removed. |
37 |
| - * The lifecycle events have been turned into actual events. You can use `notice.on('pnotify:beforeOpen')` and the like. |
38 |
| -* The 'ui-pnotify' class and 'ui-pnotify-\*' classes have been changed to just 'pnotify' and 'pnotify-\*', respectively. |
39 |
| -* The 'ui-pnotify' attribute has been changed to 'data-pnotify'. |
40 |
| -* The `cornerClass` options has been removed, as has the `ui-pnotify-sharp` class. If you want `border-radius: 0;`, just use a custom class. |
41 |
| -* Methods are no longer chainable. (Sorry.) |
| 16 | +- 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;`. |
| 17 | +- Using the factory functions is required. Using the `new` keyword will break your notice. |
| 18 | +- IIFE scripts have been replaced with UMD scripts, since static methods and properties are now module exports. |
| 19 | + - The `dist` folder structure has changed. It's simpler now. All CSS and UMD scripts are right under `dist`. |
| 20 | +- 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. |
| 21 | +- Modules dont alter PNotify Core anymore. Instead, they are only used when they are explicitly added to the `modules` option. |
| 22 | + - 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. |
| 23 | + - The way you add them and their options is different. Now `modules` is a `Map`, where the module itself is the key, and the options are the value. |
| 24 | +- Bootstrap styling, Glyphicon icons, and Font Awesome icons are now provided by modules, rather than being built in. |
| 25 | +- The deprecated `remove()`, `removeAll()`, `cancelRemove()`, etc. methods have been removed. (Use `close()`, `stack.close()`, `cancelClose()`.) |
| 26 | +- The `autoDisplay` option has been renamed `autoOpen`. |
| 27 | +- There is no longer a global array, and therefore, no longer `closeAll()` and `positionAll()` methods. |
| 28 | +- Stacks use a `Stack` class now. |
| 29 | + - Stacks now have `close()` and `position()` methods. |
| 30 | + - The stack option `overlayClose` now defaults to true. |
| 31 | +- `notice.get()` is no longer available. |
| 32 | +- Dark mode is enabled by default if the user has enabled it on their OS! Use `PNotify.defaults.mode = 'light';` to remove this functionality. |
| 33 | +- The History module has been removed. |
| 34 | + - The `showLast()` and `showAll()` methods are now the `openLast()` and `open()` methods of the Stack, respectively. |
| 35 | + - The `maxInStack` option has been replaced with `stack.maxOpen`. To use the old behavior, set `stack.maxStrategy` to 'close'. |
| 36 | +- The Callbacks module has been removed. |
| 37 | + - The lifecycle events have been turned into actual events. You can use `notice.on('pnotify:beforeOpen')` and the like. |
| 38 | +- The 'ui-pnotify' class and 'ui-pnotify-\*' classes have been changed to just 'pnotify' and 'pnotify-\*', respectively. |
| 39 | +- The 'ui-pnotify' attribute has been changed to 'data-pnotify'. |
| 40 | +- The `cornerClass` options has been removed, as has the `ui-pnotify-sharp` class. If you want `border-radius: 0;`, just use a custom class. |
| 41 | +- Methods are no longer chainable. (Sorry.) |
42 | 42 |
|
43 | 43 | ## Minor Breaking Changes.
|
44 | 44 |
|
45 |
| -* It's built using [Svelte](https://svelte.dev) 3, which has a slightly different component API than Svelte 2. |
46 |
| -* The title is no longer an h4 element. It is now just a div. |
47 |
| -* The deprecated NonBlock module has been removed. |
48 |
| -* White space formatting has changed. HTML notices no longer use `white-space: pre-line;`. Only regular text notices. But also titles do too now. |
49 |
| -* `notice.off(event, callback)` is no longer needed. `on()` returns a function that will remove the listener when invoked. |
50 |
| -* Confirm module's events changed from `pnotify.confirm` and `pnotify.cancel` to `pnotify:confirm` and `pnotify:cancel`. |
51 |
| - * The event value for prompts moved from `event.value` to `event.detail.value`. |
52 |
| -* The Mobile module now always styles notices. If you don't want styling, don't use the module. |
53 |
| -* Animate.css support in legacy browsers has been removed. |
54 |
| -* Some styling props and classes have changed, like pinDown, actionBar, etc. |
55 |
| -* The styling class ending in '-element' has changed to '-elem'. |
56 |
| -* Material styling is no longer a module, but rather just a CSS file. |
57 |
| -* There is no longer a Compat module for running PNotify 3 code, and one will not be provided for running PNotify 4 code. |
58 |
| -* `PNotify.styling` renamed to `PNotify.styles`. (Only relevant for creating modules.) |
59 |
| -* The VERSION constant has been removed. |
60 |
| -* The default labels for the sticker button has changed to 'Pin' and 'Unpin'. |
| 45 | +- It's built using [Svelte](https://svelte.dev) 3, which has a slightly different component API than Svelte 2. |
| 46 | +- The title is no longer an h4 element. It is now just a div. |
| 47 | +- The deprecated NonBlock module has been removed. |
| 48 | +- White space formatting has changed. HTML notices no longer use `white-space: pre-line;`. Only regular text notices. But also titles do too now. |
| 49 | +- `notice.off(event, callback)` is no longer needed. `on()` returns a function that will remove the listener when invoked. |
| 50 | +- Confirm module's events changed from `pnotify.confirm` and `pnotify.cancel` to `pnotify:confirm` and `pnotify:cancel`. |
| 51 | + - The event value for prompts moved from `event.value` to `event.detail.value`. |
| 52 | +- The Mobile module now always styles notices. If you don't want styling, don't use the module. |
| 53 | +- Animate.css support in legacy browsers has been removed. |
| 54 | +- Some styling props and classes have changed, like pinDown, actionBar, etc. |
| 55 | +- The styling class ending in '-element' has changed to '-elem'. |
| 56 | +- Material styling is no longer a module, but rather just a CSS file. |
| 57 | +- There is no longer a Compat module for running PNotify 3 code, and one will not be provided for running PNotify 4 code. |
| 58 | +- `PNotify.styling` renamed to `PNotify.styles`. (Only relevant for creating modules.) |
| 59 | +- The VERSION constant has been removed. |
| 60 | +- The default labels for the sticker button has changed to 'Pin' and 'Unpin'. |
0 commit comments