@frontile/notifications 0.17.0-alpha.7 → 0.17.0-beta.1

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.
@@ -1,3 +1,4 @@
1
1
  import { DefaultConfig } from "./types-16c08671.js";
2
2
  declare function getConfigOption<T extends keyof DefaultConfig>(key: T, defaultValue: NonNullable<DefaultConfig[T]>): NonNullable<DefaultConfig[T]>;
3
3
  export { getConfigOption };
4
+ //# sourceMappingURL=get-config-a59d13fc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-config-a59d13fc.d.ts","sourceRoot":"","sources":["../src/-private/get-config.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAsB,4BAAgB;AAE7C,iBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,aAAa,EAC3D,GAAG,EAAE,CAAC,EACN,YAAY,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAC1C,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAW/B"}
@@ -8,3 +8,4 @@ declare class NotificationsManager {
8
8
  private setupAutoRemoval;
9
9
  }
10
10
  export { NotificationsManager as default };
11
+ //# sourceMappingURL=manager-IxquV5I2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-IxquV5I2.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAK1C,OAAO,uBAA4B,4BAAgB;AAEnD,cAAqB,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY;IAqBrE,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAkBzC,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,gBAAgB;CAKzB"}
@@ -13,3 +13,4 @@ declare class Notification {
13
13
  remove(): void;
14
14
  }
15
15
  export { Notification as default };
16
+ //# sourceMappingURL=notification-64b501e5.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-64b501e5.d.ts","sourceRoot":"","sources":["../src/-private/notification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,4BAAgB;AAE5B,OAAO,qCAA0C,4BAAgB;AAEjE,cAAqB,YAAY;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,UAAS;gBAEhB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;IAkB9D,MAAM,IAAI,IAAI;CAOf"}
@@ -1,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,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"}
@@ -11,3 +11,4 @@ declare class Timer {
11
11
  private setup;
12
12
  }
13
13
  export { Timer as default };
14
+ //# sourceMappingURL=timer-0a840cef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timer-0a840cef.d.ts","sourceRoot":"","sources":["../src/-private/timer.ts"],"names":[],"mappings":"AAMA,cAAqB,KAAK;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,UAAQ;IAE1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAU;gBAEX,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI;IAM1C,KAAK,IAAI,IAAI;IAQb,KAAK,IAAI,IAAI;IAKb,MAAM,IAAI,IAAI;IAKtB,OAAO,CAAC,KAAK;CAad"}
@@ -53,3 +53,4 @@ interface DefaultConfig extends NotificationOptions {
53
53
  skipTimer?: boolean;
54
54
  }
55
55
  export { containerPlacement, CustomAction, NotificationOptions, DefaultConfig };
56
+ //# sourceMappingURL=types-16c08671.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-16c08671.d.ts","sourceRoot":"","sources":["../src/-private/types.ts"],"names":[],"mappings":"AAAA,KAAY,kBAAkB,GAC1B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,UAAiB,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAiB,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAOlB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAEtD;;;;OAIG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,UAAiB,aAAc,SAAQ,mBAAmB;IACxD;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -26,36 +26,36 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
26
26
  _initializerDefineProperty(this, "hasEntered", _descriptor2, this);
27
27
  }
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) {
35
+ addSpacing(element) {
36
36
  if (this.args.placement && this.args.placement.includes('top')) {
37
- element1.style.marginTop = `${this.args.spacing || 16}px`;
37
+ element.style.marginTop = `${this.args.spacing || 16}px`;
38
38
  }
39
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;
40
+ transitionIn(element) {
41
+ const spacing = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
42
+ const expectedHeight = element.offsetHeight + spacing;
43
+ const duration = this.args.notification.transitionDuration / 2;
44
44
  requestAnimationFrame(() => {
45
- element1.style.height = '0';
46
- const transition1 = `height ${duration1}ms ease-in ${duration1}ms`;
47
- element1.style.transition = transition1;
45
+ element.style.height = '0';
46
+ const transition = `height ${duration}ms ease-in ${duration}ms`;
47
+ element.style.transition = transition;
48
48
  requestAnimationFrame(() => {
49
- element1.style.height = `${expectedHeight1}px`;
49
+ element.style.height = `${expectedHeight}px`;
50
50
  });
51
51
  });
52
52
  later(this, () => {
53
53
  this.hasEntered = true;
54
54
  }, this.args.notification.transitionDuration);
55
55
  }
56
- transitionOut(element1, [isExiting1, ..._1]) {
57
- if (isExiting1) {
58
- element1.style.height = '0';
56
+ transitionOut(element, [isExiting, ..._]) {
57
+ if (isExiting) {
58
+ element.style.height = '0';
59
59
  }
60
60
  }
61
61
  remove() {
@@ -71,32 +71,33 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
71
71
  this.args.notification.timer.resume();
72
72
  }
73
73
  }
74
- handleClickCustomAction(customAction1) {
75
- customAction1.onClick();
74
+ handleClickCustomAction(customAction) {
75
+ customAction.onClick();
76
76
  this.remove();
77
77
  }
78
78
  get classes() {
79
79
  const {
80
- notificationCard: notificationCard1
80
+ notificationCard
81
81
  } = useStyles();
82
82
  let {
83
- base: base1,
84
- message: message1,
85
- customActions: customActions1,
86
- customActionButton: customActionButton1,
87
- closeButton: closeButton1
88
- } = notificationCard1({
83
+ base,
84
+ message,
85
+ customActions,
86
+ customActionButton,
87
+ closeButton
88
+ } = notificationCard({
89
89
  appearance: this.args.notification.appearance
90
90
  });
91
91
  return {
92
- base: base1(),
93
- message: message1(),
94
- customActions: customActions1(),
95
- customActionButton: customActionButton1(),
96
- closeButton: closeButton1()
92
+ base: base(),
93
+ message: message(),
94
+ customActions: customActions(),
95
+ customActionButton: customActionButton(),
96
+ closeButton: closeButton()
97
97
  };
98
98
  }
99
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
+ strictMode: true,
100
101
  scope: () => ({
101
102
  didInsert,
102
103
  didUpdate,
@@ -105,9 +106,8 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
105
106
  concat,
106
107
  fn,
107
108
  CloseButton
108
- }),
109
- strictMode: true
110
- }), _NotificationCard), _NotificationCard), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
109
+ })
110
+ }), _NotificationCard), _NotificationCard), _descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
111
111
  configurable: true,
