@frontile/notifications 0.17.0-beta.2 → 0.17.0-beta.21

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 (45) hide show
  1. package/declarations/-private/get-config.d.ts +1 -2
  2. package/declarations/-private/manager.d.ts +7 -4
  3. package/declarations/-private/notification.d.ts +4 -4
  4. package/declarations/-private/timer.d.ts +0 -1
  5. package/declarations/-private/types.d.ts +7 -2
  6. package/declarations/components/notification-card.d.ts +19 -9
  7. package/declarations/components/notifications-container.d.ts +13 -2
  8. package/declarations/index.d.ts +0 -1
  9. package/declarations/services/notifications.d.ts +5 -4
  10. package/declarations/template-registry.d.ts +0 -1
  11. package/dist/components/notification-card.js +40 -56
  12. package/dist/components/notification-card.js.map +1 -1
  13. package/dist/components/notifications-container.js +27 -27
  14. package/dist/components/notifications-container.js.map +1 -1
  15. package/dist/index.js +1 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/manager-C1Vyhk-A.js +175 -0
  18. package/dist/manager-C1Vyhk-A.js.map +1 -0
  19. package/dist/runtime-BPCpkOf1-B5Lbloj7.js +67 -0
  20. package/dist/runtime-BPCpkOf1-B5Lbloj7.js.map +1 -0
  21. package/dist/services/notifications.js +19 -15
  22. package/dist/services/notifications.js.map +1 -1
  23. package/package.json +48 -52
  24. package/declarations/-private/get-config.d.ts.map +0 -1
  25. package/declarations/-private/manager.d.ts.map +0 -1
  26. package/declarations/-private/notification.d.ts.map +0 -1
  27. package/declarations/-private/timer.d.ts.map +0 -1
  28. package/declarations/-private/types.d.ts.map +0 -1
  29. package/declarations/components/notification-card.d.ts.map +0 -1
  30. package/declarations/components/notifications-container.d.ts.map +0 -1
  31. package/declarations/get-config-a59d13fc.d.ts +0 -4
  32. package/declarations/get-config-a59d13fc.d.ts.map +0 -1
  33. package/declarations/index.d.ts.map +0 -1
  34. package/declarations/manager-IxquV5I2.d.ts +0 -11
  35. package/declarations/manager-IxquV5I2.d.ts.map +0 -1
  36. package/declarations/notification-64b501e5.d.ts +0 -16
  37. package/declarations/notification-64b501e5.d.ts.map +0 -1
  38. package/declarations/services/notifications.d.ts.map +0 -1
  39. package/declarations/template-registry.d.ts.map +0 -1
  40. package/declarations/timer-0a840cef.d.ts +0 -14
  41. package/declarations/timer-0a840cef.d.ts.map +0 -1
  42. package/declarations/types-16c08671.d.ts +0 -56
  43. package/declarations/types-16c08671.d.ts.map +0 -1
  44. package/dist/manager-IxquV5I2.js +0 -159
  45. package/dist/manager-IxquV5I2.js.map +0 -1
