File tree Expand file tree Collapse file tree 6 files changed +53
-12
lines changed Expand file tree Collapse file tree 6 files changed +53
-12
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,9 @@ node_modules
5
5
# -----------
6
6
notify.js
7
7
notify.js.map
8
- notify.d.ts
9
8
notifier.js
10
9
notifier.js.map
11
- notifier.d.ts
12
10
snackbar-component.js
13
11
snackbar-component.js.map
14
- snackbar-component.d.ts
15
12
toast-component.js
16
13
toast-component.js.map
17
- toast-component.d.ts
Original file line number Diff line number Diff line change @@ -7,9 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Fixed
11
+
12
+ - typescript declaration files
13
+ - toast injection
14
+
15
+ ## [ 2.0.0] - 2020-04-23
16
+
10
17
### Added
11
18
12
19
- refactored elements into web components
20
+ - renamed ` NotificationManager() ` to ` Notifier() `
21
+
22
+ ### Fixed
23
+
24
+ - toast components use ` node.inserBefore() ` instead of forcing the ` column-reverse ` CSS property to render in the correct order
25
+
26
+ ### Removed
27
+
28
+ - deprecated ` position ` value
29
+ - ` notify() ` export -- replaced with ` snackbar() `
13
30
14
31
## [ 1.2.2] - 2020-04-17
15
32
@@ -90,7 +107,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
90
107
91
108
- Entire existing codebase due to rewrite
92
109
93
- [ unreleased ] : https://github.com/codewithkyle/notifyjs/compare/v1.2.0...HEAD
110
+ [ unreleased ] : https://github.com/codewithkyle/notifyjs/compare/v2.0.0...HEAD
111
+ [ 2.0.0 ] : https://github.com/codewithkyle/notifyjs/compare/v1.2.0...v2.0.0
94
112
[ 1.2.0 ] : https://github.com/codewithkyle/notifyjs/compare/v1.1.0...v1.2.0
95
113
[ 1.1.0 ] : https://github.com/codewithkyle/notifyjs/compare/v1.0.3...v1.1.0
96
114
[ 1.0.3 ] : https://github.com/codewithkyle/notifyjs/compare/v1.0.2...v1.0.3
Original file line number Diff line number Diff line change
1
+ type NotificationButton = {
2
+ label : string ;
3
+ callback : Function ;
4
+ ariaLabel ?: string ;
5
+ classes ?: string [ ] ;
6
+ } ;
7
+
8
+ type SnackbarNotification = {
9
+ message : string ;
10
+ uid : string ;
11
+ duration ?: number ;
12
+ closeable ?: boolean ;
13
+ buttons ?: Array < NotificationButton > ;
14
+ force ?: boolean ;
15
+ classes ?: string [ ] ;
16
+ el : HTMLElement ;
17
+ } ;
18
+
19
+ type ToasterNotification = {
20
+ title : string ;
21
+ message : string ;
22
+ closeable ?: boolean ;
23
+ icon ?: string ;
24
+ duration ?: number ;
25
+ classes ?: string [ ] ;
26
+ uid : string ;
27
+ el : HTMLElement ;
28
+ } ;
29
+
30
+ declare const snackbar : ( settings : SnackbarNotification ) => void ;
31
+ declare const toast : ( settings : ToasterNotification ) => void ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @codewithkyle/notifyjs" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " A simple JavaScript library for creating and managing toaster & snackbar notifications" ,
5
5
"main" : " notify.js" ,
6
6
"types" : " notify.d.ts" ,
10
10
" notify.d.ts" ,
11
11
" notifier.js" ,
12
12
" notifier.js.map" ,
13
- " notifier.d.ts" ,
14
13
" snackbar-component.js" ,
15
14
" snackbar-component.js.map" ,
16
- " snackbar-component.d.ts" ,
17
15
" toast-component.js" ,
18
- " toast-component.js.map" ,
19
- " toast-component.d.ts"
16
+ " toast-component.js.map"
20
17
],
21
18
"scripts" : {
22
19
"compile" : " tsc" ,
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ export class Notifier {
180
180
}
181
181
182
182
const lastSlice = shell . querySelector ( "toast-component" ) || null ;
183
- if ( ! lastSlice ) {
183
+ if ( lastSlice ) {
184
184
shell . insertBefore ( toast . el , lastSlice ) ;
185
185
} else {
186
186
shell . appendChild ( toast . el ) ;
Original file line number Diff line number Diff line change 9
9
"target" : " ES2019" ,
10
10
"module" : " ESNext" ,
11
11
"moduleResolution" : " node" ,
12
- "declaration" : true ,
13
12
"lib" : [" DOM" , " ES2019" ]
14
13
},
15
14
"exclude" : [" ./node_modules" ],
You can’t perform that action at this time.
0 commit comments