112
112
  enumerable: true,
113
113
  writable: true,
@@ -119,7 +119,7 @@ let NotificationCard = (_class = (_NotificationCard = class NotificationCard ext
119
119
  initializer: function () {
120
120
  return false;
121
121
  }
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);
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
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":["/* 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9qbHVlZGtlL2NvZGUvb3NzL2Zyb250aWxlL3BhY2thZ2VzL25vdGlmaWNhdGlvbnMvc3JjL2NvbXBvbmVudHMvbm90aWZpY2F0aW9uLWNhcmQuZ3RzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGVtYmVyL25vLWF0LWVtYmVyLXJlbmRlci1tb2RpZmllcnMsIGVtYmVyL25vLXJ1bmxvb3AgKi9cbmltcG9ydCBDb21wb25lbnQgZnJvbSAnQGdsaW1tZXIvY29tcG9uZW50JztcbmltcG9ydCB7IHRyYWNrZWQgfSBmcm9tICdAZ2xpbW1lci90cmFja2luZyc7XG5pbXBvcnQgeyBhY3Rpb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CBcIm5vdGlmaWNhdGlvbi10cmFuc2l0aW9uLS1zbGlkZS1mcm9tLVwiIEBwbGFjZW1lbnQpXG4gICAgICAgICAgICBpc0VuYWJsZWQ9dHJ1ZVxuICAgICAgICAgIH19XG4gICAgICAgICAgY2xhc3M9e3t0aGlzLmNsYXNzZXMuYmFzZX19XG4gICAgICAgICAgc3R5bGU9XCJ7e3RoaXMuc3R5bGVzfX1cIlxuICAgICAgICAgIC4uLmF0dHJpYnV0ZXNcbiAgICAgICAgPlxuICAgICAgICAgIDxkaXYgY2xhc3M9e3t0aGlzLmNsYXNzZXMubWVzc2FnZX19PlxuICAgICAgICAgICAge3tAbm90aWZpY2F0aW9uLm1lc3NhZ2V9fVxuICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAge3sjaWYgQG5vdGlmaWNhdGlvbi5jdXN0b21BY3Rpb25zfX1cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9e3t0aGlzLmNsYXNzZXMuY3VzdG9tQWN0aW9uc319PlxuICAgICAgICAgICAgICB7eyNlYWNoIEBub3RpZmljYXRpb24uY3VzdG9tQWN0aW9ucyBhcyB8Y3VzdG9tQWN0aW9ufH19XG4gICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICBjbGFzcz17e3RoaXMuY2xhc3Nlcy5jdXN0b21BY3Rpb25CdXR0b259fVxuICAgICAgICAgICAgICAgICAge3tvbiBcImNsaWNrXCIgKGZuIHRoaXMuaGFuZGxlQ2xpY2tDdXN0b21BY3Rpb24gY3VzdG9tQWN0aW9uKX19XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAge3tjdXN0b21BY3Rpb24ubGFiZWx9fVxuICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICB7ey9lYWNofX1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIHt7L2lmfX1cblxuIC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7UUFBQTtJQUFBLENBakRBO0FBa0RaO0FBRUEsU0FBUyxnQkFBZ0IsRUFBRSxBQUFLLHlCQUF5QixHQUFHO0FBQzVELGVBQWUsaUJBQWlCIn0"],"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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A,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-at-ember-render-modifiers, ember/no-runloop */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { htmlSafe } from '@ember/template';\nimport { later } from '@ember/runloop';\nimport { on } from '@ember/modifier';\nimport { fn, concat } from '@ember/helper';\nimport didUpdate from '@ember/render-modifiers/modifiers/did-update';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport { CloseButton } from '@frontile/buttons';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\n\nimport type NotificationsService from '../services/notifications';\nimport type Notification from '../-private/notification';\nimport type { CustomAction, containerPlacement } from '../-private/types';\n\ninterface NotificationCardSignature {\n Args: {\n notification: Notification;\n placement: containerPlacement;\n\n /**\n * Spacing for each notification, in px.\n *\n * @defaultValue 16\n */\n spacing?: number;\n };\n Element: HTMLDivElement;\n}\n\nclass NotificationCard extends Component<NotificationCardSignature> {\n @service notifications!: NotificationsService;\n @tracked hasEntered = false;\n\n get styles(): unknown {\n const styles = [\n `transition-duration: ${this.args.notification.transitionDuration}ms`\n ];\n\n if (!this.hasEntered) {\n styles.push(\n `transition-delay: ${this.args.notification.transitionDuration}ms`\n );\n }\n\n return htmlSafe(styles.join('; '));\n }\n\n @action addSpacing(element: HTMLElement): void {\n if (this.args.placement && this.args.placement.includes('top')) {\n element.style.marginTop = `${this.args.spacing || 16}px`;\n }\n }\n\n @action transitionIn(element: HTMLElement): void {\n const spacing =\n typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;\n const expectedHeight = element.offsetHeight + spacing;\n const duration = this.args.notification.transitionDuration / 2;\n\n requestAnimationFrame(() => {\n element.style.height = '0';\n const transition = `height ${duration}ms ease-in ${duration}ms`;\n element.style.transition = transition;\n\n requestAnimationFrame(() => {\n element.style.height = `${expectedHeight}px`;\n });\n });\n\n later(\n this,\n () => {\n this.hasEntered = true;\n },\n this.args.notification.transitionDuration\n );\n }\n\n @action transitionOut(\n element: HTMLElement,\n [isExiting, ..._]: boolean[]\n ): void {\n if (isExiting) {\n element.style.height = '0';\n }\n }\n\n @action remove(): void {\n this.notifications.remove(this.args.notification);\n }\n\n @action pause(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.pause();\n }\n }\n\n @action resume(): void {\n if (this.args.notification.timer) {\n this.args.notification.timer.resume();\n }\n }\n\n @action handleClickCustomAction(customAction: CustomAction): void {\n customAction.onClick();\n this.remove();\n }\n\n get classes() {\n const { notificationCard } = useStyles();\n\n let { base, message, customActions, customActionButton, closeButton } =\n notificationCard({\n appearance: this.args.notification.appearance\n });\n\n return {\n base: base(),\n message: message(),\n customActions: customActions(),\n customActionButton: customActionButton(),\n closeButton: closeButton()\n };\n }\n\n <template>\n {{! template-lint-disable no-invalid-interactive }}\n {{! template-lint-disable no-unnecessary-concat }}\n {{! template-lint-disable no-inline-styles }}\n {{! template-lint-disable style-concatenation }}\n <div\n {{didInsert this.transitionIn}}\n {{didUpdate this.transitionOut @notification.isRemoving}}\n >\n {{#unless @notification.isRemoving}}\n <div\n {{on \"mouseenter\" this.pause}}\n {{on \"mouseleave\" this.resume}}\n {{cssTransition\n (concat \"notification-transition--slide-from-\" @placement)\n isEnabled=true\n }}\n class={{this.classes.base}}\n style=\"{{this.styles}}\"\n ...attributes\n >\n <div class={{this.classes.message}}>\n {{@notification.message}}\n </div>\n\n {{#if @notification.customActions}}\n <div class={{this.classes.customActions}}>\n {{#each @notification.customActions as |customAction|}}\n <button\n type=\"button\"\n class={{this.classes.customActionButton}}\n {{on \"click\" (fn this.handleClickCustomAction customAction)}}\n >\n {{customAction.label}}\n </button>\n {{/each}}\n </div>\n {{/if}}\n\n {{#if @notification.allowClosing}}\n <CloseButton\n @onClick={{this.remove}}\n @size=\"sm\"\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n </div>\n {{/unless}}\n </div>\n </template>\n}\n\nexport { NotificationCard, type NotificationCardSignature };\nexport default NotificationCard;\n"],"names":["NotificationCard","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","styles","notification","transitionDuration","hasEntered","push","htmlSafe","join","addSpacing","element","placement","includes","style","marginTop","spacing","transitionIn","expectedHeight","offsetHeight","duration","requestAnimationFrame","height","transition","later","transitionOut","isExiting","_","remove","notifications","pause","timer","resume","handleClickCustomAction","customAction","onClick","classes","notificationCard","useStyles","base","message","customActions","customActionButton","closeButton","appearance","setComponentTemplate","precompileTemplate","strictMode","scope","didInsert","didUpdate","on","cssTransition","concat","fn","CloseButton","_NotificationCard","_applyDecoratedDescriptor","_class","prototype","service","configurable","enumerable","writable","initializer","tracked","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCMA,IAAAA,kDAAN,MAAMA,yBAAyBC,SAAU,CAAA;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA;AAAAC,IAAAA,0BAAA,wBAAAC,WAAA,EAAA,IAAA,CAAA;AAAAD,IAAAA,0BAAA,qBAAAE,YAAA,EAAA,IAAA,CAAA;AAAA;EAIvC,IAAIC,MAAAA,GAAkB;AACpB,IAAA,MAAMA,MAAS,GAAA,CACb,CAAA,qBAAA,EAAwB,IAAI,CAACJ,IAAI,CAACK,YAAY,CAACC,kBAAkB,CAAA,EAAA,CAAI,CACtE;AAED,IAAA,IAAI,CAAC,IAAI,CAACC,UAAU,EAAE;AACpBH,MAAAA,MAAA,CAAOI,IAAI,CACT,CAAA,kBAAA,EAAqB,IAAI,CAACR,IAAI,CAACK,YAAY,CAACC,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AAAC,wBAAA,CAAAV,MAAA,CAAAC,SAAA,EAAA,eAAA,CAAA,EAAAD,MAAA,CAAAC,SAAA,CAAAF,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EASAO,QAAAA,EAAAA,CAAAA,MAAA,GAAAC,MAAA,CAAAC,wBAAA,CAAAV,MAAA,CAAAC,SAAA,EAAA,QAAA,CAAA,EAAAD,MAAA,CAAAC,SAAA,CAAAF,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,YAIAO,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAV,MAAA,CAAAC,SAAA,EAAAD,OAAAA,CAAAA,EAAAA,MAAA,CAAAC,SAAA,CAAAF,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAMAO,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAV,MAAA,CAAAC,SAAA,EAAAD,QAAAA,CAAAA,EAAAA,MAAA,CAAAC,SAAA,CAAAF,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAAA,yBAAA,EAAA,CAMAO,MAAA,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAV,MAAA,CAAAC,SAAA,EAAAD,yBAAAA,CAAAA,EAAAA,MAAA,CAAAC,SAAA,GAAAD,MAAA;;;;"}
@@ -30,32 +30,32 @@ let NotificationsContainer = (_class = (_NotificationsContainer = class Notifica
30
30
  }
31
31
  get classes() {
32
32
  const {
33
- notificationsContainer: notificationsContainer1
33
+ notificationsContainer
34
34
  } = useStyles();
35
- return notificationsContainer1({
35
+ return notificationsContainer({
36
36
  placement: this.args.placement,
37
37
  class: this.args.class
38
38
  });
39
39
  }
40
- addSpacing(element1) {
41
- const spacing1 = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
40
+ addSpacing(element) {
41
+ const spacing = typeof this.args.spacing === 'undefined' ? 16 : this.args.spacing;
42
42
  if (this.isTopPlacement) {
43
- element1.style.marginTop = `${spacing1}px`;
43
+ element.style.marginTop = `${spacing}px`;
44
44
  }
45
45
  }
46
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
+ strictMode: true,
47
48
  scope: () => ({
48
49
  didInsert,
49
50
  didUpdate,
50
51
  NotificationCard
51
- }),
52
- strictMode: true
53
- }), _NotificationsContainer), _NotificationsContainer), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [inject], {
52
+ })
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
- }), _applyDecoratedDescriptor(_class.prototype, "addSpacing", [action], Object.getOwnPropertyDescriptor(_class.prototype, "addSpacing"), _class.prototype)), _class);
58
+ }), _applyDecoratedDescriptor(_class.prototype, "addSpacing", [action], Object.getOwnPropertyDescriptor(_class.prototype, "addSpacing"), _class.prototype), _class);
59
59
 
