@frontile/notifications 0.17.0-alpha.0 → 0.17.0-alpha.11

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.
Files changed (29) hide show
  1. package/declarations/-private/manager.d.ts.map +1 -1
  2. package/declarations/-private/timer.d.ts.map +1 -1
  3. package/declarations/components/notification-card.d.ts +14 -13
  4. package/declarations/components/notification-card.d.ts.map +1 -1
  5. package/declarations/components/notifications-container.d.ts +22 -21
  6. package/declarations/components/notifications-container.d.ts.map +1 -1
  7. package/declarations/index.d.ts +4 -1
  8. package/declarations/index.d.ts.map +1 -1
  9. package/declarations/manager-Bfx-JQOm.d.ts +10 -0
  10. package/declarations/manager-DDspsX9L.d.ts +10 -0
  11. package/declarations/manager-PexDbR1y.d.ts +10 -0
  12. package/declarations/notification-64b501e5.d.ts +1 -1
  13. package/declarations/notifications-6S2s2xJm.d.ts +7 -7
  14. package/declarations/template-registry.d.ts +1 -2
  15. package/declarations/template-registry.d.ts.map +1 -1
  16. package/declarations/timer-0a840cef.d.ts +13 -0
  17. package/declarations/timer-dbe538e6.d.ts +10 -10
  18. package/dist/components/notification-card.js +5 -5
  19. package/dist/components/notification-card.js.map +1 -1
  20. package/dist/components/notifications-container.js +5 -5
  21. package/dist/components/notifications-container.js.map +1 -1
  22. package/dist/index.js +5 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/{notifications-02bGKw8W.js → manager-DDspsX9L.js} +3 -29
  25. package/dist/manager-DDspsX9L.js.map +1 -0
  26. package/dist/services/notifications.js +30 -3
  27. package/dist/services/notifications.js.map +1 -1
  28. package/package.json +20 -20
  29. package/dist/notifications-02bGKw8W.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/-private/manager.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAK1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,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
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAK1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,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 +1 @@
1
- {"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../src/-private/timer.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,OAAO,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
+ {"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../src/-private/timer.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,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"}
@@ -2,21 +2,20 @@ import Component from '@glimmer/component';
2
2
  import type NotificationsService from '../services/notifications';
3
3
  import type Notification from '../-private/notification';
4
4
  import type { CustomAction, containerPlacement } from '../-private/types';
5
- export interface NotificationCardArgs {
6
- notification: Notification;
7
- placement: containerPlacement;
8
- /**
9
- * Spacing for each notification, in px.
10
- *
11
- * @defaultValue 16
12
- */
13
- spacing?: number;
14
- }
15
- export interface NotificationCardSignature {
16
- Args: NotificationCardArgs;
5
+ interface NotificationCardSignature {
6
+ Args: {
7
+ notification: Notification;
8
+ placement: containerPlacement;
9
+ /**
10
+ * Spacing for each notification, in px.
11
+ *
12
+ * @defaultValue 16
13
+ */
14
+ spacing?: number;
15
+ };
17
16
  Element: HTMLDivElement;
18
17
  }
19
- export default class NotificationCard extends Component<NotificationCardSignature> {
18
+ declare class NotificationCard extends Component<NotificationCardSignature> {
20
19
  notifications: NotificationsService;
21
20
  hasEntered: boolean;
22
21
  get styles(): unknown;
@@ -35,4 +34,6 @@ export default class NotificationCard extends Component<NotificationCardSignatur
35
34
  closeButton: string;
36
35
  };
37
36
  }
37
+ export { NotificationCard, type NotificationCardSignature };
38
+ export default NotificationCard;
38
39
  //# sourceMappingURL=notification-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-card.d.ts","sourceRoot":"","sources":["../../src/components/notification-card.ts"],"names":[],"mappings":"AAAA,OAAO,SA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B,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;IAEO,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAMtC,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAyBxC,aAAa,CACnB,OAAO,EAAE,WAAW,EACpB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,GAC3B,IAAI;IAMC,MAAM,IAAI,IAAI;IAId,KAAK,IAAI,IAAI;IAMb,MAAM,IAAI,IAAI;IAMd,uBAAuB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAKjE,IAAI,OAAO;;;;;;MAeV;CA4DF;AAED,OAAO,EAAE,gBAAgB,EAAE,KAAK,yBAAyB,EAAE,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -2,33 +2,34 @@ import Component from '@glimmer/component';
2
2
  import type NotificationsService from '../services/notifications';
3
3
  import type Notification from '../-private/notification';
4
4
  import { type containerPlacement } from '../-private/types';
5
- export interface NotificationsContainerArgs {
6
- /**
7
- * The placement of the notifications
8
- *
9
- * @defaultValue 'bottom-right'
10
- */
11
- placement?: containerPlacement;
12
- /**
13
- * Spacing for each notification, in px.
14
- *
15
- * @defaultValue 16
16
- */
17
- spacing?: number;
18
- /**
19
- * Custom class name, it will override the default ones using Tailwind Merge library.
20
- */
21
- class?: string;
22
- }
23
- export interface NotificationsContainerSignature {
24
- Args: NotificationsContainerArgs;
5
+ interface NotificationsContainerSignature {
6
+ Args: {
7
+ /**
8
+ * The placement of the notifications
9
+ *
10
+ * @defaultValue 'bottom-right'
11
+ */
12
+ placement?: containerPlacement;
13
+ /**
14
+ * Spacing for each notification, in px.
15
+ *
16
+ * @defaultValue 16
17
+ */
18
+ spacing?: number;
19
+ /**
20
+ * Custom class name, it will override the default ones using Tailwind Merge library.
21
+ */
22
+ class?: string;
23
+ };
25
24
  Element: HTMLDivElement;
26
25
  }
27
- export default class NotificationsContainer extends Component<NotificationsContainerSignature> {
26
+ declare class NotificationsContainer extends Component<NotificationsContainerSignature> {
28
27
  notifications: NotificationsService;
29
28
  get isTopPlacement(): boolean;
30
29
  get sortedNotifications(): Notification[];
31
30
  get classes(): string;
32
31
  addSpacing(element: HTMLElement): void;
33
32
  }
33
+ export { NotificationsContainer, type NotificationsContainerSignature };
34
+ export default NotificationsContainer;
34
35
  //# sourceMappingURL=notifications-container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-container.d.ts","sourceRoot":"","sources":["../../src/components/notifications-container.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAS,CAAC,+BAA+B,CAAC;IACnF,aAAa,EAAG,oBAAoB,CAAC;IAE9C,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,IAAI,mBAAmB,IAAI,YAAY,EAAE,CAMxC;IAED,IAAI,OAAO,WAOV;IAEO,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;CAoC/C"}
1
+ {"version":3,"file":"notifications-container.d.ts","sourceRoot":"","sources":["../../src/components/notifications-container.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,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;IAEO,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;CAoC/C;AAED,OAAO,EAAE,sBAAsB,EAAE,KAAK,+BAA+B,EAAE,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
@@ -2,6 +2,9 @@ import Notification from './-private/notification';
2
2
  import Timer from './-private/timer';
3
3
  import NotificationsService from './services/notifications';
4
4
  import type { DefaultConfig, NotificationOptions, CustomAction } from './-private/types';
5
- export { Notification, Timer, NotificationsService };
5
+ export { Notification, Timer };
6
+ export type { NotificationsService };
6
7
  export type { NotificationOptions, DefaultConfig, CustomAction };
8
+ export * from './components/notification-card';
9
+ export * from './components/notifications-container';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,oBAAoB,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;AAErD,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,oBAAoB,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC/B,YAAY,EAAE,oBAAoB,EAAE,CAAC;AACrC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACjE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC"}
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,10 @@
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 };
@@ -1,4 +1,4 @@
1
- import Timer from "./timer-dbe538e6.js";
1
+ import Timer from "./timer-0a840cef.js";
2
2
  import { NotificationOptions, CustomAction } from "./types-16c08671.js";
3
3
  declare class Notification {
4
4
  readonly message: string;
@@ -1,10 +1,10 @@
1
- import Notification from "./notification-64b501e5.js";
2
- import { NotificationOptions } from "./types-16c08671.js";
1
+ import Notification from './notification-64b501e5.js';
2
+ import { NotificationOptions } from './types-16c08671.js';
3
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;
4
+ notifications: Notification[];
5
+ add(message: string, options?: NotificationOptions): Notification;
6
+ remove(notification?: Notification): void;
7
+ removeAll(): void;
8
+ private setupAutoRemoval;
9
9
  }
10
10
  export { NotificationsManager as default };
@@ -1,5 +1,4 @@
1
- import type NotificationCard from './components/notification-card';
2
- import type NotificationsContainer from './components/notifications-container';
1
+ import type { NotificationCard, NotificationsContainer } from './index';
3
2
  export default interface Registry {
4
3
  NotificationCard: typeof NotificationCard;
5
4
  NotificationsContainer: typeof NotificationsContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,sBAAsB,MAAM,sCAAsC,CAAC;AAE/E,MAAM,CAAC,OAAO,WAAW,QAAQ;IAC/B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;CACvD"}
1
+ {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAExE,MAAM,CAAC,OAAO,WAAW,QAAQ;IAC/B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;CACvD"}
@@ -0,0 +1,13 @@
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 };
@@ -1,13 +1,13 @@
1
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;
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
12
  }
13
13
  export { Timer as default };
@@ -12,14 +12,14 @@ import { on } from '@ember/modifier';
12
12
  import { concat, fn } from '@ember/helper';
13
13
  import didUpdate from '@ember/render-modifiers/modifiers/did-update';
14
14
  import didInsert from '@ember/render-modifiers/modifiers/did-insert';
15
- import CloseButton from '@frontile/core/components/close-button';
15
+ import { CloseButton } from '@frontile/buttons';
16
16
  import { cssTransition } from 'ember-css-transitions';
17
17
  import { useStyles } from '@frontile/theme';
18
18
  import { precompileTemplate } from '@ember/template-compilation';
19
19
  import { setComponentTemplate } from '@ember/component';
20
20
 
21
- var _class, _descriptor, _descriptor2, _class2;
22
- let NotificationCard = (_class = (_class2 = class NotificationCard extends Component {
21
+ var _class, _descriptor, _descriptor2, _NotificationCard;
22
+ let NotificationCard = (_class = (_NotificationCard = class NotificationCard extends Component {
23
23
  constructor(...args) {
24
24
  super(...args);
25
25
  _initializerDefineProperty(this, "notifications", _descriptor, this);
@@ -107,7 +107,7 @@ let NotificationCard = (_class = (_class2 = class NotificationCard extends Compo
107
107
  CloseButton
108
108
  }),
109
109
  strictMode: true
110
- }), _class2), _class2), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
110
+ }), _NotificationCard), _NotificationCard), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
111
111
  configurable: true,
112
112
  enumerable: true,
113
113
  writable: true,
@@ -121,5 +121,5 @@ let NotificationCard = (_class = (_class2 = class NotificationCard extends Compo
121
121
  }
122
122
  }), _applyDecoratedDescriptor(_class.prototype, "addSpacing", [action], Object.getOwnPropertyDescriptor(_class.prototype, "addSpacing"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "transitionIn", [action], Object.getOwnPropertyDescriptor(_class.prototype, "transitionIn"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "transitionOut", [action], Object.getOwnPropertyDescriptor(_class.prototype, "transitionOut"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "remove", [action], Object.getOwnPropertyDescriptor(_class.prototype, "remove"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "pause", [action], Object.getOwnPropertyDescriptor(_class.prototype, "pause"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "resume", [action], Object.getOwnPropertyDescriptor(_class.prototype, "resume"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleClickCustomAction", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleClickCustomAction"), _class.prototype)), _class);
123
123
 
124
- export { NotificationCard as default };
124
+ export { NotificationCard, NotificationCard as default };
125
125
  //# sourceMappingURL=notification-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-card.js","sources":["../../src/components/notification-card.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\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/core/components/close-button';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\nimport type NotificationsService from '../services/notifications';\nimport type Notification from '../-private/notification';\nimport type { CustomAction, containerPlacement } from '../-private/types';\nexport interface NotificationCardArgs {\n notification: Notification;\n placement: containerPlacement;\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */ spacing?: number;\n}\nexport interface NotificationCardSignature {\n Args: NotificationCardArgs;\n Element: HTMLDivElement;\n}\nexport default class NotificationCard extends Component<NotificationCardSignature> {\n @service\n notifications: NotificationsService;\n @tracked\n hasEntered = false;\n get styles(): unknown {\n const styles1 = [\n `transition-duration: ${this.args.notification.transitionDuration}ms`\n ];\n if (!this.hasEntered) {\n styles1.push(`transition-delay: ${this.args.notification.transitionDuration}ms`);\n }\n return htmlSafe(styles1.join('; '));\n }\n @action\n addSpacing(element1: HTMLElement): void {\n if (this.args.placement && this.args.placement.includes('top')) {\n element1.style.marginTop = `${this.args.spacing || 16}px`;\n }\n }\n @action\n transitionIn(element1: HTMLElement): void {\n const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n const expectedHeight1 = element1.offsetHeight + spacing1;\n const duration1 = this.args.notification.transitionDuration / 2;\n requestAnimationFrame(()=>{\n element1.style.height = '0';\n const transition1 = `height ${duration1}ms ease-in ${duration1}ms`;\n element1.style.transition = transition1;\n requestAnimationFrame(()=>{\n element1.style.height = `${expectedHeight1}px`;\n });\n });\n later(this, ()=>{\n this.hasEntered = true;\n }, this.args.notification.transitionDuration);\n }\n @action\n transitionOut(element1: HTMLElement, [isExiting1, ..._1]: boolean[]): void {\n if (isExiting1) {\n element1.style.height = '0';\n }\n }\n @action\n remove(): void {\n this.notifications.remove(this.args.notification);\n }\n @action\n pause(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.pause();\n }\n }\n @action\n resume(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.resume();\n }\n }\n @action\n handleClickCustomAction(customAction1: CustomAction): void {\n customAction1.onClick();\n this.remove();\n }\n get classes() {\n const { notificationCard: notificationCard1 } = useStyles();\n let { base: base1, message: message1, customActions: customActions1, customActionButton: customActionButton1, closeButton: closeButton1 } = notificationCard1({\n appearance: this.args.notification.appearance\n });\n return {\n base: base1(),\n message: message1(),\n customActions: customActions1(),\n customActionButton: customActionButton1(),\n closeButton: closeButton1()\n };\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["NotificationCard","_class","_class2","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","styles","styles1","notification","transitionDuration","hasEntered","push","htmlSafe","join","addSpacing","element1","placement","includes","style","marginTop","spacing","transitionIn","spacing1","expectedHeight1","offsetHeight","duration1","requestAnimationFrame","height","transition1","transition","later","transitionOut","isExiting1","_1","remove","notifications","pause","timer","resume","handleClickCustomAction","customAction1","onClick","classes","notificationCard","notificationCard1","useStyles","base","base1","message","message1","customActions","customActions1","customActionButton","customActionButton1","closeButton","closeButton1","appearance","setComponentTemplate","precompileTemplate","scope","didInsert","didUpdate","on","cssTransition","concat","fn","CloseButton","strictMode","_applyDecoratedDescriptor","prototype","service","configurable","enumerable","writable","initializer","tracked","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BqBA,IAAAA,gBAAgB,IAAAC,MAAA,IAAAC,OAAA,GAAtB,MAAMF,gBAAgB,SAASG,SAAS,CAA4B;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,wBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,qBAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;EAK/E,IAAIC,MAAMA,GAAY;AAClB,IAAA,MAAMC,OAAO,GAAG,CACX,CAAA,qBAAA,EAAuB,IAAI,CAACL,IAAI,CAACM,YAAY,CAACC,kBAAmB,CAAA,EAAA,CAAG,C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yBAAA,CAAAtE,MAAA,CAAAuE,SAAA,EAAA,yBAAA,EAAA,CAMNO,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,EAAAvE,yBAAAA,CAAAA,EAAAA,MAAA,CAAAuE,SAAA,IAAAvE,MAAA;;;;"}
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 */ import { template } from \"@ember/template-compiler\";\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';\nimport type NotificationsService from '../services/notifications';\nimport type Notification from '../-private/notification';\nimport type { CustomAction, containerPlacement } from '../-private/types';\ninterface NotificationCardSignature {\n Args: {\n notification: Notification;\n placement: containerPlacement;\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */ spacing?: number;\n };\n Element: HTMLDivElement;\n}\nlet NotificationCard = class NotificationCard extends Component<NotificationCardSignature> {\n @service\n notifications: NotificationsService;\n @tracked\n hasEntered = false;\n get styles(): unknown {\n const styles1 = [\n `transition-duration: ${this.args.notification.transitionDuration}ms`\n ];\n if (!this.hasEntered) {\n styles1.push(`transition-delay: ${this.args.notification.transitionDuration}ms`);\n }\n return htmlSafe(styles1.join('; '));\n }\n @action\n addSpacing(element1: HTMLElement): void {\n if (this.args.placement && this.args.placement.includes('top')) {\n element1.style.marginTop = `${this.args.spacing || 16}px`;\n }\n }\n @action\n transitionIn(element1: HTMLElement): void {\n const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n const expectedHeight1 = element1.offsetHeight + spacing1;\n const duration1 = this.args.notification.transitionDuration / 2;\n requestAnimationFrame(()=>{\n element1.style.height = '0';\n const transition1 = `height ${duration1}ms ease-in ${duration1}ms`;\n element1.style.transition = transition1;\n requestAnimationFrame(()=>{\n element1.style.height = `${expectedHeight1}px`;\n });\n });\n later(this, ()=>{\n this.hasEntered = true;\n }, this.args.notification.transitionDuration);\n }\n @action\n transitionOut(element1: HTMLElement, [isExiting1, ..._1]: boolean[]): void {\n if (isExiting1) {\n element1.style.height = '0';\n }\n }\n @action\n remove(): void {\n this.notifications.remove(this.args.notification);\n }\n @action\n pause(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.pause();\n }\n }\n @action\n resume(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.resume();\n }\n }\n @action\n handleClickCustomAction(customAction1: CustomAction): void {\n customAction1.onClick();\n this.remove();\n }\n get classes() {\n const { notificationCard: notificationCard1 } = useStyles();\n let { base: base1, message: message1, customActions: customActions1, customActionButton: customActionButton1, closeButton: closeButton1 } = notificationCard1({\n appearance: this.args.notification.appearance\n });\n return {\n base: base1(),\n message: message1(),\n customActions: customActions1(),\n customActionButton: customActionButton1(),\n closeButton: closeButton1()\n };\n }\n static{\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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { NotificationCard, NotificationCardSignature };\nexport default NotificationCard;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9qbHVlZGtlL2NvZGUvb3NzL2Zyb250aWxlL3BhY2thZ2VzL25vdGlmaWNhdGlvbnMvc3JjL2NvbXBvbmVudHMvbm90aWZpY2F0aW9uLWNhcmQuZ3RzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGVtYmVyL25vLWF0LWVtYmVyLXJlbmRlci1tb2RpZmllcnMsIGVtYmVyL25vLXJ1bmxvb3AgKi9cbmltcG9ydCBDb21wb25lbnQgZnJvbSAnQGdsaW1tZXIvY29tcG9uZW50JztcbmltcG9ydCB7IHRyYWNrZWQgfSBmcm9tICdAZ2xpbW1lci90cmFja2luZyc7XG5pbXBvcnQgeyBhY3Rpb24gfSBmcm9tICdAZW1iZXIvb2JqZWN0JztcbmltcG9ydCB7IGluamVjdCBhcyBzZXJ2aWNlIH0gZnJvbSAnQGVtYmVyL3NlcnZpY2UnO1xuaW1wb3J0IHsgaHRtbFNhZmUgfSBmcm9tICdAZW1iZXIvdGVtcGxhdGUnO1xuaW1wb3J0IHsgbGF0ZXIgfSBmcm9tICdAZW1iZXIvcnVubG9vcCc7XG5pbXBvcnQgeyBvbiB9IGZyb20gJ0BlbWJlci9tb2RpZmllcic7XG5pbXBvcnQgeyBmbiwgY29uY2F0IH0gZnJ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zLmNsYXNzZXMubWVzc2FnZX19PlxuICAgICAgICAgICAge3tAbm90aWZpY2F0aW9uLm1lc3NhZ2V9fVxuICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAge3sjaWYgQG5vdGlmaWNhdGlvbi5jdXN0b21BY3Rpb25zfX1cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9e3t0aGlzLmNsYXNzZXMuY3VzdG9tQWN0aW9uc319PlxuICAgICAgICAgICAgICB7eyNlYWNoIEBub3RpZmljYXRpb24uY3VzdG9tQWN0aW9ucyBhcyB8Y3VzdG9tQWN0aW9ufH19XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICBjbGFzcz17e3RoaXMuY2xhc3Nlcy5jdXN0b21BY3Rpb25CdXR0b259fVxuICAgICAgICAgICAgICAgICAge3tvbiBcImNsaWNrXCIgKGZuIHRoaXMuaGFuZGxlQ2xpY2tDdXN0b21BY3Rpb24gY3VzdG9tQWN0aW9uKX19XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAge3tjdXN0b21BY3Rpb24ubGFiZWx9fVxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICB7ey9lYWNofX1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIHt7L2lmfX1cblxuICAgICAgICAgIHt7I2lmIEBub3RpZmljYXRpb24uYWxsb3dDbG9zaW5nfX1cbiAgICAgICAgICAgIDxDbG9zZUJ1dHRvblxuICAgICAgICAgICAgICBAb25DbGljaz17e3RoaXMucmVtb3ZlfX1cbiAgICAgICAgICAgICAgQHNpemU9XCJzbVwiXG4gICAgICAgICAgICAgIEBjbGFzcz17e3RoaXMuY2xhc3Nlcy5jbG9zZUJ1dHRvbn19XG4gICAgICAgICAgICAvPlxuICAgICAgICAgIHt7L2lmfX1cbiAgICAgICAgPC9kaXY-XG4gICAgICB7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LENBQUMsTUFBTTtRQUNyQztJQUNGO0lBRUEsQ0FBQztJQUFPLHdCQUF3QixlQUFjLFlBQVksR0FBRyxJQUFJLENBQUM7UUFDaEUsY0FBYSxPQUFPO1FBQ3BCLElBQUksQ0FBQyxNQUFNO0lBQ2I7SUFFQSxJQUFJLFVBQVU7UUFDWixNQUFNLEVBQUUsa0JBQUEsaUJBQWdCLEVBQUUsR0FBRztRQUU3QixJQUFJLEVBQUUsTUFBQSxLQUFJLEVBQUUsU0FBQSxRQUFPLEVBQUUsZUFBQSxjQUFhLEVBQUUsb0JBQUEsbUJBQWtCLEVBQUUsYUFBQSxZQUFXLEVBQUUsR0FDbkUsa0JBQWlCO1lBQ2YsWUFBWSxJQUFJLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxVQUFVO1FBQy9DO1FBRUYsT0FBTztZQUNMLE1BQU07WUFDTixTQUFTO1lBQ1QsZUFBZTtZQUNmLG9CQUFvQjtZQUNwQixhQUFhO1FBQ2Y7SUFDRjtJQUVBLE1BQUE7UUFBQSxTQUFVLENBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7RUFpRFYsQ0FBQSxFQUFBO1lBQUEsV0FBQSxJQUFXO1lBQVg7Z0JBQUEsT0FBQSxLQUFBLFNBQUEsQ0FBQSxFQUFXO1lBQUQ7UUFBQTtJQUFBLENBakRBO0FBa0RaO0FBRUEsU0FBUyxnQkFBZ0IsRUFBRSxBQUFLLHlCQUF5QixHQUFHO0FBQzVELGVBQWUsaUJBQWlCIn0"],"names":["NotificationCard","_class","_NotificationCard","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","styles","styles1","notification","transitionDuration","hasEntered","push","htmlSafe","join","addSpacing","element1","placement","includes","style","marginTop","spacing","transitionIn","spacing1","expectedHeight1","offsetHeight","duration1","requestAnimationFrame","height","transition1","transition","later","transitionOut","isExiting1","_1","remove","notifications","pause","timer","resume","handleClickCustomAction","customAction1","onClick","classes","notificationCard","notificationCard1","useStyles","base","base1","message","message1","customActions","customActions1","customActionButton","customActionButton1","closeButton","closeButton1","appearance","setComponentTemplate","precompileTemplate","scope","didInsert","didUpdate","on","cssTransition","concat","fn","CloseButton","strictMode","_applyDecoratedDescriptor","prototype","service","configurable","enumerable","writable","initializer","tracked","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCAA,IAAAA,gBAAM,IAAAC,MAAA,IAAAC,iBAAA,GAAN,MAAMF,gBAAA,SAAyBG,SAAA,CAAU;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,wBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,qBAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAIvC,EAAA,IAAIC,SAAkB;AACpB,IAAA,MAAMC,OAAA,GAAS,CACZ,CAAA,qBAAA,EAAuB,IAAI,CAACL,IAAI,CAACM,YAAY,CAACC,kBAAmB,CAAA,EAAA,CAAG,CACtE,CAAA;AAED,IAAA,IAAI,CAAC,IAAI,CAACC,UAAU,EAAE;MACpBH,OAAA,CAAOI,IAAI,CACR,CAAoB,kBAAA,EAAA,IAAI,CAACT,IAAI,CAACM,YAAY,CAACC,kBAAmB,CAAG,EAAA,CAAA,CAAA,CAAA;AAEtE,KAAA;AAEA,IAAA,OAAOG,QAAA,CAASL,OAAA,CAAOM,IAAI,CAAC,IAAA,CAAA,CAAA,CAAA;AAC9B,GAAA;AAEQC,EAAAA,UAAAA,CAAWC,QAAoB,EAAQ;AAC7C,IAAA,IAAI,IAAI,CAACb,IAAI,CAACc,SAAS,IAAI,IAAI,CAACd,IAAI,CAACc,SAAS,CAACC,QAAQ,CAAC,KAAQ,CAAA,EAAA;AAC9DF,MAAAA,Q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AAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,EAAA,cAAA,CAAA,EAAAvE,MAAA,CAAAuE,SAAA,CAAA,EAAAD,yBAAA,CAAAtE,MAAA,CAAAuE,SAAA,EAyBAO,eAAAA,EAAAA,CAAAA,MAAA,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,EAAA,eAAA,CAAA,EAAAvE,MAAA,CAAAuE,SAAA,CAAAD,EAAAA,yBAAA,CAAAtE,MAAA,CAAAuE,SAAA,EASAO,QAAAA,EAAAA,CAAAA,MAAA,GAAAC,MAAA,CAAAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,EAAA,QAAA,CAAA,EAAAvE,MAAA,CAAAuE,SAAA,CAAAD,EAAAA,yBAAA,CAAAtE,MAAA,CAAAuE,SAAA,YAIAO,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,EAAAvE,OAAAA,CAAAA,EAAAA,MAAA,CAAAuE,SAAA,CAAAD,EAAAA,yBAAA,CAAAtE,MAAA,CAAAuE,SAAA,EAAA,QAAA,EAAA,CAMAO,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,EAAAvE,QAAAA,CAAAA,EAAAA,MAAA,CAAAuE,SAAA,CAAAD,EAAAA,yBAAA,CAAAtE,MAAA,CAAAuE,SAAA,EAAA,yBAAA,EAAA,CAMAO,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAhF,MAAA,CAAAuE,SAAA,8BAAAvE,MAAA,CAAAuE,SAAA,CAAA,GAAAvE,MAAA;;;;"}
@@ -7,13 +7,13 @@ import { inject } from '@ember/service';
7
7
  import { action } from '@ember/object';
8
8
  import didUpdate from '@ember/render-modifiers/modifiers/did-update';
9
9
  import didInsert from '@ember/render-modifiers/modifiers/did-insert';
10
- import NotificationCard from './notification-card.js';
10
+ import { NotificationCard } from './notification-card.js';
11
11
  import { useStyles } from '@frontile/theme';
12
12
  import { precompileTemplate } from '@ember/template-compilation';
13
13
  import { setComponentTemplate } from '@ember/component';
14
14
 
15
- var _class, _descriptor, _class2;
16
- let NotificationsContainer = (_class = (_class2 = class NotificationsContainer extends Component {
15
+ var _class, _descriptor, _NotificationsContainer;
16
+ let NotificationsContainer = (_class = (_NotificationsContainer = class NotificationsContainer extends Component {
17
17
  constructor(...args) {
18
18
  super(...args);
19
19
  _initializerDefineProperty(this, "notifications", _descriptor, this);
@@ -50,12 +50,12 @@ let NotificationsContainer = (_class = (_class2 = class NotificationsContainer e
50
50
  NotificationCard
51
51
  }),
52
52
  strictMode: true
53
- }), _class2), _class2), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
53
+ }), _NotificationsContainer), _NotificationsContainer), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
54
54
  configurable: true,
55
55
  enumerable: true,
56
56
  writable: true,
57
57
  initializer: null
58
58
  }), _applyDecoratedDescriptor(_class.prototype, "addSpacing", [action], Object.getOwnPropertyDescriptor(_class.prototype, "addSpacing"), _class.prototype)), _class);
