Skip to content

Commit 243a725

Browse files
authored
Merge pull request #11 from codewithkyle/v2.0.0
V2.0.1
2 parents 765c1ad + f3483b0 commit 243a725

File tree

6 files changed

+53
-12
lines changed

6 files changed

+53
-12
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ node_modules
55
# -----------
66
notify.js
77
notify.js.map
8-
notify.d.ts
98
notifier.js
109
notifier.js.map
11-
notifier.d.ts
1210
snackbar-component.js
1311
snackbar-component.js.map
14-
snackbar-component.d.ts
1512
toast-component.js
1613
toast-component.js.map
17-
toast-component.d.ts

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff 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

notify.d.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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;

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",
@@ -10,13 +10,10 @@
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",

src/notifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"target": "ES2019",
1010
"module": "ESNext",
1111
"moduleResolution": "node",
12-
"declaration": true,
1312
"lib": ["DOM", "ES2019"]
1413
},
1514
"exclude": ["./node_modules"],

0 commit comments

Comments
 (0)