60
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":["/* 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9qbHVlZGtlL2NvZGUvb3NzL2Zyb250aWxlL3BhY2thZ2VzL25vdGlmaWNhd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7Ozs7Ozs7Ozs7RUFvQlYsQ0FBQSxFQUFBO1lBQUEsV0FBQSxJQUFXO1lBQVg7Z0JBQUEsT0FBQSxLQUFBLFNBQUEsQ0FBQSxFQUFXO1lBQUQ7UUFBQTtJQUFBLENBcEJBO0FBcUJaO0FBRUEsU0FBUyxzQkFBc0IsRUFBRSxBQUFLLCtCQUErQixHQUFHO0FBQ3hFLGVBQWUsdUJBQXVCIn0"],"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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,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":["/* eslint-disable ember/no-at-ember-render-modifiers */\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';\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 @action addSpacing(element: HTMLElement): void {\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 {{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 </template>\n}\n\nexport { NotificationsContainer, type NotificationsContainerSignature };\nexport default NotificationsContainer;\n"],"names":["NotificationsContainer","Component","constructor","args","_initializerDefineProperty","_descriptor","isTopPlacement","placement","includes","sortedNotifications","notifications","slice","reverse","classes","notificationsContainer","useStyles","class","addSpacing","element","spacing","style","marginTop","setComponentTemplate","precompileTemplate","strictMode","scope","didInsert","didUpdate","NotificationCard","_NotificationsContainer","_applyDecoratedDescriptor","_class","prototype","service","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;AAmCMA,IAAAA,8DAAN,MAAMA,+BAA+BC,SAAU,CAAA;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA;AAAAC,IAAAA,0BAAA,wBAAAC,WAAA,EAAA,IAAA,CAAA;AAAA;EAG7C,IAAIC,cAAAA,GAA0B;AAC5B,IAAA,OAAO,CAAC,EAAE,IAAI,CAACH,IAAI,CAACI,SAAS,IAAI,IAAI,CAACJ,IAAI,CAACI,SAAS,CAACC,QAAQ,CAAC,KAAM,CAAA,CAAA;AACtE;EAEA,IAAIC,sBAAsC;IACxC,IAAI,IAAI,CAACH,cAAc,EAAE;AACvB,MAAA,OAAO,IAAI,CAACI,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,CAACJ,IAAI,CAACI,SAAS;AAC9BS,MAAAA,KAAA,EAAO,IAAI,CAACb,IAAI,CAACa;AACnB,KAAA,CAAA;AACF;EAEQC,UAAAA,CAAWC,OAAoB,EAAQ;AAC7C,IAAA,MAAMC,OACJ,GAAA,OAAO,IAAI,CAAChB,IAAI,CAACgB,OAAO,KAAK,WAAA,GAAc,EAAK,GAAA,IAAI,CAAChB,IAAI,CAACgB,OAAO;IACnE,IAAI,IAAI,CAACb,cAAc,EAAE;AACvBY,MAAAA,OAAQ,CAAAE,KAAK,CAACC,SAAS,GAAG,CAAA,EAAGF,OAAA,CAAW,EAAA,CAAA;AAC1C;AACF;AAuBF,CAAA,EAAAG,oBAAA,CArBEC,kBAAA,CAoBA,oeAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,SAAA;IAAAC,SAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,uBAAA,CAAA,EAAAA,uBAAA,CAAAxB,EAAAA,WAAA,GAAAyB,yBAAA,CAAAC,MAAA,CAAAC,SAAA,oBAnDTC,MAAA,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA;AAAA,CAAAP,CAAAA,EAAAA,yBAAA,CAAAC,MAAA,CAAAC,SAAA,EAuBAM,YAAAA,EAAAA,CAAAA,MAAA,GAAAC,MAAA,CAAAC,wBAAA,CAAAT,MAAA,CAAAC,SAAA,EAAA,YAAA,CAAA,EAAAD,MAAA,CAAAC,SAAA,GAAAD,MAAA;;;;"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { N as Notification, T as Timer } from './manager-DDspsX9L.js';
1
+ export { N as Notification, T as Timer } from './manager-IxquV5I2.js';
2
2
  import '@babel/runtime/helpers/esm/defineProperty';
