Skip to content

Commit

Permalink
Version 2.3.0 Released.
Browse files Browse the repository at this point in the history
Added: "Notiflix.Notify.*" module, "optionsOrCallback" parameter has been added.

Added: "Notiflix.Report.*" module, "optionsOrCallback" parameter has been added.

Changed: Code Review.
  • Loading branch information
furcan committed Jun 10, 2020
1 parent 627963e commit 2c9a0fc
Show file tree
Hide file tree
Showing 14 changed files with 935 additions and 807 deletions.
87 changes: 70 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
[downloads-url]: https://npmjs.org/package/notiflix
[jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/notiflix/badge?style=rounded
[jsdelivr-url]: https://www.jsdelivr.com/package/npm/notiflix
[size-badge]: https://img.badgesize.io/https://unpkg.com/browse/notiflix/dist/notiflix-aio-2.2.1.min.js?compression=gzip
[size-url]: https://unpkg.com/browse/notiflix/dist/notiflix-aio-2.2.1.min.js
[size-badge]: https://img.badgesize.io/https://unpkg.com/browse/notiflix/dist/notiflix-aio-2.3.0.min.js?compression=gzip
[size-url]: https://unpkg.com/browse/notiflix/dist/notiflix-aio-2.3.0.min.js
[lic-badge]: https://img.shields.io/github/license/notiflix/Notiflix.svg
[lic-url]: https://github.com/notiflix/Notiflix/blob/master/LICENSE

Expand All @@ -34,15 +34,15 @@
Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more to that makes your web projects much better.

#### Current Version
2.2.1 [*](https://github.com/notiflix/Notiflix/blob/master/ReleaseNotes.md "Release Notes")
2.3.0 [*](https://github.com/notiflix/Notiflix/blob/master/ReleaseNotes.md "Release Notes")

#### Website
https://www.notiflix.com

#### Documentation
https://www.notiflix.com/documentation

#### Demo
#### Modules (Demo)
- **Notiflix Notify** => https://www.notiflix.com/#Notify
- **Notiflix Report** => https://www.notiflix.com/#Report
- **Notiflix Confirm** => https://www.notiflix.com/#Confirm
Expand Down Expand Up @@ -84,29 +84,32 @@ import { Notify, Report, Confirm, Loading, Block } from "notiflix";

##### CSS and JS
```html
<link rel="stylesheet" href="dist/notiflix-2.2.1.min.css" />
<link rel="stylesheet" href="dist/notiflix-2.3.0.min.css" />

<script src="dist/notiflix-2.2.1.min.js"></script>
<script src="dist/notiflix-2.3.0.min.js"></script>
```

##### or only JS (All in One - Internal CSS)
```html
<script src="dist/notiflix-aio-2.2.1.min.js"></script>
<script src="dist/notiflix-aio-2.3.0.min.js"></script>
```


---------

### Usage

1- Notify Module
#### 1- Notify Module

```js
/*
* @param1 {string}: Required, message text in String format.
* @param2 {function}: Optional, callback function when the notification element clicked.
*
* @param2 {Object | function}: Optional, extend the initialize options with new options for each notification element. Or, a callback function when the notification element has been clicked.
*
* @param3 {function}: Optional, a callback function when the notification element has been clicked (if the second parameter is an Object).
*/

// e.g. Only message
Notiflix.Notify.Success('Success message text');

Notiflix.Notify.Failure('Failure message text');
Expand All @@ -115,9 +118,28 @@ Notiflix.Notify.Warning('Warning message text');

Notiflix.Notify.Info('Info message text');

// e.g. with a callback
// e.g. Message with a callback
Notiflix.Notify.Success(
'Click Me',
function(){
// callback
},
);

// e.g. Message with the new options (v2.3.0 and the next versions)
Notiflix.Notify.Success(
'Click Me',
{
timeout: 6000,
},
);

// e.g. Message with the new options, and callback (v2.3.0 and the next versions)
Notiflix.Notify.Success(
'Click Me',
{
timeout: 4000,
},
function(){
// callback
},
Expand All @@ -127,16 +149,22 @@ Notiflix.Notify.Success(
--_--_----_--_----_--_----_--_----_--_----_--_--


2- Report Module
#### 2- Report Module

```js
/*
* @param1 {string}: Required, title text in String format.
*
* @param2 {string}: Required, message text in String format.
*
* @param3 {string}: Required, button text in String format.
* @param4 {function}: Optional, callback function when the button element clicked.
*
* @param4 {Object | function}: Optional, extend the initialize options with new options for each element. Or, a callback function when the button element has been clicked.
*
* @param5 {function}: Optional, a callback function when the button element has been clicked (if the second parameter is an Object).
*/

// e.g. Only title, message, and button text
Notiflix.Report.Success('Title', 'Message', 'Button Text');

Notiflix.Report.Failure('Title', 'Message', 'Button Text');
Expand All @@ -145,7 +173,7 @@ Notiflix.Report.Warning('Title', 'Message', 'Button Text');

Notiflix.Report.Info('Title', 'Message', 'Button Text');

// e.g. with a callback
// e.g. With a callback
Notiflix.Report.Success(
'Title',
'Message',
Expand All @@ -154,12 +182,37 @@ Notiflix.Report.Success(
// callback
},
);

// e.g. With the new options (v2.3.0 and the next versions)
Notiflix.Report.Success(
'Title',
'Message',
'Button Text',
{
width: '360px',
svgSize: '120px',
},
);

// e.g. With the new options, and callback (v2.3.0 and the next versions)
Notiflix.Report.Success(
'Title',
'Message',
'Button Text',
{
width: '360px',
svgSize: '120px',
},
function(){
// callback
},
);
```

--_--_----_--_----_--_----_--_----_--_----_--_--


3- Confirm Module
#### 3- Confirm Module

```js
/*
Expand Down Expand Up @@ -195,7 +248,7 @@ Notiflix.Confirm.Show(
--_--_----_--_----_--_----_--_----_--_----_--_--


4- Loading Module
#### 4- Loading Module

```js
/*
Expand Down Expand Up @@ -249,7 +302,7 @@ Notiflix.Loading.Custom('Loading...');
--_--_----_--_----_--_----_--_----_--_----_--_--


5- Block Module
#### 5- Block Module

Notiflix Block module can be used to block or unblock elements to prevents users actions during the process (AJAX etc.) without locking the browser or the other elements.

Expand Down
41 changes: 41 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
@2.3.0
* **Added:** `Notiflix.Notify.*` module, `optionsOrCallback` parameter has been added. (Recommended by [VirgilioGM](https://github.com/VirgilioGM))

- Custom options can be used for each Notify element to extend the initialize settings.
```js
// Current:
// e.g. Message with a callback
Notiflix.Notify.Success(
'Click Me',
function(){
// callback
},
);

// NEW: v2.3.0 and the next versions
// e.g. Message with the new options
Notiflix.Notify.Success(
'Click Me',
{
timeout: 6000,
},
);

// e.g. Message with the new options, and callback
Notiflix.Notify.Success(
'Click Me',
{
timeout: 4000,
},
function(){
// callback
},
);
```

* **Added:** `Notiflix.Report.*` module, `optionsOrCallback` parameter has been added.

* **Changed:** Code Review.

-----

@2.2.1
* **Changed:** `Notiflix.Notify.*` module, CSS animation improvements.

Expand Down
3 changes: 0 additions & 3 deletions dist/notiflix-2.2.1.min.js

This file was deleted.

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/notiflix-2.3.0.min.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/notiflix-aio-2.2.1.min.js

This file was deleted.

3 changes: 3 additions & 0 deletions dist/notiflix-aio-2.3.0.min.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@

</style>

<!-- <link href="../dist/notiflix-2.2.1.min.css" rel="stylesheet" />
<script src="../dist/notiflix-2.2.1.min.js"></script> -->
<script src="../dist/notiflix-aio-2.2.1.min.js"></script>
<!-- <link href="../dist/notiflix-2.3.0.min.css" rel="stylesheet" />
<script src="../dist/notiflix-2.3.0.min.js"></script> -->
<script src="../dist/notiflix-aio-2.3.0.min.js"></script>

<!-- <link href="../src/notiflix.css" rel="stylesheet" />
<script src="../src/notiflix.js"></script> -->
Expand Down Expand Up @@ -197,7 +197,9 @@ <h1 class="title"><span>//</span> Notiflix Notify</h1>
<button class="nx-notify" onclick="Notiflix.Notify.Success();">Notify Success</button>
<button class="nx-notify" onclick="Notiflix.Notify.Failure();">Notify Failure</button>
<button class="nx-notify" onclick="Notiflix.Notify.Warning();">Notify Warning</button>
<button class="nx-notify" onclick="Notiflix.Notify.Info('Click me!',function(){alert('Thanks!')});">Notify Info (With Callback)</button>
<button class="nx-notify" onclick="Notiflix.Notify.Info('Click me!', function(){alert('Thanks!')});">Notify Info (With Callback)</button>
<button class="nx-notify" onclick="Notiflix.Notify.Success('Click me!', {cssAnimationStyle:'zoom', cssAnimationDuration:500,});">Notify Success (With Options)</button>
<button class="nx-notify" onclick="Notiflix.Notify.Success('Click me!', {cssAnimationStyle:'zoom', cssAnimationDuration:500,}, function(){alert('Thanks!')});">Notify Success (With Options + Callback)</button>
</div>
</div>

Expand All @@ -207,15 +209,17 @@ <h1 class="title"><span>//</span> Notiflix Report</h1>
<button class="nx-report" onclick="Notiflix.Report.Success();">Report Success</button>
<button class="nx-report" onclick="Notiflix.Report.Failure();">Report Failure</button>
<button class="nx-report" onclick="Notiflix.Report.Warning();">Report Warning</button>
<button class="nx-report" onclick="Notiflix.Report.Info(false,'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.',false,function(){alert('Thanks!')});">Report Info (With Callback)</button>
<button class="nx-report" onclick="Notiflix.Report.Info(false, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', false, function(){alert('Thanks!')});">Report Info (With Callback)</button>
<button class="nx-report" onclick="Notiflix.Report.Success(false, false, false, {width:'360px', borderRadius:'8px', success:{backOverlayColor:'rgba(50, 198, 130, 0.4)'}});">Report Success (With Options)</button>
<button class="nx-report" onclick="Notiflix.Report.Success(false, false, false, {width:'360px', borderRadius:'8px', success:{backOverlayColor:'rgba(50, 198, 130, 0.4)'}}, function(){alert('Thanks!')});">Report Success (With Options + Callback)</button>
</div>
</div>

<div class="nx-box">
<h1 class="title"><span>//</span> Notiflix Confirm</h1>
<div class="buttons">
<button class="nx-confirm" onclick="Notiflix.Confirm.Show();">Notiflix Confirm</button>
<button class="nx-confirm" onclick="Notiflix.Confirm.Show(false,'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.',false,false,function(){alert('Thanks!')},function(){alert('Uppsss...')});">Notiflix Confirm (With Callback)</button>
<button class="nx-confirm" onclick="Notiflix.Confirm.Show(false, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', false, false, function(){alert('Thanks!')}, function(){alert('Uppsss...')});">Notiflix Confirm (With Callback)</button>
</div>
</div>

Expand Down
9 changes: 9 additions & 0 deletions helpers/notiflix-minifier.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*!
* Notiflix Minifier
*
* Description: Minify the Notiflix scripts, and clean the Notiflix styles to the distribution. (Used "Babel Minify", and "Clean CSS")
* Version: 1.0.0
* Author: Furkan MT ('https://github.com/furcan')
* Copyright 2020 Notiflix Minifier, MIT Licence ('https://opensource.org/licenses/MIT')
*/

// Dev Dependencies
const { existsSync, readdirSync, unlinkSync, readFileSync, writeFileSync } = require('fs');
const { join } = require('path');
Expand Down
Loading

0 comments on commit 2c9a0fc

Please sign in to comment.