@frontile/notifications 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/-private/timer.ts +2 -2
- package/addon/components/notification-card.ts +9 -4
- package/addon/components/notifications-container.ts +6 -1
- package/addon/index.ts +4 -9
- package/components/notification-card.d.ts +8 -5
- package/components/notifications-container.d.ts +5 -1
- package/index.d.ts +3 -2
- package/package.json +33 -44
- package/services/notifications.d.ts +2 -2
- package/types/index.d.ts +1 -0
package/addon/-private/timer.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tracked } from '@glimmer/tracking';
|
|
2
2
|
import { later, cancel } from '@ember/runloop';
|
|
3
|
-
import {
|
|
3
|
+
import type { Timer as EmberTimer } from '@ember/runloop';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
|
|
6
6
|
export default class Timer {
|
|
@@ -8,7 +8,7 @@ export default class Timer {
|
|
|
8
8
|
@tracked isRunning = true;
|
|
9
9
|
|
|
10
10
|
readonly onFinish: () => void;
|
|
11
|
-
private timer?:
|
|
11
|
+
private timer?: EmberTimer;
|
|
12
12
|
private start!: number;
|
|
13
13
|
|
|
14
14
|
constructor(duration: number, onFinish: () => void) {
|
|
@@ -5,11 +5,11 @@ import { inject as service } from '@ember/service';
|
|
|
5
5
|
import { htmlSafe } from '@ember/template';
|
|
6
6
|
import { NotificationsService, Notification, CustomAction } from '../.';
|
|
7
7
|
import { later } from '@ember/runloop';
|
|
8
|
-
import {
|
|
8
|
+
import { NotificationsContainerSignature } from './notifications-container';
|
|
9
9
|
|
|
10
|
-
interface NotificationCardArgs {
|
|
10
|
+
export interface NotificationCardArgs {
|
|
11
11
|
notification: Notification;
|
|
12
|
-
placement:
|
|
12
|
+
placement: NotificationsContainerSignature['Args']['placement'];
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Spacing for each notification, in px.
|
|
@@ -19,7 +19,12 @@ interface NotificationCardArgs {
|
|
|
19
19
|
spacing?: number;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export interface NotificationCardSignature {
|
|
23
|
+
Args: NotificationCardArgs;
|
|
24
|
+
Element: HTMLDivElement | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default class NotificationCard extends Component<NotificationCardSignature> {
|
|
23
28
|
@service notifications!: NotificationsService;
|
|
24
29
|
@tracked hasEntered = false;
|
|
25
30
|
|
|
@@ -26,7 +26,12 @@ export interface NotificationsContainerArgs {
|
|
|
26
26
|
spacing?: number;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export
|
|
29
|
+
export interface NotificationsContainerSignature {
|
|
30
|
+
Args: NotificationsContainerArgs;
|
|
31
|
+
Element: HTMLDivElement | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default class NotificationsContainer extends Component<NotificationsContainerSignature> {
|
|
30
35
|
@service notifications!: NotificationsService;
|
|
31
36
|
|
|
32
37
|
get isTopPlacement(): boolean {
|
package/addon/index.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import Notification from './-private/notification';
|
|
2
2
|
import Timer from './-private/timer';
|
|
3
3
|
import NotificationsService from './services/notifications';
|
|
4
|
-
import {
|
|
4
|
+
import type {
|
|
5
5
|
DefaultConfig,
|
|
6
6
|
NotificationOptions,
|
|
7
7
|
CustomAction
|
|
8
8
|
} from './-private/types';
|
|
9
9
|
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
NotificationsService,
|
|
14
|
-
NotificationOptions,
|
|
15
|
-
DefaultConfig,
|
|
16
|
-
CustomAction
|
|
17
|
-
};
|
|
10
|
+
export { Notification, Timer, NotificationsService };
|
|
11
|
+
|
|
12
|
+
export type { NotificationOptions, DefaultConfig, CustomAction };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { NotificationsService, Notification, CustomAction } from '../.';
|
|
3
|
-
import {
|
|
4
|
-
interface NotificationCardArgs {
|
|
3
|
+
import { NotificationsContainerSignature } from './notifications-container';
|
|
4
|
+
export interface NotificationCardArgs {
|
|
5
5
|
notification: Notification;
|
|
6
|
-
placement:
|
|
6
|
+
placement: NotificationsContainerSignature['Args']['placement'];
|
|
7
7
|
/**
|
|
8
8
|
* Spacing for each notification, in px.
|
|
9
9
|
*
|
|
@@ -11,7 +11,11 @@ interface NotificationCardArgs {
|
|
|
11
11
|
*/
|
|
12
12
|
spacing?: number;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export interface NotificationCardSignature {
|
|
15
|
+
Args: NotificationCardArgs;
|
|
16
|
+
Element: HTMLDivElement | null;
|
|
17
|
+
}
|
|
18
|
+
export default class NotificationCard extends Component<NotificationCardSignature> {
|
|
15
19
|
notifications: NotificationsService;
|
|
16
20
|
hasEntered: boolean;
|
|
17
21
|
get styles(): unknown;
|
|
@@ -23,4 +27,3 @@ export default class NotificationCard extends Component<NotificationCardArgs> {
|
|
|
23
27
|
resume(): void;
|
|
24
28
|
handleClickCustomAction(customAction: CustomAction): void;
|
|
25
29
|
}
|
|
26
|
-
export {};
|
|
@@ -15,7 +15,11 @@ export interface NotificationsContainerArgs {
|
|
|
15
15
|
*/
|
|
16
16
|
spacing?: number;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export interface NotificationsContainerSignature {
|
|
19
|
+
Args: NotificationsContainerArgs;
|
|
20
|
+
Element: HTMLDivElement | null;
|
|
21
|
+
}
|
|
22
|
+
export default class NotificationsContainer extends Component<NotificationsContainerSignature> {
|
|
19
23
|
notifications: NotificationsService;
|
|
20
24
|
get isTopPlacement(): boolean;
|
|
21
25
|
get sortedNotifications(): Notification[];
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Notification from './-private/notification';
|
|
2
2
|
import Timer from './-private/timer';
|
|
3
3
|
import NotificationsService from './services/notifications';
|
|
4
|
-
import { DefaultConfig, NotificationOptions, CustomAction } from './-private/types';
|
|
5
|
-
export { Notification, Timer, NotificationsService
|
|
4
|
+
import type { DefaultConfig, NotificationOptions, CustomAction } from './-private/types';
|
|
5
|
+
export { Notification, Timer, NotificationsService };
|
|
6
|
+
export type { NotificationOptions, DefaultConfig, CustomAction };
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontile/notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Component Library for Ember Octane apps: Notifications",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"ember-addon"
|
|
6
|
+
"ember-addon",
|
|
7
|
+
"frontile"
|
|
7
8
|
],
|
|
8
9
|
"repository": "https://github.com/josemarluedke/frontile",
|
|
9
10
|
"license": "MIT",
|
|
@@ -21,64 +22,52 @@
|
|
|
21
22
|
"prepack": "ember ts:precompile",
|
|
22
23
|
"postpack": "ember ts:clean"
|
|
23
24
|
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"ember-source": "^4.0.0 || ^5.0.0"
|
|
27
|
+
},
|
|
24
28
|
"dependencies": {
|
|
25
|
-
"@ember/render-modifiers": "^2.0
|
|
26
|
-
"@frontile/core": "^0.
|
|
27
|
-
"@frontile/tailwindcss-plugin-helpers": "^0.
|
|
28
|
-
"ember-auto-import": "^2.
|
|
29
|
+
"@ember/render-modifiers": "^2.1.0",
|
|
30
|
+
"@frontile/core": "^0.15.0",
|
|
31
|
+
"@frontile/tailwindcss-plugin-helpers": "^0.15.0",
|
|
32
|
+
"ember-auto-import": "^2.6.3",
|
|
29
33
|
"ember-cli-babel": "^7.26.11",
|
|
30
|
-
"ember-cli-htmlbars": "^6.0
|
|
31
|
-
"ember-cli-typescript": "^5.
|
|
32
|
-
"ember-css-transitions": "^4.
|
|
33
|
-
"ember-get-config": "^1.
|
|
34
|
+
"ember-cli-htmlbars": "^6.2.0",
|
|
35
|
+
"ember-cli-typescript": "^5.2.1",
|
|
36
|
+
"ember-css-transitions": "^4.3.2",
|
|
37
|
+
"ember-get-config": "^2.1.1"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
|
-
"@babel/core": "^7.
|
|
40
|
+
"@babel/core": "^7.22.9",
|
|
37
41
|
"@ember/optional-features": "^2.0.0",
|
|
38
|
-
"@ember/test-helpers": "^2.
|
|
39
|
-
"@embroider/test-setup": "^
|
|
40
|
-
"@frontile/forms": "^0.
|
|
41
|
-
"@glimmer/component": "^1.
|
|
42
|
-
"@glimmer/tracking": "^1.
|
|
43
|
-
"@types/ember-qunit": "^
|
|
44
|
-
"@types/ember-resolver": "^
|
|
45
|
-
"@types/ember__application": "^4.0.0",
|
|
46
|
-
"@types/ember__array": "^4.0.1",
|
|
47
|
-
"@types/ember__component": "^4.0.4",
|
|
48
|
-
"@types/ember__debug": "^4.0.1",
|
|
49
|
-
"@types/ember__error": "^4.0.0",
|
|
50
|
-
"@types/ember__object": "^4.0.1",
|
|
51
|
-
"@types/ember__routing": "^4.0.4",
|
|
52
|
-
"@types/ember__runloop": "^4.0.0",
|
|
53
|
-
"@types/ember__service": "^4.0.0",
|
|
54
|
-
"@types/ember__string": "^3.0.9",
|
|
55
|
-
"@types/ember__template": "^4.0.0",
|
|
56
|
-
"@types/ember__test": "^4.0.0",
|
|
57
|
-
"@types/ember__test-helpers": "^2.6.1",
|
|
42
|
+
"@ember/test-helpers": "^3.2.0",
|
|
43
|
+
"@embroider/test-setup": "^3.0.1",
|
|
44
|
+
"@frontile/forms": "^0.15.0",
|
|
45
|
+
"@glimmer/component": "^1.1.2",
|
|
46
|
+
"@glimmer/tracking": "^1.1.2",
|
|
47
|
+
"@types/ember-qunit": "^6.1.1",
|
|
48
|
+
"@types/ember-resolver": "^9.0.0",
|
|
58
49
|
"@types/htmlbars-inline-precompile": "^3.0.0",
|
|
59
|
-
"@types/qunit": "^2.
|
|
50
|
+
"@types/qunit": "^2.19.6",
|
|
60
51
|
"@types/rsvp": "^4.0.4",
|
|
61
|
-
"@types/sinon": "^10.0.11",
|
|
62
52
|
"broccoli-asset-rev": "^3.0.0",
|
|
63
|
-
"ember-cli": "^
|
|
64
|
-
"ember-cli-dependency-checker": "^3.2
|
|
53
|
+
"ember-cli": "^5.1.0",
|
|
54
|
+
"ember-cli-dependency-checker": "^3.3.2",
|
|
65
55
|
"ember-cli-inject-live-reload": "^2.1.0",
|
|
66
56
|
"ember-cli-sri": "^2.1.1",
|
|
67
57
|
"ember-cli-typescript-blueprints": "^3.0.0",
|
|
68
58
|
"ember-cli-uglify": "^3.0.0",
|
|
69
59
|
"ember-disable-prototype-extensions": "^1.1.3",
|
|
70
60
|
"ember-load-initializers": "^2.1.2",
|
|
71
|
-
"ember-qunit": "^
|
|
72
|
-
"ember-resolver": "^
|
|
73
|
-
"ember-
|
|
74
|
-
"ember-source": "^4.3.0",
|
|
61
|
+
"ember-qunit": "^7.0.0",
|
|
62
|
+
"ember-resolver": "^11.0.0",
|
|
63
|
+
"ember-source": "^5.1.2",
|
|
75
64
|
"ember-try": "^2.0.0",
|
|
76
65
|
"loader.js": "^4.7.0",
|
|
77
|
-
"qunit": "^2.
|
|
66
|
+
"qunit": "^2.19.4",
|
|
78
67
|
"qunit-dom": "^2.0.0",
|
|
79
|
-
"tailwindcss": "^3.
|
|
80
|
-
"typescript": "^
|
|
81
|
-
"webpack": "^5.
|
|
68
|
+
"tailwindcss": "^3.3.3",
|
|
69
|
+
"typescript": "^5.1.6",
|
|
70
|
+
"webpack": "^5.88.2"
|
|
82
71
|
},
|
|
83
72
|
"engines": {
|
|
84
73
|
"node": "10.* || >= 12"
|
|
@@ -92,5 +81,5 @@
|
|
|
92
81
|
"ember-addon": {
|
|
93
82
|
"configPath": "tests/dummy/config"
|
|
94
83
|
},
|
|
95
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "b038ebd4a286717de3339de658c6c32d628ae4f0"
|
|
96
85
|
}
|
|
@@ -5,8 +5,8 @@ import { NotificationOptions } from '../-private/types';
|
|
|
5
5
|
export default class NotificationsService extends Service {
|
|
6
6
|
manager: NotificationsManager;
|
|
7
7
|
get notifications(): Notification[];
|
|
8
|
-
add: (message: string, options?: NotificationOptions
|
|
9
|
-
remove: (notification?: Notification
|
|
8
|
+
add: (message: string, options?: NotificationOptions) => Notification;
|
|
9
|
+
remove: (notification?: Notification) => void;
|
|
10
10
|
removeAll: () => void;
|
|
11
11
|
willDestroy(): void;
|
|
12
12
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'ember-source/types';
|