3
3
  import '@ember/service';
4
4
  export { NotificationCard } from './components/notification-card.js';
@@ -41,7 +41,7 @@ let Timer = (_class$2 = class Timer {
41
41
  this.isRunning = false;
42
42
  }, this.remaining);
43
43
  }
44
- }, (_descriptor$2 = _applyDecoratedDescriptor(_class$2.prototype, "remaining", [tracked], {
44
+ }, _descriptor$2 = _applyDecoratedDescriptor(_class$2.prototype, "remaining", [tracked], {
45
45
  configurable: true,
46
46
  enumerable: true,
47
47
  writable: true,
@@ -53,7 +53,7 @@ let Timer = (_class$2 = class Timer {
53
53
  initializer: function () {
54
54
  return true;
55
55
  }
56
- }), _applyDecoratedDescriptor(_class$2.prototype, "clear", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "clear"), _class$2.prototype), _applyDecoratedDescriptor(_class$2.prototype, "pause", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "pause"), _class$2.prototype), _applyDecoratedDescriptor(_class$2.prototype, "resume", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "resume"), _class$2.prototype)), _class$2);
56
+ }), _applyDecoratedDescriptor(_class$2.prototype, "clear", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "clear"), _class$2.prototype), _applyDecoratedDescriptor(_class$2.prototype, "pause", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "pause"), _class$2.prototype), _applyDecoratedDescriptor(_class$2.prototype, "resume", [action], Object.getOwnPropertyDescriptor(_class$2.prototype, "resume"), _class$2.prototype), _class$2);
57
57
 