59
59
 
60
- export { NotificationsContainer as default };
60
+ export { NotificationsContainer, NotificationsContainer as default };
61
61
  //# sourceMappingURL=notifications-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-container.js","sources":["../../src/components/notifications-container.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { inject as service } from '@ember/service';\nimport { action } from '@ember/object';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\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';\nexport interface NotificationsContainerArgs {\n /**\n * The placement of the notifications\n *\n * @defaultValue 'bottom-right'\n */ placement?: containerPlacement;\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */ spacing?: number;\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */ class?: string;\n}\nexport interface NotificationsContainerSignature {\n Args: NotificationsContainerArgs;\n Element: HTMLDivElement;\n}\nexport default class NotificationsContainer extends Component<NotificationsContainerSignature> {\n @service\n notifications: NotificationsService;\n get isTopPlacement(): boolean {\n return !!(this.args.placement && this.args.placement.includes('top'));\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 get classes() {\n const { notificationsContainer: notificationsContainer1 } = useStyles();\n return notificationsContainer1({\n placement: this.args.placement,\n class: this.args.class\n });\n }\n @action\n addSpacing(element1: HTMLElement): void {\n const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n if (this.isTopPlacement) {\n element1.style.marginTop = `${spacing1}px`;\n }\n }\n static{\n template(`\n {{#if this.sortedNotifications}}\n <div\n {{didInsert this.addSpacing}}\n {{didUpdate this.addSpacing @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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["NotificationsContainer","_class","_class2","Component","constructor","args","_initializerDefineProperty","_descriptor","isTopPlacement","placement","includes","sortedNotifications","notifications","slice","reverse","classes","notificationsContainer","notificationsContainer1","useStyles","class","addSpacing","element1","spacing1","spacing","style","marginTop","setComponentTemplate","precompileTemplate","scope","didInsert","didUpdate","NotificationCard","strictMode","_applyDecoratedDescriptor","prototype","service","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;A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,CAACC,SAAS,GAAI,CAAA,EAAEH,QAAS,CAAG,EAAA,CAAA,CAAA;AAC9C,KAAA;AACJ,GAAA;AA6BJ,CAAC,EAAAI,oBAAA,CA3BOC,kBAAA,CAoBH,oeAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,SAAA;IAAAC,SAAA;AAAAC,IAAAA,gBAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAA9B,OAAA,CAAA,EAAAA,OAAA,CAAAK,GAAAA,WAAA,GAAA0B,yBAAA,CAAAhC,MAAA,CAAAiC,SAAA,oBApDLC,MAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAAN,CAAAA,EAAAA,yBAAA,CAAAhC,MAAA,CAAAiC,SAAA,EAmBPM,YAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAzC,MAAA,CAAAiC,SAAA,EAAA,YAAA,CAAA,EAAAjC,MAAA,CAAAiC,SAAA,IAAAjC,MAAA;;;;"}
