@frontile/notifications 0.17.0-beta.4 → 0.17.0-beta.5

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,6 +1,6 @@
1
1
  import Notification from './notification';
2
- import type { NotificationOptions } from './types';
3
2
  import type { DefaultConfig } from './types';
3
+ import type { NotificationOptions } from './types';
4
4
  export default class NotificationsManager {
5
5
  notifications: Notification[];
6
6
  config: DefaultConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAM1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,MAAM,EAAE,aAAa,CAAM;gBAEf,OAAO,EAAE,MAAM;IAW3B,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 Notification from "./notification-5242cbb9.js";
2
- import { NotificationOptions, DefaultConfig } from "./types-16c08671.js";
2
+ import { DefaultConfig, NotificationOptions } from "./types-16c08671.js";
3
3
  declare class NotificationsManager {
4
4
  notifications: Notification[];
5
5
  config: DefaultConfig;
@@ -10,4 +10,4 @@ declare class NotificationsManager {
10
10
  private setupAutoRemoval;
11
11
  }
12
12
  export { NotificationsManager as default };
13
- //# sourceMappingURL=manager-CpMKYiRF.d.ts.map
13
+ //# sourceMappingURL=manager-F_0k8v_Z.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-F_0k8v_Z.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAS1C,OAAO,sCAAsB,4BAAgB;AAG7C,cAAqB,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"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { N as Notification, T as Timer } from './manager-CpMKYiRF.js';
1
+ export { N as Notification, T as Timer } from './manager-F_0k8v_Z.js';
2
2
  import '@babel/runtime/helpers/esm/defineProperty';
3
3
  import '@ember/service';
4
4
  export { NotificationCard } from './components/notification-card.js';
@@ -0,0 +1,171 @@
1
+ import _initializerDefineProperty from '@babel/runtime/helpers/esm/initializerDefineProperty';
2
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
+ import _applyDecoratedDescriptor from '@babel/runtime/helpers/esm/applyDecoratedDescriptor';
4
+ import '@babel/runtime/helpers/esm/initializerWarningHelper';
5
+ import { tracked } from '@glimmer/tracking';
6
+ import { cancel, later } from '@ember/runloop';
7
+ import { action, get } from '@ember/object';
8
+ import { assert } from '@ember/debug';
9
+ import { getOwner } from '@ember/owner';
10
+ import { isDestroyed } from '@ember/destroyable';
11
+
12
+ var _class$2, _descriptor$2, _descriptor2$1;
13
+ let Timer = (_class$2 = class Timer {
14
+ constructor(duration, onFinish) {
15
+ _initializerDefineProperty(this, "remaining", _descriptor$2, this);
16
+ _initializerDefineProperty(this, "isRunning", _descriptor2$1, this);
17
+ _defineProperty(this, "onFinish", void 0);
18
+ _defineProperty(this, "timer", void 0);
19
+ _defineProperty(this, "start", void 0);
20
+ this.remaining = duration;
21
+ this.onFinish = onFinish;
22
+ this.setup();
23
+ }
24
+ clear() {
25
+ this.isRunning = false;
26
+ if (this.timer) {
27
+ cancel(this.timer);
28
+ }
29
+ }
30
+ pause() {
31
+ this.clear();
32
+ this.remaining -= Date.now() - this.start;
33
+ }
34
+ resume() {
35
+ this.clear();
36
+ this.setup();
37
+ }
38
+ setup() {
39
+ this.start = Date.now();
40
+ this.isRunning = true;
41
+ this.timer = later(this, () => {
42
+ this.onFinish();
43
+ this.isRunning = false;
44
+ }, this.remaining);
45
+ }
46
+ }, _descriptor$2 = _applyDecoratedDescriptor(_class$2.prototype, "remaining", [tracked], {
47
+ configurable: true,
48
+ enumerable: true,
49
+ writable: true,
50
+ initializer: null
51
+ }), _descriptor2$1 = _applyDecoratedDescriptor(_class$2.prototype, "isRunning", [tracked], {
52
+ configurable: true,
53
+ enumerable: true,
54
+ writable: true,
55
+ initializer: function () {
56
+ return true;
57
+ }
58
+ }), _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);
59
+
60
+ function getConfigOption(config, key, defaultValue) {
61
+ const value = get(config, key);
62
+ if (value === undefined) {
63
+ return defaultValue;
64
+ }
65
+ return value;
66
+ }
67
+
68
+ var _class$1, _descriptor$1, _descriptor2;
69
+ let Notification = (_class$1 = class Notification {
70
+ constructor(config, message, options = {}) {
71
+ _defineProperty(this, "message", void 0);
72
+ _defineProperty(this, "transitionDuration", void 0);
73
+ _defineProperty(this, "appearance", void 0);
74
+ _defineProperty(this, "customActions", void 0);
75
+ _defineProperty(this, "allowClosing", void 0);
76
+ _defineProperty(this, "duration", void 0);
77
+ _initializerDefineProperty(this, "timer", _descriptor$1, this);
78
+ _initializerDefineProperty(this, "isRemoving", _descriptor2, this);
79
+ this.message = message;
80
+ this.appearance = options.appearance || getConfigOption(config, 'appearance', 'info');
81
+ this.customActions = options.customActions;
82
+ this.duration = options.duration || getConfigOption(config, 'duration', 5000);
83
+ this.transitionDuration = typeof options.transitionDuration !== 'undefined' ? options.transitionDuration : getConfigOption(config, 'transitionDuration', 200);
84
+ if (options.allowClosing === false) {
85
+ this.allowClosing = false;
86
+ } else {
87
+ this.allowClosing = true;
88
+ }
89
+ }
90
+ remove() {
91
+ this.isRemoving = true;
92
+ if (this.timer) {
93
+ this.timer.clear();
94
+ }
95
+ }
96
+ }, _descriptor$1 = _applyDecoratedDescriptor(_class$1.prototype, "timer", [tracked], {
97
+ configurable: true,
98
+ enumerable: true,
99
+ writable: true,
100
+ initializer: null
101
+ }), _descriptor2 = _applyDecoratedDescriptor(_class$1.prototype, "isRemoving", [tracked], {
102
+ configurable: true,
103
+ enumerable: true,
104
+ writable: true,
105
+ initializer: function () {
106
+ return false;
107
+ }
108
+ }), _class$1);
109
+
110
+ var _class, _descriptor;
111
+ let NotificationsManager = (_class = class NotificationsManager {
112
+ constructor(context) {
113
+ _initializerDefineProperty(this, "notifications", _descriptor, this);
114
+ _defineProperty(this, "config", {});
115
+ if (isDestroyed(context)) {
116
+ return;
117
+ }
118
+ const owner = getOwner(context);
119
+ assert('NotificationsManager context must have an owner', owner);
120
+ const configFactory = owner.factoryFor('config:environment');
121
+ if (configFactory && configFactory.class) {
122
+ this.config = configFactory.class['@frontile/notifications'] || {};
123
+ }
124
+ }
125
+ add(message, options = {}) {
126
+ const notification = new Notification(this.config, message, options);
127
+ this.notifications = [...this.notifications, notification];
128
+ let preserve = typeof options.preserve === 'undefined' ? getConfigOption(this.config, 'preserve', false) : options.preserve;
129
+
130
+ // if default config has set skipTimer to true, we will preserve the
131
+ // notification, therefore skiping the timer
132
+ if (getConfigOption(this.config, 'skipTimer', false) === true) {
133
+ preserve = true;
134
+ }
135
+ if (preserve === false) {
136
+ this.setupAutoRemoval(notification, notification.duration);
137
+ }
138
+ return notification;
139
+ }
140
+ remove(notification) {
141
+ if (!notification) {
142
+ return;
143
+ }
144
+ notification.remove();
145
+ later(this, () => {
146
+ this.notifications = this.notifications.filter(n => {
147
+ return n !== notification;
148
+ });
149
+ }, notification.transitionDuration);
150
+ }
151
+ removeAll() {
152
+ this.notifications.forEach(notification => {
153
+ this.remove(notification);
154
+ });
155
+ }
156
+ setupAutoRemoval(notification, duration) {
157
+ notification.timer = new Timer(duration, () => {
158
+ this.remove(notification);
159
+ });
160
+ }
161
+ }, _descriptor = _applyDecoratedDescriptor(_class.prototype, "notifications", [tracked], {
162
+ configurable: true,
163
+ enumerable: true,
164
+ writable: true,
165
+ initializer: function () {
166
+ return [];
167
+ }
168
+ }), _class);
169
+
170
+ export { Notification as N, Timer as T, NotificationsManager as a };
171
+ //# sourceMappingURL=manager-F_0k8v_Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-F_0k8v_Z.js","sources":["../src/-private/timer.ts","../src/-private/get-config.ts","../src/-private/notification.ts","../src/-private/manager.ts"],"sourcesContent":["/* eslint-disable ember/no-runloop */\nimport { tracked } from '@glimmer/tracking';\nimport { later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { action } from '@ember/object';\n\nexport default class Timer {\n @tracked remaining: number;\n @tracked isRunning = true;\n\n readonly onFinish: () => void;\n private timer?: EmberTimer;\n private start!: number;\n\n constructor(duration: number, onFinish: () => void) {\n this.remaining = duration;\n this.onFinish = onFinish;\n this.setup();\n }\n\n @action clear(): void {\n this.isRunning = false;\n\n if (this.timer) {\n cancel(this.timer);\n }\n }\n\n @action pause(): void {\n this.clear();\n this.remaining -= Date.now() - this.start;\n }\n\n @action resume(): void {\n this.clear();\n this.setup();\n }\n\n private setup(): void {\n this.start = Date.now();\n this.isRunning = true;\n\n this.timer = later(\n this,\n () => {\n this.onFinish();\n this.isRunning = false;\n },\n this.remaining\n );\n }\n}\n","import { get } from '@ember/object';\nimport type { DefaultConfig } from './types';\n\nexport function getConfigOption<T extends keyof DefaultConfig>(\n config: DefaultConfig,\n key: T,\n defaultValue: NonNullable<DefaultConfig[T]>\n): NonNullable<DefaultConfig[T]> {\n const value = get(config, key);\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","import { tracked } from '@glimmer/tracking';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport type { NotificationOptions, CustomAction, DefaultConfig } from './types';\n\nexport default class Notification {\n readonly message: string;\n readonly transitionDuration: number;\n readonly appearance: NonNullable<NotificationOptions['appearance']>;\n readonly customActions?: CustomAction[];\n readonly allowClosing: boolean;\n readonly duration: number;\n\n @tracked timer?: Timer;\n @tracked isRemoving = false;\n\n constructor(\n config: DefaultConfig,\n message: string,\n options: NotificationOptions = {}\n ) {\n this.message = message;\n this.appearance =\n options.appearance || getConfigOption(config, 'appearance', 'info');\n this.customActions = options.customActions;\n this.duration =\n options.duration || getConfigOption(config, 'duration', 5000);\n this.transitionDuration =\n typeof options.transitionDuration !== 'undefined'\n ? options.transitionDuration\n : getConfigOption(config, 'transitionDuration', 200);\n\n if (options.allowClosing === false) {\n this.allowClosing = false;\n } else {\n this.allowClosing = true;\n }\n }\n\n remove(): void {\n this.isRemoving = true;\n\n if (this.timer) {\n this.timer.clear();\n }\n }\n}\n","/* eslint-disable ember/no-runloop */\nimport Notification from './notification';\nimport Timer from './timer';\nimport { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { getConfigOption } from './get-config';\nimport { getOwner } from '@ember/owner';\nimport { isDestroyed } from '@ember/destroyable';\nimport { later } from '@ember/runloop';\nimport type Owner from '@ember/owner';\nimport type { DefaultConfig } from './types';\nimport type { NotificationOptions } from './types';\n\nexport default class NotificationsManager {\n @tracked notifications: Notification[] = [];\n\n config: DefaultConfig = {};\n\n constructor(context: object) {\n if (isDestroyed(context)) {\n return;\n }\n const owner = getOwner(context) as Owner;\n assert('NotificationsManager context must have an owner', owner);\n const configFactory = owner.factoryFor('config:environment');\n\n if (configFactory && configFactory.class) {\n this.config =\n (configFactory.class as never)['@frontile/notifications'] || {};\n }\n }\n\n add(message: string, options: NotificationOptions = {}): Notification {\n const notification = new Notification(this.config, message, options);\n this.notifications = [...this.notifications, notification];\n\n let preserve =\n typeof options.preserve === 'undefined'\n ? getConfigOption(this.config, 'preserve', false)\n : options.preserve;\n\n // if default config has set skipTimer to true, we will preserve the\n // notification, therefore skiping the timer\n if (getConfigOption(this.config, 'skipTimer', false) === true) {\n preserve = true;\n }\n\n if (preserve === false) {\n this.setupAutoRemoval(notification, notification.duration);\n }\n return notification;\n }\n\n remove(notification?: Notification): void {\n if (!notification) {\n return;\n }\n\n notification.remove();\n\n later(\n this,\n () => {\n this.notifications = this.notifications.filter((n) => {\n return n !== notification;\n });\n },\n notification.transitionDuration\n );\n }\n\n removeAll(): void {\n this.notifications.forEach((notification) => {\n this.remove(notification);\n });\n }\n\n private setupAutoRemoval(notification: Notification, duration: number): void {\n notification.timer = new Timer(duration, () => {\n this.remove(notification);\n });\n }\n}\n"],"names":["Timer","_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","config","key","defaultValue","value","get","undefined","Notification","message","options","appearance","customActions","transitionDuration","allowClosing","remove","isRemoving","NotificationsManager","context","isDestroyed","owner","getOwner","assert","configFactory","factoryFor","class","add","notification","notifications","preserve","setupAutoRemoval","filter","n","removeAll","forEach"],"mappings":";;;;;;;;;;;;AAIuC,IAElBA,KAAK,IAAAC,QAAA,GAAX,MAAMD,KAAK,CAAC;AAQzBE,EAAAA,WAAWA,CAACC,QAAgB,EAAEC,QAAoB,EAAE;AAAAC,IAAAA,0BAAA,oBAAAC,aAAA,EAAA,IAAA,CAAA;AAAAD,IAAAA,0BAAA,oBAAAE,cAAA,EAAA,IAAA,CAAA;IAAAC,eAAA,CAAA,IAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;IAAAA,eAAA,CAAA,IAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;IAClD,IAAI,CAACC,SAAS,GAAGN,QAAQ;IACzB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACM,KAAK,EAAE;AACd;AAEQC,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACC,SAAS,GAAG,KAAK;IAEtB,IAAI,IAAI,CAACC,KAAK,EAAE;AACdC,MAAAA,MAAM,CAAC,IAAI,CAACD,KAAK,CAAC;AACpB;AACF;AAEQE,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACJ,KAAK,EAAE;IACZ,IAAI,CAACF,SAAS,IAAIO,IAAI,CAACC,GAA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AAOsD,YAAY;AACrB;EAEAZ,MAAMA,CAACY,YAA2B,EAAQ;IACxC,IAAI,CAACA,YAAY,EAAE;AACjB,MAAA;AACF;IAEAA,YAAY,CAACZ,MAAM,EAAE;IAErBzB,KAAK,CACH,IAAI,EACJ,MAAM;MACJ,IAAI,CAACsC,aAAa,GAAG,IAAI,CAACA,aAAa,CAACG,MAAM,CAAEC,CAAC,IAAK;QACpD,OAAOA,CAAC,KAAKL,YAAY;AAC3B,OAAC,CAAC;AACJ,KAAC,EACDA,YAAY,CAACd,kBACf,CAAC;AACH;AAEAoB,EAAAA,SAASA,GAAS;AAChB,IAAA,IAAI,CAACL,aAAa,CAACM,OAAO,CAAEP,YAAY,IAAK;AAC3C,MAAA,IAAI,CAACZ,MAAM,CAACY,YAAY,CAAC;AAC3B,KAAC,CAAC;AACJ;AAEQG,EAAAA,gBAAgBA,CAACH,YAA0B,EAAEtD,QAAgB,EAAQ;IAC3EsD,YAAY,CAAC5C,KAAK,GAAG,IAAIb,KAAK,CAACG,QAAQ,EAAE,MAAM;AAC7C,MAAA,IAAI,CAAC0C,MAAM,CAACY,YAAY,CAAC;AAC3B,KAAC,CAAC;AACJ;AACF,CAAC,EAAAnD,WAAA,GAAAe,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,EAAA,eAAA,EAAA,CApEEC,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-CpMKYiRF.js';
3
+ import { a as NotificationsManager } from '../manager-F_0k8v_Z.js';
4
4
 
5
5
  class NotificationsService extends Service {
6
6
  constructor(...args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/notifications",
3
- "version": "0.17.0-beta.4",
3
+ "version": "0.17.0-beta.5",
4
4
  "description": "Component Library for Ember Octane apps: Notifications",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -42,8 +42,8 @@
42
42
  "dependencies": {
43
43
  "@ember/render-modifiers": "^2.1.0",
44
44
  "@embroider/addon-shim": "^1.9.0",
45
- "@frontile/buttons": "0.17.0-beta.4",
46
- "@frontile/theme": "0.17.0-beta.4",
45
+ "@frontile/buttons": "0.17.0-beta.5",
46
+ "@frontile/theme": "0.17.0-beta.5",
47
47
  "ember-auto-import": "^2.7.2",
48
48
  "ember-css-transitions": "^4.4.0"
49
49
  },
@@ -107,5 +107,5 @@
107
107
  ]
108
108
  }
109
109
  },
110
- "gitHead": "bd3f230b0044b7c1d6a35a295c60c435df7ec12b"
110
+ "gitHead": "5a9a2f933b0f137f9437bbfc8cf99244ec9d5e85"
111
111
  }