58
58
  function getConfigOption(key, defaultValue) {
59
59
  const value = get(config['@frontile/notifications'] || {}, key);
@@ -91,7 +91,7 @@ let Notification = (_class$1 = class Notification {
91
91
  this.timer.clear();
92
92
  }
93
93
  }
94
- }, (_descriptor$1 = _applyDecoratedDescriptor(_class$1.prototype, "timer", [tracked], {
94
+ }, _descriptor$1 = _applyDecoratedDescriptor(_class$1.prototype, "timer", [tracked], {
95
95
  configurable: true,
96
96
  enumerable: true,
97
97
  writable: true,
@@ -103,7 +103,7 @@ let Notification = (_class$1 = class Notification {
103
103
  initializer: function () {
104
104
  return false;
105
105
  }
106
- })), _class$1);
106
+ }), _class$1);
107
107
 
108
108
  var _class, _descriptor;
109
109
  let NotificationsManager = (_class = class NotificationsManager {
@@ -146,14 +146,14 @@ let NotificationsManager = (_class = class NotificationsManager {
146
146
  this.remove(notification);
147
147
  });
148
148
  }
149
- }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [tracked], {
149
+ }, _descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [tracked], {
150
150
  configurable: true,
151
151
  enumerable: true,
152
152
  writable: true,
153
153
  initializer: function () {
154
154
  return [];
155
155
  }
156
- })), _class);
156
+ }), _class);
157
157
 