1
+ {"version":3,"file":"notifications-container.js","sources":["../../src/components/notifications-container.gts"],"sourcesContent":["/* eslint-disable ember/no-at-ember-render-modifiers */ import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { inject as service } from '@ember/service';\nimport { action } from '@ember/object';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\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';\ninterface NotificationsContainerSignature {\n Args: {\n /**\n * The placement of the notifications\n *\n * @defaultValue 'bottom-right'\n */ placement?: containerPlacement;\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */ spacing?: number;\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */ class?: string;\n };\n Element: HTMLDivElement;\n}\nlet NotificationsContainer = class NotificationsContainer extends Component<NotificationsContainerSignature> {\n @service\n notifications: NotificationsService;\n get isTopPlacement(): boolean {\n return !!(this.args.placement && this.args.placement.includes('top'));\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 get classes() {\n const { notificationsContainer: notificationsContainer1 } = useStyles();\n return notificationsContainer1({\n placement: this.args.placement,\n class: this.args.class\n });\n }\n @action\n addSpacing(element1: HTMLElement): void {\n const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n if (this.isTopPlacement) {\n element1.style.marginTop = `${spacing1}px`;\n }\n }\n static{\n template(`\n {{#if this.sortedNotifications}}\n <div\n {{didInsert this.addSpacing}}\n {{didUpdate this.addSpacing @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 `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { NotificationsContainer, NotificationsContainerSignature };\nexport default NotificationsContainer;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9qbHVlZGtlL2NvZGUvb3NzL2Zyb250aWxlL3BhY2thZ2VzL25vdGlmaWNhdGlvbnMvc3JjL2NvbXBvbmVudHMvbm90aWZpY2F0aW9ucy1jb250YWluZXIuZ3RzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGVtYmVyL25vLWF0LWVtYmVyLXJlbmRlci1tb2RpZmll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RUEsU0FBUyxzQkFBc0IsRUFBRSxBQUFLLCtCQUErQixHQUFHO0FBQ3hFLGVBQWUsdUJBQXVCIn0"],"names":["NotificationsContainer","_class","_NotificationsContainer","Component","constructor","args","_initializerDefineProperty","_descriptor","isTopPlacement","placement","includes","sortedNotifications","notifications","slice","reverse","classes","notificationsContainer","notificationsContainer1","useStyles","class","addSpacing","element1","spacing1","spacing","style","marginTop","setComponentTemplate","precompileTemplate","scope","didInsert","didUpdate","NotificationCard","strictMode","_applyDecoratedDescriptor","prototype","service","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;AAmCAA,IAAAA,sBAAM,IAAAC,MAAA,IAAAC,uBAAA,GAAN,MAAMF,sBAAA,SAA+BG,SAAA,CAAU;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,wBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAG7C,EAAA,IAAIC,iBAA0B;AAC5B,IAAA,OAAO,CAAC,EAAE,IAAI,CAACH,IAAI,CAACI,SAAS,IAAI,IAAI,CAACJ,IAAI,CAACI,SAAS,CAACC,QAAQ,CAAC,KAAM,CAAA,CAAA,CAAA;AACtE,GAAA;AAEA,EAAA,IAAIC,sBAAsC;IACxC,IAAI,IAAI,CAACH,cAAc,EAAE;MACvB,OAAO,IAAI,CAACI,aAAa,CAACA,aAAa,CAACC,KAAK,GAAGC,OAAO,EAAA,CAAA;KAClD,MAAA;AACL,MAAA,OAAO,IAAI,CAACF,aAAa,CAACA,aAAa,CAAA;AACzC,KAAA;AACF,GAAA;AAEA,EAAA,IAAIG,UAAU;IACZ,MAAM;AAAEC,MAAAA,sBAAA,EAAAC,uBAAAA;AAAsB,KAAE,GAAGC,SAAA,EAAA,CAAA;AAEnC,IAAA,OAAOD,uBAAA,CAAuB;AAC5BR,MA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ifications-02bGKw8W.js';
1
+ export { N as Notification, T as Timer } from './manager-DDspsX9L.js';
2
+ import '@babel/runtime/helpers/esm/defineProperty';
3
+ import '@ember/service';
4
+ export { NotificationCard } from './components/notification-card.js';
5
+ export { NotificationsContainer } from './components/notifications-container.js';
2
6
  //# sourceMappingURL=index.js.map
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":";;;;"}
@@ -1,6 +1,5 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import Service from '@ember/service';
3
1
  import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
2
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
4
3
  import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
5
4
  import '@babel/runtime/helpers/esm/initializerWarningHelper';
6
5
  import { tracked } from '@glimmer/tracking';
@@ -156,30 +155,5 @@ let NotificationsManager = (_class = class NotificationsManager {
156
155
  }
157
156
  })), _class);
