-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.js
4354 lines (4044 loc) · 179 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (__filename){(function (){
// 3rd dependances
const bel = require('bel')
const csjs = require('csjs-inject')
// init
const head = require('head')()
const fullScreen = require('fullscreen')()
// modules
const message_maker = require('message-maker')
const make_grid = require('../src/node_modules/make-grid')
const logs = require('..')
const i_button = require('datdot-ui-button')
var id = 0
function demo () {
// -----------------------------------
const myaddress = `${__filename}-${id++}`
const inbox = {}
const outbox = {}
const recipients = {}
const names = {}
const message_id = to => (outbox[to] = 1 + (outbox[to]||0))
function make_protocol (name) {
return function protocol (address, notify) {
names[address] = recipients[name] = { name, address, notify, make: message_maker(myaddress) }
return { notify: listen, address: myaddress }
}
}
function listen (msg) {
// console.log('New message', { msg })
const { head, refs, type, data, meta } = msg // receive msg
inbox[head.join('/')] = msg // store msg
const [from] = head
if (type === 'click') return handle_click(from, type)
// send back ack
// const { notify, make, address } = names[from]
// notify(make({ to: address, type: 'ack', refs: { 'cause': head } }))
}
// -----------------------------------
let is_checked = false
let is_selected = false
const log_list = logs({expanded: 'false'}, make_protocol('logs'))
notifyLogs()
function notifyLogs () {
const { make, notify, address } = recipients['logs']
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'register'}))
notify(make({to: address, type: 'current-block'}))
notify(make({to: address, type: 'eventpool'}))
notify(make({to: address, type: 'keep-alive'}))
// todo: for testing only, after remove
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'info', data: { Old_user: 'shannon', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'info', data: { Old_user: 'shannon', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'info', data: { Old_user: 'shannon', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
// todo: for testing only, after remove
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'info', data: { Old_user: 'shannon', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'info', data: { Old_user: 'shannon', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
notify(make({to: address, type: 'info', data: { New_user: 'poppy', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'info', data: { Old_user: 'shannon', address: '5HQyG6vukenbLDPFBsnHkLHpX8rBaHyWi5WD8cy4uUvsSKnE', noiseKey: { type: 'buffer', data: [8,94,61,252,227,5,211,20,255,248,162,237,241,237,238,88,226,240,104,226,168,119,35,35,188,81,92,25,228,226,253,61]}, signingKey: { type: 'Buffer', data: [172,229,161,118,201,45,60,40,217,146,238,23,93,212,161,31,176,194,119,44,139,186,111,39,203,198,158,184,154,206,131,29]}, form: {}, idleStorage: 0, rating: 0, balance: 0, id: 46 } }))
notify(make({to: address, type: 'extrinsic'}))
notify(make({to: address, type: 'execute-extrinsic'}))
notify(make({to: address, type: 'user'}))
notify(make({to: address, type: 'peer'}))
notify(make({to: address, type: '@todo'}))
notify(make({to: address, type: 'hoster'}))
notify(make({to: address, type: 'encoder'}))
notify(make({to: address, type: 'attestor'}))
notify(make({to: address, type: 'chat', data: { eve_says: { feedkey: { type: 'Buffer', data: [76,160,52,198,102,163,249,71,227,149,111,218,4,197,117,167,124,176,47,176,225,53,187,139,207,121,189,202,71,102,84,184] }, topic: { type: 'Buffer', data: [94,32,85,249,12,183,242,125,62,191,244,253,212,164,127,243,199,182,126,35,11,188,176,86,240,42,193,107,71,92,16,193] } } , refs: ["log1: janice, {\"address\":\"5Exp7NViUbfrRrFNPbH33F6GWXJZGwqzE3tyJucUfnLZza6F\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[246,154,158,32,110,242,75,85,125,75,44,97,87,97,125,84,16,91,223,24,142,49,35,89,3,195,18,50,242,76,232,172]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[112,34,215,111,71,153,9,239,173,159,29,36,39,194,233,89,140,136,238,173,89,202,41,77,201,13,27,92,53,12,140,217]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":32}", "log2: two, {\"address\":\"5Gb39p9GLpL4MxkhqY3oBohva4nnF9FGu9NFSE9vom6jpujW\",\"noiseKey\":{\"type\":\"Buffer\",\"data\":[122,245,207,238,106,50,236,161,87,166,209,147,126,179,75,107,146,252,98,69,66,104,15,202,189,1,166,107,131,149,83,158]},\"signingKey\":{\"type\":\"Buffer\",\"data\":[134,88,213,147,241,23,157,79,167,171,44,123,117,117,173,115,80,29,7,100,174,216,180,56,30,125,45,152,195,9,61,182]},\"form\":{},\"idleStorage\":0,\"rating\":0,\"balance\":0,\"id\":38}"] } }))
notify(make({to: address, type: 'expanded'}))
notify(make({to: address, type: 'collapsed'}))
}
const click = i_button({name: 'click', body: 'Click', theme: { props: { border_radius: '0' } }}, make_protocol('click'))
const open = i_button({name: 'open', body: 'Open', theme: { props: { border_radius: '0' } }}, make_protocol('open'))
const close = i_button({name: 'close', body: 'Close', theme: { props: { border_radius: '0' } }}, make_protocol('close'))
const error = i_button({name: 'error', body: 'Error', theme: { props: { border_radius: '0' } }}, make_protocol('error'))
const warning = i_button({name: 'warning', body: 'Warning', theme: { props: { border_radius: '0' } }}, make_protocol('warning'))
const select = i_button({name: 'select', body: 'Select', theme: { props: { border_radius: '0' } }}, make_protocol('select'))
const toggle = i_button({name: 'toggle', body: 'Toggle', theme: { props: { border_radius: '0' } }}, make_protocol('toggle'))
const actions = bel`<div class="${css.actions}">${click}${open}${close}${error}${warning}${toggle}${select}</div>`
const app = bel`
<div class="${css.wrap}" data-state="debug">
${actions}${log_list}
</div>`
const test = bel`
<div class=${css.test}>
<div class=${css.article}>
<section>
<h2>What is Lorem Ipsum?</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</section>
<section>
<h2>Why do we use it?</h2>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
</section>
<section>
<h2>Beautiy landscape</h2>
<img src="https://cdn.pixabay.com/photo/2021/08/14/04/15/mountains-6544522_960_720.jpg" alt="Landscape">
</section>
</div>
<div class=${css.buttons}>
<button>Hello</button>
<button>WOW</button>
<button>Animals</button>
</div>
</div>
`
return app
function click_event (target) {
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type: 'click' }))
trigger_event(target)
}
function trigger_event(target) {
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type: 'triggered' }))
}
function open_event (target) {
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type: 'opened' }))
}
function close_event (target) {
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type: 'closed' }))
}
function error_event (target) {
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type: 'error' }))
}
function warning_event (target) {
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type: 'warning' }))
}
function toggle_event(target) {
is_checked = !is_checked
const type = is_checked === true ? 'checked' : 'unchecked'
toggle.ariaChecked = is_checked
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type }))
}
function selected_event (target) {
is_selected = !is_selected
const type = is_selected === true ? 'selected' : 'unselected'
select.ariaSelected = is_selected
const { make, notify, address } = recipients['logs']
notify(make({ to: address, type }))
}
function handle_click (from, type) {
const name = names[from].name
if (name === 'select') return selected_event(name)
if (name === 'open') return open_event(name)
if (name === 'close') return close_event(name)
if (name === 'error') return error_event(name)
if (name === 'warning') return warning_event(name)
if (type === 'button') return click_event(target)
if (type === 'switch') return toggle_event(target)
}
}
const css = csjs`
/*
.test {
display: grid;
grid-template-areas: "actions" "article";
height: 100%;
}
.actions {
grid-area: actions;
}
.article {
grid-area: article;
height: 100%;
overflow: scroll;
} */
:root {
/* define colors ---------------------------------------------*/
--b: 0, 0%;
--r: 100%, 50%;
--color-white: var(--b), 100%;
--color-black: var(--b), 0%;
--color-dark: 223, 13%, 20%;
--color-deep-black: 222, 18%, 11%;
--color-red: 358, 99%, 53%;
--color-amaranth-pink: 329, 100%, 65%;
--color-persian-rose: 323, 100%, 50%;
--color-orange: 32, var(--r);
--color-light-orange: 36, 100%, 55%;
--color-safety-orange: 27, 100%, 50%;
--color-deep-saffron: 31, 100%, 56%;
--color-ultra-red: 348, 96%, 71%;
--color-flame: 15, 80%, 50%;
--color-verdigris: 180, 54%, 43%;
--color-viridian-green: 180, 100%, 63%;
--color-blue: 214, 100%, 49%;
--color-heavy-blue: 233, var(--r);
--color-maya-blue: 205, 96%, 72%;
--color-slate-blue: 248, 56%, 59%;
--color-blue-jeans: 204, 96%, 61%;
--color-dodger-blue: 213, 90%, 59%;
--color-light-green: 97, 86%, 77%;
--color-lime-green: 127, 100%, 40%;
--color-slimy-green: 108, 100%, 28%;
--color-maximum-blue-green: 180, 54%, 51%;
--color-deep-green: 136, 79%, 22%;
--color-green: 136, 82%, 38%;
--color-lincoln-green: 97, 100%, 18%;
--color-yellow: 44, 100%, 55%;
--color-chrome-yellow: 39, var(--r);
--color-bright-yellow-crayola: 35, 100%, 58%;
--color-green-yellow-crayola: 51, 100%, 83%;
--color-purple: 283, var(--r);
--color-heliotrope: 288, 100%, 73%;
--color-medium-purple: 269, 100%, 70%;
--color-electric-violet: 276, 98%, 48%;
--color-grey33: var(--b), 20%;
--color-grey66: var(--b), 40%;
--color-grey70: var(--b), 44%;
--color-grey88: var(--b), 53%;
--color-greyA2: var(--b), 64%;
--color-greyC3: var(--b), 76%;
--color-greyCB: var(--b), 80%;
--color-greyD8: var(--b), 85%;
--color-greyD9: var(--b), 85%;
--color-greyE2: var(--b), 89%;
--color-greyEB: var(--b), 92%;
--color-greyED: var(--b), 93%;
--color-greyEF: var(--b), 94%;
--color-greyF2: var(--b), 95%;
--transparent: transparent;
/* define font ---------------------------------------------*/
--snippet-font: Segoe UI Mono, Monospace, Cascadia Mono, Courier New, ui-monospace, Liberation Mono, Menlo, Monaco, Consolas;
--size12: 1.2rem;
--size13: 1.3rem;
--size14: 1.4rem;
--size15: 1.5rem;
--size16: 1.6rem;
--size18: 1.8rem;
--size20: 2rem;
--size22: 2.2rem;
--size24: 2.4rem;
--size26: 2.6rem;
--size28: 2.8rem;
--size30: 3rem;
--size32: 3.2rem;
--size34: 3.4rem;
--size36: 3.6rem;
--size38: 3.8rem;
--size40: 4rem;
--size42: 4.2rem;
--size44: 4.4rem;
--size46: 4.6rem;
--size48: 4.8rem;
--size50: 5rem;
--size52: 5.2rem;
--size54: 5.4rem;
--size56: 5.6rem;
--size58: 5.8rem;
--size60: 6rem;
--weight100: 100;
--weight300: 300;
--weight400: 400;
--weight600: 600;
--weight800: 800;
/* define primary ---------------------------------------------*/
--primary-body-bg-color: var(--color-greyF2);
--primary-font: Arial, sens-serif;
--primary-size: var(--size12);
--primary-size-hover: var(--primary-size);
--primary-weight: 300;
--primary-weight-hover: 300;
--primary-color: var(--color-black);
--primary-color-hover: var(--color-white);
--primary-bg-color: var(--color-white);
--primary-bg-color-hover: var(--color-black);
--primary-border-width: 1px;
--primary-border-style: solid;
--primary-border-color: var(--color-black);
--primary-border-opacity: 1;
--primary-radius: 8px;
--primary-avatar-width: 100%;
--primary-avatar-height: auto;
--primary-avatar-radius: 0;
--primary-disabled-size: var(--primary-size);
--primary-disabled-color: var(--color-greyA2);
--primary-disabled-bg-color: var(--color-greyEB);
--primary-disabled-icon-size: var(--primary-icon-size);
--primary-disabled-icon-fill: var(--color-greyA2);
--primary-listbox-option-icon-size: 20px;
--primary-list-avatar-width: 30px;
--primary-list-avatar-height: auto;
--primary-list-avatar-radius: var(--primary-avatar-radius);
/* define icon settings ---------------------------------------------*/
--primary-icon-size: var(--size14);
--primary-icon-size-hover: var(--size14);
--primary-icon-fill: var(--primary-color);
--primary-icon-fill-hover: var(--primary-color-hover);
/* define current ---------------------------------------------*/
--current-size: var(--primary-size);
--current-weight: var(--primary-weight);
--current-color: var(--color-white);
--current-bg-color: var(--color-black);
--current-icon-size: var(--primary-icon-size);
--current-icon-fill: var(--color-white);
--current-list-selected-icon-size: var(--list-selected-icon-size);
--current-list-selected-icon-fill: var(--color-white);
--current-list-selected-icon-fill-hover: var(--color-white);
--current-list-size: var(--current-size);
--current-list-color: var(--current-color);
--current-list-bg-color: var(--current-bg-color);
/* role listbox settings ---------------------------------------------*/
/*-- collapsed --*/
--listbox-collapsed-bg-color: var(--primary-bg-color);
--listbox-collapsed-bg-color-hover: var(--primary-bg-color-hover);
--listbox-collapsed-icon-size: var(--size14);
--listbox-collapsed-icon-size-hover: var(--listbox-collapsed-icon-size);
--listbox-collapsed-icon-fill: var(--primary-icon-fill);
--listbox-collapsed-icon-fill-hover: var(--primary-icon-fill-hover);
--listbox-collapsed-listbox-size: var(--primary-size);
--listbox-collapsed-listbox-size-hover: var(--listbox-collapsed-listbox-size);
--listbox-collapsed-listbox-weight: var(--primary-weight);
--listbox-collapsed-listbox-weight-hover: var(--primary-weight);
--listbox-collapsed-listbox-color: var(--primary-color);
--listbox-collapsed-listbox-color-hover: var(-primary-color-hover);
--listbox-collapsed-listbox-icon-size: var(--primary-listbox-option-icon-size);
--listbox-collapsed-listbox-icon-size-hover: var(--primary-listbox-option-icon-size);
--listbox-collapsed-listbox-icon-fill: var(--color-blue);
--listbox-collapsed-listbox-icon-fill-hover: var(--color-yellow);
/*-- expanded ---*/
--listbox-expanded-bg-color: var(--current-bg-color);
--listbox-expanded-icon-size: var(--size14);
--listbox-expanded-icon-fill: var(--color-light-green);
--listbox-expanded-listbox-size: var(--listbox-collapsed-listbox-size);
--listbox-expanded-listbox-weight: var(--primary-weight);
--listbox-expanded-listbox-color: var(--current-color);
--listbox-expanded-listbox-icon-size: var(--primary-listbox-option-icon-size);
--listbox-expanded-listbox-icon-fill: var(--color-light-green);
/* role option settings ---------------------------------------------*/
--list-bg-color: var(--primary-bg-color);
--list-bg-color-hover: var(--primary-bg-color-hover);
--list-selected-icon-size: var(--size16);
--list-selected-icon-size-hover: var(--list-selected-icon-size);
--list-selected-icon-fill: var(--primary-icon-fill);
--list-selected-icon-fill-hover: var(--primary-icon-fill-hover);
}
*, *:before, *:after {
box-sizing: border-box;
}
html {
font-size: 62.5%;
height: 100%;
}
body {
-webkit-text-size-adjust: 100%;
font-size: var(--primary-font-size);
font-family: var(--primary-font);
background-color: hsl( var(--primary-bgColor) );
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
}
button {
--color: var(--color-black);
--bgColor: var(--color-white);
padding: 8px 12px;
border: none;
border-radius: 8px;
color: hsl( var(--color) );
background-color: hsl( var(--bgColor) );
transition: background-color .3s, color .3s ease-in-out;
cursor: pointer;
}
button:hover {
--color: var(--color-white);
--bgColor: var(--color-dark);
}
.wrap {
display: grid;
grid-template-rows: auto 1fr;
grid-template-areas: "actions" "terminal";
}
[data-state="debug"] {
height: 100%;
}
.actions {
grid-area: actions;
display: grid;
grid-template-rows: auto;
grid-template-columns: repeat(auto-fit, minmax(60px, auto));
gap: 2px;
}
[aria-selected="true"] {
color: hsl(var(--color-white));
background-color: hsl(var(--primary-color));
}
`
document.body.append( demo() )
}).call(this)}).call(this,"/demo/demo.js")
},{"..":50,"../src/node_modules/make-grid":53,"bel":5,"csjs-inject":8,"datdot-ui-button":25,"fullscreen":2,"head":3,"message-maker":46}],2:[function(require,module,exports){
module.exports = fullscreen
function fullscreen () {
document.body.addEventListener("keydown", (e) => {
const key = e.which || e.keyCode || e.charCode
if (key === 70) return toggleFullScreen()
})
}
function toggleFullScreen () {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen()
} else {
if (document.exitFullscreen) {
document.exitFullscreen()
}
}
}
},{}],3:[function(require,module,exports){
module.exports = head
function head (lang = 'UTF-8', title = 'Terminal - DatDot') {
document.documentElement.lang = 'en'
document.title = title
const lan = document.createElement('meta')
const viewport = document.createElement('meta')
const description = document.createElement('meta')
lan.setAttribute('charset', lang)
viewport.setAttribute('name', 'viewport')
viewport.setAttribute('content', 'width=device-width, initial-scale=1, user-scalable=no')
description.setAttribute('name', 'description')
description.setAttribute('content', 'Datdot-UI is a web component and the widgets for datdot.org using.')
document.head.append(lan, viewport)
}
},{}],4:[function(require,module,exports){
var trailingNewlineRegex = /\n[\s]+$/
var leadingNewlineRegex = /^\n[\s]+/
var trailingSpaceRegex = /[\s]+$/
var leadingSpaceRegex = /^[\s]+/
var multiSpaceRegex = /[\n\s]+/g
var TEXT_TAGS = [
'a', 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'data', 'dfn', 'em', 'i',
'kbd', 'mark', 'q', 'rp', 'rt', 'rtc', 'ruby', 's', 'amp', 'small', 'span',
'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr'
]
var VERBATIM_TAGS = [
'code', 'pre', 'textarea'
]
module.exports = function appendChild (el, childs) {
if (!Array.isArray(childs)) return
var nodeName = el.nodeName.toLowerCase()
var hadText = false
var value, leader
for (var i = 0, len = childs.length; i < len; i++) {
var node = childs[i]
if (Array.isArray(node)) {
appendChild(el, node)
continue
}
if (typeof node === 'number' ||
typeof node === 'boolean' ||
typeof node === 'function' ||
node instanceof Date ||
node instanceof RegExp) {
node = node.toString()
}
var lastChild = el.childNodes[el.childNodes.length - 1]
// Iterate over text nodes
if (typeof node === 'string') {
hadText = true
// If we already had text, append to the existing text
if (lastChild && lastChild.nodeName === '#text') {
lastChild.nodeValue += node
// We didn't have a text node yet, create one
} else {
node = document.createTextNode(node)
el.appendChild(node)
lastChild = node
}
// If this is the last of the child nodes, make sure we close it out
// right
if (i === len - 1) {
hadText = false
// Trim the child text nodes if the current node isn't a
// node where whitespace matters.
if (TEXT_TAGS.indexOf(nodeName) === -1 &&
VERBATIM_TAGS.indexOf(nodeName) === -1) {
value = lastChild.nodeValue
.replace(leadingNewlineRegex, '')
.replace(trailingSpaceRegex, '')
.replace(trailingNewlineRegex, '')
.replace(multiSpaceRegex, ' ')
if (value === '') {
el.removeChild(lastChild)
} else {
lastChild.nodeValue = value
}
} else if (VERBATIM_TAGS.indexOf(nodeName) === -1) {
// The very first node in the list should not have leading
// whitespace. Sibling text nodes should have whitespace if there
// was any.
leader = i === 0 ? '' : ' '
value = lastChild.nodeValue
.replace(leadingNewlineRegex, leader)
.replace(leadingSpaceRegex, ' ')
.replace(trailingSpaceRegex, '')
.replace(trailingNewlineRegex, '')
.replace(multiSpaceRegex, ' ')
lastChild.nodeValue = value
}
}
// Iterate over DOM nodes
} else if (node && node.nodeType) {
// If the last node was a text node, make sure it is properly closed out
if (hadText) {
hadText = false
// Trim the child text nodes if the current node isn't a
// text node or a code node
if (TEXT_TAGS.indexOf(nodeName) === -1 &&
VERBATIM_TAGS.indexOf(nodeName) === -1) {
value = lastChild.nodeValue
.replace(leadingNewlineRegex, '')
.replace(trailingNewlineRegex, '')
.replace(multiSpaceRegex, ' ')
// Remove empty text nodes, append otherwise
if (value === '') {
el.removeChild(lastChild)
} else {
lastChild.nodeValue = value
}
// Trim the child nodes if the current node is not a node
// where all whitespace must be preserved
} else if (VERBATIM_TAGS.indexOf(nodeName) === -1) {
value = lastChild.nodeValue
.replace(leadingSpaceRegex, ' ')
.replace(leadingNewlineRegex, '')
.replace(trailingNewlineRegex, '')
.replace(multiSpaceRegex, ' ')
lastChild.nodeValue = value
}
}
// Store the last nodename
var _nodeName = node.nodeName
if (_nodeName) nodeName = _nodeName.toLowerCase()
// Append the node to the DOM
el.appendChild(node)
}
}
}
},{}],5:[function(require,module,exports){
var hyperx = require('hyperx')
var appendChild = require('./appendChild')
var SVGNS = 'http://www.w3.org/2000/svg'
var XLINKNS = 'http://www.w3.org/1999/xlink'
var BOOL_PROPS = [
'autofocus', 'checked', 'defaultchecked', 'disabled', 'formnovalidate',
'indeterminate', 'readonly', 'required', 'selected', 'willvalidate'
]
var COMMENT_TAG = '!--'
var SVG_TAGS = [
'svg', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor',
'animateMotion', 'animateTransform', 'circle', 'clipPath', 'color-profile',
'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix',
'feComponentTransfer', 'feComposite', 'feConvolveMatrix',
'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood',
'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage',
'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight',
'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter',
'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src',
'font-face-uri', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image',
'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph',
'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect',
'set', 'stop', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref',
'tspan', 'use', 'view', 'vkern'
]
function belCreateElement (tag, props, children) {
var el
// If an svg tag, it needs a namespace
if (SVG_TAGS.indexOf(tag) !== -1) {
props.namespace = SVGNS
}
// If we are using a namespace
var ns = false
if (props.namespace) {
ns = props.namespace
delete props.namespace
}
// Create the element
if (ns) {
el = document.createElementNS(ns, tag)
} else if (tag === COMMENT_TAG) {
return document.createComment(props.comment)
} else {
el = document.createElement(tag)
}
// Create the properties
for (var p in props) {
if (props.hasOwnProperty(p)) {
var key = p.toLowerCase()
var val = props[p]
// Normalize className
if (key === 'classname') {
key = 'class'
p = 'class'
}
// The for attribute gets transformed to htmlFor, but we just set as for
if (p === 'htmlFor') {
p = 'for'
}
// If a property is boolean, set itself to the key
if (BOOL_PROPS.indexOf(key) !== -1) {
if (val === 'true') val = key
else if (val === 'false') continue
}
// If a property prefers being set directly vs setAttribute
if (key.slice(0, 2) === 'on') {
el[p] = val
} else {
if (ns) {
if (p === 'xlink:href') {
el.setAttributeNS(XLINKNS, p, val)
} else if (/^xmlns($|:)/i.test(p)) {
// skip xmlns definitions
} else {
el.setAttributeNS(null, p, val)
}
} else {
el.setAttribute(p, val)
}
}
}
}
appendChild(el, children)
return el
}
module.exports = hyperx(belCreateElement, {comments: true})
module.exports.default = module.exports
module.exports.createElement = belCreateElement
},{"./appendChild":4,"hyperx":48}],6:[function(require,module,exports){
(function (global){(function (){
'use strict';
var csjs = require('csjs');
var insertCss = require('insert-css');
function csjsInserter() {
var args = Array.prototype.slice.call(arguments);
var result = csjs.apply(null, args);
if (global.document) {
insertCss(csjs.getCss(result));
}
return result;
}
module.exports = csjsInserter;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"csjs":11,"insert-css":49}],7:[function(require,module,exports){
'use strict';
module.exports = require('csjs/get-css');
},{"csjs/get-css":10}],8:[function(require,module,exports){
'use strict';
var csjs = require('./csjs');
module.exports = csjs;
module.exports.csjs = csjs;
module.exports.getCss = require('./get-css');
},{"./csjs":6,"./get-css":7}],9:[function(require,module,exports){
'use strict';
module.exports = require('./lib/csjs');
},{"./lib/csjs":15}],10:[function(require,module,exports){
'use strict';
module.exports = require('./lib/get-css');
},{"./lib/get-css":19}],11:[function(require,module,exports){
'use strict';
var csjs = require('./csjs');
module.exports = csjs();
module.exports.csjs = csjs;
module.exports.noScope = csjs({ noscope: true });
module.exports.getCss = require('./get-css');
},{"./csjs":9,"./get-css":10}],12:[function(require,module,exports){
'use strict';
/**
* base62 encode implementation based on base62 module:
* https://github.com/andrew/base62.js
*/
var CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
module.exports = function encode(integer) {
if (integer === 0) {
return '0';
}
var str = '';
while (integer > 0) {
str = CHARS[integer % 62] + str;
integer = Math.floor(integer / 62);
}
return str;
};
},{}],13:[function(require,module,exports){
'use strict';
var makeComposition = require('./composition').makeComposition;
module.exports = function createExports(classes, keyframes, compositions) {
var keyframesObj = Object.keys(keyframes).reduce(function(acc, key) {
var val = keyframes[key];
acc[val] = makeComposition([key], [val], true);
return acc;
}, {});
var exports = Object.keys(classes).reduce(function(acc, key) {
var val = classes[key];
var composition = compositions[key];
var extended = composition ? getClassChain(composition) : [];
var allClasses = [key].concat(extended);
var unscoped = allClasses.map(function(name) {
return classes[name] ? classes[name] : name;
});
acc[val] = makeComposition(allClasses, unscoped);
return acc;
}, keyframesObj);
return exports;
}
function getClassChain(obj) {
var visited = {}, acc = [];
function traverse(obj) {
return Object.keys(obj).forEach(function(key) {
if (!visited[key]) {
visited[key] = true;
acc.push(key);
traverse(obj[key]);
}
});
}
traverse(obj);
return acc;
}
},{"./composition":14}],14:[function(require,module,exports){
'use strict';
module.exports = {
makeComposition: makeComposition,
isComposition: isComposition,
ignoreComposition: ignoreComposition
};
/**
* Returns an immutable composition object containing the given class names
* @param {array} classNames - The input array of class names
* @return {Composition} - An immutable object that holds multiple
* representations of the class composition
*/
function makeComposition(classNames, unscoped, isAnimation) {
var classString = classNames.join(' ');
return Object.create(Composition.prototype, {
classNames: { // the original array of class names
value: Object.freeze(classNames),
configurable: false,
writable: false,
enumerable: true
},
unscoped: { // the original array of class names
value: Object.freeze(unscoped),
configurable: false,
writable: false,
enumerable: true
},
className: { // space-separated class string for use in HTML
value: classString,
configurable: false,
writable: false,
enumerable: true
},
selector: { // comma-separated, period-prefixed string for use in CSS
value: classNames.map(function(name) {
return isAnimation ? name : '.' + name;
}).join(', '),
configurable: false,
writable: false,
enumerable: true
},
toString: { // toString() method, returns class string for use in HTML
value: function() {
return classString;
},
configurable: false,
writeable: false,
enumerable: false
}
});
}
/**
* Returns whether the input value is a Composition
* @param value - value to check
* @return {boolean} - whether value is a Composition or not
*/
function isComposition(value) {
return value instanceof Composition;
}
function ignoreComposition(values) {
return values.reduce(function(acc, val) {
if (isComposition(val)) {
val.classNames.forEach(function(name, i) {
acc[name] = val.unscoped[i];
});
}
return acc;
}, {});
}
/**
* Private constructor for use in `instanceof` checks
*/
function Composition() {}
},{}],15:[function(require,module,exports){
'use strict';
var extractExtends = require('./css-extract-extends');
var composition = require('./composition');
var isComposition = composition.isComposition;
var ignoreComposition = composition.ignoreComposition;
var buildExports = require('./build-exports');