158
158
  export { Notification as N, Timer as T, NotificationsManager as a };
159
- //# sourceMappingURL=manager-DDspsX9L.js.map
159
+ //# sourceMappingURL=manager-IxquV5I2.js.map
@@ -1 +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,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MA,CAACI,YAA2B,EAAQ;IACxC,IAAI,CAACA,YAAY,EAAE;AACjB,MAAA,OAAA;AACF,KAAA;IAEAA,YAAY,CAACJ,MAAM,EAAE,CAAA;IAErBzB,KAAK,CACH,IAAI,EACJ,MAAM;MACJ,IAAI,CAAC8B,aAAa,GAAG,IAAI,CAACA,aAAa,CAACG,MAAM,CAAEC,CAAC,IAAK;QACpD,OAAOA,CAAC,KAAKL,YAAY,CAAA;AAC3B,OAAC,CAAC,CAAA;AACJ,KAAC,EACDA,YAAY,CAACN,kBACf,CAAC,CAAA;AACH,GAAA;AAEAY,EAAAA,SAASA,GAAS;AAChB,IAAA,IAAI,CAACL,aAAa,CAACM,OAAO,CAAEP,YAAY,IAAK;AAC3C,MAAA,IAAI,CAACJ,MAAM,CAACI,YAAY,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
+ {"version":3,"file":"manager-IxquV5I2.js","sources":["../src/-private/timer.ts","../src/-private/get-config.ts","../src/-private/notification.ts","../src/-private/manager.ts"],"sourcesContent":["/* eslint-disable ember/no-runloop */\nimport { tracked } from '@glimmer/tracking';\nimport { later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { action } from '@ember/object';\n\nexport default class Timer {\n @tracked remaining: number;\n @tracked isRunning = true;\n\n readonly onFinish: () => void;\n private timer?: EmberTimer;\n private start!: number;\n\n constructor(duration: number, onFinish: () => void) {\n this.remaining = duration;\n this.onFinish = onFinish;\n this.setup();\n }\n\n @action clear(): void {\n this.isRunning = false;\n\n if (this.timer) {\n cancel(this.timer);\n }\n }\n\n @action pause(): void {\n this.clear();\n this.remaining -= Date.now() - this.start;\n }\n\n @action resume(): void {\n this.clear();\n this.setup();\n }\n\n private setup(): void {\n this.start = Date.now();\n this.isRunning = true;\n\n this.timer = later(\n this,\n () => {\n this.onFinish();\n this.isRunning = false;\n },\n this.remaining\n );\n }\n}\n","import config from 'ember-get-config';\nimport { get } from '@ember/object';\nimport type { DefaultConfig } from './types';\n\nexport function getConfigOption<T extends keyof DefaultConfig>(\n key: T,\n defaultValue: NonNullable<DefaultConfig[T]>\n): NonNullable<DefaultConfig[T]> {\n const value = get(\n config['@frontile/notifications'] || ({} as never),\n key as never\n );\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","import { tracked } from '@glimmer/tracking';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport type { NotificationOptions, CustomAction } from './types';\n\nexport default class Notification {\n readonly message: string;\n readonly transitionDuration: number;\n readonly appearance: NonNullable<NotificationOptions['appearance']>;\n readonly customActions?: CustomAction[];\n readonly allowClosing: boolean;\n readonly duration: number;\n\n @tracked timer?: Timer;\n @tracked isRemoving = false;\n\n constructor(message: string, options: NotificationOptions = {}) {\n this.message = message;\n this.appearance =\n options.appearance || getConfigOption('appearance', 'info');\n this.customActions = options.customActions;\n this.duration = options.duration || getConfigOption('duration', 5000);\n this.transitionDuration =\n typeof options.transitionDuration !== 'undefined'\n ? options.transitionDuration\n : getConfigOption('transitionDuration', 200);\n\n if (options.allowClosing === false) {\n this.allowClosing = false;\n } else {\n this.allowClosing = true;\n }\n }\n\n remove(): void {\n this.isRemoving = true;\n\n if (this.timer) {\n this.timer.clear();\n }\n }\n}\n","/* eslint-disable ember/no-runloop */\nimport Notification from './notification';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport { tracked } from '@glimmer/tracking';\nimport { later } from '@ember/runloop';\nimport type { NotificationOptions } from './types';\n\nexport default class NotificationsManager {\n @tracked notifications: Notification[] = [];\n\n add(message: string, options: NotificationOptions = {}): Notification {\n const notification = new Notification(message, options);\n this.notifications = [...this.notifications, notification];\n\n let preserve =\n typeof options.preserve === 'undefined'\n ? getConfigOption('preserve', false)\n : options.preserve;\n\n // if default config has set skipTimer to true, we will preserve the\n // notification, therefore skiping the timer\n if (getConfigOption('skipTimer', false) === true) {\n preserve = true;\n }\n\n if (preserve === false) {\n this.setupAutoRemoval(notification, notification.duration);\n }\n return notification;\n }\n\n remove(notification?: Notification): void {\n if (!notification) {\n return;\n }\n\n notification.remove();\n\n later(\n this,\n () => {\n this.notifications = this.notifications.filter((n) => {\n return n !== notification;\n });\n },\n notification.transitionDuration\n );\n }\n\n removeAll(): void {\n this.notifications.forEach((notification) => {\n this.remove(notification);\n });\n }\n\n private setupAutoRemoval(notification: Notification, duration: number): void {\n notification.timer = new Timer(duration, () => {\n this.remove(notification);\n });\n }\n}\n"],"names":["Timer","_class","constructor","duration","onFinish","_initializerDefineProperty","_descriptor","_descriptor2","_defineProperty","remaining","setup","clear","isRunning","timer","cancel","pause","Date","now","start","resume","later","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","getConfigOption","key","defaultValue","value","get","config","undefined","Notification","message","options","appearance","customActions","transitionDuration","allowClosing","remove","isRemoving","NotificationsManager","add","notification","notifications","preserve","setupAutoRemoval","filter","n","removeAll","forEach"],"mappings":";;;;;;;;;;AAIuC,IAElBA,KAAK,IAAAC,QAAA,GAAX,MAAMD,KAAK,CAAC;AAQzBE,EAAAA,WAAWA,CAACC,QA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A,IAAIA,QAAQ,KAAK,KAAK,EAAE;MACtB,IAAI,CAACC,gBAAgB,CAACH,YAAY,EAAEA,YAAY,CAAC9C,QAAQ,CAAC;AAC5D;AACA,IAAA,OAAO8C,YAAY;AACrB;EAEAJ,MAAMA,CAACI,YAA2B,EAAQ;IACxC,IAAI,CAACA,YAAY,EAAE;AACjB,MAAA;AACF;IAEAA,YAAY,CAACJ,MAAM,EAAE;IAErBzB,KAAK,CACH,IAAI,EACJ,MAAM;MACJ,IAAI,CAAC8B,aAAa,GAAG,IAAI,CAACA,aAAa,CAACG,MAAM,CAAEC,CAAC,IAAK;QACpD,OAAOA,CAAC,KAAKL,YAAY;AAC3B,OAAC,CAAC;AACJ,KAAC,EACDA,YAAY,CAACN,kBACf,CAAC;AACH;AAEAY,EAAAA,SAASA,GAAS;AAChB,IAAA,IAAI,CAACL,aAAa,CAACM,OAAO,CAAEP,YAAY,IAAK;AAC3C,MAAA,IAAI,CAACJ,MAAM,CAACI,YAAY,CAAC;AAC3B,KAAC,CAAC;AACJ;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;AAC3B,KAAC,CAAC;AACJ;AACF,CAAC,EAAA3C,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;AAAA;AAAA,CAAA,CAAA,EAAA1B,MAAA;;;;"}
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
2
  import Service from '@ember/service';
