@frontile/notifications 0.17.0-beta.1 → 0.17.0-beta.10
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/declarations/-private/get-config.d.ts +1 -1
- package/declarations/-private/get-config.d.ts.map +1 -1
- package/declarations/-private/manager.d.ts +3 -0
- package/declarations/-private/manager.d.ts.map +1 -1
- package/declarations/-private/notification.d.ts +2 -2
- package/declarations/-private/notification.d.ts.map +1 -1
- package/declarations/components/notification-card.d.ts +18 -7
- package/declarations/components/notification-card.d.ts.map +1 -1
- package/declarations/components/notifications-container.d.ts +7 -1
- package/declarations/components/notifications-container.d.ts.map +1 -1
- package/declarations/services/notifications.d.ts.map +1 -1
- package/dist/components/notification-card.js +38 -54
- package/dist/components/notification-card.js.map +1 -1
- package/dist/components/notifications-container.js +16 -26
- package/dist/components/notifications-container.js.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/manager-i6QWzaob.js +166 -0
- package/dist/manager-i6QWzaob.js.map +1 -0
- package/dist/runtime-BPCpkOf1-DV8zmEr2.js +67 -0
- package/dist/runtime-BPCpkOf1-DV8zmEr2.js.map +1 -0
- package/dist/services/notifications.js +11 -15
- package/dist/services/notifications.js.map +1 -1
- package/package.json +48 -52
- package/declarations/get-config-a59d13fc.d.ts +0 -4
- package/declarations/get-config-a59d13fc.d.ts.map +0 -1
- package/declarations/manager-IxquV5I2.d.ts +0 -11
- package/declarations/manager-IxquV5I2.d.ts.map +0 -1
- package/declarations/notification-64b501e5.d.ts +0 -16
- package/declarations/notification-64b501e5.d.ts.map +0 -1
- package/declarations/timer-0a840cef.d.ts +0 -14
- package/declarations/timer-0a840cef.d.ts.map +0 -1
- package/declarations/types-16c08671.d.ts +0 -56
- package/declarations/types-16c08671.d.ts.map +0 -1
- package/dist/manager-IxquV5I2.js +0 -159
- package/dist/manager-IxquV5I2.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DefaultConfig } from './types';
|
|
2
|
-
export declare function getConfigOption<T extends keyof DefaultConfig>(key: T, defaultValue: NonNullable<DefaultConfig[T]>): NonNullable<DefaultConfig[T]>;
|
|
2
|
+
export declare function getConfigOption<T extends keyof DefaultConfig>(config: DefaultConfig, key: T, defaultValue: NonNullable<DefaultConfig[T]>): NonNullable<DefaultConfig[T]>;
|
|
3
3
|
//# sourceMappingURL=get-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-config.d.ts","sourceRoot":"","sources":["../../src/-private/get-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-config.d.ts","sourceRoot":"","sources":["../../src/-private/get-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,aAAa,EAC3D,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,CAAC,EACN,YAAY,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAC1C,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAQ/B"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import Notification from './notification';
|
|
2
|
+
import type { DefaultConfig } from './types';
|
|
2
3
|
import type { NotificationOptions } from './types';
|
|
3
4
|
export default class NotificationsManager {
|
|
4
5
|
notifications: Notification[];
|
|
6
|
+
config: DefaultConfig;
|
|
7
|
+
constructor(context: object);
|
|
5
8
|
add(message: string, options?: NotificationOptions): Notification;
|
|
6
9
|
remove(notification?: Notification): void;
|
|
7
10
|
removeAll(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAS1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,MAAM,EAAE,aAAa,CAAM;gBAEf,OAAO,EAAE,MAAM;IAc3B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY;IAqBrE,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAkBzC,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,gBAAgB;CAKzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Timer from './timer';
|
|
2
|
-
import type { NotificationOptions, CustomAction } from './types';
|
|
2
|
+
import type { NotificationOptions, CustomAction, DefaultConfig } from './types';
|
|
3
3
|
export default class Notification {
|
|
4
4
|
readonly message: string;
|
|
5
5
|
readonly transitionDuration: number;
|
|
@@ -9,7 +9,7 @@ export default class Notification {
|
|
|
9
9
|
readonly duration: number;
|
|
10
10
|
timer?: Timer;
|
|
11
11
|
isRemoving: boolean;
|
|
12
|
-
constructor(message: string, options?: NotificationOptions);
|
|
12
|
+
constructor(config: DefaultConfig, message: string, options?: NotificationOptions);
|
|
13
13
|
remove(): void;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/-private/notification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/-private/notification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,UAAS;gBAG1B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB;IAoBnC,MAAM,IAAI,IAAI;CAOf"}
|
|
@@ -19,13 +19,24 @@ declare class NotificationCard extends Component<NotificationCardSignature> {
|
|
|
19
19
|
notifications: NotificationsService;
|
|
20
20
|
hasEntered: boolean;
|
|
21
21
|
get styles(): unknown;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
transitionIn: import("ember-modifier").FunctionBasedModifier<{
|
|
23
|
+
Args: {
|
|
24
|
+
Positional: unknown[];
|
|
25
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
26
|
+
};
|
|
27
|
+
Element: HTMLElement;
|
|
28
|
+
}>;
|
|
29
|
+
transitionOut: import("ember-modifier").FunctionBasedModifier<{
|
|
30
|
+
Args: {
|
|
31
|
+
Positional: boolean[];
|
|
32
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
33
|
+
};
|
|
34
|
+
Element: HTMLElement;
|
|
35
|
+
}>;
|
|
36
|
+
remove: () => void;
|
|
37
|
+
pause: () => void;
|
|
38
|
+
resume: () => void;
|
|
39
|
+
handleClickCustomAction: (customAction: CustomAction) => void;
|
|
29
40
|
get classes(): {
|
|
30
41
|
base: string;
|
|
31
42
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-card.d.ts","sourceRoot":"","sources":["../../src/components/notification-card.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-card.d.ts","sourceRoot":"","sources":["../../src/components/notification-card.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAY3C,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,UAAU,yBAAyB;IACjC,IAAI,EAAE;QACJ,YAAY,EAAE,YAAY,CAAC;QAC3B,SAAS,EAAE,kBAAkB,CAAC;QAE9B;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,gBAAiB,SAAQ,SAAS,CAAC,yBAAyB,CAAC;IACxD,aAAa,EAAG,oBAAoB,CAAC;IACrC,UAAU,UAAS;IAE5B,IAAI,MAAM,IAAI,OAAO,CAYpB;IAED,YAAY;;;;;;OAuBT;IAEH,aAAa;;;;;;OAMX;IAEF,MAAM,aAEJ;IAEF,KAAK,aAIH;IAEF,MAAM,aAIJ;IAEF,uBAAuB,iBAAkB,YAAY,UAGnD;IAEF,IAAI,OAAO;;;;;;MAeV;CA4DF;AAED,OAAO,EAAE,gBAAgB,EAAE,KAAK,yBAAyB,EAAE,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -28,7 +28,13 @@ declare class NotificationsContainer extends Component<NotificationsContainerSig
|
|
|
28
28
|
get isTopPlacement(): boolean;
|
|
29
29
|
get sortedNotifications(): Notification[];
|
|
30
30
|
get classes(): string;
|
|
31
|
-
|
|
31
|
+
setupSpacing: import("ember-modifier").FunctionBasedModifier<{
|
|
32
|
+
Args: {
|
|
33
|
+
Positional: unknown[];
|
|
34
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
35
|
+
};
|
|
36
|
+
Element: HTMLElement;
|
|
37
|
+
}>;
|
|
32
38
|
}
|
|
33
39
|
export { NotificationsContainer, type NotificationsContainerSignature };
|
|
34
40
|
export default NotificationsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-container.d.ts","sourceRoot":"","sources":["../../src/components/notifications-container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notifications-container.d.ts","sourceRoot":"","sources":["../../src/components/notifications-container.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,UAAU,+BAA+B;IACvC,IAAI,EAAE;QACJ;;;;WAIG;QACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;QAC/B;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,sBAAuB,SAAQ,SAAS,CAAC,+BAA+B,CAAC;IACpE,aAAa,EAAG,oBAAoB,CAAC;IAE9C,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,IAAI,mBAAmB,IAAI,YAAY,EAAE,CAMxC;IAED,IAAI,OAAO,WAOV;IAED,YAAY;;;;;;OAMT;CA6BJ;AAED,OAAO,EAAE,sBAAsB,EAAE,KAAK,+BAA+B,EAAE,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/services/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,oBAAoB,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/services/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,oBAAoB,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACvD,OAAO,uBAAkC;IAEzC,IAAI,aAAa,IAAI,YAAY,EAAE,CAElC;IAED,GAAG,YAAa,MAAM,YAAY,mBAAmB,KAAG,YAAY,CAElE;IAEF,MAAM,kBAAmB,YAAY,KAAG,IAAI,CAE1C;IAEF,SAAS,QAAO,IAAI,CAElB;IAEF,WAAW,IAAI,IAAI;CAIpB;AAGD,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,QAAQ;QAChB,aAAa,EAAE,oBAAoB,CAAC;KACrC;CACF"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
|
|
2
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
4
|
-
import '@babel/runtime/helpers/esm/initializerWarningHelper';
|
|
5
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import { modifier } from 'ember-modifier';
|
|
6
3
|
import { tracked } from '@glimmer/tracking';
|
|
7
|
-
import { action } from '@ember/object';
|
|
8
4
|
import { inject } from '@ember/service';
|
|
9
5
|
import { htmlSafe } from '@ember/template';
|
|
10
6
|
import { later } from '@ember/runloop';
|
|
11
7
|
import { on } from '@ember/modifier';
|
|
12
|
-
import {
|
|
13
|
-
import didUpdate from '@ember/render-modifiers/modifiers/did-update';
|
|
14
|
-
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
|
|
8
|
+
import { fn, concat } from '@ember/helper';
|
|
15
9
|
import { CloseButton } from '@frontile/buttons';
|
|
16
10
|
import { cssTransition } from 'ember-css-transitions';
|
|
17
11
|
import { useStyles } from '@frontile/theme';
|
|
18
12
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
19
13
|
import { setComponentTemplate } from '@ember/component';
|
|
14
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../runtime-BPCpkOf1-DV8zmEr2.js';
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_initializerDefineProperty(this, "notifications", _descriptor, this);
|
|
26
|
-
_initializerDefineProperty(this, "hasEntered", _descriptor2, this);
|
|
16
|
+
/* eslint-disable ember/no-runloop */
|
|
17
|
+
class NotificationCard extends Component {
|
|
18
|
+
static {
|
|
19
|
+
decorateFieldV2(this.prototype, "notifications", [inject]);
|
|
27
20
|
}
|
|
21
|
+
#notifications = (initializeDeferredDecorator(this, "notifications"), undefined);
|
|
22
|
+
static {
|
|
23
|
+
decorateFieldV2(this.prototype, "hasEntered", [tracked], function () {
|
|
24
|
+
return false;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
#hasEntered = (initializeDeferredDecorator(this, "hasEntered"), undefined);
|
|
28
28
|
get styles() {
|
|
29
29
|
const styles = [`transition-duration: ${this.args.notification.transitionDuration}ms`];
|
|
30
30
|
if (!this.hasEntered) {
|
|
@@ -32,12 +32,7 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
|
|
|
32
32
|
}
|
|
33
33
|
return htmlSafe(styles.join('; '));
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
if (this.args.placement && this.args.placement.includes('top')) {
|
|
37
|
-
element.style.marginTop = `${this.args.spacing || 16}px`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
transitionIn(element) {
|
|
35
|
+
transitionIn = modifier(element => {
|
|
41
36
|
const spacing = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
|
|
42
37
|
const expectedHeight = element.offsetHeight + spacing;
|
|
43
38
|
const duration = this.args.notification.transitionDuration / 2;
|
|
@@ -52,29 +47,29 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
|
|
|
52
47
|
later(this, () => {
|
|
53
48
|
this.hasEntered = true;
|
|
54
49
|
}, this.args.notification.transitionDuration);
|
|
55
|
-
}
|
|
56
|
-
transitionOut(element, [isExiting, ..._]) {
|
|
50
|
+
});
|
|
51
|
+
transitionOut = modifier((element, [isExiting, ..._]) => {
|
|
57
52
|
if (isExiting) {
|
|
58
53
|
element.style.height = '0';
|
|
59
54
|
}
|
|
60
|
-
}
|
|
61
|
-
remove() {
|
|
55
|
+
});
|
|
56
|
+
remove = () => {
|
|
62
57
|
this.notifications.remove(this.args.notification);
|
|
63
|
-
}
|
|
64
|
-
pause() {
|
|
58
|
+
};
|
|
59
|
+
pause = () => {
|
|
65
60
|
if (this.args.notification.timer) {
|
|
66
61
|
this.args.notification.timer.pause();
|
|
67
62
|
}
|
|
68
|
-
}
|
|
69
|
-
resume() {
|
|
63
|
+
};
|
|
64
|
+
resume = () => {
|
|
70
65
|
if (this.args.notification.timer) {
|
|
71
66
|
this.args.notification.timer.resume();
|
|
72
67
|
}
|
|
73
|
-
}
|
|
74
|
-
handleClickCustomAction
|
|
68
|
+
};
|
|
69
|
+
handleClickCustomAction = customAction => {
|
|
75
70
|
customAction.onClick();
|
|
76
71
|
this.remove();
|
|
77
|
-
}
|
|
72
|
+
};
|
|
78
73
|
get classes() {
|
|
79
74
|
const {
|
|
80
75
|
notificationCard
|
|
@@ -96,30 +91,19 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
|
|
|
96
91
|
closeButton: closeButton()
|
|
97
92
|
};
|
|
98
93
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), _NotificationCard), _NotificationCard), _descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
|
|
111
|
-
configurable: true,
|
|
112
|
-
enumerable: true,
|
|
113
|
-
writable: true,
|
|
114
|
-
initializer: null
|
|
115
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "hasEntered", [tracked], {
|
|
116
|
-
configurable: true,
|
|
117
|
-
enumerable: true,
|
|
118
|
-
writable: true,
|
|
119
|
-
initializer: function () {
|
|
120
|
-
return false;
|
|
94
|
+
static {
|
|
95
|
+
setComponentTemplate(precompileTemplate("\n {{!-- template-lint-disable no-invalid-interactive --}}\n {{!-- template-lint-disable no-unnecessary-concat --}}\n {{!-- template-lint-disable no-inline-styles --}}\n {{!-- template-lint-disable style-concatenation --}}\n <div {{this.transitionIn}} {{this.transitionOut @notification.isRemoving}}>\n {{#unless @notification.isRemoving}}\n <div {{on \"mouseenter\" this.pause}} {{on \"mouseleave\" this.resume}} {{cssTransition (concat \"notification-transition--slide-from-\" @placement) isEnabled=true}} class={{this.classes.base}} style=\"{{this.styles}}\" ...attributes>\n <div class={{this.classes.message}}>\n {{@notification.message}}\n </div>\n\n {{#if @notification.customActions}}\n <div class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction|}}\n <button type=\"button\" class={{this.classes.customActionButton}} {{on \"click\" (fn this.handleClickCustomAction customAction)}}>\n {{customAction.label}}\n </button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton @onClick={{this.remove}} @size=\"sm\" @class={{this.classes.closeButton}} />\n {{/if}}\n </div>\n {{/unless}}\n </div>\n ", {
|
|
96
|
+
strictMode: true,
|
|
97
|
+
scope: () => ({
|
|
98
|
+
on,
|
|
99
|
+
cssTransition,
|
|
100
|
+
concat,
|
|
101
|
+
fn,
|
|
102
|
+
CloseButton
|
|
103
|
+
})
|
|
104
|
+
}), this);
|
|
121
105
|
}
|
|
122
|
-
}
|
|
106
|
+
}
|
|
123
107
|
|
|
124
108
|
export { NotificationCard, NotificationCard as default };
|
|
125
109
|
//# sourceMappingURL=notification-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-card.js","sources":["../../src/components/notification-card.gts"],"sourcesContent":["/* eslint-disable ember/no-at-ember-render-modifiers, ember/no-runloop */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { later } from '@ember/runloop';\nimport { on } from '@ember/modifier';\nimport { fn, concat } from '@ember/helper';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport { CloseButton } from '@frontile/buttons';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../services/notifications';\nimport type Notification from '../-private/notification';\nimport type { CustomAction, containerPlacement } from '../-private/types';\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification;\n placement: containerPlacement;\n\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */\n spacing?: number;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n @tracked hasEntered = false;\n\n get styles(): unknown {\n const styles = [\n `transition-duration: ${this.args.notification.transitionDuration}ms`\n ];\n\n if (!this.hasEntered) {\n styles.push(\n `transition-delay: ${this.args.notification.transitionDuration}ms`\n );\n }\n\n return htmlSafe(styles.join('; '));\n }\n\n @action addSpacing(element: HTMLElement): void {\n if (this.args.placement && this.args.placement.includes('top')) {\n element.style.marginTop = `${this.args.spacing || 16}px`;\n }\n }\n\n @action transitionIn(element: HTMLElement): void {\n const spacing =\n typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n const expectedHeight = element.offsetHeight + spacing;\n const duration = this.args.notification.transitionDuration / 2;\n\n requestAnimationFrame(() => {\n element.style.height = '0';\n const transition = `height ${duration}ms ease-in ${duration}ms`;\n element.style.transition = transition;\n\n requestAnimationFrame(() => {\n element.style.height = `${expectedHeight}px`;\n });\n });\n\n later(\n this,\n () => {\n this.hasEntered = true;\n },\n this.args.notification.transitionDuration\n );\n }\n\n @action transitionOut(\n element: HTMLElement,\n [isExiting, ..._]: boolean[]\n ): void {\n if (isExiting) {\n element.style.height = '0';\n }\n }\n\n @action remove(): void {\n this.notifications.remove(this.args.notification);\n }\n\n @action pause(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.pause();\n }\n }\n\n @action resume(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.resume();\n }\n }\n\n @action handleClickCustomAction(customAction: CustomAction): void {\n customAction.onClick();\n this.remove();\n }\n\n get classes() {\n const { notificationCard } = useStyles();\n\n let { base, message, customActions, customActionButton, closeButton } =\n notificationCard({\n appearance: this.args.notification.appearance\n });\n\n return {\n base: base(),\n message: message(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! template-lint-disable no-unnecessary-concat }}\n {{! template-lint-disable no-inline-styles }}\n {{! template-lint-disable style-concatenation }}\n <div\n {{didInsert this.transitionIn}}\n {{didUpdate this.transitionOut @notification.isRemoving}}\n >\n {{#unless @notification.isRemoving}}\n <div\n {{on \"mouseenter\" this.pause}}\n {{on \"mouseleave\" this.resume}}\n {{cssTransition\n (concat \"notification-transition--slide-from-\" @placement)\n isEnabled=true\n }}\n class={{this.classes.base}}\n style=\"{{this.styles}}\"\n ...attributes\n >\n <div class={{this.classes.message}}>\n {{@notification.message}}\n </div>\n\n {{#if @notification.customActions}}\n <div class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction|}}\n <button\n type=\"button\"\n class={{this.classes.customActionButton}}\n {{on \"click\" (fn this.handleClickCustomAction customAction)}}\n >\n {{customAction.label}}\n </button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n @onClick={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n {{/unless}}\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["NotificationCard","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","styles","notification","transitionDuration","hasEntered","push","htmlSafe","join","addSpacing","element","placement","includes","style","marginTop","spacing","transitionIn","expectedHeight","offsetHeight","duration","requestAnimationFrame","height","transition","later","transitionOut","isExiting","_","remove","notifications","pause","timer","resume","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","message","customActions","customActionButton","closeButton","appearance","setComponentTemplate","precompileTemplate","strictMode","scope","didInsert","didUpdate","on","cssTransition","concat","fn","CloseButton","_NotificationCard","_applyDecoratedDescriptor","_class","prototype","service","configurable","enumerable","writable","initializer","tracked","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCMA,IAAAA,kDAAN,MAAMA,yBAAyBC,SAAU,CAAA;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAA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GAAAD,MAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"notification-card.js","sources":["../../src/components/notification-card.gts"],"sourcesContent":["/* eslint-disable ember/no-runloop */\nimport Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport { tracked } from '@glimmer/tracking';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { later } from '@ember/runloop';\nimport { on } from '@ember/modifier';\nimport { fn, concat } from '@ember/helper';\nimport { CloseButton } from '@frontile/buttons';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../services/notifications';\nimport type Notification from '../-private/notification';\nimport type { CustomAction, containerPlacement } from '../-private/types';\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification;\n placement: containerPlacement;\n\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */\n spacing?: number;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n @tracked hasEntered = false;\n\n get styles(): unknown {\n const styles = [\n `transition-duration: ${this.args.notification.transitionDuration}ms`\n ];\n\n if (!this.hasEntered) {\n styles.push(\n `transition-delay: ${this.args.notification.transitionDuration}ms`\n );\n }\n\n return htmlSafe(styles.join('; '));\n }\n\n transitionIn = modifier((element: HTMLElement) => {\n const spacing =\n typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n const expectedHeight = element.offsetHeight + spacing;\n const duration = this.args.notification.transitionDuration / 2;\n\n requestAnimationFrame(() => {\n element.style.height = '0';\n const transition = `height ${duration}ms ease-in ${duration}ms`;\n element.style.transition = transition;\n\n requestAnimationFrame(() => {\n element.style.height = `${expectedHeight}px`;\n });\n });\n\n later(\n this,\n () => {\n this.hasEntered = true;\n },\n this.args.notification.transitionDuration\n );\n });\n\n transitionOut = modifier(\n (element: HTMLElement, [isExiting, ..._]: boolean[]) => {\n if (isExiting) {\n element.style.height = '0';\n }\n }\n );\n\n remove = () => {\n this.notifications.remove(this.args.notification);\n };\n\n pause = () => {\n if (this.args.notification.timer) {\n this.args.notification.timer.pause();\n }\n };\n\n resume = () => {\n if (this.args.notification.timer) {\n this.args.notification.timer.resume();\n }\n };\n\n handleClickCustomAction = (customAction: CustomAction) => {\n customAction.onClick();\n this.remove();\n };\n\n get classes() {\n const { notificationCard } = useStyles();\n\n let { base, message, customActions, customActionButton, closeButton } =\n notificationCard({\n appearance: this.args.notification.appearance\n });\n\n return {\n base: base(),\n message: message(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! template-lint-disable no-unnecessary-concat }}\n {{! template-lint-disable no-inline-styles }}\n {{! template-lint-disable style-concatenation }}\n <div {{this.transitionIn}} {{this.transitionOut @notification.isRemoving}}>\n {{#unless @notification.isRemoving}}\n <div\n {{on \"mouseenter\" this.pause}}\n {{on \"mouseleave\" this.resume}}\n {{cssTransition\n (concat \"notification-transition--slide-from-\" @placement)\n isEnabled=true\n }}\n class={{this.classes.base}}\n style=\"{{this.styles}}\"\n ...attributes\n >\n <div class={{this.classes.message}}>\n {{@notification.message}}\n </div>\n\n {{#if @notification.customActions}}\n <div class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction|}}\n <button\n type=\"button\"\n class={{this.classes.customActionButton}}\n {{on \"click\" (fn this.handleClickCustomAction customAction)}}\n >\n {{customAction.label}}\n </button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n @onClick={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n {{/unless}}\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["NotificationCard","Component","g","prototype","service","i","void 0","tracked","styles","args","notification","transitionDuration","hasEntered","push","htmlSafe","join","transitionIn","modifier","element","spacing","expectedHeight","offsetHeight","duration","requestAnimationFrame","style","height","transition","later","transitionOut","isExiting","_","remove","notifications","pause","timer","resume","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","message","customActions","customActionButton","closeButton","appearance","setComponentTemplate","precompileTemplate","strictMode","scope","on","cssTransition","concat","fn","CloseButton"],"mappings":";;;;;;;;;;;;;;;AAAA;AAgCA,MAAMA,yBAAyBC,SAAU,CAAA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CACtCC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,SAAA;AAAA,EAAA;IAAAJ,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,YAAA,EAAA,CACAI,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAqB,KAAM;AAAA,KAAA,CAAA;AAAA;AAAA,EAAA,WAAA,IAAAF,2BAAA,CAAA,IAAA,EAAA,YAAA,CAAA,EAAAC,SAAA;EAE5B,IAAIE,MAAAA,GAAkB;AACpB,IAAA,MAAMA,MAAS,GAAA,CACb,CAAA,qBAAA,EAAwB,IAAI,CAACC,IAAI,CAACC,YAAY,CAACC,kBAAkB,CAAA,EAAA,CAAI,CACtE;AAED,IAAA,IAAI,CAAC,IAAI,CAACC,UAAU,EAAE;AACpBJ,MAAAA,MAAA,CAAOK,IAAI,CACT,CAAA,kBAAA,EAAqB,IAAI,CAACJ,IAAI,CAACC,YAAY,CAACC,kBAAkB,CAAA,EAAA,CAAI,CAAA;AAEtE;IAEA,OAAOG,QAAA,CAASN,MAAO,CAAAO,IAAI,CAAC,IAAA,CAAA,CAAA;AAC9B;AAEAC,EAAAA,YAAe,GAAAC,QAAA,CAAUC,OAAS,IAAA;AAChC,IAAA,MAAMC,OACJ,GAAA,OAAO,IAAI,CAACV,IAAI,CAACU,OAAO,KAAK,WAAA,GAAc,EAAK,GAAA,IAAI,CAACV,IAAI,CAACU,OAAO;A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AACP,IAAA,IAAI,IAAI,CAAC1B,IAAI,CAACC,YAAY,CAACwB,KAAK,EAAE;MAChC,IAAI,CAACzB,IAAI,CAACC,YAAY,CAACwB,KAAK,CAACC,MAAM,EAAA;AACrC;GACA;EAEFC,uBAAA,GAA2BC,YAAc,IAAA;IACvCA,YAAA,CAAaC,OAAO,EAAA;IACpB,IAAI,CAACP,MAAM,EAAA;GACX;EAEF,IAAIQ,OAAUA,GAAA;IACZ,MAAM;AAAEC,MAAAA;KAAkB,GAAGC,SAAA,EAAA;IAE7B,IAAI;MAAEC,IAAI;MAAEC,OAAO;MAAEC,aAAa;MAAEC,kBAAkB;AAAEC,MAAAA;KAAa,GACnEN,gBAAiB,CAAA;AACfO,MAAAA,UAAA,EAAY,IAAI,CAACtC,IAAI,CAACC,YAAY,CAACqC;AACrC,KAAA,CAAA;IAEF,OAAO;MACLL,IAAM,EAAAA,IAAA,EAAA;MACNC,OAAS,EAAAA,OAAA,EAAA;MACTC,aAAe,EAAAA,aAAA,EAAA;MACfC,kBAAoB,EAAAA,kBAAA,EAAA;MACpBC,WAAa,EAAAA,WAAA;KACf;AACF;AAEA,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CA8CA,62CAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;QAAAC,aAAA;QAAAC,MAAA;QAAAC,EAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
|
|
2
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
4
|
-
import '@babel/runtime/helpers/esm/initializerWarningHelper';
|
|
5
1
|
import Component from '@glimmer/component';
|
|
6
2
|
import { inject } from '@ember/service';
|
|
7
|
-
import {
|
|
8
|
-
import didUpdate from '@ember/render-modifiers/modifiers/did-update';
|
|
9
|
-
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
|
|
3
|
+
import { modifier } from 'ember-modifier';
|
|
10
4
|
import { NotificationCard } from './notification-card.js';
|
|
11
5
|
import { useStyles } from '@frontile/theme';
|
|
12
6
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
13
7
|
import { setComponentTemplate } from '@ember/component';
|
|
8
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../runtime-BPCpkOf1-DV8zmEr2.js';
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
super(...args);
|
|
19
|
-
_initializerDefineProperty(this, "notifications", _descriptor, this);
|
|
10
|
+
class NotificationsContainer extends Component {
|
|
11
|
+
static {
|
|
12
|
+
decorateFieldV2(this.prototype, "notifications", [inject]);
|
|
20
13
|
}
|
|
14
|
+
#notifications = (initializeDeferredDecorator(this, "notifications"), undefined);
|
|
21
15
|
get isTopPlacement() {
|
|
22
16
|
return !!(this.args.placement && this.args.placement.includes('top'));
|
|
23
17
|
}
|
|
@@ -37,25 +31,21 @@ let NotificationsContainer = (_class = (_NotificationsContainer = class Notifica
|
|
|
37
31
|
class: this.args.class
|
|
38
32
|
});
|
|
39
33
|
}
|
|
40
|
-
|
|
34
|
+
setupSpacing = modifier(element => {
|
|
41
35
|
const spacing = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
|
|
42
36
|
if (this.isTopPlacement) {
|
|
43
37
|
element.style.marginTop = `${spacing}px`;
|
|
44
38
|
}
|
|
39
|
+
});
|
|
40
|
+
static {
|
|
41
|
+
setComponentTemplate(precompileTemplate("\n {{#if this.sortedNotifications}}\n <div {{this.setupSpacing @spacing @placement}} class={{this.classes}} role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" ...attributes>\n {{#each this.sortedNotifications as |notification|}}\n <NotificationCard @spacing={{@spacing}} @placement={{if @placement @placement \"bottom-right\"}} @notification={{notification}} />\n {{/each}}\n </div>\n {{/if}}\n ", {
|
|
42
|
+
strictMode: true,
|
|
43
|
+
scope: () => ({
|
|
44
|
+
NotificationCard
|
|
45
|
+
})
|
|
46
|
+
}), this);
|
|
45
47
|
}
|
|
46
|
-
}
|
|
47
|
-
strictMode: true,
|
|
48
|
-
scope: () => ({
|
|
49
|
-
didInsert,
|
|
50
|
-
didUpdate,
|
|
51
|
-
NotificationCard
|
|
52
|
-
})
|
|
53
|
-
}), _NotificationsContainer), _NotificationsContainer), _descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
|
|
54
|
-
configurable: true,
|
|
55
|
-
enumerable: true,
|
|
56
|
-
writable: true,
|
|
57
|
-
initializer: null
|
|
58
|
-
}), _applyDecoratedDescriptor(_class.prototype, "addSpacing", [action], Object.getOwnPropertyDescriptor(_class.prototype, "addSpacing"), _class.prototype), _class);
|
|
48
|
+
}
|
|
59
49
|
|
|
60
50
|
export { NotificationsContainer, NotificationsContainer as default };
|
|
61
51
|
//# sourceMappingURL=notifications-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-container.js","sources":["../../src/components/notifications-container.gts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"notifications-container.js","sources":["../../src/components/notifications-container.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { inject as service } from '@ember/service';\nimport { modifier } from 'ember-modifier';\nimport NotificationCard from './notification-card';\nimport type NotificationsService from '../services/notifications';\nimport type Notification from '../-private/notification';\nimport { type containerPlacement } from '../-private/types';\nimport { useStyles } from '@frontile/theme';\n\ninterface NotificationsContainerSignature {\n Args: {\n /**\n * The placement of the notifications\n *\n * @defaultValue 'bottom-right'\n */\n placement?: containerPlacement;\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */\n spacing?: number;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationsContainer extends Component<NotificationsContainerSignature> {\n @service notifications!: NotificationsService;\n\n get isTopPlacement(): boolean {\n return !!(this.args.placement && this.args.placement.includes('top'));\n }\n\n get sortedNotifications(): Notification[] {\n if (this.isTopPlacement) {\n return this.notifications.notifications.slice().reverse();\n } else {\n return this.notifications.notifications;\n }\n }\n\n get classes() {\n const { notificationsContainer } = useStyles();\n\n return notificationsContainer({\n placement: this.args.placement,\n class: this.args.class\n });\n }\n\n setupSpacing = modifier((element: HTMLElement) => {\n const spacing =\n typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n if (this.isTopPlacement) {\n element.style.marginTop = `${spacing}px`;\n }\n });\n\n <template>\n {{#if this.sortedNotifications}}\n <div\n {{this.setupSpacing @spacing @placement}}\n class={{this.classes}}\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n ...attributes\n >\n {{#each this.sortedNotifications as |notification|}}\n <NotificationCard\n @spacing={{@spacing}}\n @placement={{if @placement @placement \"bottom-right\"}}\n @notification={{notification}}\n />\n {{/each}}\n </div>\n {{/if}}\n </template>\n}\n\nexport { NotificationsContainer, type NotificationsContainerSignature };\nexport default NotificationsContainer;\n"],"names":["NotificationsContainer","Component","g","prototype","service","i","void 0","isTopPlacement","args","placement","includes","sortedNotifications","notifications","slice","reverse","classes","notificationsContainer","useStyles","class","setupSpacing","modifier","element","spacing","style","marginTop","setComponentTemplate","precompileTemplate","strictMode","scope","NotificationCard"],"mappings":";;;;;;;;;AAgCA,MAAMA,+BAA+BC,SAAU,CAAA;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CAC5CC,MAAA,CAAA,CAAA;AAAA;AAAA,EAAA,cAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,eAAA,CAAA,EAAAC,SAAA;EAED,IAAIC,cAAAA,GAA0B;AAC5B,IAAA,OAAO,CAAC,EAAE,IAAI,CAACC,IAAI,CAACC,SAAS,IAAI,IAAI,CAACD,IAAI,CAACC,SAAS,CAACC,QAAQ,CAAC,KAAM,CAAA,CAAA;AACtE;EAEA,IAAIC,sBAAsC;IACxC,IAAI,IAAI,CAACJ,cAAc,EAAE;AACvB,MAAA,OAAO,IAAI,CAACK,aAAa,CAACA,aAAa,CAACC,KAAK,GAAGC,OAAO,EAAA;AACzD,KAAO,MAAA;AACL,MAAA,OAAO,IAAI,CAACF,aAAa,CAACA,aAAa;AACzC;AACF;EAEA,IAAIG,OAAUA,GAAA;IACZ,MAAM;AAAEC,MAAAA;KAAwB,GAAGC,SAAA,EAAA;AAEnC,IAAA,OAAOD,sBAAuB,CAAA;AAC5BP,MAAAA,SAAA,EAAW,IAAI,CAACD,IAAI,CAACC,SAAS;AAC9BS,MAAAA,KAAA,EAAO,IAAI,CAACV,IAAI,CAACU;AACnB,KAAA,CAAA;AACF;AAEAC,EAAAA,YAAe,GAAAC,QAAA,CAAUC,OAAS,IAAA;AAChC,IAAA,MAAMC,OACJ,GAAA,OAAO,IAAI,CAACd,IAAI,CAACc,OAAO,KAAK,WAAA,GAAc,EAAK,GAAA,IAAI,CAACd,IAAI,CAACc,OAAO;IACnE,IAAI,IAAI,CAACf,cAAc,EAAE;AACvBc,MAAAA,OAAQ,CAAAE,KAAK,CAACC,SAAS,GAAG,CAAA,EAAGF,OAAA,CAAW,EAAA,CAAA;AAC1C;AACF,GAAG,CAAA;AAEH,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAmBA,8bAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { N as Notification, T as Timer } from './manager-
|
|
2
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
1
|
+
export { N as Notification, T as Timer } from './manager-i6QWzaob.js';
|
|
3
2
|
import '@ember/service';
|
|
4
3
|
export { NotificationCard } from './components/notification-card.js';
|
|
5
4
|
export { NotificationsContainer } from './components/notifications-container.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { tracked } from '@glimmer/tracking';
|
|
2
|
+
import { cancel, later } from '@ember/runloop';
|
|
3
|
+
import { action, get } from '@ember/object';
|
|
4
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from './runtime-BPCpkOf1-DV8zmEr2.js';
|
|
5
|
+
import { assert } from '@ember/debug';
|
|
6
|
+
import { getOwner } from '@ember/owner';
|
|
7
|
+
import { isDestroyed } from '@ember/destroyable';
|
|
8
|
+
|
|
9
|
+
/* eslint-disable ember/no-runloop */
|
|
10
|
+
class Timer {
|
|
11
|
+
static {
|
|
12
|
+
decorateFieldV2(this.prototype, "remaining", [tracked]);
|
|
13
|
+
}
|
|
14
|
+
#remaining = (initializeDeferredDecorator(this, "remaining"), undefined);
|
|
15
|
+
static {
|
|
16
|
+
decorateFieldV2(this.prototype, "isRunning", [tracked], function () {
|
|
17
|
+
return true;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
#isRunning = (initializeDeferredDecorator(this, "isRunning"), undefined);
|
|
21
|
+
onFinish;
|
|
22
|
+
timer;
|
|
23
|
+
start;
|
|
24
|
+
constructor(duration, onFinish) {
|
|
25
|
+
this.remaining = duration;
|
|
26
|
+
this.onFinish = onFinish;
|
|
27
|
+
this.setup();
|
|
28
|
+
}
|
|
29
|
+
clear() {
|
|
30
|
+
this.isRunning = false;
|
|
31
|
+
if (this.timer) {
|
|
32
|
+
cancel(this.timer);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
static {
|
|
36
|
+
decorateMethodV2(this.prototype, "clear", [action]);
|
|
37
|
+
}
|
|
38
|
+
pause() {
|
|
39
|
+
this.clear();
|
|
40
|
+
this.remaining -= Date.now() - this.start;
|
|
41
|
+
}
|
|
42
|
+
static {
|
|
43
|
+
decorateMethodV2(this.prototype, "pause", [action]);
|
|
44
|
+
}
|
|
45
|
+
resume() {
|
|
46
|
+
this.clear();
|
|
47
|
+
this.setup();
|
|
48
|
+
}
|
|
49
|
+
static {
|
|
50
|
+
decorateMethodV2(this.prototype, "resume", [action]);
|
|
51
|
+
}
|
|
52
|
+
setup() {
|
|
53
|
+
this.start = Date.now();
|
|
54
|
+
this.isRunning = true;
|
|
55
|
+
this.timer = later(this, () => {
|
|
56
|
+
this.onFinish();
|
|
57
|
+
this.isRunning = false;
|
|
58
|
+
}, this.remaining);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getConfigOption(config, key, defaultValue) {
|
|
63
|
+
const value = get(config, key);
|
|
64
|
+
if (value === undefined) {
|
|
65
|
+
return defaultValue;
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
class Notification {
|
|
71
|
+
message;
|
|
72
|
+
transitionDuration;
|
|
73
|
+
appearance;
|
|
74
|
+
customActions;
|
|
75
|
+
allowClosing;
|
|
76
|
+
duration;
|
|
77
|
+
static {
|
|
78
|
+
decorateFieldV2(this.prototype, "timer", [tracked]);
|
|
79
|
+
}
|
|
80
|
+
#timer = (initializeDeferredDecorator(this, "timer"), undefined);
|
|
81
|
+
static {
|
|
82
|
+
decorateFieldV2(this.prototype, "isRemoving", [tracked], function () {
|
|
83
|
+
return false;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
#isRemoving = (initializeDeferredDecorator(this, "isRemoving"), undefined);
|
|
87
|
+
constructor(config, message, options = {}) {
|
|
88
|
+
this.message = message;
|
|
89
|
+
this.appearance = options.appearance || getConfigOption(config, 'appearance', 'info');
|
|
90
|
+
this.customActions = options.customActions;
|
|
91
|
+
this.duration = options.duration || getConfigOption(config, 'duration', 5000);
|
|
92
|
+
this.transitionDuration = typeof options.transitionDuration !== 'undefined' ? options.transitionDuration : getConfigOption(config, 'transitionDuration', 200);
|
|
93
|
+
if (options.allowClosing === false) {
|
|
94
|
+
this.allowClosing = false;
|
|
95
|
+
} else {
|
|
96
|
+
this.allowClosing = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
remove() {
|
|
100
|
+
this.isRemoving = true;
|
|
101
|
+
if (this.timer) {
|
|
102
|
+
this.timer.clear();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* eslint-disable ember/no-runloop */
|
|
108
|
+
class NotificationsManager {
|
|
109
|
+
static {
|
|
110
|
+
decorateFieldV2(this.prototype, "notifications", [tracked], function () {
|
|
111
|
+
return [];
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
#notifications = (initializeDeferredDecorator(this, "notifications"), undefined);
|
|
115
|
+
config = {};
|
|
116
|
+
constructor(context) {
|
|
117
|
+
if (isDestroyed(context)) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const owner = getOwner(context);
|
|
121
|
+
assert('NotificationsManager context must have an owner', owner);
|
|
122
|
+
const configFactory = owner.factoryFor('config:environment');
|
|
123
|
+
if (configFactory && configFactory.class) {
|
|
124
|
+
this.config = configFactory.class['@frontile/notifications'] || {};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
add(message, options = {}) {
|
|
128
|
+
const notification = new Notification(this.config, message, options);
|
|
129
|
+
this.notifications = [...this.notifications, notification];
|
|
130
|
+
let preserve = typeof options.preserve === 'undefined' ? getConfigOption(this.config, 'preserve', false) : options.preserve;
|
|
131
|
+
|
|
132
|
+
// if default config has set skipTimer to true, we will preserve the
|
|
133
|
+
// notification, therefore skiping the timer
|
|
134
|
+
if (getConfigOption(this.config, 'skipTimer', false) === true) {
|
|
135
|
+
preserve = true;
|
|
136
|
+
}
|
|
137
|
+
if (preserve === false) {
|
|
138
|
+
this.setupAutoRemoval(notification, notification.duration);
|
|
139
|
+
}
|
|
140
|
+
return notification;
|
|
141
|
+
}
|
|
142
|
+
remove(notification) {
|
|
143
|
+
if (!notification) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
notification.remove();
|
|
147
|
+
later(this, () => {
|
|
148
|
+
this.notifications = this.notifications.filter(n => {
|
|
149
|
+
return n !== notification;
|
|
150
|
+
});
|
|
151
|
+
}, notification.transitionDuration);
|
|
152
|
+
}
|
|
153
|
+
removeAll() {
|
|
154
|
+
this.notifications.forEach(notification => {
|
|
155
|
+
this.remove(notification);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
setupAutoRemoval(notification, duration) {
|
|
159
|
+
notification.timer = new Timer(duration, () => {
|
|
160
|
+
this.remove(notification);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { Notification as N, Timer as T, NotificationsManager as a };
|
|
166
|
+
//# sourceMappingURL=manager-i6QWzaob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager-i6QWzaob.js","sources":["../src/-private/timer.ts","../src/-private/get-config.ts","../src/-private/notification.ts","../src/-private/manager.ts"],"sourcesContent":["/* eslint-disable ember/no-runloop */\nimport { tracked } from '@glimmer/tracking';\nimport { later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { action } from '@ember/object';\n\nexport default class Timer {\n @tracked remaining: number;\n @tracked isRunning = true;\n\n readonly onFinish: () => void;\n private timer?: EmberTimer;\n private start!: number;\n\n constructor(duration: number, onFinish: () => void) {\n this.remaining = duration;\n this.onFinish = onFinish;\n this.setup();\n }\n\n @action clear(): void {\n this.isRunning = false;\n\n if (this.timer) {\n cancel(this.timer);\n }\n }\n\n @action pause(): void {\n this.clear();\n this.remaining -= Date.now() - this.start;\n }\n\n @action resume(): void {\n this.clear();\n this.setup();\n }\n\n private setup(): void {\n this.start = Date.now();\n this.isRunning = true;\n\n this.timer = later(\n this,\n () => {\n this.onFinish();\n this.isRunning = false;\n },\n this.remaining\n );\n }\n}\n","import { get } from '@ember/object';\nimport type { DefaultConfig } from './types';\n\nexport function getConfigOption<T extends keyof DefaultConfig>(\n config: DefaultConfig,\n key: T,\n defaultValue: NonNullable<DefaultConfig[T]>\n): NonNullable<DefaultConfig[T]> {\n const value = get(config, key);\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","import { tracked } from '@glimmer/tracking';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport type { NotificationOptions, CustomAction, DefaultConfig } from './types';\n\nexport default class Notification {\n readonly message: string;\n readonly transitionDuration: number;\n readonly appearance: NonNullable<NotificationOptions['appearance']>;\n readonly customActions?: CustomAction[];\n readonly allowClosing: boolean;\n readonly duration: number;\n\n @tracked timer?: Timer;\n @tracked isRemoving = false;\n\n constructor(\n config: DefaultConfig,\n message: string,\n options: NotificationOptions = {}\n ) {\n this.message = message;\n this.appearance =\n options.appearance || getConfigOption(config, 'appearance', 'info');\n this.customActions = options.customActions;\n this.duration =\n options.duration || getConfigOption(config, 'duration', 5000);\n this.transitionDuration =\n typeof options.transitionDuration !== 'undefined'\n ? options.transitionDuration\n : getConfigOption(config, 'transitionDuration', 200);\n\n if (options.allowClosing === false) {\n this.allowClosing = false;\n } else {\n this.allowClosing = true;\n }\n }\n\n remove(): void {\n this.isRemoving = true;\n\n if (this.timer) {\n this.timer.clear();\n }\n }\n}\n","/* eslint-disable ember/no-runloop */\nimport Notification from './notification';\nimport Timer from './timer';\nimport { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { getConfigOption } from './get-config';\nimport { getOwner } from '@ember/owner';\nimport { isDestroyed } from '@ember/destroyable';\nimport { later } from '@ember/runloop';\nimport type Owner from '@ember/owner';\nimport type { DefaultConfig } from './types';\nimport type { NotificationOptions } from './types';\n\nexport default class NotificationsManager {\n @tracked notifications: Notification[] = [];\n\n config: DefaultConfig = {};\n\n constructor(context: object) {\n if (isDestroyed(context)) {\n return;\n }\n const owner = getOwner(context) as Owner;\n assert('NotificationsManager context must have an owner', owner);\n const configFactory = owner.factoryFor('config:environment');\n\n if (configFactory && configFactory.class) {\n this.config =\n (configFactory.class as never)['@frontile/notifications'] || {};\n }\n }\n\n add(message: string, options: NotificationOptions = {}): Notification {\n const notification = new Notification(this.config, message, options);\n this.notifications = [...this.notifications, notification];\n\n let preserve =\n typeof options.preserve === 'undefined'\n ? getConfigOption(this.config, 'preserve', false)\n : options.preserve;\n\n // if default config has set skipTimer to true, we will preserve the\n // notification, therefore skiping the timer\n if (getConfigOption(this.config, 'skipTimer', false) === true) {\n preserve = true;\n }\n\n if (preserve === false) {\n this.setupAutoRemoval(notification, notification.duration);\n }\n return notification;\n }\n\n remove(notification?: Notification): void {\n if (!notification) {\n return;\n }\n\n notification.remove();\n\n later(\n this,\n () => {\n this.notifications = this.notifications.filter((n) => {\n return n !== notification;\n });\n },\n notification.transitionDuration\n );\n }\n\n removeAll(): void {\n this.notifications.forEach((notification) => {\n this.remove(notification);\n });\n }\n\n private setupAutoRemoval(notification: Notification, duration: number): void {\n notification.timer = new Timer(duration, () => {\n this.remove(notification);\n });\n }\n}\n"],"names":["Timer","g","prototype","tracked","i","void 0","onFinish","timer","start","constructor","duration","remaining","setup","clear","isRunning","cancel","n","action","pause","Date","now","resume","later","getConfigOption","config","key","defaultValue","value","get","undefined","Notification","message","transitionDuration","appearance","customActions","allowClosing","options","remove","isRemoving","NotificationsManager","context","isDestroyed","owner","getOwner","assert","configFactory","factoryFor","class","add","notification","notifications","preserve","setupAutoRemoval","filter","removeAll","forEach"],"mappings":";;;;;;;;AAAA;AAMe,MAAMA,KAAK,CAAC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,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EACDA,YAAY,CAACjB,kBACf,CAAC;AACH;AAEAsB,EAAAA,SAASA,GAAS;AAChB,IAAA,IAAI,CAACJ,aAAa,CAACK,OAAO,CAAEN,YAAY,IAAK;AAC3C,MAAA,IAAI,CAACZ,MAAM,CAACY,YAAY,CAAC;AAC3B,KAAC,CAAC;AACJ;AAEQG,EAAAA,gBAAgBA,CAACH,YAA0B,EAAEvC,QAAgB,EAAQ;IAC3EuC,YAAY,CAAC1C,KAAK,GAAG,IAAIP,KAAK,CAACU,QAAQ,EAAE,MAAM;AAC7C,MAAA,IAAI,CAAC2B,MAAM,CAACY,YAAY,CAAC;AAC3B,KAAC,CAAC;AACJ;AACF;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const deferred = /* @__PURE__ */new WeakMap();
|
|
2
|
+
function deferDecorator(proto, prop, desc) {
|
|
3
|
+
let map = deferred.get(proto);
|
|
4
|
+
if (!map) {
|
|
5
|
+
map = /* @__PURE__ */new Map();
|
|
6
|
+
deferred.set(proto, map);
|
|
7
|
+
}
|
|
8
|
+
map.set(prop, desc);
|
|
9
|
+
}
|
|
10
|
+
function findDeferredDecorator(target, prop) {
|
|
11
|
+
var _a;
|
|
12
|
+
let cursor = target.prototype;
|
|
13
|
+
while (cursor) {
|
|
14
|
+
let desc = (_a = deferred.get(cursor)) == null ? undefined : _a.get(prop);
|
|
15
|
+
if (desc) {
|
|
16
|
+
return desc;
|
|
17
|
+
}
|
|
18
|
+
cursor = cursor.prototype;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function decorateFieldV2(prototype, prop, decorators, initializer) {
|
|
22
|
+
let desc = {
|
|
23
|
+
configurable: true,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
initializer: null
|
|
27
|
+
};
|
|
28
|
+
if (initializer) {
|
|
29
|
+
desc.initializer = initializer;
|
|
30
|
+
}
|
|
31
|
+
for (let decorator of decorators) {
|
|
32
|
+
desc = decorator(prototype, prop, desc) || desc;
|
|
33
|
+
}
|
|
34
|
+
if (desc.initializer === undefined) {
|
|
35
|
+
Object.defineProperty(prototype, prop, desc);
|
|
36
|
+
} else {
|
|
37
|
+
deferDecorator(prototype, prop, desc);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function decorateMethodV2(prototype, prop, decorators) {
|
|
41
|
+
const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
|
|
42
|
+
let desc = {
|
|
43
|
+
...origDesc
|
|
44
|
+
};
|
|
45
|
+
for (let decorator of decorators) {
|
|
46
|
+
desc = decorator(prototype, prop, desc) || desc;
|
|
47
|
+
}
|
|
48
|
+
if (desc.initializer !== undefined) {
|
|
49
|
+
desc.value = desc.initializer ? desc.initializer.call(prototype) : undefined;
|
|
50
|
+
desc.initializer = undefined;
|
|
51
|
+
}
|
|
52
|
+
Object.defineProperty(prototype, prop, desc);
|
|
53
|
+
}
|
|
54
|
+
function initializeDeferredDecorator(target, prop) {
|
|
55
|
+
let desc = findDeferredDecorator(target.constructor, prop);
|
|
56
|
+
if (desc) {
|
|
57
|
+
Object.defineProperty(target, prop, {
|
|
58
|
+
enumerable: desc.enumerable,
|
|
59
|
+
configurable: desc.configurable,
|
|
60
|
+
writable: desc.writable,
|
|
61
|
+
value: desc.initializer ? desc.initializer.call(target) : undefined
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { decorateMethodV2 as a, decorateFieldV2 as d, initializeDeferredDecorator as i };
|
|
67
|
+
//# sourceMappingURL=runtime-BPCpkOf1-DV8zmEr2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-BPCpkOf1-DV8zmEr2.js","sources":["../../../node_modules/.pnpm/decorator-transforms@2.3.0_@babel+core@7.26.7/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js"],"sourcesContent":["const deferred = /* @__PURE__ */ new WeakMap();\nfunction deferDecorator(proto, prop, desc) {\n let map = deferred.get(proto);\n if (!map) {\n map = /* @__PURE__ */ new Map();\n deferred.set(proto, map);\n }\n map.set(prop, desc);\n}\nfunction findDeferredDecorator(target, prop) {\n var _a;\n let cursor = target.prototype;\n while (cursor) {\n let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);\n if (desc) {\n return desc;\n }\n cursor = cursor.prototype;\n }\n}\nfunction decorateFieldV1(target, prop, decorators, initializer) {\n return decorateFieldV2(target.prototype, prop, decorators, initializer);\n}\nfunction decorateFieldV2(prototype, prop, decorators, initializer) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n };\n if (initializer) {\n desc.initializer = initializer;\n }\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(prototype, prop, desc);\n } else {\n deferDecorator(prototype, prop, desc);\n }\n}\nfunction decorateMethodV1({ prototype }, prop, decorators) {\n return decorateMethodV2(prototype, prop, decorators);\n}\nfunction decorateMethodV2(prototype, prop, decorators) {\n const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n let desc = { ...origDesc };\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;\n desc.initializer = void 0;\n }\n Object.defineProperty(prototype, prop, desc);\n}\nfunction initializeDeferredDecorator(target, prop) {\n let desc = findDeferredDecorator(target.constructor, prop);\n if (desc) {\n Object.defineProperty(target, prop, {\n enumerable: desc.enumerable,\n configurable: desc.configurable,\n writable: desc.writable,\n value: desc.initializer ? desc.initializer.call(target) : void 0\n });\n }\n}\nfunction decorateClass(target, decorators) {\n return decorators.reduce(\n (accum, decorator) => decorator(accum) || accum,\n target\n );\n}\nfunction decoratePOJO(pojo, decorated) {\n for (let [type, prop, decorators] of decorated) {\n if (type === \"field\") {\n decoratePojoField(pojo, prop, decorators);\n } else {\n decorateMethodV2(pojo, prop, decorators);\n }\n }\n return pojo;\n}\nfunction decoratePojoField(pojo, prop, decorators) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: () => {\n var _a;\n return (_a = Object.getOwnPropertyDescriptor(pojo, prop)) == null ? void 0 : _a.value;\n }\n };\n for (let decorator of decorators) {\n desc = decorator(pojo, prop, desc) || desc;\n }\n if (desc.initializer) {\n desc.value = desc.initializer.call(pojo);\n delete desc.initializer;\n }\n Object.defineProperty(pojo, prop, desc);\n}\nconst runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n c: decorateClass,\n f: decorateFieldV1,\n g: decorateFieldV2,\n i: initializeDeferredDecorator,\n m: decorateMethodV1,\n n: decorateMethodV2,\n p: decoratePOJO\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n decorateFieldV2 as a,\n decorateMethodV1 as b,\n decorateMethodV2 as c,\n decorateFieldV1 as d,\n decorateClass as e,\n decoratePOJO as f,\n initializeDeferredDecorator as i,\n runtime as r\n};\n//# sourceMappingURL=runtime-BPCpkOf1.js.map\n"],"names":["deferred","WeakMap","deferDecorator","proto","prop","desc","map","get","Map","set","findDeferredDecorator","target","_a","cursor","prototype","decorateFieldV2","decorators","initializer","configurable","enumerable","writable","decorator","Object","defineProperty","decorateMethodV2","origDesc","getOwnPropertyDescriptor","value","call","initializeDeferredDecorator","constructor"],"mappings":"AAuBA,MAAMA,QAAA,sBAGEC,OAAA,EAAA;AAER,SAASC,eACPC,KAAA,EACAC,IAAA,EACAC,IAAA,EACM;AACF,EAAA,IAAAC,GAAA,GAAMN,QAAA,CAASO,GAAA,CAAIJ,KAAK,CAAA;EAC5B,IAAI,CAACG,GAAA,EAAK;AACRA,IAAAA,GAAA,sBAAUE,GAAA,EAAA;AACDR,IAAAA,QAAA,CAAAS,GAAA,CAAIN,KAAA,EAAOG,GAAG,CAAA;AACzB;AACIA,EAAAA,GAAA,CAAAG,GAAA,CAAIL,IAAA,EAAMC,IAAI,CAAA;AACp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AAWV,IAAI,CAAA;AAC5D,EAAA,IAAAC,IAAA,GAAmB;IAAE,GAAGoB;AAAA,GAAA;EAC5B,KAASJ,IAAAA,SAAA,IAAaL,UAAA,EAAY;IAChCX,IAAA,GAAOgB,SAAA,CAAUP,SAAA,EAAWV,IAAA,EAAMC,IAAI,CAAA,IAAKA,IAAA;AAC7C;AACI,EAAA,IAAAA,IAAA,CAAKY,WAAA,KAAgB,SAAW,EAAA;AAClCZ,IAAAA,IAAA,CAAKsB,KAAA,GAAQtB,IAAA,CAAKY,WAAA,GAAcZ,IAAA,CAAKY,WAAA,CAAYW,IAAA,CAAKd,SAAS,CAAI,GAAA,SAAA;IACnET,IAAA,CAAKY,WAAA,GAAc,SAAA;AACrB;AACOK,EAAAA,MAAA,CAAAC,cAAA,CAAeT,SAAA,EAAWV,IAAA,EAAMC,IAAI,CAAA;AAC7C;AAEA,SAASwB,2BACPlB,CAAAA,MAAA,EACAP,IAAA,EACM;EACN,IAAIC,IAAA,GAAOK,qBAAA,CAAsBC,MAAA,CAAOmB,WAAA,EAAa1B,IAAI,CAAA;AACzD,EAAA,IAAIC,IAAA,EAAM;AACDiB,IAAAA,MAAA,CAAAC,cAAA,CAAeZ,MAAA,EAAQP,IAAA,EAAM;MAClCe,UAAA,EAAYd,IAAA,CAAKc,UAAA;MACjBD,YAAA,EAAcb,IAAA,CAAKa,YAAA;MACnBE,QAAA,EAAUf,IAAA,CAAKe,QAAA;AACfO,MAAAA,KAAA,EAAOtB,IAAA,CAAKY,WAAA,GAAcZ,IAAA,CAAKY,WAAA,CAAYW,IAAA,CAAKjB,MAAM,CAAI,GAAA;KAC3D,CAAA;AACH;AACF;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import Service from '@ember/service';
|
|
3
|
-
import { a as NotificationsManager } from '../manager-
|
|
2
|
+
import { a as NotificationsManager } from '../manager-i6QWzaob.js';
|
|
4
3
|
|
|
5
4
|
class NotificationsService extends Service {
|
|
6
|
-
|
|
7
|
-
super(...args);
|
|
8
|
-
_defineProperty(this, "manager", new NotificationsManager());
|
|
9
|
-
_defineProperty(this, "add", (message, options) => {
|
|
10
|
-
return this.manager.add(message, options);
|
|
11
|
-
});
|
|
12
|
-
_defineProperty(this, "remove", notification => {
|
|
13
|
-
this.manager.remove(notification);
|
|
14
|
-
});
|
|
15
|
-
_defineProperty(this, "removeAll", () => {
|
|
16
|
-
this.manager.removeAll();
|
|
17
|
-
});
|
|
18
|
-
}
|
|
5
|
+
manager = new NotificationsManager(this);
|
|
19
6
|
get notifications() {
|
|
20
7
|
return this.manager.notifications;
|
|
21
8
|
}
|
|
9
|
+
add = (message, options) => {
|
|
10
|
+
return this.manager.add(message, options);
|
|
11
|
+
};
|
|
12
|
+
remove = notification => {
|
|
13
|
+
this.manager.remove(notification);
|
|
14
|
+
};
|
|
15
|
+
removeAll = () => {
|
|
16
|
+
this.manager.removeAll();
|
|
17
|
+
};
|
|
22
18
|
willDestroy() {
|
|
23
19
|
this.removeAll();
|
|
24
20
|
super.willDestroy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sources":["../../src/services/notifications.ts"],"sourcesContent":["import Service from '@ember/service';\nimport Notification from '../-private/notification';\nimport NotificationsManager from '../-private/manager';\nimport type { NotificationOptions } from '../-private/types';\n\nexport default class NotificationsService extends Service {\n manager = new NotificationsManager();\n\n get notifications(): Notification[] {\n return this.manager.notifications;\n }\n\n add = (message: string, options?: NotificationOptions): Notification => {\n return this.manager.add(message, options);\n };\n\n remove = (notification?: Notification): void => {\n this.manager.remove(notification);\n };\n\n removeAll = (): void => {\n this.manager.removeAll();\n };\n\n willDestroy(): void {\n this.removeAll();\n super.willDestroy();\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your services.\ndeclare module '@ember/service' {\n interface Registry {\n notifications: NotificationsService;\n }\n}\n"],"names":["NotificationsService","Service","
|
|
1
|
+
{"version":3,"file":"notifications.js","sources":["../../src/services/notifications.ts"],"sourcesContent":["import Service from '@ember/service';\nimport Notification from '../-private/notification';\nimport NotificationsManager from '../-private/manager';\nimport type { NotificationOptions } from '../-private/types';\n\nexport default class NotificationsService extends Service {\n manager = new NotificationsManager(this);\n\n get notifications(): Notification[] {\n return this.manager.notifications;\n }\n\n add = (message: string, options?: NotificationOptions): Notification => {\n return this.manager.add(message, options);\n };\n\n remove = (notification?: Notification): void => {\n this.manager.remove(notification);\n };\n\n removeAll = (): void => {\n this.manager.removeAll();\n };\n\n willDestroy(): void {\n this.removeAll();\n super.willDestroy();\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your services.\ndeclare module '@ember/service' {\n interface Registry {\n notifications: NotificationsService;\n }\n}\n"],"names":["NotificationsService","Service","manager","NotificationsManager","notifications","add","message","options","remove","notification","removeAll","willDestroy"],"mappings":";;;AAKe,MAAMA,oBAAoB,SAASC,OAAO,CAAC;AACxDC,EAAAA,OAAO,GAAG,IAAIC,oBAAoB,CAAC,IAAI,CAAC;EAExC,IAAIC,aAAaA,GAAmB;AAClC,IAAA,OAAO,IAAI,CAACF,OAAO,CAACE,aAAa;AACnC;AAEAC,EAAAA,GAAG,GAAGA,CAACC,OAAe,EAAEC,OAA6B,KAAmB;IACtE,OAAO,IAAI,CAACL,OAAO,CAACG,GAAG,CAACC,OAAO,EAAEC,OAAO,CAAC;GAC1C;EAEDC,MAAM,GAAIC,YAA2B,IAAW;AAC9C,IAAA,IAAI,CAACP,OAAO,CAACM,MAAM,CAACC,YAAY,CAAC;GAClC;EAEDC,SAAS,GAAGA,MAAY;AACtB,IAAA,IAAI,CAACR,OAAO,CAACQ,SAAS,EAAE;GACzB;AAEDC,EAAAA,WAAWA,GAAS;IAClB,IAAI,CAACD,SAAS,EAAE;IAChB,KAAK,CAACC,WAAW,EAAE;AACrB;AACF;;AAEA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontile/notifications",
|
|
3
|
-
"version": "0.17.0-beta.
|
|
3
|
+
"version": "0.17.0-beta.10",
|
|
4
4
|
"description": "Component Library for Ember Octane apps: Notifications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -9,6 +9,24 @@
|
|
|
9
9
|
"repository": "https://github.com/josemarluedke/frontile",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./declarations/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./*": {
|
|
18
|
+
"types": "./declarations/*.d.ts",
|
|
19
|
+
"default": "./dist/*.js"
|
|
20
|
+
},
|
|
21
|
+
"./addon-main.js": "./addon-main.js"
|
|
22
|
+
},
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
"*": [
|
|
26
|
+
"declarations/*"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
12
30
|
"directories": {
|
|
13
31
|
"doc": "doc",
|
|
14
32
|
"test": "tests"
|
|
@@ -19,57 +37,53 @@
|
|
|
19
37
|
"dist"
|
|
20
38
|
],
|
|
21
39
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"build:js": "rollup --config",
|
|
24
|
-
"build:types": "glint --declaration",
|
|
40
|
+
"build": "rollup --config",
|
|
25
41
|
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
|
|
26
42
|
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
|
|
27
43
|
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
|
|
28
|
-
"lint:js": "eslint . --cache",
|
|
29
44
|
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
|
|
45
|
+
"lint:js": "eslint . --cache",
|
|
30
46
|
"lint:js:fix": "eslint . --fix",
|
|
31
47
|
"lint:types": "glint",
|
|
48
|
+
"prepack": "concurrently 'npm:build'",
|
|
32
49
|
"start": "concurrently 'npm:start:*'",
|
|
33
50
|
"start:js": "rollup --config --watch --no-watch.clearScreen",
|
|
34
51
|
"start:types": "glint -d --watch",
|
|
35
|
-
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
|
|
36
|
-
"prepack": "concurrently 'npm:build'"
|
|
37
|
-
},
|
|
38
|
-
"peerDependencies": {
|
|
39
|
-
"@babel/runtime": ">= 7",
|
|
40
|
-
"ember-source": ">= 4.12.0"
|
|
52
|
+
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
|
|
41
53
|
},
|
|
42
54
|
"dependencies": {
|
|
43
|
-
"@ember/render-modifiers": "^2.1.0",
|
|
44
55
|
"@embroider/addon-shim": "^1.9.0",
|
|
45
|
-
"@frontile/buttons": "0.17.0-beta.
|
|
46
|
-
"@frontile/theme": "0.17.0-beta.
|
|
56
|
+
"@frontile/buttons": "0.17.0-beta.10",
|
|
57
|
+
"@frontile/theme": "0.17.0-beta.10",
|
|
47
58
|
"ember-auto-import": "^2.7.2",
|
|
48
59
|
"ember-css-transitions": "^4.4.0",
|
|
49
|
-
"ember-
|
|
60
|
+
"ember-modifier": "^4.1.0"
|
|
50
61
|
},
|
|
51
62
|
"devDependencies": {
|
|
52
|
-
"@babel/core": "7.26.
|
|
53
|
-
"@babel/plugin-
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@babel/preset-typescript": "7.26.0",
|
|
57
|
-
"@embroider/addon-dev": "7.0.0",
|
|
58
|
-
"@glimmer/component": "^1.1.2",
|
|
63
|
+
"@babel/core": "7.26.7",
|
|
64
|
+
"@babel/plugin-transform-typescript": "^7.26.7",
|
|
65
|
+
"@embroider/addon-dev": "7.1.1",
|
|
66
|
+
"@glimmer/component": "^2.0.0",
|
|
59
67
|
"@glimmer/tracking": "^1.1.2",
|
|
60
|
-
"@glint/core": "1.5.
|
|
61
|
-
"@glint/environment-ember-loose": "1.5.
|
|
62
|
-
"@glint/environment-ember-template-imports": "1.5.
|
|
63
|
-
"@glint/template": "1.5.
|
|
64
|
-
"@rollup/plugin-
|
|
65
|
-
"@
|
|
68
|
+
"@glint/core": "1.5.2",
|
|
69
|
+
"@glint/environment-ember-loose": "1.5.2",
|
|
70
|
+
"@glint/environment-ember-template-imports": "1.5.2",
|
|
71
|
+
"@glint/template": "1.5.2",
|
|
72
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
73
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
74
|
+
"@tsconfig/ember": "^3.0.9",
|
|
66
75
|
"babel-plugin-ember-template-compilation": "^2.2.1",
|
|
67
76
|
"concurrently": "^9.1.0",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"rollup
|
|
71
|
-
"
|
|
72
|
-
"
|
|
77
|
+
"decorator-transforms": "^2.3.0",
|
|
78
|
+
"ember-source": "^6.1.0",
|
|
79
|
+
"rollup": "^4.29.1",
|
|
80
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
81
|
+
"tailwindcss": "^3.4.17",
|
|
82
|
+
"typescript": "^5.7.3"
|
|
83
|
+
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"@babel/runtime": ">= 7",
|
|
86
|
+
"ember-source": ">= 4.12.0"
|
|
73
87
|
},
|
|
74
88
|
"engines": {
|
|
75
89
|
"node": "10.* || >= 12"
|
|
@@ -90,23 +104,5 @@
|
|
|
90
104
|
"./services/notifications.js": "./dist/_app_/services/notifications.js"
|
|
91
105
|
}
|
|
92
106
|
},
|
|
93
|
-
"
|
|
94
|
-
".": {
|
|
95
|
-
"types": "./declarations/index.d.ts",
|
|
96
|
-
"default": "./dist/index.js"
|
|
97
|
-
},
|
|
98
|
-
"./*": {
|
|
99
|
-
"types": "./declarations/*.d.ts",
|
|
100
|
-
"default": "./dist/*.js"
|
|
101
|
-
},
|
|
102
|
-
"./addon-main.js": "./addon-main.js"
|
|
103
|
-
},
|
|
104
|
-
"typesVersions": {
|
|
105
|
-
"*": {
|
|
106
|
-
"*": [
|
|
107
|
-
"declarations/*"
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"gitHead": "74ced40974f3f509f12bc90eb28bf258557c0637"
|
|
107
|
+
"gitHead": "c705a46293b2be6e0eb96873df5d5d0e60e914c7"
|
|
112
108
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DefaultConfig } from "./types-16c08671.js";
|
|
2
|
-
declare function getConfigOption<T extends keyof DefaultConfig>(key: T, defaultValue: NonNullable<DefaultConfig[T]>): NonNullable<DefaultConfig[T]>;
|
|
3
|
-
export { getConfigOption };
|
|
4
|
-
//# sourceMappingURL=get-config-a59d13fc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-config-a59d13fc.d.ts","sourceRoot":"","sources":["../src/-private/get-config.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAsB,4BAAgB;AAE7C,iBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,aAAa,EAC3D,GAAG,EAAE,CAAC,EACN,YAAY,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAC1C,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAW/B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Notification from "./notification-64b501e5.js";
|
|
2
|
-
import { NotificationOptions } from "./types-16c08671.js";
|
|
3
|
-
declare class NotificationsManager {
|
|
4
|
-
notifications: Notification[];
|
|
5
|
-
add(message: string, options?: NotificationOptions): Notification;
|
|
6
|
-
remove(notification?: Notification): void;
|
|
7
|
-
removeAll(): void;
|
|
8
|
-
private setupAutoRemoval;
|
|
9
|
-
}
|
|
10
|
-
export { NotificationsManager as default };
|
|
11
|
-
//# sourceMappingURL=manager-IxquV5I2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manager-IxquV5I2.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAK1C,OAAO,uBAA4B,4BAAgB;AAEnD,cAAqB,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY;IAqBrE,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAkBzC,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,gBAAgB;CAKzB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Timer from "./timer-0a840cef.js";
|
|
2
|
-
import { NotificationOptions, CustomAction } from "./types-16c08671.js";
|
|
3
|
-
declare class Notification {
|
|
4
|
-
readonly message: string;
|
|
5
|
-
readonly transitionDuration: number;
|
|
6
|
-
readonly appearance: NonNullable<NotificationOptions['appearance']>;
|
|
7
|
-
readonly customActions?: CustomAction[];
|
|
8
|
-
readonly allowClosing: boolean;
|
|
9
|
-
readonly duration: number;
|
|
10
|
-
timer?: Timer;
|
|
11
|
-
isRemoving: boolean;
|
|
12
|
-
constructor(message: string, options?: NotificationOptions);
|
|
13
|
-
remove(): void;
|
|
14
|
-
}
|
|
15
|
-
export { Notification as default };
|
|
16
|
-
//# sourceMappingURL=notification-64b501e5.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-64b501e5.d.ts","sourceRoot":"","sources":["../src/-private/notification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,4BAAgB;AAE5B,OAAO,qCAA0C,4BAAgB;AAEjE,cAAqB,YAAY;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,UAAS;gBAEhB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;IAkB9D,MAAM,IAAI,IAAI;CAOf"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare class Timer {
|
|
2
|
-
remaining: number;
|
|
3
|
-
isRunning: boolean;
|
|
4
|
-
readonly onFinish: () => void;
|
|
5
|
-
private timer?;
|
|
6
|
-
private start;
|
|
7
|
-
constructor(duration: number, onFinish: () => void);
|
|
8
|
-
clear(): void;
|
|
9
|
-
pause(): void;
|
|
10
|
-
resume(): void;
|
|
11
|
-
private setup;
|
|
12
|
-
}
|
|
13
|
-
export { Timer as default };
|
|
14
|
-
//# sourceMappingURL=timer-0a840cef.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timer-0a840cef.d.ts","sourceRoot":"","sources":["../src/-private/timer.ts"],"names":[],"mappings":"AAMA,cAAqB,KAAK;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,UAAQ;IAE1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAU;gBAEX,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI;IAM1C,KAAK,IAAI,IAAI;IAQb,KAAK,IAAI,IAAI;IAKb,MAAM,IAAI,IAAI;IAKtB,OAAO,CAAC,KAAK;CAad"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
type containerPlacement = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
2
|
-
interface CustomAction {
|
|
3
|
-
/**
|
|
4
|
-
* The label of the action
|
|
5
|
-
*/
|
|
6
|
-
label: string;
|
|
7
|
-
/**
|
|
8
|
-
* The function to be called when clicked
|
|
9
|
-
*/
|
|
10
|
-
onClick: () => void;
|
|
11
|
-
}
|
|
12
|
-
interface NotificationOptions {
|
|
13
|
-
/**
|
|
14
|
-
* If set to false, the close button will not be displayed.
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue true
|
|
17
|
-
*/
|
|
18
|
-
allowClosing?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Preserve the notification open, no auto-dismiss.
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue false
|
|
23
|
-
*/
|
|
24
|
-
preserve?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Duration before the notification is auto-dismissed, in milliseconds.
|
|
27
|
-
*
|
|
28
|
-
* @defaultValue 5000
|
|
29
|
-
*/
|
|
30
|
-
duration?: number;
|
|
31
|
-
transitionDuration?: number;
|
|
32
|
-
/**
|
|
33
|
-
* The appearance of the notification
|
|
34
|
-
*
|
|
35
|
-
* @defaultValue 'info'
|
|
36
|
-
*/
|
|
37
|
-
appearance?: 'info' | 'success' | 'warning' | 'error';
|
|
38
|
-
/**
|
|
39
|
-
* A list of custom actions
|
|
40
|
-
*
|
|
41
|
-
* @defaultValue undefined
|
|
42
|
-
*/
|
|
43
|
-
customActions?: CustomAction[];
|
|
44
|
-
}
|
|
45
|
-
interface DefaultConfig extends NotificationOptions {
|
|
46
|
-
/**
|
|
47
|
-
* If set to true, we will preserve the notification, therefore skiping the timer.
|
|
48
|
-
* This is useful in tests because Ember will wait for any runloop to
|
|
49
|
-
* finish before proceeding.
|
|
50
|
-
*
|
|
51
|
-
* @defaultValue false
|
|
52
|
-
*/
|
|
53
|
-
skipTimer?: boolean;
|
|
54
|
-
}
|
|
55
|
-
export { containerPlacement, CustomAction, NotificationOptions, DefaultConfig };
|
|
56
|
-
//# sourceMappingURL=types-16c08671.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-16c08671.d.ts","sourceRoot":"","sources":["../src/-private/types.ts"],"names":[],"mappings":"AAAA,KAAY,kBAAkB,GAC1B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,UAAiB,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAiB,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAEtD;;;;OAIG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,UAAiB,aAAc,SAAQ,mBAAmB;IACxD;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/dist/manager-IxquV5I2.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
|
|
4
|
-
import '@babel/runtime/helpers/esm/initializerWarningHelper';
|
|
5
|
-
import { tracked } from '@glimmer/tracking';
|
|
6
|
-
import { cancel, later } from '@ember/runloop';
|
|
7
|
-
import { action, get } from '@ember/object';
|
|
8
|
-
import config from 'ember-get-config';
|
|
9
|
-
|
|
10
|
-
var _class$2, _descriptor$2, _descriptor2$1;
|
|
11
|
-
let Timer = (_class$2 = class Timer {
|
|
12
|
-
constructor(duration, onFinish) {
|
|
13
|
-
_initializerDefineProperty(this, "remaining", _descriptor$2, this);
|
|
14
|
-
_initializerDefineProperty(this, "isRunning", _descriptor2$1, this);
|
|
15
|
-
_defineProperty(this, "onFinish", void 0);
|
|
16
|
-
_defineProperty(this, "timer", void 0);
|
|
17
|
-
_defineProperty(this, "start", void 0);
|
|
18
|
-
this.remaining = duration;
|
|
19
|
-
this.onFinish = onFinish;
|
|
20
|
-
this.setup();
|
|
21
|
-
}
|
|
22
|
-
clear() {
|
|
23
|
-
this.isRunning = false;
|
|
24
|
-
if (this.timer) {
|
|
25
|
-
cancel(this.timer);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
pause() {
|
|
29
|
-
this.clear();
|
|
30
|
-
this.remaining -= Date.now() - this.start;
|
|
31
|
-
}
|
|
32
|
-
resume() {
|
|
33
|
-
this.clear();
|
|
34
|
-
this.setup();
|
|
35
|
-
}
|
|
36
|
-
setup() {
|
|
37
|
-
this.start = Date.now();
|
|
38
|
-
this.isRunning = true;
|
|
39
|
-
this.timer = later(this, () => {
|
|
40
|
-
this.onFinish();
|
|
41
|
-
this.isRunning = false;
|
|
42
|
-
}, this.remaining);
|
|
43
|
-
}
|
|
44
|
-
}, _descriptor$2 = _applyDecoratedDescriptor(_class$2.prototype, "remaining", [tracked], {
|
|
45
|
-
configurable: true,
|
|
46
|
-
enumerable: true,
|
|
47
|
-
writable: true,
|
|
48
|
-
initializer: null
|
|
49
|
-
}), _descriptor2$1 = _applyDecoratedDescriptor(_class$2.prototype, "isRunning", [tracked], {
|
|
50
|
-
configurable: true,
|
|
51
|
-
enumerable: true,
|
|
52
|
-
writable: true,
|
|
53
|
-
initializer: function () {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
}), _applyDecoratedDescriptor(_class$2.prototype, "clear", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "clear"), _class$2.prototype), _applyDecoratedDescriptor(_class$2.prototype, "pause", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "pause"), _class$2.prototype), _applyDecoratedDescriptor(_class$2.prototype, "resume", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "resume"), _class$2.prototype), _class$2);
|
|
57
|
-
|
|
58
|
-
function getConfigOption(key, defaultValue) {
|
|
59
|
-
const value = get(config['@frontile/notifications'] || {}, key);
|
|
60
|
-
if (value === undefined) {
|
|
61
|
-
return defaultValue;
|
|
62
|
-
}
|
|
63
|
-
return value;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var _class$1, _descriptor$1, _descriptor2;
|
|
67
|
-
let Notification = (_class$1 = class Notification {
|
|
68
|
-
constructor(message, options = {}) {
|
|
69
|
-
_defineProperty(this, "message", void 0);
|
|
70
|
-
_defineProperty(this, "transitionDuration", void 0);
|
|
71
|
-
_defineProperty(this, "appearance", void 0);
|
|
72
|
-
_defineProperty(this, "customActions", void 0);
|
|
73
|
-
_defineProperty(this, "allowClosing", void 0);
|
|
74
|
-
_defineProperty(this, "duration", void 0);
|
|
75
|
-
_initializerDefineProperty(this, "timer", _descriptor$1, this);
|
|
76
|
-
_initializerDefineProperty(this, "isRemoving", _descriptor2, this);
|
|
77
|
-
this.message = message;
|
|
78
|
-
this.appearance = options.appearance || getConfigOption('appearance', 'info');
|
|
79
|
-
this.customActions = options.customActions;
|
|
80
|
-
this.duration = options.duration || getConfigOption('duration', 5000);
|
|
81
|
-
this.transitionDuration = typeof options.transitionDuration !== 'undefined' ? options.transitionDuration : getConfigOption('transitionDuration', 200);
|
|
82
|
-
if (options.allowClosing === false) {
|
|
83
|
-
this.allowClosing = false;
|
|
84
|
-
} else {
|
|
85
|
-
this.allowClosing = true;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
remove() {
|
|
89
|
-
this.isRemoving = true;
|
|
90
|
-
if (this.timer) {
|
|
91
|
-
this.timer.clear();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}, _descriptor$1 = _applyDecoratedDescriptor(_class$1.prototype, "timer", [tracked], {
|
|
95
|
-
configurable: true,
|
|
96
|
-
enumerable: true,
|
|
97
|
-
writable: true,
|
|
98
|
-
initializer: null
|
|
99
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class$1.prototype, "isRemoving", [tracked], {
|
|
100
|
-
configurable: true,
|
|
101
|
-
enumerable: true,
|
|
102
|
-
writable: true,
|
|
103
|
-
initializer: function () {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
}), _class$1);
|
|
107
|
-
|
|
108
|
-
var _class, _descriptor;
|
|
109
|
-
let NotificationsManager = (_class = class NotificationsManager {
|
|
110
|
-
constructor() {
|
|
111
|
-
_initializerDefineProperty(this, "notifications", _descriptor, this);
|
|
112
|
-
}
|
|
113
|
-
add(message, options = {}) {
|
|
114
|
-
const notification = new Notification(message, options);
|
|
115
|
-
this.notifications = [...this.notifications, notification];
|
|
116
|
-
let preserve = typeof options.preserve === 'undefined' ? getConfigOption('preserve', false) : options.preserve;
|
|
117
|
-
|
|
118
|
-
// if default config has set skipTimer to true, we will preserve the
|
|
119
|
-
// notification, therefore skiping the timer
|
|
120
|
-
if (getConfigOption('skipTimer', false) === true) {
|
|
121
|
-
preserve = true;
|
|
122
|
-
}
|
|
123
|
-
if (preserve === false) {
|
|
124
|
-
this.setupAutoRemoval(notification, notification.duration);
|
|
125
|
-
}
|
|
126
|
-
return notification;
|
|
127
|
-
}
|
|
128
|
-
remove(notification) {
|
|
129
|
-
if (!notification) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
notification.remove();
|
|
133
|
-
later(this, () => {
|
|
134
|
-
this.notifications = this.notifications.filter(n => {
|
|
135
|
-
return n !== notification;
|
|
136
|
-
});
|
|
137
|
-
}, notification.transitionDuration);
|
|
138
|
-
}
|
|
139
|
-
removeAll() {
|
|
140
|
-
this.notifications.forEach(notification => {
|
|
141
|
-
this.remove(notification);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
setupAutoRemoval(notification, duration) {
|
|
145
|
-
notification.timer = new Timer(duration, () => {
|
|
146
|
-
this.remove(notification);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}, _descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [tracked], {
|
|
150
|
-
configurable: true,
|
|
151
|
-
enumerable: true,
|
|
152
|
-
writable: true,
|
|
153
|
-
initializer: function () {
|
|
154
|
-
return [];
|
|
155
|
-
}
|
|
156
|
-
}), _class);
|
|
157
|
-
|
|
158
|
-
export { Notification as N, Timer as T, NotificationsManager as a };
|
|
159
|
-
//# sourceMappingURL=manager-IxquV5I2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manager-IxquV5I2.js","sources":["../src/-private/timer.ts","../src/-private/get-config.ts","../src/-private/notification.ts","../src/-private/manager.ts"],"sourcesContent":["/* eslint-disable ember/no-runloop */\nimport { tracked } from '@glimmer/tracking';\nimport { later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { action } from '@ember/object';\n\nexport default class Timer {\n @tracked remaining: number;\n @tracked isRunning = true;\n\n readonly onFinish: () => void;\n private timer?: EmberTimer;\n private start!: number;\n\n constructor(duration: number, onFinish: () => void) {\n this.remaining = duration;\n this.onFinish = onFinish;\n this.setup();\n }\n\n @action clear(): void {\n this.isRunning = false;\n\n if (this.timer) {\n cancel(this.timer);\n }\n }\n\n @action pause(): void {\n this.clear();\n this.remaining -= Date.now() - this.start;\n }\n\n @action resume(): void {\n this.clear();\n this.setup();\n }\n\n private setup(): void {\n this.start = Date.now();\n this.isRunning = true;\n\n this.timer = later(\n this,\n () => {\n this.onFinish();\n this.isRunning = false;\n },\n this.remaining\n );\n }\n}\n","import config from 'ember-get-config';\nimport { get } from '@ember/object';\nimport type { DefaultConfig } from './types';\n\nexport function getConfigOption<T extends keyof DefaultConfig>(\n key: T,\n defaultValue: NonNullable<DefaultConfig[T]>\n): NonNullable<DefaultConfig[T]> {\n const value = get(\n config['@frontile/notifications'] || ({} as never),\n key as never\n );\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","import { tracked } from '@glimmer/tracking';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport type { NotificationOptions, CustomAction } from './types';\n\nexport default class Notification {\n readonly message: string;\n readonly transitionDuration: number;\n readonly appearance: NonNullable<NotificationOptions['appearance']>;\n readonly customActions?: CustomAction[];\n readonly allowClosing: boolean;\n readonly duration: number;\n\n @tracked timer?: Timer;\n @tracked isRemoving = false;\n\n constructor(message: string, options: NotificationOptions = {}) {\n this.message = message;\n this.appearance =\n options.appearance || getConfigOption('appearance', 'info');\n this.customActions = options.customActions;\n this.duration = options.duration || getConfigOption('duration', 5000);\n this.transitionDuration =\n typeof options.transitionDuration !== 'undefined'\n ? options.transitionDuration\n : getConfigOption('transitionDuration', 200);\n\n if (options.allowClosing === false) {\n this.allowClosing = false;\n } else {\n this.allowClosing = true;\n }\n }\n\n remove(): void {\n this.isRemoving = true;\n\n if (this.timer) {\n this.timer.clear();\n }\n }\n}\n","/* eslint-disable ember/no-runloop */\nimport Notification from './notification';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport { tracked } from '@glimmer/tracking';\nimport { later } from '@ember/runloop';\nimport type { NotificationOptions } from './types';\n\nexport default class NotificationsManager {\n @tracked notifications: Notification[] = [];\n\n add(message: string, options: NotificationOptions = {}): Notification {\n const notification = new Notification(message, options);\n this.notifications = [...this.notifications, notification];\n\n let preserve =\n typeof options.preserve === 'undefined'\n ? getConfigOption('preserve', false)\n : options.preserve;\n\n // if default config has set skipTimer to true, we will preserve the\n // notification, therefore skiping the timer\n if (getConfigOption('skipTimer', false) === true) {\n preserve = true;\n }\n\n if (preserve === false) {\n this.setupAutoRemoval(notification, notification.duration);\n }\n return notification;\n }\n\n remove(notification?: Notification): void {\n if (!notification) {\n return;\n }\n\n notification.remove();\n\n later(\n this,\n () => {\n this.notifications = this.notifications.filter((n) => {\n return n !== notification;\n });\n },\n notification.transitionDuration\n );\n }\n\n removeAll(): void {\n this.notifications.forEach((notification) => {\n this.remove(notification);\n });\n }\n\n private setupAutoRemoval(notification: Notification, duration: number): void {\n notification.timer = new Timer(duration, () => {\n this.remove(notification);\n });\n }\n}\n"],"names":["Timer","_class","constructor","duration","onFinish","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","remaining","setup","clear","isRunning","timer","cancel","pause","Date","now","start","resume","later","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","getConfigOption","key","defaultValue","value","get","config","undefined","Notification","message","options","appearance","customActions","transitionDuration","allowClosing","remove","isRemoving","NotificationsManager","add","notification","notifications","preserve","setupAutoRemoval","filter","n","removeAll","forEach"],"mappings":";;;;;;;;;;AAIuC,IAElBA,KAAK,IAAAC,QAAA,GAAX,MAAMD,KAAK,CAAC;AAQzBE,EAAAA,WAAWA,CAACC,QAAgB,EAAEC,QAAoB,EAAE;AAAAC,IAAAA,0BAAA,oBAAAC,aAAA,EAAA,IAAA,CAAA;AAAAD,IAAAA,0BAAA,oBAAAE,cAAA,EAAA,IAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;IAClD,IAAI,CAACC,SAAS,GAAGN,QAAQ;IACzB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACM,KAAK,EAAE;AACd;AAEQC,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACC,SAAS,GAAG,KAAK;IAEtB,IAAI,IAAI,CAACC,KAAK,EAAE;AACdC,MAAAA,MAAM,CAAC,IAAI,CAACD,KAAK,CAAC;AACpB;AACF;AAEQE,EAAAA,KAAKA,GAAS;IACp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