@@ -0,0 +1,175 @@
1
+ import { tracked } from '@glimmer/tracking';
2
+ import { cancel, later } from '@ember/runloop';
3
+ import { action, get } from '@ember/object';
4
+ import { d as decorateFieldV2, i as initializeDeferredDecorator, a as decorateMethodV2 } from './runtime-BPCpkOf1-B5Lbloj7.js';
5
+ import { assert } from '@ember/debug';
6
+ import { getOwner } from '@ember/owner';
7
+ import { isDestroyed } from '@ember/destroyable';
8
+
9
+ /* eslint-disable ember/no-runloop */
10
+ class Timer {
11
+ static {
12
+ decorateFieldV2(this.prototype, "remaining", [tracked]);
13
+ }
14
+ #remaining = (initializeDeferredDecorator(this, "remaining"), void 0);
15
+ static {
16
+ decorateFieldV2(this.prototype, "isRunning", [tracked], function () {
17
+ return true;
18
+ });
19
+ }
20
+ #isRunning = (initializeDeferredDecorator(this, "isRunning"), void 0);
21
+ onFinish;
22
+ timer;
23
+ start;
24
+ constructor(duration, onFinish) {
25
+ this.remaining = duration;
26
+ this.onFinish = onFinish;
27
+ this.setup();
28
+ }
29
+ clear() {
30
+ this.isRunning = false;
31
+ if (this.timer) {
32
+ cancel(this.timer);
33
+ }
34
+ }
35
+ static {
36
+ decorateMethodV2(this.prototype, "clear", [action]);
37
+ }
38
+ pause() {
39
+ this.clear();
40
+ this.remaining -= Date.now() - this.start;
41
+ }
42
+ static {
43
+ decorateMethodV2(this.prototype, "pause", [action]);
44
+ }
45
+ resume() {
46
+ this.clear();
47
+ this.setup();
48
+ }
49
+ static {
50
+ decorateMethodV2(this.prototype, "resume", [action]);
51
+ }
52
+ setup() {
53
+ this.start = Date.now();
54
+ this.isRunning = true;
55
+ this.timer = later(this, () => {
56
+ this.onFinish();
57
+ this.isRunning = false;
58
+ }, this.remaining);
59
+ }
60
+ }
61
+
62
+ function getConfigOption(config, key, defaultValue) {
63
+ const value = get(config, key);
64
+ if (value === undefined) {
65
+ return defaultValue;
66
+ }
67
+ return value;
68
+ }
69
+
70
+ class Notification {
71
+ message;
72
+ transitionDuration;
73
+ appearance;
74
+ customActions;
75
+ allowClosing;
76
+ duration;
77
+ metadata;
78
+ static {
79
+ decorateFieldV2(this.prototype, "timer", [tracked]);
80
+ }
81
+ #timer = (initializeDeferredDecorator(this, "timer"), void 0);
82
+ static {
83
+ decorateFieldV2(this.prototype, "isRemoving", [tracked], function () {
84
+ return false;
85
+ });
86
+ }
87
+ #isRemoving = (initializeDeferredDecorator(this, "isRemoving"), void 0);
88
+ constructor(config, message, options = {}) {
89
+ this.message = message;
90
+ this.appearance = options.appearance || getConfigOption(config, 'appearance', 'info');
91
+ this.customActions = options.customActions;
92
+ this.duration = options.duration || getConfigOption(config, 'duration', 5000);
93
+ this.transitionDuration = typeof options.transitionDuration !== 'undefined' ? options.transitionDuration : getConfigOption(config, 'transitionDuration', 200);
94
+ this.metadata = options.metadata;
95
+ if (options.allowClosing === false) {
96
+ this.allowClosing = false;
97
+ } else {
98
+ this.allowClosing = true;
99
+ }
100
+ }
101
+ remove() {
102
+ this.isRemoving = true;
103
+ if (this.timer) {
104
+ this.timer.clear();
105
+ }
106
+ }
107
+ }
108
+
109
+ /* eslint-disable ember/no-runloop */
110
+ class NotificationsManager {
111
+ static {
112
+ decorateFieldV2(this.prototype, "notifications", [tracked], function () {
113
+ return [];
114
+ });
115
+ }
116
+ #notifications = (initializeDeferredDecorator(this, "notifications"), void 0);
117
+ config = {};
118
+ onRemove;
119
+ constructor(context, onRemove) {
120
+ if (isDestroyed(context)) {
121
+ return;
122
+ }
123
+ const owner = getOwner(context);
124
+ assert('NotificationsManager context must have an owner', owner);
125
+ const configFactory = owner.factoryFor('config:environment');
126
+ if (configFactory && configFactory.class) {
127
+ this.config = configFactory.class['@frontile/notifications'] || {};
128
+ }
129
+ this.onRemove = onRemove;
130
+ }
131
+ add(message, options = {}) {
132
+ const notification = new Notification(this.config, message, options);
133
+ this.notifications = [...this.notifications, notification];
134
+ let preserve = typeof options.preserve === 'undefined' ? getConfigOption(this.config, 'preserve', false) : options.preserve;
135
+
136
+ // if default config has set skipTimer to true, we will preserve the
137
+ // notification, therefore skiping the timer
138
+ if (getConfigOption(this.config, 'skipTimer', false) === true) {
139
+ preserve = true;
140
+ }
141
+ if (preserve === false) {
142
+ this.setupAutoRemoval(notification, notification.duration);
143
+ }
144
+ return notification;
145
+ }
146
+ remove(notification) {
147
+ if (!notification) {
148
+ return;
149
+ }
150
+ notification.remove();
151
+ later(this, () => {
152
+ this.notifications = this.notifications.filter(n => {
153
+ return n !== notification;
154
+ });
155
+
156
+ // Call the onRemove callback after the notification is actually removed
157
+ if (this.onRemove) {
158
+ this.onRemove(notification);
159
+ }
160
+ }, notification.transitionDuration);
161
+ }
162
+ removeAll() {
163
+ this.notifications.forEach(notification => {
164
+ this.remove(notification);
165
+ });
166
+ }
167
+ setupAutoRemoval(notification, duration) {
168
+ notification.timer = new Timer(duration, () => {
169
+ this.remove(notification);
170
+ });
171
+ }
172
+ }
173
+
174
+ export { Notification as N, Timer as T, NotificationsManager as a };
175
+ //# sourceMappingURL=manager-C1Vyhk-A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager-C1Vyhk-A.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 TMetadata extends Record<string, unknown> = Record<string, unknown>\n> {\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 readonly metadata?: TMetadata;\n\n @tracked timer?: Timer;\n @tracked isRemoving = false;\n\n constructor(\n config: DefaultConfig,\n message: string,\n options: NotificationOptions<TMetadata> = {}\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 this.metadata = options.metadata;\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<Record<string, unknown>>[] = [];\n\n config: DefaultConfig = {};\n onRemove?: (notification: Notification<Record<string, unknown>>) => void;\n\n constructor(\n context: object,\n onRemove?: (notification: Notification<Record<string, unknown>>) => void\n ) {\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 this.onRemove = onRemove;\n }\n\n add<TMetadata extends Record<string, unknown> = Record<string, unknown>>(\n message: string,\n options: NotificationOptions<TMetadata> = {}\n ): Notification<TMetadata> {\n const notification = new Notification<TMetadata>(\n this.config,\n message,\n options\n );\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<Record<string, unknown>>): 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 // Call the onRemove callback after the notification is actually removed\n if (this.onRemove) {\n this.onRemove(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(\n notification: Notification<Record<string, unknown>>,\n duration: number\n ): void {\n notification.timer = new Timer(duration, () => {\n this.remove(notification);\n });\n }\n}\n"],"names":["Timer","g","prototype","tracked","i","void 0","onFinish","timer","start","constructor","duration","remaining","setup","clear","isRunning","cancel","n","action","pause","Date","now","resume","later","getConfigOption","config","key","defaultValue","value","get","undefined","Notification","message","transitionDuration","appearance","customActions","allowClosing","metadata","options","remove","isRemoving","NotificationsManager","onRemove","context","isDestroyed","owner","getOwner","assert","configFactory","factoryFor","class","add","notification","notifications","preserve","setupAutoRemoval","filter","removeAll","forEach"],"mappings":";;;;;;;;AAAA;AAMe,MAAMA,KAAK,CAAC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACxBC,OAAO,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;AAAA,EAAA;IAAAJ,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACPC,OAAO,CAAA,EAAA,YAAA;AAAA,MAAA,OAAa,IAAI;AAAA,IAAA,CAAA,CAAA;AAAA;AAAA,EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAAC,MAAA;EAEhBC,QAAQ;EACTC,KAAK;EACLC,KAAK;AAEbC,EAAAA,WAAWA,CAACC,QAAgB,EAAEJ,QAAoB,EAAE;IAClD,IAAI,CAACK,SAAS,GAAGD,QAAQ;IACzB,IAAI,CAACJ,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACM,KAAK,EAAE;AACd,EAAA;AAEQC,EAAAA,KAAKA,GAAS;IACpB,IAAI,CAACC,SAAS,GAAG,KAAK;IAEtB,IAAI,IAAI,CA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tBH,YAAmD,EACnDzC,QAAgB,EACV;IACNyC,YAAY,CAAC5C,KAAK,GAAG,IAAIP,KAAK,CAACU,QAAQ,EAAE,MAAM;AAC7C,MAAA,IAAI,CAAC4B,MAAM,CAACa,YAAY,CAAC;AAC3B,IAAA,CAAC,CAAC;AACJ,EAAA;AACF;;;;"}
@@ -0,0 +1,67 @@
1
+ const deferred = /* @__PURE__ */new WeakMap();
2
+ function deferDecorator(proto, prop, desc) {
3
+ let map = deferred.get(proto);
4
+ if (!map) {
5
+ map = /* @__PURE__ */new Map();
6
+ deferred.set(proto, map);
7
+ }
8
+ map.set(prop, desc);
9
+ }
10
+ function findDeferredDecorator(target, prop) {
11
+ var _a;
12
+ let cursor = target.prototype;
13
+ while (cursor) {
14
+ let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);
15
+ if (desc) {
16
+ return desc;
17
+ }
18
+ cursor = cursor.prototype;
19
+ }
20
+ }
21
+ function decorateFieldV2(prototype, prop, decorators, initializer) {
22
+ let desc = {
23
+ configurable: true,
24
+ enumerable: true,
25
+ writable: true,
26
+ initializer: null
27
+ };
28
+ if (initializer) {
29
+ desc.initializer = initializer;
30
+ }
31
+ for (let decorator of decorators) {
32
+ desc = decorator(prototype, prop, desc) || desc;
33
+ }
34
+ if (desc.initializer === void 0) {
35
+ Object.defineProperty(prototype, prop, desc);
36
+ } else {
37
+ deferDecorator(prototype, prop, desc);
38
+ }
39
+ }
40
+ function decorateMethodV2(prototype, prop, decorators) {
41
+ const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);
42
+ let desc = {
43
+ ...origDesc
44
+ };
45
+ for (let decorator of decorators) {
46
+ desc = decorator(prototype, prop, desc) || desc;
47
+ }
48
+ if (desc.initializer !== void 0) {
49
+ desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;
50
+ desc.initializer = void 0;
51
+ }
52
+ Object.defineProperty(prototype, prop, desc);
53
+ }
54
+ function initializeDeferredDecorator(target, prop) {
55
+ let desc = findDeferredDecorator(target.constructor, prop);
56
+ if (desc) {
57
+ Object.defineProperty(target, prop, {
58
+ enumerable: desc.enumerable,
59
+ configurable: desc.configurable,
60
+ writable: desc.writable,
61
+ value: desc.initializer ? desc.initializer.call(target) : void 0
62
+ });
63
+ }
64
+ }
65
+
66
+ export { decorateMethodV2 as a, decorateFieldV2 as d, initializeDeferredDecorator as i };
67
+ //# sourceMappingURL=runtime-BPCpkOf1-B5Lbloj7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-BPCpkOf1-B5Lbloj7.js","sources":["../../../node_modules/.pnpm/decorator-transforms@2.3.0_@babel+core@7.26.7/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js"],"sourcesContent":["const deferred = /* @__PURE__ */ new WeakMap();\nfunction deferDecorator(proto, prop, desc) {\n let map = deferred.get(proto);\n if (!map) {\n map = /* @__PURE__ */ new Map();\n deferred.set(proto, map);\n }\n map.set(prop, desc);\n}\nfunction findDeferredDecorator(target, prop) {\n var _a;\n let cursor = target.prototype;\n while (cursor) {\n let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);\n if (desc) {\n return desc;\n }\n cursor = cursor.prototype;\n }\n}\nfunction decorateFieldV1(target, prop, decorators, initializer) {\n return decorateFieldV2(target.prototype, prop, decorators, initializer);\n}\nfunction decorateFieldV2(prototype, prop, decorators, initializer) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n };\n if (initializer) {\n desc.initializer = initializer;\n }\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(prototype, prop, desc);\n } else {\n deferDecorator(prototype, prop, desc);\n }\n}\nfunction decorateMethodV1({ prototype }, prop, decorators) {\n return decorateMethodV2(prototype, prop, decorators);\n}\nfunction decorateMethodV2(prototype, prop, decorators) {\n const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n let desc = { ...origDesc };\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;\n desc.initializer = void 0;\n }\n Object.defineProperty(prototype, prop, desc);\n}\nfunction initializeDeferredDecorator(target, prop) {\n let desc = findDeferredDecorator(target.constructor, prop);\n if (desc) {\n Object.defineProperty(target, prop, {\n enumerable: desc.enumerable,\n configurable: desc.configurable,\n writable: desc.writable,\n value: desc.initializer ? desc.initializer.call(target) : void 0\n });\n }\n}\nfunction decorateClass(target, decorators) {\n return decorators.reduce(\n (accum, decorator) => decorator(accum) || accum,\n target\n );\n}\nfunction decoratePOJO(pojo, decorated) {\n for (let [type, prop, decorators] of decorated) {\n if (type === \"field\") {\n decoratePojoField(pojo, prop, decorators);\n } else {\n decorateMethodV2(pojo, prop, decorators);\n }\n }\n return pojo;\n}\nfunction decoratePojoField(pojo, prop, decorators) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: () => {\n var _a;\n return (_a = Object.getOwnPropertyDescriptor(pojo, prop)) == null ? void 0 : _a.value;\n }\n };\n for (let decorator of decorators) {\n desc = decorator(pojo, prop, desc) || desc;\n }\n if (desc.initializer) {\n desc.value = desc.initializer.call(pojo);\n delete desc.initializer;\n }\n Object.defineProperty(pojo, prop, desc);\n}\nconst runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n c: decorateClass,\n f: decorateFieldV1,\n g: decorateFieldV2,\n i: initializeDeferredDecorator,\n m: decorateMethodV1,\n n: decorateMethodV2,\n p: decoratePOJO\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n decorateFieldV2 as a,\n decorateMethodV1 as b,\n decorateMethodV2 as c,\n decorateFieldV1 as d,\n decorateClass as e,\n decoratePOJO as f,\n initializeDeferredDecorator as i,\n runtime as r\n};\n//# sourceMappingURL=runtime-BPCpkOf1.js.map\n"],"names":["deferred","WeakMap","deferDecorator","proto","prop","desc","map","get","Map","set","findDeferredDecorator","target","_a","cursor","prototype","decorateFieldV2","decorators","initializer","configurable","enumerable","writable","decorator","Object","defineProperty","decorateMethodV2","origDesc","getOwnPropertyDescriptor","value","call","initializeDeferredDecorator","constructor"],"mappings":"AAuBA,MAAMA,QAAA,sBAGEC,OAAA,EAAA;AAER,SAASC,eACPC,KAAA,EACAC,IAAA,EACAC,IAAA,EACM;AACF,EAAA,IAAAC,GAAA,GAAMN,QAAA,CAASO,GAAA,CAAIJ,KAAK,CAAA;EAC5B,IAAI,CAACG,GAAA,EAAK;AACRA,IAAAA,GAAA,sBAAUE,GAAA,EAAA;AACDR,IAAAA,QAAA,CAAAS,GAAA,CAAIN,KAAA,EAAOG,GAAG,CAAA;AACzB,EAAA;AACIA,EAAAA,GAAA,CAAAG,GAAA,CAAIL,IAAA,EAAMC,IAAI,CAAA;AACpB;AAEA,SAASK,qBAAAA,CACPC,MAAA,EACAP,IAAA,EACwB;AArB1B,EAAA,IAAAQ,EAAA;AAsBE,EAAA,IAAIC,MAAA,GAAkBF,MAAA,CAAeG,SAAA;AACrC,EAAA,OAAOD,MAAA,EAAQ;AACb,IAAA,IAAIR,IAAA,GAAA,CAAOO,EAAA,GAAAZ,QAAA,CAASO,GAAA,CAAIM,MAAM,MAAnB,IAAA,GAAA,MAAA,GAAAD,EAAA,CAAsBL,GAAA,CAAIH,IAAA,CAAA;AACrC,IAAA,IAAIC,IAAA,EAAM;AACD,MAAA,OAAAA,IAAA;AACT,IAAA;IACAQ,MAAA,GAAUA,MAAA,CAAeC,SAAA;AAC3B,EAAA;AACF;AAWA,SAASC,eAAAA,CACPD,SAAA,EACAV,IAAA,EACAY,UAAA,EACAC,WAAA,EACM;AACN,EAAA,IAAIZ,IAAA,GAAmB;AACrBa,IAAAA,YAAA,EAAc,IAAA;AACdC,IAAAA,UAAA,EAAY,IAAA;AACZC,IAAAA,QAAA,EAAU,IAAA;AACVH,IAAAA,WAAA,EAAa;AAAA,GAAA;AAEf,EAAA,IAAIA,WAAA,EAAa;IAC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ACzD,EAAA,IAAIC,IAAA,EAAM;AACDiB,IAAAA,MAAA,CAAAC,cAAA,CAAeZ,MAAA,EAAQP,IAAA,EAAM;MAClCe,UAAA,EAAYd,IAAA,CAAKc,UAAA;MACjBD,YAAA,EAAcb,IAAA,CAAKa,YAAA;MACnBE,QAAA,EAAUf,IAAA,CAAKe,QAAA;AACfO,MAAAA,KAAA,EAAOtB,IAAA,CAAKY,WAAA,GAAcZ,IAAA,CAAKY,WAAA,CAAYW,IAAA,CAAKjB,MAAM,CAAA,GAAI;KAC3D,CAAA;AACH,EAAA;AACF;;;;","x_google_ignoreList":[0]}
@@ -1,24 +1,28 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
1
  import Service from '@ember/service';
