@teambit/notifications 1.0.188 → 1.0.189

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,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.ui-foundation/notifications@1.0.188" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.ui-foundation/notifications@1.0.189" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -0,0 +1,1006 @@
1
+ {
2
+ "__schema": "APISchema",
3
+ "location": {
4
+ "filePath": "index.ts",
5
+ "line": 1,
6
+ "character": 1
7
+ },
8
+ "module": {
9
+ "__schema": "ModuleSchema",
10
+ "location": {
11
+ "filePath": "index.ts",
12
+ "line": 1,
13
+ "character": 1
14
+ },
15
+ "exports": [
16
+ {
17
+ "__schema": "ClassSchema",
18
+ "location": {
19
+ "filePath": "notification.ui.runtime.tsx",
20
+ "line": 17,
21
+ "character": 1
22
+ },
23
+ "doc": {
24
+ "__schema": "DocSchema",
25
+ "location": {
26
+ "filePath": "notification.ui.runtime.tsx",
27
+ "line": 14,
28
+ "character": 1
29
+ },
30
+ "raw": "/**\n * extension\n */",
31
+ "comment": "extension"
32
+ },
33
+ "signature": "class NotificationUI",
34
+ "name": "NotificationUI",
35
+ "members": [
36
+ {
37
+ "__schema": "VariableLikeSchema",
38
+ "location": {
39
+ "filePath": "notification.ui.runtime.tsx",
40
+ "line": 18,
41
+ "character": 3
42
+ },
43
+ "signature": "(property) NotificationUI.dependencies: Aspect[]",
44
+ "name": "dependencies",
45
+ "type": {
46
+ "__schema": "InferenceTypeSchema",
47
+ "location": {
48
+ "filePath": "notification.ui.runtime.tsx",
49
+ "line": 18,
50
+ "character": 3
51
+ },
52
+ "type": "Aspect[]"
53
+ },
54
+ "isOptional": true,
55
+ "defaultValue": "[UIAspect]"
56
+ },
57
+ {
58
+ "__schema": "VariableLikeSchema",
59
+ "location": {
60
+ "filePath": "notification.ui.runtime.tsx",
61
+ "line": 20,
62
+ "character": 3
63
+ },
64
+ "signature": "(property) NotificationUI.runtime: RuntimeDefinition",
65
+ "name": "runtime",
66
+ "type": {
67
+ "__schema": "InferenceTypeSchema",
68
+ "location": {
69
+ "filePath": "notification.ui.runtime.tsx",
70
+ "line": 20,
71
+ "character": 3
72
+ },
73
+ "type": "RuntimeDefinition"
74
+ },
75
+ "isOptional": true,
76
+ "defaultValue": "UIRuntime"
77
+ },
78
+ {
79
+ "__schema": "FunctionLikeSchema",
80
+ "location": {
81
+ "filePath": "notification.ui.runtime.tsx",
82
+ "line": 22,
83
+ "character": 3
84
+ },
85
+ "signature": "(method) NotificationUI.provider([uiRuntimeExtension]: [UiUI]): Promise<NotificationUI>",
86
+ "name": "provider",
87
+ "params": [
88
+ {
89
+ "__schema": "ParameterSchema",
90
+ "location": {
91
+ "filePath": "notification.ui.runtime.tsx",
92
+ "line": 22,
93
+ "character": 25
94
+ },
95
+ "name": "[ uiRuntimeExtension ]",
96
+ "type": {
97
+ "__schema": "TupleTypeSchema",
98
+ "location": {
99
+ "filePath": "notification.ui.runtime.tsx",
100
+ "line": 22,
101
+ "character": 47
102
+ },
103
+ "elements": [
104
+ {
105
+ "__schema": "TypeRefSchema",
106
+ "location": {
107
+ "filePath": "notification.ui.runtime.tsx",
108
+ "line": 22,
109
+ "character": 48
110
+ },
111
+ "name": "UiUI",
112
+ "componentId": {
113
+ "scope": "teambit.ui-foundation",
114
+ "name": "ui"
115
+ }
116
+ }
117
+ ]
118
+ },
119
+ "isOptional": false,
120
+ "isSpread": false
121
+ }
122
+ ],
123
+ "returnType": {
124
+ "__schema": "InferenceTypeSchema",
125
+ "location": {
126
+ "filePath": "notification.ui.runtime.tsx",
127
+ "line": 22,
128
+ "character": 3
129
+ },
130
+ "type": "Promise<NotificationUI>"
131
+ },
132
+ "modifiers": [
133
+ "static",
134
+ "async"
135
+ ]
136
+ },
137
+ {
138
+ "__schema": "ConstructorSchema",
139
+ "location": {
140
+ "filePath": "notification.ui.runtime.tsx",
141
+ "line": 26,
142
+ "character": 3
143
+ },
144
+ "signature": "constructor NotificationUI(uiRuntimeExtension: UiUI): NotificationUI",
145
+ "name": "constructor",
146
+ "params": [
147
+ {
148
+ "__schema": "ParameterSchema",
149
+ "location": {
150
+ "filePath": "notification.ui.runtime.tsx",
151
+ "line": 26,
152
+ "character": 15
153
+ },
154
+ "name": "uiRuntimeExtension",
155
+ "type": {
156
+ "__schema": "TypeRefSchema",
157
+ "location": {
158
+ "filePath": "notification.ui.runtime.tsx",
159
+ "line": 26,
160
+ "character": 35
161
+ },
162
+ "name": "UiUI",
163
+ "componentId": {
164
+ "scope": "teambit.ui-foundation",
165
+ "name": "ui"
166
+ }
167
+ },
168
+ "isOptional": false,
169
+ "isSpread": false
170
+ }
171
+ ],
172
+ "returnType": {
173
+ "__schema": "ThisTypeSchema",
174
+ "location": {
175
+ "filePath": "notification.ui.runtime.tsx",
176
+ "line": 17,
177
+ "character": 1
178
+ },
179
+ "name": "NotificationUI"
180
+ },
181
+ "modifiers": []
182
+ },
183
+ {
184
+ "__schema": "VariableLikeSchema",
185
+ "location": {
186
+ "filePath": "notification.ui.runtime.tsx",
187
+ "line": 34,
188
+ "character": 3
189
+ },
190
+ "doc": {
191
+ "__schema": "DocSchema",
192
+ "location": {
193
+ "filePath": "notification.ui.runtime.tsx",
194
+ "line": 33,
195
+ "character": 3
196
+ },
197
+ "raw": "/** adds a full message to the log */",
198
+ "comment": "adds a full message to the log"
199
+ },
200
+ "signature": "(property) NotificationUI.add: (message: string, level: MessageLevel) => string",
201
+ "name": "add",
202
+ "type": {
203
+ "__schema": "InferenceTypeSchema",
204
+ "location": {
205
+ "filePath": "notification.ui.runtime.tsx",
206
+ "line": 34,
207
+ "character": 3
208
+ },
209
+ "type": "(message: string, level: MessageLevel) => string"
210
+ },
211
+ "isOptional": true,
212
+ "defaultValue": "(message: string, level: MessageLevel) => {\n const id = v1();\n\n this.dispatch?.({\n type: 'add',\n content: {\n id,\n message,\n level,\n time: new Date().toISOString(),\n },\n });\n\n return id;\n }"
213
+ },
214
+ {
215
+ "__schema": "FunctionLikeSchema",
216
+ "location": {
217
+ "filePath": "notification.ui.runtime.tsx",
218
+ "line": 51,
219
+ "character": 3
220
+ },
221
+ "doc": {
222
+ "__schema": "DocSchema",
223
+ "location": {
224
+ "filePath": "notification.ui.runtime.tsx",
225
+ "line": 50,
226
+ "character": 3
227
+ },
228
+ "raw": "/** removes/archives a message from the log */",
229
+ "comment": "removes/archives a message from the log"
230
+ },
231
+ "signature": "(method) NotificationUI.dismiss(id: string): void",
232
+ "name": "dismiss",
233
+ "params": [
234
+ {
235
+ "__schema": "ParameterSchema",
236
+ "location": {
237
+ "filePath": "notification.ui.runtime.tsx",
238
+ "line": 51,
239
+ "character": 11
240
+ },
241
+ "name": "id",
242
+ "type": {
243
+ "__schema": "KeywordTypeSchema",
244
+ "location": {
245
+ "filePath": "notification.ui.runtime.tsx",
246
+ "line": 51,
247
+ "character": 15
248
+ },
249
+ "name": "string"
250
+ },
251
+ "isOptional": false,
252
+ "isSpread": false
253
+ }
254
+ ],
255
+ "returnType": {
256
+ "__schema": "InferenceTypeSchema",
257
+ "location": {
258
+ "filePath": "notification.ui.runtime.tsx",
259
+ "line": 51,
260
+ "character": 3
261
+ },
262
+ "type": "void"
263
+ },
264
+ "modifiers": []
265
+ },
266
+ {
267
+ "__schema": "VariableLikeSchema",
268
+ "location": {
269
+ "filePath": "notification.ui.runtime.tsx",
270
+ "line": 59,
271
+ "character": 3
272
+ },
273
+ "doc": {
274
+ "__schema": "DocSchema",
275
+ "location": {
276
+ "filePath": "notification.ui.runtime.tsx",
277
+ "line": 58,
278
+ "character": 3
279
+ },
280
+ "raw": "/** adds a message with level \"info\" to the log */",
281
+ "comment": "adds a message with level \"info\" to the log"
282
+ },
283
+ "signature": "(property) NotificationUI.log: (message: string) => string",
284
+ "name": "log",
285
+ "type": {
286
+ "__schema": "InferenceTypeSchema",
287
+ "location": {
288
+ "filePath": "notification.ui.runtime.tsx",
289
+ "line": 59,
290
+ "character": 3
291
+ },
292
+ "type": "(message: string) => string"
293
+ },
294
+ "isOptional": true,
295
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.info)"
296
+ },
297
+ {
298
+ "__schema": "VariableLikeSchema",
299
+ "location": {
300
+ "filePath": "notification.ui.runtime.tsx",
301
+ "line": 61,
302
+ "character": 3
303
+ },
304
+ "doc": {
305
+ "__schema": "DocSchema",
306
+ "location": {
307
+ "filePath": "notification.ui.runtime.tsx",
308
+ "line": 60,
309
+ "character": 3
310
+ },
311
+ "raw": "/** adds a message with level \"warning\" to the log */",
312
+ "comment": "adds a message with level \"warning\" to the log"
313
+ },
314
+ "signature": "(property) NotificationUI.warn: (message: string) => string",
315
+ "name": "warn",
316
+ "type": {
317
+ "__schema": "InferenceTypeSchema",
318
+ "location": {
319
+ "filePath": "notification.ui.runtime.tsx",
320
+ "line": 61,
321
+ "character": 3
322
+ },
323
+ "type": "(message: string) => string"
324
+ },
325
+ "isOptional": true,
326
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.warning)"
327
+ },
328
+ {
329
+ "__schema": "VariableLikeSchema",
330
+ "location": {
331
+ "filePath": "notification.ui.runtime.tsx",
332
+ "line": 63,
333
+ "character": 3
334
+ },
335
+ "doc": {
336
+ "__schema": "DocSchema",
337
+ "location": {
338
+ "filePath": "notification.ui.runtime.tsx",
339
+ "line": 62,
340
+ "character": 3
341
+ },
342
+ "raw": "/** adds a message with level \"error\" to the log */",
343
+ "comment": "adds a message with level \"error\" to the log"
344
+ },
345
+ "signature": "(property) NotificationUI.error: (message: string) => string",
346
+ "name": "error",
347
+ "type": {
348
+ "__schema": "InferenceTypeSchema",
349
+ "location": {
350
+ "filePath": "notification.ui.runtime.tsx",
351
+ "line": 63,
352
+ "character": 3
353
+ },
354
+ "type": "(message: string) => string"
355
+ },
356
+ "isOptional": true,
357
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.error)"
358
+ },
359
+ {
360
+ "__schema": "VariableLikeSchema",
361
+ "location": {
362
+ "filePath": "notification.ui.runtime.tsx",
363
+ "line": 65,
364
+ "character": 3
365
+ },
366
+ "doc": {
367
+ "__schema": "DocSchema",
368
+ "location": {
369
+ "filePath": "notification.ui.runtime.tsx",
370
+ "line": 64,
371
+ "character": 3
372
+ },
373
+ "raw": "/** adds a message with level \"success\" to the log */",
374
+ "comment": "adds a message with level \"success\" to the log"
375
+ },
376
+ "signature": "(property) NotificationUI.success: (message: string) => string",
377
+ "name": "success",
378
+ "type": {
379
+ "__schema": "InferenceTypeSchema",
380
+ "location": {
381
+ "filePath": "notification.ui.runtime.tsx",
382
+ "line": 65,
383
+ "character": 3
384
+ },
385
+ "type": "(message: string) => string"
386
+ },
387
+ "isOptional": true,
388
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.success)"
389
+ },
390
+ {
391
+ "__schema": "VariableLikeSchema",
392
+ "location": {
393
+ "filePath": "notification.ui.runtime.tsx",
394
+ "line": 68,
395
+ "character": 3
396
+ },
397
+ "doc": {
398
+ "__schema": "DocSchema",
399
+ "location": {
400
+ "filePath": "notification.ui.runtime.tsx",
401
+ "line": 67,
402
+ "character": 3
403
+ },
404
+ "raw": "/** removes all notifications */",
405
+ "comment": "removes all notifications"
406
+ },
407
+ "signature": "(property) NotificationUI.clear: () => void",
408
+ "name": "clear",
409
+ "type": {
410
+ "__schema": "InferenceTypeSchema",
411
+ "location": {
412
+ "filePath": "notification.ui.runtime.tsx",
413
+ "line": 68,
414
+ "character": 3
415
+ },
416
+ "type": "() => void"
417
+ },
418
+ "isOptional": true,
419
+ "defaultValue": "() => {\n this.dispatch?.({\n type: 'clear',\n });\n }"
420
+ }
421
+ ],
422
+ "extendsNodes": [],
423
+ "implementNodes": [
424
+ {
425
+ "__schema": "ExpressionWithTypeArgumentsSchema",
426
+ "location": {
427
+ "filePath": "notification.ui.runtime.tsx",
428
+ "line": 17,
429
+ "character": 48
430
+ },
431
+ "name": "implements NotificationsStore",
432
+ "typeArgs": [],
433
+ "expression": {
434
+ "__schema": "TypeRefSchema",
435
+ "location": {
436
+ "filePath": "notification.ui.runtime.tsx",
437
+ "line": 17,
438
+ "character": 48
439
+ },
440
+ "name": "NotificationsStore",
441
+ "componentId": {
442
+ "_legacy": {
443
+ "scope": "teambit.ui-foundation",
444
+ "name": "notifications",
445
+ "version": "1.0.189"
446
+ },
447
+ "_scope": "teambit.ui-foundation"
448
+ }
449
+ }
450
+ }
451
+ ]
452
+ },
453
+ {
454
+ "__schema": "VariableLikeSchema",
455
+ "location": {
456
+ "filePath": "notifications.aspect.ts",
457
+ "line": 3,
458
+ "character": 14
459
+ },
460
+ "signature": "const NotificationsAspect: Aspect",
461
+ "name": "NotificationsAspect",
462
+ "type": {
463
+ "__schema": "TypeRefSchema",
464
+ "location": {
465
+ "filePath": "notifications.aspect.ts",
466
+ "line": 3,
467
+ "character": 14
468
+ },
469
+ "name": "Aspect",
470
+ "componentId": {
471
+ "scope": "teambit.harmony",
472
+ "name": "harmony",
473
+ "version": "0.4.6"
474
+ }
475
+ },
476
+ "isOptional": false,
477
+ "defaultValue": "Aspect.create({\n id: 'teambit.ui-foundation/notifications',\n})"
478
+ },
479
+ {
480
+ "__schema": "UnImplementedSchema",
481
+ "location": {
482
+ "filePath": "index.ts",
483
+ "line": 6,
484
+ "character": 16
485
+ },
486
+ "name": "NotificationsAspect",
487
+ "type": "Identifier"
488
+ }
489
+ ],
490
+ "internals": []
491
+ },
492
+ "internals": [
493
+ {
494
+ "__schema": "ModuleSchema",
495
+ "location": {
496
+ "filePath": "notification.ui.runtime.tsx",
497
+ "line": 1,
498
+ "character": 1
499
+ },
500
+ "exports": [
501
+ {
502
+ "__schema": "ClassSchema",
503
+ "location": {
504
+ "filePath": "notification.ui.runtime.tsx",
505
+ "line": 17,
506
+ "character": 1
507
+ },
508
+ "doc": {
509
+ "__schema": "DocSchema",
510
+ "location": {
511
+ "filePath": "notification.ui.runtime.tsx",
512
+ "line": 14,
513
+ "character": 1
514
+ },
515
+ "raw": "/**\n * extension\n */",
516
+ "comment": "extension"
517
+ },
518
+ "signature": "class NotificationUI",
519
+ "name": "NotificationUI",
520
+ "members": [
521
+ {
522
+ "__schema": "VariableLikeSchema",
523
+ "location": {
524
+ "filePath": "notification.ui.runtime.tsx",
525
+ "line": 18,
526
+ "character": 3
527
+ },
528
+ "signature": "(property) NotificationUI.dependencies: Aspect[]",
529
+ "name": "dependencies",
530
+ "type": {
531
+ "__schema": "InferenceTypeSchema",
532
+ "location": {
533
+ "filePath": "notification.ui.runtime.tsx",
534
+ "line": 18,
535
+ "character": 3
536
+ },
537
+ "type": "Aspect[]"
538
+ },
539
+ "isOptional": true,
540
+ "defaultValue": "[UIAspect]"
541
+ },
542
+ {
543
+ "__schema": "VariableLikeSchema",
544
+ "location": {
545
+ "filePath": "notification.ui.runtime.tsx",
546
+ "line": 20,
547
+ "character": 3
548
+ },
549
+ "signature": "(property) NotificationUI.runtime: RuntimeDefinition",
550
+ "name": "runtime",
551
+ "type": {
552
+ "__schema": "InferenceTypeSchema",
553
+ "location": {
554
+ "filePath": "notification.ui.runtime.tsx",
555
+ "line": 20,
556
+ "character": 3
557
+ },
558
+ "type": "RuntimeDefinition"
559
+ },
560
+ "isOptional": true,
561
+ "defaultValue": "UIRuntime"
562
+ },
563
+ {
564
+ "__schema": "FunctionLikeSchema",
565
+ "location": {
566
+ "filePath": "notification.ui.runtime.tsx",
567
+ "line": 22,
568
+ "character": 3
569
+ },
570
+ "signature": "(method) NotificationUI.provider([uiRuntimeExtension]: [UiUI]): Promise<NotificationUI>",
571
+ "name": "provider",
572
+ "params": [
573
+ {
574
+ "__schema": "ParameterSchema",
575
+ "location": {
576
+ "filePath": "notification.ui.runtime.tsx",
577
+ "line": 22,
578
+ "character": 25
579
+ },
580
+ "name": "[ uiRuntimeExtension ]",
581
+ "type": {
582
+ "__schema": "TupleTypeSchema",
583
+ "location": {
584
+ "filePath": "notification.ui.runtime.tsx",
585
+ "line": 22,
586
+ "character": 47
587
+ },
588
+ "elements": [
589
+ {
590
+ "__schema": "TypeRefSchema",
591
+ "location": {
592
+ "filePath": "notification.ui.runtime.tsx",
593
+ "line": 22,
594
+ "character": 48
595
+ },
596
+ "name": "UiUI",
597
+ "componentId": {
598
+ "scope": "teambit.ui-foundation",
599
+ "name": "ui"
600
+ }
601
+ }
602
+ ]
603
+ },
604
+ "isOptional": false,
605
+ "isSpread": false
606
+ }
607
+ ],
608
+ "returnType": {
609
+ "__schema": "InferenceTypeSchema",
610
+ "location": {
611
+ "filePath": "notification.ui.runtime.tsx",
612
+ "line": 22,
613
+ "character": 3
614
+ },
615
+ "type": "Promise<NotificationUI>"
616
+ },
617
+ "modifiers": [
618
+ "static",
619
+ "async"
620
+ ]
621
+ },
622
+ {
623
+ "__schema": "ConstructorSchema",
624
+ "location": {
625
+ "filePath": "notification.ui.runtime.tsx",
626
+ "line": 26,
627
+ "character": 3
628
+ },
629
+ "signature": "constructor NotificationUI(uiRuntimeExtension: UiUI): NotificationUI",
630
+ "name": "constructor",
631
+ "params": [
632
+ {
633
+ "__schema": "ParameterSchema",
634
+ "location": {
635
+ "filePath": "notification.ui.runtime.tsx",
636
+ "line": 26,
637
+ "character": 15
638
+ },
639
+ "name": "uiRuntimeExtension",
640
+ "type": {
641
+ "__schema": "TypeRefSchema",
642
+ "location": {
643
+ "filePath": "notification.ui.runtime.tsx",
644
+ "line": 26,
645
+ "character": 35
646
+ },
647
+ "name": "UiUI",
648
+ "componentId": {
649
+ "scope": "teambit.ui-foundation",
650
+ "name": "ui"
651
+ }
652
+ },
653
+ "isOptional": false,
654
+ "isSpread": false
655
+ }
656
+ ],
657
+ "returnType": {
658
+ "__schema": "ThisTypeSchema",
659
+ "location": {
660
+ "filePath": "notification.ui.runtime.tsx",
661
+ "line": 17,
662
+ "character": 1
663
+ },
664
+ "name": "NotificationUI"
665
+ },
666
+ "modifiers": []
667
+ },
668
+ {
669
+ "__schema": "VariableLikeSchema",
670
+ "location": {
671
+ "filePath": "notification.ui.runtime.tsx",
672
+ "line": 34,
673
+ "character": 3
674
+ },
675
+ "doc": {
676
+ "__schema": "DocSchema",
677
+ "location": {
678
+ "filePath": "notification.ui.runtime.tsx",
679
+ "line": 33,
680
+ "character": 3
681
+ },
682
+ "raw": "/** adds a full message to the log */",
683
+ "comment": "adds a full message to the log"
684
+ },
685
+ "signature": "(property) NotificationUI.add: (message: string, level: MessageLevel) => string",
686
+ "name": "add",
687
+ "type": {
688
+ "__schema": "InferenceTypeSchema",
689
+ "location": {
690
+ "filePath": "notification.ui.runtime.tsx",
691
+ "line": 34,
692
+ "character": 3
693
+ },
694
+ "type": "(message: string, level: MessageLevel) => string"
695
+ },
696
+ "isOptional": true,
697
+ "defaultValue": "(message: string, level: MessageLevel) => {\n const id = v1();\n\n this.dispatch?.({\n type: 'add',\n content: {\n id,\n message,\n level,\n time: new Date().toISOString(),\n },\n });\n\n return id;\n }"
698
+ },
699
+ {
700
+ "__schema": "FunctionLikeSchema",
701
+ "location": {
702
+ "filePath": "notification.ui.runtime.tsx",
703
+ "line": 51,
704
+ "character": 3
705
+ },
706
+ "doc": {
707
+ "__schema": "DocSchema",
708
+ "location": {
709
+ "filePath": "notification.ui.runtime.tsx",
710
+ "line": 50,
711
+ "character": 3
712
+ },
713
+ "raw": "/** removes/archives a message from the log */",
714
+ "comment": "removes/archives a message from the log"
715
+ },
716
+ "signature": "(method) NotificationUI.dismiss(id: string): void",
717
+ "name": "dismiss",
718
+ "params": [
719
+ {
720
+ "__schema": "ParameterSchema",
721
+ "location": {
722
+ "filePath": "notification.ui.runtime.tsx",
723
+ "line": 51,
724
+ "character": 11
725
+ },
726
+ "name": "id",
727
+ "type": {
728
+ "__schema": "KeywordTypeSchema",
729
+ "location": {
730
+ "filePath": "notification.ui.runtime.tsx",
731
+ "line": 51,
732
+ "character": 15
733
+ },
734
+ "name": "string"
735
+ },
736
+ "isOptional": false,
737
+ "isSpread": false
738
+ }
739
+ ],
740
+ "returnType": {
741
+ "__schema": "InferenceTypeSchema",
742
+ "location": {
743
+ "filePath": "notification.ui.runtime.tsx",
744
+ "line": 51,
745
+ "character": 3
746
+ },
747
+ "type": "void"
748
+ },
749
+ "modifiers": []
750
+ },
751
+ {
752
+ "__schema": "VariableLikeSchema",
753
+ "location": {
754
+ "filePath": "notification.ui.runtime.tsx",
755
+ "line": 59,
756
+ "character": 3
757
+ },
758
+ "doc": {
759
+ "__schema": "DocSchema",
760
+ "location": {
761
+ "filePath": "notification.ui.runtime.tsx",
762
+ "line": 58,
763
+ "character": 3
764
+ },
765
+ "raw": "/** adds a message with level \"info\" to the log */",
766
+ "comment": "adds a message with level \"info\" to the log"
767
+ },
768
+ "signature": "(property) NotificationUI.log: (message: string) => string",
769
+ "name": "log",
770
+ "type": {
771
+ "__schema": "InferenceTypeSchema",
772
+ "location": {
773
+ "filePath": "notification.ui.runtime.tsx",
774
+ "line": 59,
775
+ "character": 3
776
+ },
777
+ "type": "(message: string) => string"
778
+ },
779
+ "isOptional": true,
780
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.info)"
781
+ },
782
+ {
783
+ "__schema": "VariableLikeSchema",
784
+ "location": {
785
+ "filePath": "notification.ui.runtime.tsx",
786
+ "line": 61,
787
+ "character": 3
788
+ },
789
+ "doc": {
790
+ "__schema": "DocSchema",
791
+ "location": {
792
+ "filePath": "notification.ui.runtime.tsx",
793
+ "line": 60,
794
+ "character": 3
795
+ },
796
+ "raw": "/** adds a message with level \"warning\" to the log */",
797
+ "comment": "adds a message with level \"warning\" to the log"
798
+ },
799
+ "signature": "(property) NotificationUI.warn: (message: string) => string",
800
+ "name": "warn",
801
+ "type": {
802
+ "__schema": "InferenceTypeSchema",
803
+ "location": {
804
+ "filePath": "notification.ui.runtime.tsx",
805
+ "line": 61,
806
+ "character": 3
807
+ },
808
+ "type": "(message: string) => string"
809
+ },
810
+ "isOptional": true,
811
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.warning)"
812
+ },
813
+ {
814
+ "__schema": "VariableLikeSchema",
815
+ "location": {
816
+ "filePath": "notification.ui.runtime.tsx",
817
+ "line": 63,
818
+ "character": 3
819
+ },
820
+ "doc": {
821
+ "__schema": "DocSchema",
822
+ "location": {
823
+ "filePath": "notification.ui.runtime.tsx",
824
+ "line": 62,
825
+ "character": 3
826
+ },
827
+ "raw": "/** adds a message with level \"error\" to the log */",
828
+ "comment": "adds a message with level \"error\" to the log"
829
+ },
830
+ "signature": "(property) NotificationUI.error: (message: string) => string",
831
+ "name": "error",
832
+ "type": {
833
+ "__schema": "InferenceTypeSchema",
834
+ "location": {
835
+ "filePath": "notification.ui.runtime.tsx",
836
+ "line": 63,
837
+ "character": 3
838
+ },
839
+ "type": "(message: string) => string"
840
+ },
841
+ "isOptional": true,
842
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.error)"
843
+ },
844
+ {
845
+ "__schema": "VariableLikeSchema",
846
+ "location": {
847
+ "filePath": "notification.ui.runtime.tsx",
848
+ "line": 65,
849
+ "character": 3
850
+ },
851
+ "doc": {
852
+ "__schema": "DocSchema",
853
+ "location": {
854
+ "filePath": "notification.ui.runtime.tsx",
855
+ "line": 64,
856
+ "character": 3
857
+ },
858
+ "raw": "/** adds a message with level \"success\" to the log */",
859
+ "comment": "adds a message with level \"success\" to the log"
860
+ },
861
+ "signature": "(property) NotificationUI.success: (message: string) => string",
862
+ "name": "success",
863
+ "type": {
864
+ "__schema": "InferenceTypeSchema",
865
+ "location": {
866
+ "filePath": "notification.ui.runtime.tsx",
867
+ "line": 65,
868
+ "character": 3
869
+ },
870
+ "type": "(message: string) => string"
871
+ },
872
+ "isOptional": true,
873
+ "defaultValue": "(message: string) => this.add(message, MessageLevel.success)"
874
+ },
875
+ {
876
+ "__schema": "VariableLikeSchema",
877
+ "location": {
878
+ "filePath": "notification.ui.runtime.tsx",
879
+ "line": 68,
880
+ "character": 3
881
+ },
882
+ "doc": {
883
+ "__schema": "DocSchema",
884
+ "location": {
885
+ "filePath": "notification.ui.runtime.tsx",
886
+ "line": 67,
887
+ "character": 3
888
+ },
889
+ "raw": "/** removes all notifications */",
890
+ "comment": "removes all notifications"
891
+ },
892
+ "signature": "(property) NotificationUI.clear: () => void",
893
+ "name": "clear",
894
+ "type": {
895
+ "__schema": "InferenceTypeSchema",
896
+ "location": {
897
+ "filePath": "notification.ui.runtime.tsx",
898
+ "line": 68,
899
+ "character": 3
900
+ },
901
+ "type": "() => void"
902
+ },
903
+ "isOptional": true,
904
+ "defaultValue": "() => {\n this.dispatch?.({\n type: 'clear',\n });\n }"
905
+ }
906
+ ],
907
+ "extendsNodes": [],
908
+ "implementNodes": [
909
+ {
910
+ "__schema": "ExpressionWithTypeArgumentsSchema",
911
+ "location": {
912
+ "filePath": "notification.ui.runtime.tsx",
913
+ "line": 17,
914
+ "character": 48
915
+ },
916
+ "name": "implements NotificationsStore",
917
+ "typeArgs": [],
918
+ "expression": {
919
+ "__schema": "TypeRefSchema",
920
+ "location": {
921
+ "filePath": "notification.ui.runtime.tsx",
922
+ "line": 17,
923
+ "character": 48
924
+ },
925
+ "name": "NotificationsStore",
926
+ "componentId": {
927
+ "_legacy": {
928
+ "scope": "teambit.ui-foundation",
929
+ "name": "notifications",
930
+ "version": "1.0.189"
931
+ },
932
+ "_scope": "teambit.ui-foundation"
933
+ }
934
+ }
935
+ }
936
+ ]
937
+ }
938
+ ],
939
+ "internals": [
940
+ {
941
+ "__schema": "UnImplementedSchema",
942
+ "location": {
943
+ "filePath": "notification.ui.runtime.tsx",
944
+ "line": 87,
945
+ "character": 1
946
+ },
947
+ "name": "NotificationsAspect.addRuntime(NotificationUI);",
948
+ "type": "ExpressionStatement"
949
+ }
950
+ ]
951
+ },
952
+ {
953
+ "__schema": "ModuleSchema",
954
+ "location": {
955
+ "filePath": "notifications.aspect.ts",
956
+ "line": 1,
957
+ "character": 1
958
+ },
959
+ "exports": [
960
+ {
961
+ "__schema": "VariableLikeSchema",
962
+ "location": {
963
+ "filePath": "notifications.aspect.ts",
964
+ "line": 3,
965
+ "character": 14
966
+ },
967
+ "signature": "const NotificationsAspect: Aspect",
968
+ "name": "NotificationsAspect",
969
+ "type": {
970
+ "__schema": "TypeRefSchema",
971
+ "location": {
972
+ "filePath": "notifications.aspect.ts",
973
+ "line": 3,
974
+ "character": 14
975
+ },
976
+ "name": "Aspect",
977
+ "componentId": {
978
+ "scope": "teambit.harmony",
979
+ "name": "harmony",
980
+ "version": "0.4.6"
981
+ }
982
+ },
983
+ "isOptional": false,
984
+ "defaultValue": "Aspect.create({\n id: 'teambit.ui-foundation/notifications',\n})"
985
+ },
986
+ {
987
+ "__schema": "UnImplementedSchema",
988
+ "location": {
989
+ "filePath": "notifications.aspect.ts",
990
+ "line": 7,
991
+ "character": 16
992
+ },
993
+ "name": "NotificationsAspect",
994
+ "type": "Identifier"
995
+ }
996
+ ],
997
+ "internals": []
998
+ }
999
+ ],
1000
+ "componentId": {
1001
+ "scope": "teambit.ui-foundation",
1002
+ "name": "notifications",
1003
+ "version": "1.0.189"
1004
+ },
1005
+ "taggedModuleExports": []
1006
+ }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_notifications","data","require","_default","exports","default","NotificationsAspect"],"sources":["index.ts"],"sourcesContent":["import { NotificationsAspect } from './notifications.aspect';\n\nexport type { default as NotificationUI } from './notification.ui.runtime';\n\nexport { NotificationsAspect };\nexport default NotificationsAspect;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAK9CC,oCAAmB"}
1
+ {"version":3,"names":["_notifications","data","require","_default","exports","default","NotificationsAspect"],"sources":["index.ts"],"sourcesContent":["import { NotificationsAspect } from './notifications.aspect';\n\nexport type { default as NotificationUI } from './notification.ui.runtime';\n\nexport { NotificationsAspect };\nexport default NotificationsAspect;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAK9CC,oCAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["notificationReducer","state","action","type","filter","x","id","content","concat"],"sources":["notification-reducer.tsx"],"sourcesContent":["import { Message } from '@teambit/ui-foundation.ui.notifications.store';\n\nexport type NotificationAction = {\n type: 'add' | 'dismiss' | 'clear';\n content?: Message;\n id?: string;\n};\n\nexport function notificationReducer(state: Message[], action: NotificationAction) {\n switch (action.type) {\n case 'dismiss':\n return state.filter((x) => x.id !== action.id);\n case 'add':\n if (!action.content) return state;\n return state.concat(action.content);\n case 'clear':\n return [];\n default:\n return state;\n }\n}\n"],"mappings":";;;;;;AAQO,SAASA,mBAAmBA,CAACC,KAAgB,EAAEC,MAA0B,EAAE;EAChF,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAK,SAAS;MACZ,OAAOF,KAAK,CAACG,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,KAAKJ,MAAM,CAACI,EAAE,CAAC;IAChD,KAAK,KAAK;MACR,IAAI,CAACJ,MAAM,CAACK,OAAO,EAAE,OAAON,KAAK;MACjC,OAAOA,KAAK,CAACO,MAAM,CAACN,MAAM,CAACK,OAAO,CAAC;IACrC,KAAK,OAAO;MACV,OAAO,EAAE;IACX;MACE,OAAON,KAAK;EAChB;AACF"}
1
+ {"version":3,"names":["notificationReducer","state","action","type","filter","x","id","content","concat"],"sources":["notification-reducer.tsx"],"sourcesContent":["import { Message } from '@teambit/ui-foundation.ui.notifications.store';\n\nexport type NotificationAction = {\n type: 'add' | 'dismiss' | 'clear';\n content?: Message;\n id?: string;\n};\n\nexport function notificationReducer(state: Message[], action: NotificationAction) {\n switch (action.type) {\n case 'dismiss':\n return state.filter((x) => x.id !== action.id);\n case 'add':\n if (!action.content) return state;\n return state.concat(action.content);\n case 'clear':\n return [];\n default:\n return state;\n }\n}\n"],"mappings":";;;;;;AAQO,SAASA,mBAAmBA,CAACC,KAAgB,EAAEC,MAA0B,EAAE;EAChF,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAK,SAAS;MACZ,OAAOF,KAAK,CAACG,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,EAAE,KAAKJ,MAAM,CAACI,EAAE,CAAC;IAChD,KAAK,KAAK;MACR,IAAI,CAACJ,MAAM,CAACK,OAAO,EAAE,OAAON,KAAK;MACjC,OAAOA,KAAK,CAACO,MAAM,CAACN,MAAM,CAACK,OAAO,CAAC;IACrC,KAAK,OAAO;MACV,OAAO,EAAE;IACX;MACE,OAAON,KAAK;EAChB;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_ui","data","require","_react","_interopRequireWildcard","_uuid","_uiFoundationUiNotifications","_uiFoundationUiNotifications2","_uiFoundationUiNotifications3","_notificationReducer","_notifications","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_defineProperty","obj","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","NotificationUI","provider","uiRuntimeExtension","constructor","message","level","id","v1","dispatch","type","content","time","Date","toISOString","add","MessageLevel","info","warning","error","success","props","messages","useReducer","notificationReducer","createElement","NotificationCenter","notifications","children","NotificationContext","Provider","registerHudItem","render","registerRenderHooks","reactContext","renderContext","dismiss","exports","UIAspect","UIRuntime","NotificationsAspect","addRuntime"],"sources":["notification.ui.runtime.tsx"],"sourcesContent":["import { UIAspect, UIRuntime, UiUI } from '@teambit/ui';\nimport React, { ReactNode, useReducer } from 'react';\nimport { v1 } from 'uuid';\n\nimport { NotificationContext } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport {\n NotificationCenter,\n NotificationCenterProps,\n} from '@teambit/ui-foundation.ui.notifications.notification-center';\nimport { MessageLevel, NotificationsStore } from '@teambit/ui-foundation.ui.notifications.store';\nimport { NotificationAction, notificationReducer } from './notification-reducer';\nimport { NotificationsAspect } from './notifications.aspect';\n\n/**\n * extension\n */\nexport default class NotificationUI implements NotificationsStore {\n static dependencies = [UIAspect];\n\n static runtime = UIRuntime;\n\n static async provider([uiRuntimeExtension]: [UiUI]) {\n return new NotificationUI(uiRuntimeExtension);\n }\n\n constructor(uiRuntimeExtension: UiUI) {\n uiRuntimeExtension.registerHudItem(<this.render key=\"NotificationUI\" />);\n uiRuntimeExtension.registerRenderHooks({ reactContext: this.renderContext });\n }\n\n private dispatch?: React.Dispatch<NotificationAction>;\n\n /** adds a full message to the log */\n add = (message: string, level: MessageLevel) => {\n const id = v1();\n\n this.dispatch?.({\n type: 'add',\n content: {\n id,\n message,\n level,\n time: new Date().toISOString(),\n },\n });\n\n return id;\n };\n\n /** removes/archives a message from the log */\n dismiss(id: string) {\n this.dispatch?.({\n type: 'dismiss',\n id,\n });\n }\n\n /** adds a message with level \"info\" to the log */\n log = (message: string) => this.add(message, MessageLevel.info);\n /** adds a message with level \"warning\" to the log */\n warn = (message: string) => this.add(message, MessageLevel.warning);\n /** adds a message with level \"error\" to the log */\n error = (message: string) => this.add(message, MessageLevel.error);\n /** adds a message with level \"success\" to the log */\n success = (message: string) => this.add(message, MessageLevel.success);\n\n /** removes all notifications */\n clear = () => {\n this.dispatch?.({\n type: 'clear',\n });\n };\n\n private render = (props: Omit<NotificationCenterProps, 'notifications'>) => {\n // this code assumes a single place of render per instance of NotificationUI\n const [messages, dispatch] = useReducer(notificationReducer, []);\n this.dispatch = dispatch;\n\n return <NotificationCenter {...props} notifications={messages} />;\n };\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n return <NotificationContext.Provider value={this}>{children}</NotificationContext.Provider>;\n };\n}\n\nNotificationsAspect.addRuntime(NotificationUI);\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,6BAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,4BAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,8BAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,6BAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,8BAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,6BAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,qBAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,oBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,eAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,cAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OA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E,MAAA,GAAAc,OAAA,CAAA6D,aAAA,CAACxE,4BAAA,GAAA4E,mBAAmB,CAACC,QAAQ;QAACxC,KAAK,EAAE;MAAK,GAAEsC,QAAuC,CAAC;IAC7F,CAAC;IAzDCzB,kBAAkB,CAAC4B,eAAe,eAACjF,MAAA,GAAAc,OAAA,CAAA6D,aAAA,MAAMO,MAAM;MAAC9C,GAAG,EAAC;IAAgB,CAAE,CAAC,CAAC;IACxEiB,kBAAkB,CAAC8B,mBAAmB,CAAC;MAAEC,YAAY,EAAE,IAAI,CAACC;IAAc,CAAC,CAAC;EAC9E;EAqBA;EACAC,OAAOA,CAAC7B,EAAU,EAAE;IAClB,IAAI,CAACE,QAAQ,GAAG;MACdC,IAAI,EAAE,SAAS;MACfH;IACF,CAAC,CAAC;EACJ;AA6BF;AAAC8B,OAAA,CAAAzE,OAAA,GAAAqC,cAAA;AAAAb,eAAA,CApEoBa,cAAc,kBACX,CAACqC,cAAQ,CAAC;AAAAlD,eAAA,CADba,cAAc,aAGhBsC,eAAS;AAmE5BC,oCAAmB,CAACC,UAAU,CAACxC,cAAc,CAAC"}
1
+ {"version":3,"names":["_ui","data","require","_react","_interopRequireWildcard","_uuid","_uiFoundationUiNotifications","_uiFoundationUiNotifications2","_uiFoundationUiNotifications3","_notificationReducer","_notifications","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_defineProperty","obj","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","NotificationUI","provider","uiRuntimeExtension","constructor","message","level","id","v1","dispatch","type","content","time","Date","toISOString","add","MessageLevel","info","warning","error","success","props","messages","useReducer","notificationReducer","createElement","NotificationCenter","notifications","children","NotificationContext","Provider","registerHudItem","render","registerRenderHooks","reactContext","renderContext","dismiss","exports","UIAspect","UIRuntime","NotificationsAspect","addRuntime"],"sources":["notification.ui.runtime.tsx"],"sourcesContent":["import { UIAspect, UIRuntime, UiUI } from '@teambit/ui';\nimport React, { ReactNode, useReducer } from 'react';\nimport { v1 } from 'uuid';\n\nimport { NotificationContext } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport {\n NotificationCenter,\n NotificationCenterProps,\n} from '@teambit/ui-foundation.ui.notifications.notification-center';\nimport { MessageLevel, NotificationsStore } from '@teambit/ui-foundation.ui.notifications.store';\nimport { NotificationAction, notificationReducer } from './notification-reducer';\nimport { NotificationsAspect } from './notifications.aspect';\n\n/**\n * extension\n */\nexport default class NotificationUI implements NotificationsStore {\n static dependencies = [UIAspect];\n\n static runtime = UIRuntime;\n\n static async provider([uiRuntimeExtension]: [UiUI]) {\n return new NotificationUI(uiRuntimeExtension);\n }\n\n constructor(uiRuntimeExtension: UiUI) {\n uiRuntimeExtension.registerHudItem(<this.render key=\"NotificationUI\" />);\n uiRuntimeExtension.registerRenderHooks({ reactContext: this.renderContext });\n }\n\n private dispatch?: React.Dispatch<NotificationAction>;\n\n /** adds a full message to the log */\n add = (message: string, level: MessageLevel) => {\n const id = v1();\n\n this.dispatch?.({\n type: 'add',\n content: {\n id,\n message,\n level,\n time: new Date().toISOString(),\n },\n });\n\n return id;\n };\n\n /** removes/archives a message from the log */\n dismiss(id: string) {\n this.dispatch?.({\n type: 'dismiss',\n id,\n });\n }\n\n /** adds a message with level \"info\" to the log */\n log = (message: string) => this.add(message, MessageLevel.info);\n /** adds a message with level \"warning\" to the log */\n warn = (message: string) => this.add(message, MessageLevel.warning);\n /** adds a message with level \"error\" to the log */\n error = (message: string) => this.add(message, MessageLevel.error);\n /** adds a message with level \"success\" to the log */\n success = (message: string) => this.add(message, MessageLevel.success);\n\n /** removes all notifications */\n clear = () => {\n this.dispatch?.({\n type: 'clear',\n });\n };\n\n private render = (props: Omit<NotificationCenterProps, 'notifications'>) => {\n // this code assumes a single place of render per instance of NotificationUI\n const [messages, dispatch] = useReducer(notificationReducer, []);\n this.dispatch = dispatch;\n\n return <NotificationCenter {...props} notifications={messages} />;\n };\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n return <NotificationContext.Provider value={this}>{children}</NotificationContext.Provider>;\n };\n}\n\nNotificationsAspect.addRuntime(NotificationUI);\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,6BAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,4BAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,8BAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,6BAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,8BAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,6BAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,qBAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,oBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,eAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,cAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,I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E,CAAC;IAAAlC,eAAA,wBAEuB,CAAC;MAAEwC;IAAkC,CAAC,KAAK;MACjE,oBAAO9E,MAAA,GAAAc,OAAA,CAAA6D,aAAA,CAACxE,4BAAA,GAAA4E,mBAAmB,CAACC,QAAQ;QAACxC,KAAK,EAAE;MAAK,GAAEsC,QAAuC,CAAC;IAC7F,CAAC;IAzDCzB,kBAAkB,CAAC4B,eAAe,eAACjF,MAAA,GAAAc,OAAA,CAAA6D,aAAA,MAAMO,MAAM;MAAC9C,GAAG,EAAC;IAAgB,CAAE,CAAC,CAAC;IACxEiB,kBAAkB,CAAC8B,mBAAmB,CAAC;MAAEC,YAAY,EAAE,IAAI,CAACC;IAAc,CAAC,CAAC;EAC9E;EAqBA;EACAC,OAAOA,CAAC7B,EAAU,EAAE;IAClB,IAAI,CAACE,QAAQ,GAAG;MACdC,IAAI,EAAE,SAAS;MACfH;IACF,CAAC,CAAC;EACJ;AA6BF;AAAC8B,OAAA,CAAAzE,OAAA,GAAAqC,cAAA;AAAAb,eAAA,CApEoBa,cAAc,kBACX,CAACqC,cAAQ,CAAC;AAAAlD,eAAA,CADba,cAAc,aAGhBsC,eAAS;AAmE5BC,oCAAmB,CAACC,UAAU,CAACxC,cAAc,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_harmony","data","require","NotificationsAspect","exports","Aspect","create","id","_default","default"],"sources":["notifications.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const NotificationsAspect = Aspect.create({\n id: 'teambit.ui-foundation/notifications',\n});\n\nexport default NotificationsAspect;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC/CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAAK,OAAA,GAEYN,mBAAmB"}
1
+ {"version":3,"names":["_harmony","data","require","NotificationsAspect","exports","Aspect","create","id","_default","default"],"sources":["notifications.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const NotificationsAspect = Aspect.create({\n id: 'teambit.ui-foundation/notifications',\n});\n\nexport default NotificationsAspect;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC/CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAAK,OAAA,GAEYN,mBAAmB","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/notifications",
3
- "version": "1.0.188",
3
+ "version": "1.0.189",
4
4
  "homepage": "https://bit.cloud/teambit/ui-foundation/notifications",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.ui-foundation",
8
8
  "name": "notifications",
9
- "version": "1.0.188"
9
+ "version": "1.0.189"
10
10
  },
11
11
  "dependencies": {
12
12
  "uuid": "8.3.2",
@@ -14,13 +14,13 @@
14
14
  "@teambit/ui-foundation.ui.notifications.notification-center": "0.0.523",
15
15
  "@teambit/ui-foundation.ui.notifications.notification-context": "0.0.501",
16
16
  "@teambit/harmony": "0.4.6",
17
- "@teambit/ui": "1.0.188"
17
+ "@teambit/ui": "1.0.189"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/uuid": "8.3.4",
21
21
  "@types/mocha": "9.1.0",
22
22
  "chai": "4.3.0",
23
- "@teambit/harmony.envs.core-aspect-env": "0.0.25"
23
+ "@teambit/harmony.envs.core-aspect-env": "0.0.27"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^17.0.0 || ^18.0.0",