158
157
 
159
- class NotificationsService extends Service {
160
- constructor(...args) {
161
- super(...args);
162
- _defineProperty(this, "manager", new NotificationsManager());
163
- _defineProperty(this, "add", (message, options) => {
164
- return this.manager.add(message, options);
165
- });
166
- _defineProperty(this, "remove", notification => {
167
- this.manager.remove(notification);
168
- });
169
- _defineProperty(this, "removeAll", () => {
170
- this.manager.removeAll();
171
- });
172
- }
173
- get notifications() {
174
- return this.manager.notifications;
175
- }
176
- willDestroy() {
177
- this.removeAll();
178
- super.willDestroy();
179
- }
180
- }
181
-
182
- // DO NOT DELETE: this is how TypeScript knows how to look up your services.
183
-
184
- export { Notification as N, Timer as T, NotificationsService as a };
185
- //# sourceMappingURL=notifications-02bGKw8W.js.map
158
+ export { Notification as N, Timer as T, NotificationsManager as a };
159
+ //# sourceMappingURL=manager-DDspsX9L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-DDspsX9L.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,CAAA;AAAAD,IAAAA,0BAAA,oBAAAE,cAAA,EAAA,IAAA,CAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAClD,IAAI,CAACC,SAAS,GAAGN,QAAQ,CAAA;IACzB,IAAI,CAACC,QAAQ,GAAGA,QAAQ,CAAA;IACxB,IAAI,CAACM,KAAK,EAAE,CAAA;AACd,GAAA;AAEQC,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACC,SAAS,GAAG,KAAK,CAAA;IAEtB,IAAI,IAAI,CAACC,KAAK,EAAE;AACdC,MAAAA,MAAM,CAAC,IAAI,CAACD,KAAK,CAAC,CAAA;AACpB,KAAA;AACF,GAAA;AAEQE,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACJ,KAAK,EAAE,CAAA;IACZ,IAAI,CAACF,SAAS,IAAIO,IAAI,CAACC,GAAG,EAAE,GAAG,IAAI,CAACC,KAAK,CAAA;AAC3C,GAAA;AAEQC,EAAAA,MAAMA,GAAS;IACrB,IAAI,CAACR,KAAK,EAAE,CAAA;IACZ,IAAI,CAACD,KAAK,EAAE,CAAA;AACd,GAAA;AAEQA,EAAAA,KAAKA,GAAS;AACpB,IAAA,IAAI,CAACQ,KAAK,GAAGF,IAAI,CAACC,GAAG,EAAE,CAAA;IACvB,IAAI,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AAY,CAAC,CAAA;AAC3B,KAAC,CAAC,CAAA;AACJ,GAAA;AAEQG,EAAAA,gBAAgBA,CAACH,YAA0B,EAAE9C,QAAgB,EAAQ;IAC3E8C,YAAY,CAACpC,KAAK,GAAG,IAAIb,KAAK,CAACG,QAAQ,EAAE,MAAM;AAC7C,MAAA,IAAI,CAAC0C,MAAM,CAACI,YAAY,CAAC,CAAA;AAC3B,KAAC,CAAC,CAAA;AACJ,GAAA;AACF,CAAC,GAAA3C,WAAA,GAAAe,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,EAAA,eAAA,EAAA,CApDEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAiC,EAAE,CAAA;AAAA,GAAA;AAAA,CAAA,CAAA,GAAA1B,MAAA;;;;"}
@@ -1,4 +1,31 @@
1
- import '@babel/runtime/helpers/esm/defineProperty';
2
- import '@ember/service';
3
- export { a as default } from '../notifications-02bGKw8W.js';
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import Service from '@ember/service';
3
+ import { a as NotificationsManager } from '../manager-DDspsX9L.js';
4
+
5
+ class NotificationsService extends Service {
6
+ constructor(...args) {
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
+ }
19
+ get notifications() {
20
+ return this.manager.notifications;
21
+ }
22
+ willDestroy() {
23
+ this.removeAll();
24
+ super.willDestroy();
25
+ }
26
+ }
27
+
28
+ // DO NOT DELETE: this is how TypeScript knows how to look up your services.
29
+
30
+ export { NotificationsService as default };
4
31
  //# sourceMappingURL=notifications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
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","constructor","args","_defineProperty","NotificationsManager","message","options","manager","add","notification","remove","removeAll","notifications","willDestroy"],"mappings":";;;;AAKe,MAAMA,oBAAoB,SAASC,OAAO,CAAC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,CAC9C,IAAA,EAAA,SAAA,EAAA,IAAIC,oBAAoB,EAAE,CAAA,CAAA;AAAAD,IAAAA,eAAA,CAM9B,IAAA,EAAA,KAAA,EAAA,CAACE,OAAe,EAAEC,OAA6B,KAAmB;MACtE,OAAO,IAAI,CAACC,OAAO,CAACC,GAAG,CAACH,OAAO,EAAEC,OAAO,CAAC,CAAA;KAC1C,CAAA,CAAA;IAAAH,eAAA,CAAA,IAAA,EAAA,QAAA,EAESM,YAA2B,IAAW;AAC9C,MAAA,IAAI,CAACF,OAAO,CAACG,MAAM,CAACD,YAAY,CAAC,CAAA;KAClC,CAAA,CAAA;AAAAN,IAAAA,eAAA,oBAEW,MAAY;AACtB,MAAA,IAAI,CAACI,OAAO,CAACI,SAAS,EAAE,CAAA;KACzB,CAAA,CAAA;AAAA,GAAA;EAdD,IAAIC,aAAaA,GAAmB;AAClC,IAAA,OAAO,IAAI,CAACL,OAAO,CAACK,aAAa,CAAA;AACnC,GAAA;AAcAC,EAAAA,WAAWA,GAAS;IAClB,IAAI,CAACF,SAAS,EAAE,CAAA;IAChB,KAAK,CAACE,WAAW,EAAE,CAAA;AACrB,GAAA;AACF,CAAA;;AAEA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/notifications",
3
- "version": "0.17.0-alpha.0",
3
+ "version": "0.17.0-alpha.11",
4
4
  "description": "Component Library for Ember Octane apps: Notifications",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -42,35 +42,35 @@