3
- import { a as NotificationsManager } from '../manager-IxquV5I2.js';
2
+ import { a as NotificationsManager } from '../manager-C1Vyhk-A.js';
4
3
 
5
4
  class NotificationsService extends Service {
6
- constructor(...args) {
7
- super(...args);
8
- _defineProperty(this, "manager", new NotificationsManager());
9
- _defineProperty(this, "add", (message, options) => {
10
- return this.manager.add(message, options);
11
- });
12
- _defineProperty(this, "remove", notification => {
13
- this.manager.remove(notification);
14
- });
15
- _defineProperty(this, "removeAll", () => {
16
- this.manager.removeAll();
17
- });
18
- }
5
+ onRemoveCallback;
6
+ manager = new NotificationsManager(this, notification => {
7
+ if (this.onRemoveCallback) {
8
+ this.onRemoveCallback(notification);
9
+ }
10
+ });
19
11
  get notifications() {
20
12
  return this.manager.notifications;
21
13
  }
14
+ add = (message, options) => {
15
+ return this.manager.add(message, options);
16
+ };
17
+ remove = notification => {
18
+ this.manager.remove(notification);
19
+ };
20
+ removeAll = () => {
21
+ this.manager.removeAll();
22
+ };
23
+ setOnRemoveCallback = callback => {
24
+ this.onRemoveCallback = callback;
25
+ };
22
26
  willDestroy() {
23
27
  this.removeAll();
24
28
  super.willDestroy();
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sources":["../../src/services/notifications.ts"],"sourcesContent":["import Service from '@ember/service';\nimport Notification from '../-private/notification';\nimport NotificationsManager from '../-private/manager';\nimport type { NotificationOptions } from '../-private/types';\n\nexport default class NotificationsService extends Service {\n manager = new NotificationsManager();\n\n get notifications(): Notification[] {\n return this.manager.notifications;\n }\n\n add = (message: string, options?: NotificationOptions): Notification => {\n return this.manager.add(message, options);\n };\n\n remove = (notification?: Notification): void => {\n this.manager.remove(notification);\n };\n\n removeAll = (): void => {\n this.manager.removeAll();\n };\n\n willDestroy(): void {\n this.removeAll();\n super.willDestroy();\n }\n}\n\n// DO NOT DELETE: this is how TypeScript knows how to look up your services.\ndeclare module '@ember/service' {\n interface Registry {\n notifications: NotificationsService;\n }\n}\n"],"names":["NotificationsService","Service","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;;;;"}
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 onRemoveCallback?: (\n notification: Notification<Record<string, unknown>>\n ) => void;\n\n manager = new NotificationsManager(this, (notification) => {\n if (this.onRemoveCallback) {\n this.onRemoveCallback(notification);\n }\n });\n\n get notifications(): Notification<Record<string, unknown>>[] {\n return this.manager.notifications;\n }\n\n add = <TMetadata extends Record<string, unknown> = Record<string, unknown>>(\n message: string,\n options?: NotificationOptions<TMetadata>\n ): Notification<TMetadata> => {\n return this.manager.add<TMetadata>(message, options);\n };\n\n remove = (notification?: Notification<Record<string, unknown>>): void => {\n this.manager.remove(notification);\n };\n\n removeAll = (): void => {\n this.manager.removeAll();\n };\n\n setOnRemoveCallback = (\n callback?: (notification: Notification<Record<string, unknown>>) => void\n ): void => {\n this.onRemoveCallback = callback;\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","onRemoveCallback","manager","NotificationsManager","notification","notifications","add","message","options","remove","removeAll","setOnRemoveCallback","callback","willDestroy"],"mappings":";;;AAKe,MAAMA,oBAAoB,SAASC,OAAO,CAAC;EACxDC,gBAAgB;AAIhBC,EAAAA,OAAO,GAAG,IAAIC,oBAAoB,CAAC,IAAI,EAAGC,YAAY,IAAK;IACzD,IAAI,IAAI,CAACH,gBAAgB,EAAE;AACzB,MAAA,IAAI,CAACA,gBAAgB,CAACG,YAAY,CAAC;AACrC,IAAA;AACF,EAAA,CAAC,CAAC;EAEF,IAAIC,aAAaA,GAA4C;AAC3D,IAAA,OAAO,IAAI,CAACH,OAAO,CAACG,aAAa;AACnC,EAAA;AAEAC,EAAAA,GAAG,GAAGA,CACJC,OAAe,EACfC,OAAwC,KACZ;IAC5B,OAAO,IAAI,CAACN,OAAO,CAACI,GAAG,CAAYC,OAAO,EAAEC,OAAO,CAAC;EACtD,CAAC;EAEDC,MAAM,GAAIL,YAAoD,IAAW;AACvE,IAAA,IAAI,CAACF,OAAO,CAACO,MAAM,CAACL,YAAY,CAAC;EACnC,CAAC;EAEDM,SAAS,GAAGA,MAAY;AACtB,IAAA,IAAI,CAACR,OAAO,CAACQ,SAAS,EAAE;EAC1B,CAAC;EAEDC,mBAAmB,GACjBC,QAAwE,IAC/D;IACT,IAAI,CAACX,gBAAgB,GAAGW,QAAQ;EAClC,CAAC;AAEDC,EAAAA,WAAWA,GAAS;IAClB,IAAI,CAACH,SAAS,EAAE;IAChB,KAAK,CAACG,WAAW,EAAE;AACrB,EAAA;AACF;;AAEA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/notifications",
3
- "version": "0.17.0-beta.2",
3
+ "version": "0.17.0-beta.21",
4
4
  "description": "Component Library for Ember Octane apps: Notifications",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -9,6 +9,24 @@
9
9
  "repository": "https://github.com/josemarluedke/frontile",
10
10
  "license": "MIT",
11
11
  "author": "",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./declarations/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./*": {
18
+ "types": "./declarations/*.d.ts",
19
+ "default": "./dist/*.js"
20
+ },
21
+ "./addon-main.js": "./addon-main.js"
22
+ },
23
+ "typesVersions": {
24
+ "*": {
25
+ "*": [
26
+ "declarations/*"
27
+ ]
28
+ }
29
+ },
12
30
  "directories": {
13
31
  "doc": "doc",
14
32
  "test": "tests"
@@ -19,57 +37,53 @@
19
37
  "dist"
20
38
  ],
21
39
  "scripts": {
22
- "build": "concurrently -m 1 'npm:build:*'",
23
- "build:js": "rollup --config",
24
- "build:types": "glint --declaration",
40
+ "build": "rollup --config",
25
41
  "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
26
42
  "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
27
43
  "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
28
- "lint:js": "eslint . --cache",
29
44
  "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
45
+ "lint:js": "eslint . --cache",
30
46
  "lint:js:fix": "eslint . --fix",
31
47
  "lint:types": "glint",
48
+ "prepack": "concurrently 'npm:build'",
32
49
  "start": "concurrently 'npm:start:*'",
33
50
  "start:js": "rollup --config --watch --no-watch.clearScreen",
34
51
  "start:types": "glint -d --watch",
35
- "test": "echo 'A v2 addon does not have tests, run tests in test-app'",
36
- "prepack": "concurrently 'npm:build'"
37
- },
38
- "peerDependencies": {
39
- "@babel/runtime": ">= 7",
40
- "ember-source": ">= 4.12.0"
52
+ "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
41
53
  },
42
54
  "dependencies": {
43
- "@ember/render-modifiers": "^2.1.0",
44
55
  "@embroider/addon-shim": "^1.9.0",
45
- "@frontile/buttons": "0.17.0-beta.2",
46
- "@frontile/theme": "0.17.0-beta.2",
56
+ "@frontile/buttons": "0.17.0-beta.21",
57
+ "@frontile/theme": "0.17.0-beta.21",
47
58
  "ember-auto-import": "^2.7.2",
48
59
  "ember-css-transitions": "^4.4.0",
49
- "ember-get-config": "^2.1.1"
60
+ "ember-modifier": "^4.1.0"
50
61
  },
51
62
  "devDependencies": {
52
- "@babel/core": "7.26.0",
53
- "@babel/plugin-proposal-class-properties": "7.18.6",
54
- "@babel/plugin-proposal-decorators": "7.25.9",
55
- "@babel/plugin-transform-class-static-block": "^7.23.4",
56
- "@babel/preset-typescript": "7.26.0",
57
- "@embroider/addon-dev": "7.0.0",
58
- "@glimmer/component": "^1.1.2",
63
+ "@babel/core": "7.26.7",
64
+ "@babel/plugin-transform-typescript": "^7.26.7",
65
+ "@embroider/addon-dev": "7.1.1",
66
+ "@glimmer/component": "^2.0.0",
59
67
  "@glimmer/tracking": "^1.1.2",
60
- "@glint/core": "1.5.0",
61
- "@glint/environment-ember-loose": "1.5.0",
62
- "@glint/environment-ember-template-imports": "1.5.0",
63
- "@glint/template": "1.5.0",
64
- "@rollup/plugin-node-resolve": "^15.2.3",
65
- "@tsconfig/ember": "^3.0.5",
68
+ "@glint/core": "1.5.2",
69
+ "@glint/environment-ember-loose": "1.5.2",
70
+ "@glint/environment-ember-template-imports": "1.5.2",
71
+ "@glint/template": "1.5.2",
72
+ "@rollup/plugin-babel": "^6.0.4",
73
+ "@rollup/plugin-node-resolve": "^16.0.0",
74
+ "@tsconfig/ember": "^3.0.9",
66
75
  "babel-plugin-ember-template-compilation": "^2.2.1",
67
76
  "concurrently": "^9.1.0",
68
- "ember-source": "^5.12.0",
69
- "rollup": "^4.25.0",
70
- "rollup-plugin-ts": "^3.4.5",
71
- "tailwindcss": "^3.4.1",
72
- "typescript": "^5.4.2"
77
+ "decorator-transforms": "^2.3.0",
78
+ "ember-source": "^6.1.0",
79
+ "rollup": "^4.29.1",
80
+ "rollup-plugin-copy": "^3.5.0",
81
+ "tailwindcss": "^3.4.17",
82
+ "typescript": "^5.7.3"
83
+ },
84
+ "peerDependencies": {
85
+ "@babel/runtime": ">= 7",
86
+ "ember-source": ">= 4.12.0"
73
87
  },
74
88
  "engines": {
75
89
  "node": "10.* || >= 12"
@@ -90,23 +104,5 @@
90
104
  "./services/notifications.js": "./dist/_app_/services/notifications.js"
91
105
  }
92
106
  },
93
- "exports": {
94
- ".": {
95
- "types": "./declarations/index.d.ts",
96
- "default": "./dist/index.js"
97
- },
98
- "./*": {
99
- "types": "./declarations/*.d.ts",
100
- "default": "./dist/*.js"
101
- },
102
- "./addon-main.js": "./addon-main.js"
103
- },
104
- "typesVersions": {
105
- "*": {
106
- "*": [
107
- "declarations/*"
108
- ]
109
- }
110
- },
111
- "gitHead": "0755b1e3d6734ba228180026cc5dc65621bed57d"
107
+ "gitHead": "aaa68602e93ea36b4a5547c0ee8c2bbea76c84cc"
112
108
  }
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../src/-private/timer.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,KAAK;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,UAAQ;IAE1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAU;gBAEX,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI;IAM1C,KAAK,IAAI,IAAI;IAQb,KAAK,IAAI,IAAI;IAKb,MAAM,IAAI,IAAI;IAKtB,OAAO,CAAC,KAAK;CAad"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/-private/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;O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AMC,MAAM,IAAI,IAAI;IAId,KAAK,IAAI,IAAI;IAMb,MAAM,IAAI,IAAI;IAMd,uBAAuB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAKjE,IAAI,OAAO;;;;;;MAeV;CA4DF;AAED,OAAO,EAAE,gBAAgB,EAAE,KAAK,yBAAyB,EAAE,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -1 +0,0 @@
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,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 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,oBAAoB,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC/B,YAAY,EAAE,oBAAoB,EAAE,CAAC;AACrC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACjE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC"}
@@ -1,11 +0,0 @@
1
- import Notification from "./notification-64b501e5.js";
2
- import { NotificationOptions } from "./types-16c08671.js";
3
- declare class NotificationsManager {
4
- notifications: Notification[];
5
- add(message: string, options?: NotificationOptions): Notification;
6
- remove(notification?: Notification): void;
7
- removeAll(): void;
8
- private setupAutoRemoval;
9
- }
10
- export { NotificationsManager as default };
11
- //# sourceMappingURL=manager-IxquV5I2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager-IxquV5I2.d.ts","sourceRoot":"","sources":["../src/-private/manager.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,mCAAuB;AAK1C,OAAO,uBAA4B,4BAAgB;AAEnD,cAAqB,oBAAoB;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAM;IAE5C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY;IAqBrE,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAkBzC,SAAS,IAAI,IAAI;IAMjB,OAAO,CAAC,gBAAgB;CAKzB"}
@@ -1,16 +0,0 @@
1
- import Timer from "./timer-0a840cef.js";
2
- import { NotificationOptions, CustomAction } from "./types-16c08671.js";
3
- declare class Notification {
4
- readonly message: string;
5
- readonly transitionDuration: number;
6
- readonly appearance: NonNullable<NotificationOptions['appearance']>;
7
- readonly customActions?: CustomAction[];
8
- readonly allowClosing: boolean;
9
- readonly duration: number;
10
- timer?: Timer;
11
- isRemoving: boolean;
12
- constructor(message: string, options?: NotificationOptions);
13
- remove(): void;
14
- }
15
- export { Notification as default };
16
- //# sourceMappingURL=notification-64b501e5.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification-64b501e5.d.ts","sourceRoot":"","sources":["../src/-private/notification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,4BAAgB;AAE5B,OAAO,qCAA0C,4BAAgB;AAEjE,cAAqB,YAAY;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,UAAS;gBAEhB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB;IAkB9D,MAAM,IAAI,IAAI;CAOf"}
@@ -1 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAExE,MAAM,CAAC,OAAO,WAAW,QAAQ;IAC/B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;CACvD"}
@@ -1,14 +0,0 @@
1
- declare class Timer {
2
- remaining: number;
3
- isRunning: boolean;
4
- readonly onFinish: () => void;
5
- private timer?;
6
- private start;
7
- constructor(duration: number, onFinish: () => void);
8
- clear(): void;
9
- pause(): void;
10
- resume(): void;
11
- private setup;
12
- }
13
- export { Timer as default };
14
- //# sourceMappingURL=timer-0a840cef.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timer-0a840cef.d.ts","sourceRoot":"","sources":["../src/-private/timer.ts"],"names":[],"mappings":"AAMA,cAAqB,KAAK;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,UAAQ;IAE1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAU;gBAEX,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI;IAM1C,KAAK,IAAI,IAAI;IAQb,KAAK,IAAI,IAAI;IAKb,MAAM,IAAI,IAAI;IAKtB,OAAO,CAAC,KAAK;CAad"}