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
55# -----------
66notify.js
77notify.js.map
8- notify.d.ts
98notifier.js
109notifier.js.map
11- notifier.d.ts
1210snackbar-component.js
1311snackbar-component.js.map
14- snackbar-component.d.ts
1512toast-component.js
1613toast-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
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ - typescript declaration files
13+ - toast injection
14+
15+ ## [ 2.0.0] - 2020-04-23
16+
1017### Added
1118
1219- 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() `
1330
1431## [ 1.2.2] - 2020-04-17
1532
@@ -90,7 +107,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
90107
91108- Entire existing codebase due to rewrite
92109
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
94112[ 1.2.0 ] : https://github.com/codewithkyle/notifyjs/compare/v1.1.0...v1.2.0
95113[ 1.1.0 ] : https://github.com/codewithkyle/notifyjs/compare/v1.0.3...v1.1.0
96114[ 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 11{
22 "name" : " @codewithkyle/notifyjs" ,
3- "version" : " 2.0.0 " ,
3+ "version" : " 2.0.1 " ,
44 "description" : " A simple JavaScript library for creating and managing toaster & snackbar notifications" ,
55 "main" : " notify.js" ,
66 "types" : " notify.d.ts" ,
1010 " notify.d.ts" ,
1111 " notifier.js" ,
1212 " notifier.js.map" ,
13- " notifier.d.ts" ,
1413 " snackbar-component.js" ,
1514 " snackbar-component.js.map" ,
16- " snackbar-component.d.ts" ,
1715 " toast-component.js" ,
18- " toast-component.js.map" ,
19- " toast-component.d.ts"
16+ " toast-component.js.map"
2017 ],
2118 "scripts" : {
2219 "compile" : " tsc" ,
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ export class Notifier {
180180 }
181181
182182 const lastSlice = shell . querySelector ( "toast-component" ) || null ;
183- if ( ! lastSlice ) {
183+ if ( lastSlice ) {
184184 shell . insertBefore ( toast . el , lastSlice ) ;
185185 } else {
186186 shell . appendChild ( toast . el ) ;
Original file line number Diff line number Diff line change 99 "target" : " ES2019" ,
1010 "module" : " ESNext" ,
1111 "moduleResolution" : " node" ,
12- "declaration" : true ,
1312 "lib" : [" DOM" , " ES2019" ]
1413 },
1514 "exclude" : [" ./node_modules" ],
You can’t perform that action at this time.
0 commit comments