42
42
  "dependencies": {
43
43
  "@ember/render-modifiers": "^2.1.0",
44
44
  "@embroider/addon-shim": "^1.8.7",
45
- "@frontile/core": "^0.17.0-alpha.0",
46
- "@frontile/theme": "^0.17.0-alpha.0",
47
- "ember-auto-import": "^2.6.3",
45
+ "@frontile/buttons": "0.17.0-alpha.11",
46
+ "@frontile/theme": "0.17.0-alpha.11",
47
+ "ember-auto-import": "^2.7.2",
48
48
  "ember-css-transitions": "^4.4.0",
49
49
  "ember-get-config": "^2.1.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@babel/core": "7.23.6",
52
+ "@babel/core": "7.23.9",
53
53
  "@babel/plugin-proposal-class-properties": "7.18.6",
54
- "@babel/plugin-proposal-decorators": "7.23.6",
54
+ "@babel/plugin-proposal-decorators": "7.23.9",
55
55
  "@babel/plugin-transform-class-static-block": "^7.23.4",
56
56
  "@babel/preset-typescript": "7.23.3",
57
- "@embroider/addon-dev": "4.1.3",
57
+ "@embroider/addon-dev": "4.2.1",
58
58
  "@embroider/addon-shim": "^1.8.6",
59
59
  "@glimmer/component": "^1.1.2",
60
60
  "@glimmer/tracking": "^1.1.2",
61
- "@glint/core": "1.2.1",
62
- "@glint/environment-ember-loose": "1.2.1",
63
- "@glint/environment-ember-template-imports": "1.2.1",
64
- "@glint/template": "1.2.1",
61
+ "@glint/core": "1.3.0",
62
+ "@glint/environment-ember-loose": "1.3.0",
63
+ "@glint/environment-ember-template-imports": "1.3.0",
64
+ "@glint/template": "1.3.0",
65
65
  "@rollup/plugin-node-resolve": "^15.2.3",
66
- "@tsconfig/ember": "^3.0.0",
67
- "babel-plugin-ember-template-compilation": "^2.1.1",
68
- "concurrently": "^8.2.0",
69
- "ember-source": "^5.5.0",
70
- "rollup": "^4.9.1",
71
- "rollup-plugin-ts": "^3.2.0",
72
- "tailwindcss": "^3.3.3",
73
- "typescript": "^5.1.6"
66
+ "@tsconfig/ember": "^3.0.3",
67
+ "babel-plugin-ember-template-compilation": "^2.2.1",
68
+ "concurrently": "^8.2.2",
69
+ "ember-source": "^5.6.0",
70
+ "rollup": "^4.11.0",
71
+ "rollup-plugin-ts": "^3.4.5",
72
+ "tailwindcss": "^3.4.1",
73
+ "typescript": "^5.3.3"
74
74
  },