@@ -1,4 +0,0 @@
1
- import { DefaultConfig } from "./types-16c08671.js";
2
- declare function getConfigOption<T extends keyof DefaultConfig>(key: T, defaultValue: NonNullable<DefaultConfig[T]>): NonNullable<DefaultConfig[T]>;
3
- export { getConfigOption };
4
- //# sourceMappingURL=get-config-a59d13fc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-config-a59d13fc.d.ts","sourceRoot":"","sources":["../src/-private/get-config.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAsB,4BAAgB;AAE7C,iBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,aAAa,EAC3D,GAAG,EAAE,CAAC,EACN,YAAY,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAC1C,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAW/B"}
@@ -1,13 +0,0 @@
1
- import Notification from "./notification-5242cbb9.js";
2
- import { NotificationOptions, DefaultConfig } from "./types-16c08671.js";
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- config: DefaultConfig;
6
- constructor(context: object);
7
- add(message: string, options?: NotificationOptions): Notification;
8
- remove(notification?: Notification): void;
9
- removeAll(): void;
10
- private setupAutoRemoval;
11
- }
12
- export { NotificationsManager as default };
13
- //# sourceMappingURL=manager--2XpSzrY.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager--2XpSzrY.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAM1C,OAAO,sCAA4B,4BAAgB;AAKnD,cAAqB,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,MAAM,EAAE,aAAa,CAAM;gBAEf,OAAO,EAAE,MAAM;IAW3B,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 +0,0 @@
1
- {"version":3,"file":"manager-CpMKYiRF.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAM1C,OAAO,sCAA4B,4BAAgB;AAKnD,cAAqB,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,MAAM,EAAE,aAAa,CAAM;gBAEf,OAAO,EAAE,MAAM;IAW3B,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,11 +0,0 @@
1
- import Notification from "./notification-64b501e5.js";
2
- import { NotificationOptions } from "./types-16c08671.js";
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- add(message: string, options?: NotificationOptions): Notification;
6
- remove(notification?: Notification): void;
7
- removeAll(): void;
8
- private setupAutoRemoval;
9
- }
10
- export { NotificationsManager as default };
11
- //# sourceMappingURL=manager-IxquV5I2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager-IxquV5I2.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAK1C,OAAO,uBAA4B,4BAAgB;AAEnD,cAAqB,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY;IAqBrE,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAkBzC,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,gBAAgB;CAKzB"}
@@ -1,16 +0,0 @@
1
- import Timer from "./timer-0a840cef.js";
2
- import { NotificationOptions, CustomAction } from "./types-16c08671.js";
3
- declare class Notification {
4
- readonly message: string;
5
- readonly transitionDuration: number;
6
- readonly appearance: NonNullable<NotificationOptions['appearance']>;
7
- readonly customActions?: CustomAction[];
8
- readonly allowClosing: boolean;
9
- readonly duration: number;
10
- timer?: Timer;
11
- isRemoving: boolean;
12
- constructor(message: string, options?: NotificationOptions);
13
- remove(): void;
14
- }
15
- export { Notification as default };
16
- //# sourceMappingURL=notification-64b501e5.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification-64b501e5.d.ts","sourceRoot":"","sources":["../src/-private/notification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,4BAAgB;AAE5B,OAAO,qCAA0C,4BAAgB;AAEjE,cAAqB,YAAY;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,UAAS;gBAEhB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;IAkB9D,MAAM,IAAI,IAAI;CAOf"}