3
- import { a as NotificationsManager } from '../manager-DDspsX9L.js';
3
+ import { a as NotificationsManager } from '../manager-IxquV5I2.js';
4
4
 
5
5
  class NotificationsService extends Service {
6
6
  constructor(...args) {
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sources":["../../src/services/notifications.ts"],"sourcesContent":["import Service from '@ember/service';\nimport Notification from '../-private/notification';\nimport NotificationsManager from '../-private/manager';\nimport type { NotificationOptions } from '../-private/types';\n\nexport default class NotificationsService extends Service {\n manager = new NotificationsManager();\n\n get notifications(): Notification[] {\n return this.manager.notifications;\n }\n\n add = (message: string, options?: NotificationOptions): Notification => {\n return this.manager.add(message, options);\n };\n\n remove = (notification?: Notification): void => {\n this.manager.remove(notification);\n };\n\n removeAll = (): void => {\n this.manager.removeAll();\n };\n\n willDestroy(): void {\n this.removeAll();\n super.willDestroy();\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your services.\ndeclare module '@ember/service' {\n interface Registry {\n notifications: NotificationsService;\n }\n}\n"],"names":["NotificationsService","Service","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;;;;"}
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;AAAAC,IAAAA,eAAA,CAC9C,IAAA,EAAA,SAAA,EAAA,IAAIC,oBAAoB,EAAE,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;KAC1C,CAAA;IAAAH,eAAA,CAAA,IAAA,EAAA,QAAA,EAESM,YAA2B,IAAW;AAC9C,MAAA,IAAI,CAACF,OAAO,CAACG,MAAM,CAACD,YAAY,CAAC;KAClC,CAAA;AAAAN,IAAAA,eAAA,oBAEW,MAAY;AACtB,MAAA,IAAI,CAACI,OAAO,CAACI,SAAS,EAAE;KACzB,CAAA;AAAA;EAdD,IAAIC,aAAaA,GAAmB;AAClC,IAAA,OAAO,IAAI,CAACL,OAAO,CAACK,aAAa;AACnC;AAcAC,EAAAA,WAAWA,GAAS;IAClB,IAAI,CAACF,SAAS,EAAE;IAChB,KAAK,CAACE,WAAW,EAAE;AACrB;AACF;;AAEA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/notifications",
3
- "version": "0.17.0-alpha.7",
3
+ "version": "0.17.0-beta.1",
4
4
  "description": "Component Library for Ember Octane apps: Notifications",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -37,40 +37,39 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@babel/runtime": ">= 7",
40
- "ember-source": "^4.0.0 || ^5.0.0"
40
+ "ember-source": ">= 4.12.0"
41
41
  },
42
42
  "dependencies": {
43
43
  "@ember/render-modifiers": "^2.1.0",
44
- "@embroider/addon-shim": "^1.8.7",
45
- "@frontile/buttons": "0.17.0-alpha.7",
46
- "@frontile/theme": "0.17.0-alpha.7",
44
+ "@embroider/addon-shim": "^1.9.0",
45
+ "@frontile/buttons": "0.17.0-beta.1",
46
+ "@frontile/theme": "0.17.0-beta.1",
47
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.9",
52
+ "@babel/core": "7.26.0",
53
53
  "@babel/plugin-proposal-class-properties": "7.18.6",
54
- "@babel/plugin-proposal-decorators": "7.23.9",
54
+ "@babel/plugin-proposal-decorators": "7.25.9",
55
55
  "@babel/plugin-transform-class-static-block": "^7.23.4",
56
- "@babel/preset-typescript": "7.23.3",
57
- "@embroider/addon-dev": "4.2.1",
58
- "@embroider/addon-shim": "^1.8.6",
56
+ "@babel/preset-typescript": "7.26.0",
57
+ "@embroider/addon-dev": "7.0.0",
59
58
  "@glimmer/component": "^1.1.2",
60
59
  "@glimmer/tracking": "^1.1.2",
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",
60
+ "@glint/core": "1.5.0",
61
+ "@glint/environment-ember-loose": "1.5.0",
62
+ "@glint/environment-ember-template-imports": "1.5.0",
63
+ "@glint/template": "1.5.0",
65
64
  "@rollup/plugin-node-resolve": "^15.2.3",
66
- "@tsconfig/ember": "^3.0.3",
65
+ "@tsconfig/ember": "^3.0.5",
67
66
  "babel-plugin-ember-template-compilation": "^2.2.1",
68
- "concurrently": "^8.2.2",
69
- "ember-source": "^5.6.0",
70
- "rollup": "^4.11.0",
67
+ "concurrently": "^9.1.0",
68
+ "ember-source": "^5.12.0",
69
+ "rollup": "^4.25.0",
71
70
  "rollup-plugin-ts": "^3.4.5",
72
71
  "tailwindcss": "^3.4.1",
73
- "typescript": "^5.3.3"
72
+ "typescript": "^5.4.2"
74
73
  },
75
74
  "engines": {
76
75
  "node": "10.* || >= 12"
@@ -109,5 +108,5 @@
109
108
  ]
110
109
  }
111
110
  },
112
- "gitHead": "d18a82dfb3de45d02048af2d38fde83d638e61ee"
111
+ "gitHead": "74ced40974f3f509f12bc90eb28bf258557c0637"
113
112
  }