75
75
  "engines": {
76
76
  "node": "10.* || >= 12"
@@ -109,5 +109,5 @@
109
109
  ]
110
110
  }
111
111
  },
112
- "gitHead": "64b5faa1b14763b32cf93e10a5035c0bd06b47d3"
112
+ "gitHead": "de133b62233d30c05c69a2cb4925ef3eb5a78208"
113
113
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"notifications-02bGKw8W.js","sources":["../src/-private/timer.ts","../src/-private/get-config.ts","../src/-private/notification.ts","../src/-private/manager.ts","../src/services/notifications.ts"],"sourcesContent":["import { 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","import 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","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":["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","NotificationsService","Service","args","manager","willDestroy"],"mappings":";;;;;;;;;;;AAGuC,IAElBA,KAAK,IAAAC,QAAA,GAAX,MAAMD,KAAK,CAAC;AAQzBE,EAAAA,WAAWA,CAACC,QAAgB,EAAEC,QAAoB,EAAE;AAAAC,IAAAA,0BAAA,oBAAAC,aAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,oBAAAE,cAAA,EAAA,IAAA,CAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;IAClD,IAAI,CAACC,SAAS,GAAGN,QAAQ,CAAA;IACzB,IAAI,CAACC,QAAQ,GAAGA,QAAQ,CAAA;IACxB,IAAI,CAACM,KAAK,EAAE,CAAA;AACd,GAAA;AAEQC,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACC,SAAS,GAAG,KAAK,CAAA;IAEtB,IAAI,IAAI,CAACC,KAAK,EAAE;AACdC,MAAAA,MAAM,CAAC,IAAI,CAACD,KAAK,CAAC,CAAA;AACpB,KAAA;AACF,GAAA;AAEQE,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACJ,KAAK,EAAE,CAAA;IACZ,IAAI,CAACF,SAAS,IAAIO,IAAI,CAACC,GAAG,EAAE,GAAG,IAAI,CAACC,KAAK,CAAA;AAC3C,GAAA;AAEQC,EAAAA,MAAMA,GAAS;IACrB,IAAI,CAACR,KAAK,EAAE,CAAA;IACZ,IAAI,CAACD,KAAK,EAAE,CAAA;AACd,GAAA;AAEQA,EAAAA,KAAKA,GAAS;AACpB,IAAA,IAAI,CAACQ,KAAK,GAAGF,IAAI,CAACC,GAAG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