@frontile/notifications 0.17.0-alpha.9 → 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.
Files changed (37) hide show
  1. package/declarations/-private/get-config.d.ts +1 -1
  2. package/declarations/-private/get-config.d.ts.map +1 -1
  3. package/declarations/-private/manager.d.ts +3 -0
  4. package/declarations/-private/manager.d.ts.map +1 -1
  5. package/declarations/-private/notification.d.ts +2 -2
  6. package/declarations/-private/notification.d.ts.map +1 -1
  7. package/declarations/components/notification-card.d.ts +18 -7
  8. package/declarations/components/notification-card.d.ts.map +1 -1
  9. package/declarations/components/notifications-container.d.ts +7 -1
  10. package/declarations/components/notifications-container.d.ts.map +1 -1
  11. package/declarations/services/notifications.d.ts +0 -2
  12. package/declarations/services/notifications.d.ts.map +1 -1
  13. package/dist/components/notification-card.js +63 -79
  14. package/dist/components/notification-card.js.map +1 -1
  15. package/dist/components/notifications-container.js +20 -30
  16. package/dist/components/notifications-container.js.map +1 -1
  17. package/dist/index.js +1 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/manager-i6QWzaob.js +166 -0
  20. package/dist/manager-i6QWzaob.js.map +1 -0
  21. package/dist/runtime-BPCpkOf1-DV8zmEr2.js +67 -0
  22. package/dist/runtime-BPCpkOf1-DV8zmEr2.js.map +1 -0
  23. package/dist/services/notifications.js +11 -15
  24. package/dist/services/notifications.js.map +1 -1
  25. package/package.json +50 -55
  26. package/declarations/get-config-a59d13fc.d.ts +0 -3
  27. package/declarations/manager-Bfx-JQOm.d.ts +0 -10
  28. package/declarations/manager-DDspsX9L.d.ts +0 -10
  29. package/declarations/manager-PexDbR1y.d.ts +0 -10
  30. package/declarations/notification-64b501e5.d.ts +0 -15
  31. package/declarations/notifications-02bGKw8W.d.ts +0 -10
  32. package/declarations/notifications-6S2s2xJm.d.ts +0 -10
  33. package/declarations/timer-0a840cef.d.ts +0 -13
  34. package/declarations/timer-dbe538e6.d.ts +0 -13
  35. package/declarations/types-16c08671.d.ts +0 -55
  36. package/dist/manager-DDspsX9L.js +0 -159
  37. package/dist/manager-DDspsX9L.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":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,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
+ {"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;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;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;AAEjE,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;gBAEhB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;IAkB9D,MAAM,IAAI,IAAI;CAOf"}
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
- addSpacing(element: HTMLElement): void;
23
- transitionIn(element: HTMLElement): void;
24
- transitionOut(element: HTMLElement, [isExiting, ..._]: boolean[]): void;
25
- remove(): void;
26
- pause(): void;
27
- resume(): void;
28
- handleClickCustomAction(customAction: CustomAction): void;
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;AAc3C,OAAO,KAAK,oBAAoB,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC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,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
- addSpacing(element: HTMLElement): void;
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":"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"}
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,5 +1,3 @@
1
- /// <reference types="ember-source/types/stable/@ember/service" />
2
- /// <reference types="ember-source/types/stable/@ember/routing/service-ext" />
3
1
  import Service from '@ember/service';
4
2
  import Notification from '../-private/notification';
5
3
  import NotificationsManager from '../-private/manager';