@@ -1,10 +0,0 @@
1
- import Notification from "./notification-64b501e5.js";
2
- import { NotificationOptions } from "./types-16c08671.js";
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- add(message: string, options?: NotificationOptions): Notification;
6
- remove(notification?: Notification): void;
7
- removeAll(): void;
8
- private setupAutoRemoval;
9
- }
10
- export { NotificationsManager as default };
@@ -1,10 +0,0 @@
1
- import Notification from "./notification-64b501e5.js";
2
- import { NotificationOptions } from "./types-16c08671.js";
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- add(message: string, options?: NotificationOptions): Notification;
6
- remove(notification?: Notification): void;
7
- removeAll(): void;
8
- private setupAutoRemoval;
9
- }
10
- export { NotificationsManager as default };
@@ -1,10 +0,0 @@
1
- import Notification from "./notification-64b501e5.js";
2
- import { NotificationOptions } from "./types-16c08671.js";
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- add(message: string, options?: NotificationOptions): Notification;
6
- remove(notification?: Notification): void;
7
- removeAll(): void;
8
- private setupAutoRemoval;
9
- }
10
- export { NotificationsManager as default };
@@ -1,10 +0,0 @@
1
- import Notification from './notification-64b501e5.js';
2
- import { NotificationOptions } from './types-16c08671.js';
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- add(message: string, options?: NotificationOptions): Notification;
6
- remove(notification?: Notification): void;
7
- removeAll(): void;
8
- private setupAutoRemoval;
9
- }
10
- export { NotificationsManager as default };
@@ -1,13 +0,0 @@
1
- declare class Timer {
2
- remaining: number;
3
- isRunning: boolean;
4
- readonly onFinish: () => void;
5
- private timer?;
6
- private start;
7
- constructor(duration: number, onFinish: () => void);
8
- clear(): void;
9
- pause(): void;
10
- resume(): void;
11
- private setup;
12
- }
13
- export { Timer as default };