@@ -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,uBAA8B;IAErC,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
+ {"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,125 +1,109 @@
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 { concat, fn } from '@ember/helper';
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
- var _class, _descriptor, _descriptor2, _NotificationCard;
22
- let NotificationCard = (_class = (_NotificationCard = class NotificationCard extends Component {
23
- constructor(...args) {
24
- super(...args);
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
- const styles1 = [`transition-duration: ${this.args.notification.transitionDuration}ms`];
29
+ const styles = [`transition-duration: ${this.args.notification.transitionDuration}ms`];
30
30
  if (!this.hasEntered) {
31
- styles1.push(`transition-delay: ${this.args.notification.transitionDuration}ms`);
31
+ styles.push(`transition-delay: ${this.args.notification.transitionDuration}ms`);
32
32
  }
33
- return htmlSafe(styles1.join('; '));
33
+ return htmlSafe(styles.join('; '));
34
34
  }
35
- addSpacing(element1) {
36
- if (this.args.placement && this.args.placement.includes('top')) {
37
- element1.style.marginTop = `${this.args.spacing || 16}px`;
38
- }
39
- }
40
- transitionIn(element1) {
41
- const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
42
- const expectedHeight1 = element1.offsetHeight + spacing1;
43
- const duration1 = this.args.notification.transitionDuration / 2;
35
+ transitionIn = modifier(element => {
36
+ const spacing = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
37
+ const expectedHeight = element.offsetHeight + spacing;
38
+ const duration = this.args.notification.transitionDuration / 2;
44
39
  requestAnimationFrame(() => {
45
- element1.style.height = '0';
46
- const transition1 = `height ${duration1}ms ease-in ${duration1}ms`;
47
- element1.style.transition = transition1;
40
+ element.style.height = '0';
41
+ const transition = `height ${duration}ms ease-in ${duration}ms`;
42
+ element.style.transition = transition;
48
43
  requestAnimationFrame(() => {
49
- element1.style.height = `${expectedHeight1}px`;
44
+ element.style.height = `${expectedHeight}px`;
50
45
  });
51
46
  });
52
47
  later(this, () => {
53
48
  this.hasEntered = true;
54
49
  }, this.args.notification.transitionDuration);
55
- }
56
- transitionOut(element1, [isExiting1, ..._1]) {
57
- if (isExiting1) {
58
- element1.style.height = '0';
50
+ });
51
+ transitionOut = modifier((element, [isExiting, ..._]) => {
52
+ if (isExiting) {
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(customAction1) {
75
- customAction1.onClick();
68
+ };
69
+ handleClickCustomAction = customAction => {
70
+ customAction.onClick();
76
71
  this.remove();
77
- }
72
+ };
78
73
  get classes() {
79
74
  const {
80
- notificationCard: notificationCard1
75
+ notificationCard
81
76
  } = useStyles();
82
77
  let {
83
- base: base1,
84
- message: message1,
85
- customActions: customActions1,
86
- customActionButton: customActionButton1,
87
- closeButton: closeButton1
88
- } = notificationCard1({
78
+ base,
79
+ message,
80
+ customActions,
81
+ customActionButton,
82
+ closeButton
83
+ } = notificationCard({
89
84
  appearance: this.args.notification.appearance
90
85
  });
91
86
  return {
92
- base: base1(),
93
- message: message1(),
94
- customActions: customActions1(),
95
- customActionButton: customActionButton1(),
96
- closeButton: closeButton1()
87
+ base: base(),
88
+ message: message(),
89
+ customActions: customActions(),
90
+ customActionButton: customActionButton(),
91
+ closeButton: closeButton()
97
92
  };
98
93
  }
99
- }, 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 {{didInsert this.transitionIn}} {{didUpdate 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 ", {
100
- scope: () => ({
101
- didInsert,
102
- didUpdate,
103
- on,
104
- cssTransition,
105
- concat,
106
- fn,
107
- CloseButton
108
- }),
109
- strictMode: true
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
- }), _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);
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 */ 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2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FBWSxJQUFJLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxVQUFVO1FBQy9DO1FBRUYsT0FBTztZQUNMLE1BQU07WUFDTixTQUFTO1lBQ1QsZUFBZTtZQUNmLG9CQUFvQjtZQUNwQixhQUFhO1FBQ2Y7SUFDRjtJQUVBLE1BQUE7UUFBQSxTQUFVLENBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7RUFpRFYsQ0FBQSxFQUFBO1lBQUEsV0FBQSxJQUFXO1lBQVg7Z0JBQUEsT0FBQSxLQUFBLFNBQUEsQ0FBQSxFQUFXO1lBQUQ7UUFBQTtJQUFBLENBakRBO0FBa0RaO0FBRUEsU0FBUyxnQkFBZ0IsRUFBRSxBQUFLLHlCQUF5QixHQUFHO0FBQzVELGVBQWUsaUJBQWlCIn0"],"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,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AAA,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;;;;"}
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,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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 { action } from '@ember/object';
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
- var _class, _descriptor, _NotificationsContainer;
16
- let NotificationsContainer = (_class = (_NotificationsContainer = class NotificationsContainer extends Component {
17
- constructor(...args) {
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
  }
@@ -30,32 +24,28 @@ let NotificationsContainer = (_class = (_NotificationsContainer = class Notifica
30
24
  }
31
25
  get classes() {
32
26
  const {
33
- notificationsContainer: notificationsContainer1
27
+ notificationsContainer
34
28
  } = useStyles();
35
- return notificationsContainer1({
29
+ return notificationsContainer({
36
30
  placement: this.args.placement,
37
31
  class: this.args.class
38
32
  });
39
33
  }
40
- addSpacing(element1) {
41
- const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
34
+ setupSpacing = modifier(element => {
35
+ const spacing = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
42
36
  if (this.isTopPlacement) {
43
- element1.style.marginTop = `${spacing1}px`;
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
- }, setComponentTemplate(precompileTemplate("\n {{#if this.sortedNotifications}}\n <div {{didInsert this.addSpacing}} {{didUpdate this.addSpacing @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 ", {
47
- scope: () => ({
48
- didInsert,
49
- didUpdate,
50
- NotificationCard
51
- }),
52
- strictMode: true
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":["/* 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9qbHVlZGtlL2NvZGUvb3NzL2Zyb250aWxlL3BhY2thZ2VzL25vdGlmaWNhdGlvbnMvc3JjL2NvbXBvbmVudHMvbm90aWZpY2F0aW9ucy1jb250YWluZXIuZ3RzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGVtYmVyL25vLWF0LWVtYmVyLXJlbmRlci1tb2RpZmllcnMgKi9cbmltcG9ydCBDb21wb25lbnQgZnJvbSAnQGdsaW1tZXIvY29tcG9uZW50JztcbmltcG9ydCB7IGluamVjdCBhcyBzZXJ2aWNlIH0gZnJvbSAnQGVtYmVyL3NlcnZpY2UnO1xuaW1wb3J0IHsgYWN0aW9uIH0gZnJvbSAnQGVtYmVyL29iamVjdCc7XG5pbXBvcnQgZGlkVXBkYXRlIGZyb20gJ0BlbWJlci9yZW5kZXItbW9kaWZpZXJzL21vZGlmaWVycy9kaWQtdXBkYXRlJztcbmltcG9ydCBkaWRJbnNlcnQgZnJvbSAnQGVtYmVyL3JlbmRlci1tb2RpZmllcnMvbW9kaWZpZXJzL2RpZC1pbnNlcnQnO1xuaW1wb3J0IE5vdGlmaWNhdGlvbkNhcmQgZnJvbSAnLi9ub3RpZmljYXRpb24tY2FyZCc7XG5pbXBvcnQgdHlwZSBOb3RpZmljYXRpb25zU2VydmljZSBmcm9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U8sSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLO1FBQ3hCO0lBQ0Y7SUFFQSxDQUFDO0lBQU8sV0FBVyxVQUFTLFdBQVcsR0FBRyxJQUFJLENBQUM7UUFDN0MsTUFBTSxXQUNKLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLEtBQUssY0FBYyxLQUFLLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTztRQUNuRSxJQUFJLElBQUksQ0FBQyxjQUFjLEVBQUU7WUFDdkIsU0FBUSxLQUFLLENBQUMsU0FBUyxHQUFHLENBQUMsRUFBRSxTQUFRLEVBQUUsQ0FBQztRQUMxQztJQUNGO0lBRUEsTUFBQTtRQUFBLFNBQVUsQ0FBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7RUFvQlYsQ0FBQSxFQUFBO1lBQUEsV0FBQSxJQUFXO1lBQVg7Z0JBQUEsT0FBQSxLQUFBLFNBQUEsQ0FBQSxFQUFXO1lBQUQ7UUFBQTtJQUFBLENBcEJBO0FBcUJaO0FBRUEsU0FBUyxzQkFBc0IsRUFBRSxBQUFLLCtCQUErQixHQUFHO0FBQ3hFLGVBQWUsdUJBQXVCIn0"],"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,C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AC,SAAA;IAAAC,SAAA;AAAAC,IAAAA,gBAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAAU,CAAA,CAAA,EAAA9B,uBAAA,CAAA,EAAAA,uBAAA,CAAA,GAAAK,WAAA,GAAA0B,yBAAA,CAAAhC,MAAA,CAAAiC,SAAA,EAAA,eAAA,EAAA,CAnDTC,MAAA,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,EAuBAM,YAAAA,EAAAA,CAAAA,MAAA,GAAAC,MAAA,CAAAC,wBAAA,CAAAzC,MAAA,CAAAiC,SAAA,EAAA,YAAA,CAAA,EAAAjC,MAAA,CAAAiC,SAAA,CAAAjC,GAAAA,MAAA;;;;"}
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-DDspsX9L.js';
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":";;;"}