-
Notifications
You must be signed in to change notification settings - Fork 2
/
stack.cirru
1523 lines (1522 loc) · 93.2 KB
/
stack.cirru
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
{} (:package |app)
:root $ {} (:ns |main) (:def |main!)
:files $ {}
|updater.router $ {}
:ns $ [] |ns |app.updater.router
[] |:require ([] |[] |app.util.stack |:refer $ [] |[] |get-path) ([] |[] |clojure.string |:as |string)
:defs $ {}
|toggle-palette $ [] |defn |toggle-palette ([] |store |op-data |op-id)
[] |update-in |store ([] |[] |:router |:show-palette?) (, |not)
|route $ [] |defn |route ([] |store |op-data)
[] |let ([] $ [] |router |op-data) ([] |assoc |store |:router |router)
|open-file-tree $ [] |defn |open-file-tree ([] |store |op-data |op-id)
[] |let
[] $ [] |code-path ([] |get-path |store)
[] |-> |store
[] |assoc-in ([] |[] |:router |:name) (, |:file-tree)
[] |assoc-in ([] |[] |:graph |:ns-path)
[] |vec $ [] |string/split ([] |:ns |code-path) (, ||.)
:procs $ []
|comp.brief-file $ {}
:ns $ [] |ns |app.comp.brief-file
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input) ([] |[] |clojure.string |:as |string) ([] |[] |respo-ui.core |:as |ui) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.keycode |:as |keycode)
:defs $ {}
|comp-brief-file $ [] |defcomp |comp-brief-file ([] |states |ns-text |file)
[] |let
[] ([] |cursor $ [] |:cursor |states)
[] |state $ [] |or ([] |:data |states) (, ||)
[] |div ([] |{} $ [] |:style |style-file)
[] |div ([] |{} $ [] |:style |ui/row) ([] |<> |ns-text |nil) ([] |=< |16 |nil)
[] |span $ [] |{} ([] |:inner-text ||ns)
[] |:style $ [] |{} ([] |:cursor |:pointer)
[] |:on-click $ [] |on-edit-ns |ns-text
[] |=< |16 |nil
[] |span $ [] |{} ([] |:inner-text ||procs)
[] |:style $ [] |{} ([] |:cursor |:pointer)
[] |:on-click $ [] |on-edit-procs |ns-text
[] |=< |16 |nil
[] |span $ [] |{} ([] |:inner-text ||Delete) ([] |:style |widget/clickable-text) ([] |:on-click $ [] |on-remove |ns-text)
[] |div ([] |{})
[] |input $ [] |{} ([] |:value |state) ([] |:placeholder "||new def") ([] |:style |widget/input)
[] |:on-input $ [] |fn ([] |e |d!) ([] |d! |cursor $ [] |:value |e)
[] |:on-keydown $ [] |fn ([] |e |d!)
[] |if ([] |= |keycode/key-enter $ [] |:key-code |e)
[] |if ([] |not $ [] |string/blank? |state)
[] |do ([] |d! |:collection/add-definition $ [] |[] |ns-text |state) ([] |d! |cursor ||)
[] |=< |nil |8
[] |list-> ([] |{})
[] |->> ([] |:defs |file) ([] |sort |compare)
[] |map $ [] |fn ([] |entry)
[] |let
[] $ [] |def-text ([] |key |entry)
[] |[] |def-text $ [] |div
[] |{} ([] |:inner-text |def-text)
[] |:style $ [] |{} ([] |:cursor |:pointer) ([] |:font-size |14) ([] |:line-height "|\"24px") ([] |:color $ [] |hsl |0 |0 |50)
[] |:on-click $ [] |on-edit-def |ns-text |def-text
|on-edit-procs $ [] |defn |on-edit-procs ([] |ns-text)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:procs) ([] |:ns |ns-text) ([] |:extra |nil) ([] |:focus $ [] |[])
|on-remove $ [] |defn |on-remove ([] |ns-text)
[] |fn ([] |e |d! |m!) ([] |d! |:collection/remove-file |ns-text)
|on-keydown $ [] |defn |on-keydown ([] |ns-text |def-text)
[] |fn ([] |e |d! |m!) ([] |println ||event)
[] |if ([] |= |keycode/key-enter $ [] |:key-code |e)
[] |if ([] |not $ [] |string/blank? |def-text)
[] |do ([] |d! |:collection/add-definition $ [] |[] |ns-text |def-text) ([] |m! ||)
|on-edit-ns $ [] |defn |on-edit-ns ([] |ns-text)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:ns) ([] |:ns |ns-text) ([] |:extra |nil) ([] |:focus $ [] |[])
|on-edit-def $ [] |defn |on-edit-def ([] |ns-text |def-text)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:defs) ([] |:ns |ns-text) ([] |:extra |def-text) ([] |:focus $ [] |[] |2)
|style-file $ [] |def |style-file
[] |{} ([] |:padding "|\"0 8px 16px 8px") ([] |:line-height |1.6)
:procs $ []
|comp.loading $ {}
:ns $ [] |ns |app.comp.loading
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|comp-loading $ [] |defcomp |comp-loading ([])
[] |div
[] |{} $ [] |:style ([] |merge |ui/fullscreen |ui/row-center |style-loading)
[] |<> ||Loading... |nil
|style-loading $ [] |def |style-loading
[] |{} ([] |:background-color $ [] |hsl |200 |40 |10) ([] |:justify-content ||center) ([] |:color $ [] |hsl |0 |0 |80) ([] |:font-size ||32px) ([] |:font-weight ||100) ([] |:font-family |ui/font-fancy)
:procs $ []
|comp.command $ {}
:ns $ [] |ns |app.comp.command
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|style-command $ [] |def |style-command
[] |{} ([] |:backgroud-color $ [] |hsl |0 |0 |0) ([] |:padding "||0 8px") ([] |:line-height "|\"30px") ([] |:font-family |ui/font-normal) ([] |:cursor ||pointer)
|comp-command $ [] |defcomp |comp-command ([] |command |selected? |on-select)
[] |div
[] |{}
[] |:style $ [] |merge |style-command
[] |if |selected? $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |20 |0.8)
[] |:on-click $ [] |fn ([] |e |dispatch!) ([] |on-select |dispatch!)
[] |case ([] |first |command)
[] |:defs $ [] |div ([] |{}) ([] |<> $ [] |get |command |2) ([] |=< |16 |nil)
[] |<> ([] |get |command |1)
[] |{} $ [] |:color ([] |hsl |0 |0 |40)
[] |<> ([] |string/join "|| " |command) (, |nil)
:procs $ []
|updater $ {}
:ns $ [] |ns |app.updater
[] |:require ([] |[] |respo.cursor |:refer $ [] |[] |update-states) ([] |[] |app.updater.router |:as |router) ([] |[] |app.updater.collection |:as |collection) ([] |[] |app.updater.notification |:as |notification) ([] |[] |app.updater.stack |:as |stack) ([] |[] |app.updater.modal |:as |modal) ([] |[] |app.updater.graph |:as |graph)
:defs $ {}
|updater $ [] |defn |updater ([] |store |op |op-data |op-id)
[] |let
[] $ [] |handler
[] |case |op
[] |:states $ [] |fn ([] |x) ([] |update-states |x |op-data)
[] |:router/route |router/route
[] |:router/toggle-palette |router/toggle-palette
[] |:router/open-file-tree |router/open-file-tree
[] |:collection/add-definition |collection/add-definition
[] |:collection/add-namespace |collection/add-namespace
[] |:collection/edit |collection/edit
[] |:collection/edit-ns |collection/edit-ns
[] |:collection/write |collection/write-code
[] |:collection/load |collection/load-remote
[] |:collection/remove-this |collection/remove-this
[] |:collection/remove-file |collection/remove-file
[] |:collection/rename |collection/rename
[] |:collection/hydrate |collection/hydrate
[] |:notification/add-one |notification/add-one
[] |:notification/remove-one |notification/remove-one
[] |:notification/remove-since |notification/remove-since
[] |:stack/goto-definition |stack/goto-definition
[] |:stack/dependents |stack/dependents
[] |:stack/go-back |stack/go-back
[] |:stack/go-next |stack/go-next
[] |:stack/point-to |stack/point-to
[] |:stack/collapse |stack/collapse
[] |:stack/shift |stack/shift-one
[] |:modal/mould |modal/mould
[] |:modal/recycle |modal/recycle
[] |:graph/load-graph |graph/load-graph
[] |:graph/view-path |graph/view-path
[] |:graph/view-ns |graph/view-ns
[] |:graph/edit-current |graph/edit-current
[] |:graph/show-orphans |graph/show-orphans
, |default-handler
[] |handler |store |op-data |op-id
|default-handler $ [] |defn |default-handler ([] |store |op-data) (, |store)
:procs $ []
|util.keycode $ {} (:ns $ [] |ns |app.util.keycode)
:defs $ {} (|key-esc $ [] |def |key-esc |27) (|key-u $ [] |def |key-u |85) (|key-down $ [] |def |key-down |40) (|key-s $ [] |def |key-s |83) (|key-d $ [] |def |key-d |68) (|key-j $ [] |def |key-j |74) (|key-a $ [] |def |key-a |65) (|key-k $ [] |def |key-k |75) (|key-p $ [] |def |key-p |80) (|key-enter $ [] |def |key-enter |13) (|key-i $ [] |def |key-i |73) (|key-b $ [] |def |key-b |66) (|key-up $ [] |def |key-up |38) (|key-e $ [] |def |key-e |69)
:procs $ []
|updater.stack $ {}
:ns $ [] |ns |app.updater.stack
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |app.util.analyze |:refer $ [] |[] |list-dependent-ns |parse-ns-deps |extract-deps) ([] |[] |app.util.detect |:refer $ [] |[] |strip-atom |contains-def? |=path?) ([] |[] |app.util |:refer $ [] |[] |remove-idx |helper-notify |helper-create-def |make-path |has-ns?) ([] |app.util.stack |:refer $ [] |push-path |push-paths) ([] |clojure.set |:refer $ [] |union)
:defs $ {}
|collapse $ [] |defn |collapse ([] |store |op-data |op-id)
[] |let ([] $ [] |cursor |op-data)
[] |update |store |:writer $ [] |fn ([] |writer)
[] |-> |writer ([] |assoc |:pointer |0)
[] |update |:stack $ [] |fn ([] |stack) ([] |subvec |stack |cursor)
|go-next $ [] |defn |go-next ([] |store |op-data)
[] |-> |store $ [] |update |:writer
[] |fn ([] |writer)
[] |if
[] |< ([] |:pointer |writer)
[] |dec $ [] |count ([] |:stack |writer)
[] |-> |writer ([] |update |:pointer |inc) ([] |assoc |:focus $ [] |[])
, |writer
|dependents $ [] |defn |dependents ([] |store |op-data |op-id)
[] |let
[] ([] |writer $ [] |:writer |store)
[]
[] |{} ([] |stack |:stack) ([] |pointer |:pointer)
, |writer
[] |code-path $ [] |get |stack |pointer
[]
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra)
, |code-path
[] |pkg $ [] |get-in |store ([] |[] |:collection |:package)
[] |def-as-dep $ [] |{} ([] |:ns $ [] |str |pkg ||. |ns-part) ([] |:def |extra-name) ([] |:external? |false)
[] |files $ [] |get-in |store ([] |[] |:collection |:files)
[] |ns-list $ [] |list-dependent-ns |ns-part |files |pkg
[] |case |kind
[] |:defs $ [] |let
[] $ [] |new-paths
[] |->> ([] |conj |ns-list |ns-part)
[] |map $ [] |fn ([] |ns-text)
[] |let
[] $ [] |file ([] |get |files |ns-text)
[] |into ([] |#{})
[] |concat
[] |->> ([] |:defs |file)
[] |filter $ [] |fn ([] |entry)
[] |let
[] $ [] |def-deps
[] |extract-deps
[] |subvec ([] |val |entry) (, |2)
, |ns-part |file |pkg
[] |contains? |def-deps |def-as-dep
[] |map $ [] |fn ([] |entry)
[] |{} ([] |:kind |:defs) ([] |:ns |ns-text) ([] |:extra $ [] |first |entry) ([] |:focus $ [] |[] |2)
[] |let
[] $ [] |proc-deps
[] |extract-deps ([] |:procs |file) (, |ns-part |file |pkg)
[] |if ([] |contains? |proc-deps |def-as-dep)
[] |list $ [] |{} ([] |:kind |:procs) ([] |:ns |ns-text) ([] |:extra |nil) ([] |:focus $ [] |[] |0)
[] |list
[] |apply |concat
[] |filter $ [] |fn ([] |x) ([] |not $ [] |=path? |x |code-path)
[] |if ([] |empty? |new-paths) ([] |update |store |:notifications $ [] |helper-notify |op-id "||Nothing found.") ([] |update |store |:writer $ [] |push-paths |new-paths)
[] |:ns $ [] |let
[] $ [] |new-paths
[] |map
[] |fn ([] |x) ([] |[] |x |:ns)
, |ns-list
[] |; |println |pointer |new-paths
[] |update |store |:writer $ [] |push-paths |new-paths
, |store
|point-to $ [] |defn |point-to ([] |store |op-data |op-id)
[] |let ([] $ [] |pointer |op-data)
[] |assoc-in |store ([] |[] |:writer |:pointer) (, |pointer)
|go-back $ [] |defn |go-back ([] |store |op-data)
[] |-> |store $ [] |update |:writer
[] |fn ([] |writer)
[] |if ([] |pos? $ [] |:pointer |writer)
[] |-> |writer ([] |update |:pointer |dec) ([] |assoc |:focus $ [] |[])
, |writer
|shift-one $ [] |defn |shift-one ([] |store |op-data |op-id)
[] |let ([] $ [] |pointer |op-data)
[] |update |store |:writer $ [] |fn ([] |writer)
[] |-> |writer
[] |update |:stack $ [] |fn ([] |stack) ([] |remove-idx |stack |pointer)
[] |update |:pointer $ [] |fn ([] |p)
[] |if ([] |= |p |pointer)
[] |if ([] |pos? |p) ([] |dec |p) (, |p)
[] |if ([] |< |p |pointer) (, |p) ([] |dec |p)
|goto-definition $ [] |defn |goto-definition ([] |store |op-data |op-id)
[] |let
[] ([] |forced? |op-data)
[]
[] |{} ([] |pkg |:package) ([] |files |:files)
[] |get-in |store $ [] |[] |:collection
[] |pkg_ $ [] |str |pkg ||.
[]
[] |{} ([] |stack |:stack) ([] |pointer |:pointer)
[] |:writer |store
[] |code-path $ [] |get |stack |pointer
[] |focus $ [] |:focus |code-path
[] |target $ [] |strip-atom
[] |get-in |store $ [] |concat ([] |make-path |code-path) (, |focus)
[] |ns-deps $ [] |parse-ns-deps
[] |get-in |files $ [] |[] ([] |:ns |code-path) (, |:ns)
[] |current-ns-defs $ [] |get-in |files
[] |[] ([] |:ns |code-path) (, |:defs)
[] |dep-info $ [] |if ([] |has-ns? |target)
[] |let
[]
[] ([] |[] |ns-text |def-text) ([] |string/split |target ||/)
[] |maybe-info $ [] |get |ns-deps |ns-text
[] |if
[] |and ([] |some? |maybe-info) ([] |= |:as $ [] |:kind |maybe-info)
[] |{} ([] |:ns $ [] |:ns |maybe-info) ([] |:def |def-text)
, |nil
[] |let
[] $ [] |maybe-info ([] |get |ns-deps |target)
[] |if
[] |and ([] |some? |maybe-info) ([] |= |:refer $ [] |:kind |maybe-info)
[] |{} ([] |:ns $ [] |:ns |maybe-info) ([] |:def |target)
[] |if
[] |or ([] |contains? |current-ns-defs |target) (, |forced?)
[] |{}
[] |:ns $ [] |str |pkg_ ([] |:ns |code-path)
[] |:def |target
, |nil
[] |; |println |target |dep-info
[] |if ([] |some? |dep-info)
[] |if
[] |string/starts-with? ([] |:ns |dep-info) (, |pkg_)
[] |let
[]
[] |existed? $ [] |some?
[] |get-in |files $ [] |[] ([] |:ns |dep-info) (, |:defs) ([] |:def |dep-info)
[] |shorten-ns $ [] |string/replace-first ([] |:ns |dep-info) (, |pkg_ ||)
[] |touch-def $ [] |fn ([] |store) ([] |println ||touching |existed?)
[] |if |existed? |store $ [] |-> |store
[] |update-in ([] |[] |:collection |:files)
[] |helper-create-def |shorten-ns ([] |:def |dep-info) (, |code-path) ([] |:focus |code-path)
[] |-> |store ([] |touch-def)
[] |update |:writer $ [] |push-path
[] |{} ([] |:kind |:defs) ([] |:ns |shorten-ns) ([] |:extra $ [] |:def |dep-info) ([] |:focus $ [] |[] |2)
[] |-> |store $ [] |update |:notifications
[] |helper-notify |op-id $ [] |str "||External package: " ([] |:ns |dep-info)
[] |-> |store $ [] |update |:notifications ([] |helper-notify |op-id $ [] |str "||Can't find: " |target)
:procs $ []
|util.analyze $ {}
:ns $ [] |ns |app.util.analyze
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |app.util.detect |:refer $ [] |[] |contains-def? |use-vector?)
:defs $ {}
|expand-deps-tree $ [] |defn |expand-deps-tree ([] |internal-ns |def-text |files |pkg |parents)
[] |let
[] ([] |this-file $ [] |get |files |internal-ns)
[] |def-expr $ [] |get-in |this-file ([] |[] |:defs |def-text)
[] |stamp $ [] |{} ([] |:ns |internal-ns) ([] |:def |def-text)
[] |base-dep $ [] |{} ([] |:ns |internal-ns) ([] |:def |def-text) ([] |:external? |false) ([] |:circular? |false)
[] |if ([] |nil? |def-expr) ([] |assoc |base-dep |:external? |true)
[] |if ([] |contains? |parents |stamp) ([] |assoc |base-dep |:circular? |true)
[] |assoc |base-dep |:deps $ [] |let
[] $ [] |def-deps
[] |if ([] |some? |def-expr)
[] |extract-deps ([] |subvec |def-expr |2) (, |internal-ns |this-file |pkg)
, |nil
[] |->> |def-deps
[] |map $ [] |fn ([] |dep-info)
[] |if ([] |:external? |dep-info) (, |dep-info)
[] |let
[]
[] |child-internal-ns $ [] |string/replace-first ([] |:ns |dep-info) ([] |str |pkg ||.) (, ||)
[] |child-def $ [] |:def |dep-info
[] |next-parents $ [] |conj |parents |stamp
[] |expand-deps-tree |child-internal-ns |child-def |files |pkg |next-parents
[] |into $ [] |#{}
|parse-rule $ [] |defn |parse-rule ([] |dict |rule)
[] |let
[]
[] |clean-rule $ [] |if ([] |= ||[] $ [] |first |rule) ([] |subvec |rule |1) (, |rule)
[] |ns-text $ [] |first |clean-rule
[] |binding-rule $ [] |subvec |clean-rule |1
[] |loop
[] ([] |left-binding |binding-rule) ([] |result |dict)
[] |; |println "||doing loop:" |left-binding |result
[] |if
[] |< ([] |count |left-binding) (, |2)
, |result
[] |let
[] ([] |kind $ [] |first |left-binding) ([] |data $ [] |get |left-binding |1)
[] |recur ([] |subvec |left-binding |2)
[] |cond
[] ([] |= ||:as |kind)
[] |assoc |result |data $ [] |{} ([] |:kind |:as) ([] |:ns |ns-text) ([] |:text |data)
[] ([] |= ||:refer |kind)
[] |->> |data
[] |filter $ [] |fn ([] |x) ([] |not= |x ||[])
[] |map $ [] |fn ([] |x)
[] |[] |x $ [] |{} ([] |:kind |:refer) ([] |:ns |ns-text) ([] |:text |x)
[] |into $ [] |{}
[] |merge |result
[] |:else |result
|list-dependent-ns $ [] |defn |list-dependent-ns ([] |ns-name |files |pkg)
[] |let
[] ([] |full-ns $ [] |str |pkg ||. |ns-name)
[] |pick-ns $ [] |fn ([] |xs)
[] |if ([] |use-vector? |xs) ([] |get |xs |1) ([] |first |xs)
[] |->> |files
[] |filter $ [] |fn ([] |entry)
[] |let
[]
[] ([] |[] |ns-part |file) (, |entry)
[] |ns-expr $ [] |:ns |file
[] |ns-rules $ [] |->> ([] |subvec |ns-expr |2) ([] |map |rest) ([] |apply |concat) ([] |map |pick-ns) ([] |into $ [] |#{})
[] |; |println ||Search: |ns-name |ns-rules
[] |contains? |ns-rules |full-ns
[] |map |first
[] |into $ [] |#{}
|pick-dep $ [] |defn |pick-dep ([] |token)
[] |cond
[] ([] |string/blank? |token) (, |nil)
[] ([] |string/starts-with? |token ||:) (, |nil)
[] ([] |string/starts-with? |token ||.) (, |nil)
[] ([] |string/starts-with? |token |||) (, |nil)
[] ([] |string/starts-with? |token ||#) (, |nil)
[] ([] |string/starts-with? |token ||[) (, |nil)
[] ([] |string/starts-with? |token ||') (, |nil)
[] ([] |string/starts-with? |token ||{) (, |nil)
[] ([] |string/starts-with? |token ||%) (, |nil)
[] ([] |string/starts-with? |token ||\) (, |nil)
[] ([] |= |token ||--) (, |nil)
[] ([] |string/includes? |token ||/)
[] |let
[] $ [] ([] |[] |ns-piece |def-piece) ([] |string/split |token ||/)
[] |{} ([] |:kind |:ns) ([] |:data |ns-piece) ([] |:extra |def-piece)
[] ([] |string/includes? |token ||.)
[] |let
[] $ [] ([] |[] |def-piece |prop-piece) ([] |string/split |token ||.)
[] |{} ([] |:kind |:def) ([] |:data |def-piece)
[] ([] |string/starts-with? |token ||@)
[] |{} ([] |:kind |:def) ([] |:data $ [] |subs |token |1)
[] |:else $ [] |{} ([] |:kind |:def) ([] |:data |token)
|parse-ns-deps $ [] |defn |parse-ns-deps ([] |expression)
[] |let
[] $ [] |branches
[] |->> ([] |subvec |expression |2)
[] |filter $ [] |fn ([] |expr) ([] |= ||:require $ [] |first |expr)
[] |if ([] |empty? |branches) ([] |{})
[] |doall $ [] |reduce |parse-rule ([] |{}) ([] |rest $ [] |first |branches)
|extract-deps $ [] |defn |extract-deps ([] |expression |internal-ns |file |pkg)
[] |let
[]
[] |external? $ [] |fn ([] |ns-text)
[] |not $ [] |string/starts-with? |ns-text ([] |str |pkg ||.)
[] |ns-deps $ [] |parse-ns-deps ([] |:ns |file)
[] |->> |expression ([] |flatten) ([] |map |pick-dep) ([] |filter |some?)
[] |map $ [] |fn ([] |info)
[] |case ([] |:kind |info)
[] |:def $ [] |let
[] ([] |def-text $ [] |:data |info) ([] |defs $ [] |:defs |file)
[] |cond
[] ([] |contains? |ns-deps |def-text)
[] |let
[] $ [] |using-mapping ([] |get |ns-deps |def-text)
[] |if ([] |= |:refer $ [] |:kind |using-mapping)
[] |let
[] $ [] |ns-text ([] |:ns |using-mapping)
[] |{} ([] |:ns |ns-text) ([] |:def |def-text) ([] |:external? $ [] |external? |ns-text)
, |nil
[] ([] |contains? |defs |def-text)
[] |{} ([] |:ns $ [] |str |pkg ||. |internal-ns) ([] |:def |def-text) ([] |:external? |false)
[] |:else |nil
[] |:ns $ [] |let
[] $ []
[] |{} ([] |ns-text |:data) ([] |def-text |:extra)
, |info
[] |if ([] |contains? |ns-deps |ns-text)
[] |let
[] $ [] |using-mapping ([] |get |ns-deps |ns-text)
[] |if ([] |= |:as $ [] |:kind |using-mapping)
[] |let
[] $ [] |ns-text ([] |:ns |using-mapping)
[] |{} ([] |:ns |ns-text) ([] |:def |def-text) ([] |:external? $ [] |external? |ns-text)
, |nil
, |nil
, |nil
[] |filter |some?
[] |into $ [] |#{}
:procs $ []
|util $ {}
:ns $ [] |ns |app.util
[] |:require ([] |[] |app.util.detect |:refer $ [] |[] |contains-def? |=path?) ([] |clojure.set |:refer $ [] |union) ([] |clojure.string |:as |string)
:defs $ {}
|remove-idx $ [] |defn |remove-idx ([] |xs |idx)
[] |let
[] $ [] |xs-size ([] |count |xs)
[] |cond
[]
[] |or ([] |>= |idx |xs-size) ([] |neg? |idx)
, |xs
[] ([] |= |xs-size |1) ([] |[])
[] ([] |zero? |idx) ([] |subvec |xs |1)
[] ([] |= |idx $ [] |dec |xs-size) ([] |subvec |xs |0 |idx)
[] |:else $ [] |into ([] |[])
[] |concat ([] |subvec |xs |0 |idx) ([] |subvec |xs $ [] |inc |idx)
|make-focus-path $ [] |defn |make-focus-path ([] |store)
[] |let
[] ([] |writer $ [] |:writer |store) ([] |pointer $ [] |:pointer |writer) ([] |stack $ [] |:stack |writer) ([] |code-path $ [] |get |stack |pointer)
[] |concat ([] |make-path |code-path) ([] |:focus |code-path)
|has-ns? $ [] |defn |has-ns? ([] |x) ([] |string/includes? |x ||/)
|helper-notify $ [] |defn |helper-notify ([] |op-id |data)
[] |fn ([] |notifications)
[] |into ([] |[])
[] |cons ([] |[] |op-id |data) (, |notifications)
|make-path $ [] |defn |make-path ([] |info)
[] |let
[] $ [] |kind ([] |:kind |info)
[] |if ([] |= |kind |:defs)
[] |[] |:collection |:files ([] |:ns |info) (, |:defs) ([] |:extra |info)
[] |[] |:collection |:files ([] |:ns |info) (, |kind)
|view-focused $ [] |defn |view-focused ([] |store) ([] |get-in |store $ [] |make-focus-path |store)
|make-short-path $ [] |defn |make-short-path ([] |info)
[] |let
[] $ [] |kind ([] |:kind |info)
[] |if ([] |= |kind |:defs)
[] |[] ([] |:ns |info) (, |:defs) ([] |:extra |info)
[] |[] ([] |:ns |info) (, |kind)
|helper-create-def $ [] |defn |helper-create-def ([] |ns-part |name-part |code-path |focus)
[] |fn ([] |files)
[] |if ([] |contains-def? |files |ns-part |name-part) (, |files)
[] |assoc-in |files ([] |[] |ns-part |:defs |name-part)
[] |let
[] $ [] |as-fn?
[] |and ([] |not $ [] |empty? |focus) ([] |zero? $ [] |last |focus)
[] |if |as-fn?
[] |let
[] $ [] |expression
[] |get-in |files $ [] |concat ([] |make-short-path |code-path) ([] |butlast |focus)
[] |if
[] |> ([] |count |expression) (, |1)
[] |[] ||defn |name-part $ [] |subvec |expression |1
[] |[] ||defn |name-part $ [] |[]
[] |[] ||def |name-part $ [] |[]
|now! $ [] |defn |now! ([]) ([] |.now |js/performance)
|collect-defs $ [] |defn |collect-defs ([] |node)
[] |let
[] $ [] |base-result
[] |#{} $ [] |select-keys |node ([] |[] |:ns |:def)
[] |if ([] |contains? |node |:deps)
[] |union
[] |apply |union $ [] |map |collect-defs ([] |:deps |node)
, |base-result
, |base-result
:procs $ []
|comp.workspace $ {}
:ns $ [] |ns |app.comp.workspace
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |>> |span |input) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo.comp.inspect |:refer $ [] |[] |comp-inspect) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.comp.stack |:refer $ [] |[] |comp-stack) ([] |[] |cirru-editor.comp.editor |:refer $ [] |[] |comp-editor) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.util.dom |:as |dom) ([] |[] |app.util |:refer $ [] |[] |make-path) ([] |[] |app.style.widget |:as |widget)
:defs $ {}
|on-command $ [] |defn |on-command ([] |store)
[] |fn ([] |snapshot |dispatch! |e)
[] |let
[] ([] |code $ [] |:key-code |e) ([] |event $ [] |:original-event |e)
[] |command? $ [] |or ([] |.-metaKey |event) ([] |.-ctrlKey |event)
[] |shift? $ [] |.-shiftKey |event
[] |cond
[] ([] |= |code |keycode/key-d)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/goto-definition |shift?)
[] ([] |= |code |keycode/key-u)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/dependents |nil)
[] ([] |= |code |keycode/key-i)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/go-back |nil)
[] ([] |= |code |keycode/key-k)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/shift $ [] |-> |store |:writer |:pointer)
[] ([] |= |code |keycode/key-j)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:stack/go-next |nil)
[] ([] |= |code |keycode/key-s)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:effect/submit |shift?)
[] ([] |and |command? $ [] |= |code |keycode/key-p)
[] |do ([] |.preventDefault |event) ([] |.stopPropagation |event) ([] |dispatch! |:router/toggle-palette |nil) ([] |dom/focus-palette!)
[]
[] |and |command? ([] |not |shift?) ([] |= |code |keycode/key-e)
[] |do ([] |.preventDefault |event) ([] |dispatch! |:collection/edit-ns |nil)
[] |:else |nil
|comp-workspace $ [] |defcomp |comp-workspace ([] |store)
[] |let
[] ([] |router $ [] |:router |store) ([] |states $ [] |:states |store) ([] |writer $ [] |:writer |store)
[] |stack $ [] |get-in |store ([] |[] |:writer |:stack)
[] |pointer $ [] |get-in |store ([] |[] |:writer |:pointer)
[] |code-path $ [] |get |stack |pointer
[] |tree $ [] |if ([] |some? |code-path) ([] |get-in |store $ [] |make-path |code-path) (, |nil)
[] |div
[] |{} $ [] |:style ([] |merge |ui/expand |ui/row |style-container)
[] |div
[] |{} $ [] |:style ([] |merge |ui/column |style-sidebar)
[] |comp-stack |stack |pointer
[] |; |comp-inspect |writer |style-debugger
[] |if ([] |some? |tree)
[] |div
[] |{} $ [] |:style ([] |merge |ui/column |ui/flex)
[] |comp-editor ([] |>> |states |:editor)
[] |{} ([] |:tree |tree) ([] |:focus $ [] |:focus |code-path) ([] |:clipboard $ [] |:clipboard |writer)
, |on-update
[] |on-command |store
[] |div
[] |{} $ [] |:style ([] |merge |ui/row |style-toolbar)
[] |div $ [] |{} ([] |:inner-text ||Rename) ([] |:class-name ||is-unremarkable) ([] |:style |widget/clickable-text) ([] |:on-click $ [] |on-rename |code-path)
[] |=< |8 |nil
[] |div $ [] |{} ([] |:inner-text ||Delete) ([] |:class-name ||is-unremarkable) ([] |:style |widget/clickable-text) ([] |:on-click |on-remove)
[] |div
[] |{} $ [] |:style ([] |merge |ui/column |ui/flex)
[] |div ([] |{} $ [] |:style |style-removed) ([] |<> |span "||No expression" |nil)
|on-update $ [] |defn |on-update ([] |snapshot |dispatch!) ([] |dispatch! |:collection/write |snapshot)
|style-toolbar $ [] |def |style-toolbar
[] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:justify-content ||flex-start)
|style-container $ [] |def |style-container
[] |{} $ [] |:background-color ([] |hsl |0 |0 |0)
|style-debugger $ [] |def |style-debugger
[] |{} ([] |:z-index |999) ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:opacity |1)
|style-sidebar $ [] |def |style-sidebar
[] |{} ([] |:width ||180px) ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:color $ [] |hsl |0 |0 |80)
|on-rename $ [] |defn |on-rename ([] |code-path)
[] |fn ([] |e |dispatch!) ([] |println "||the code path:" |code-path)
[] |dispatch! |:modal/mould $ [] |{} ([] |:title |:rename-path) ([] |:data |code-path)
[] |dom/focus-rename!
|on-remove $ [] |defn |on-remove ([] |e |dispatch!) ([] |dispatch! |:collection/remove-this |nil)
|style-removed $ [] |def |style-removed
[] |{} ([] |:margin "||32px 16px") ([] |:font-size ||20px) ([] |:font-weight ||lighter) ([] |:color $ [] |hsl |0 |80 |50) ([] |:font-family "||Josefin Sans") ([] |:padding "||0 16px") ([] |:display ||inline-block) ([] |:max-width ||400px)
:procs $ []
|comp.graph $ {}
:ns $ [] |ns |app.comp.graph
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input |button) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.comp.def |:refer $ [] |[] |comp-def) ([] |[] |app.util.detect |:refer $ [] |[] |def-order |=def?) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |app.style.widget |:as |widget) ([] |[] |clojure.set |:as |set)
:defs $ {}
|style-body $ [] |def |style-body
[] |{} ([] |:flex |1) ([] |:overflow |:auto)
|style-graph $ [] |def |style-graph
[] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:overflow |:auto)
|on-load $ [] |defn |on-load ([] |e |dispatch!) ([] |dispatch! |:graph/load-graph |nil)
|style-toolbar $ [] |def |style-toolbar ([] |{} $ [] |:padding |16)
|style-column $ [] |def |style-column
[] |{} ([] |:min-width |80) ([] |:overflow |:auto) ([] |:padding "||16px 16px") ([] |:flex-shrink |0)
|comp-graph $ [] |defcomp |comp-graph ([] |store)
[] |div
[] |{} $ [] |:style ([] |merge |ui/expand |ui/column |style-graph)
[] |render-toolbar
[] |let
[]
[] |tree $ [] |get-in |store ([] |[] |:graph |:tree)
[] |root-tree $ [] |assoc ([] |get-in |store $ [] |[] |:collection |:root) (, |:deps) ([] |#{} |tree)
[] |view-path $ [] |get-in |store ([] |[] |:graph |:path)
[] |if ([] |some? |tree)
[] |list->
[] |{} $ [] |:style ([] |merge |ui/row |style-body)
[] |loop
[] ([] |branch |root-tree) ([] |children $ [] |[]) ([] |path $ [] |[])
[] |let
[]
[] |next-path $ [] |conj |path ([] |get |view-path $ [] |count |path)
[] |next-pos $ [] |get |view-path ([] |count |path)
[] |next-children $ [] |conj |children
[] |[] ([] |count |children)
[] |list-> ([] |{} $ [] |:style |style-column)
[] |->> ([] |:deps |branch) ([] |sort |def-order)
[] |map-indexed $ [] |fn ([] |idx |child-node)
[] |[] |idx $ [] |comp-def |child-node |path ([] |=def? |next-pos |child-node)
[] |if ([] |= |path |view-path) (, |next-children)
[] |let
[] $ [] |next-branch
[] |->> ([] |:deps |branch)
[] |set/select $ [] |fn ([] |x)
[] |=def? ([] |get |view-path $ [] |count |path) (, |x)
[] |first
[] |recur |next-branch |next-children |next-path
[] |<> |div "||Not generated yet." $ [] |{} ([] |:padding "||0 16px")
|render-toolbar $ [] |defn |render-toolbar ([])
[] |div ([] |{} $ [] |:style |style-toolbar)
[] |div ([] |{})
[] |button $ [] |{} ([] |:inner-text "||Build tree") ([] |:style |widget/button) ([] |:on-click |on-load)
[] |=< |8 |nil
[] |button $ [] |{} ([] |:inner-text "||Find orphans") ([] |:style |widget/button) ([] |:on-click |on-orphans)
|on-orphans $ [] |defn |on-orphans ([] |e |dispatch!) ([] |dispatch! |:graph/show-orphans |nil)
:procs $ []
|updater.graph $ {}
:ns $ [] |ns |app.updater.graph
[] |:require ([] |app.util.analyze |:refer $ [] |parse-ns-deps |pick-dep |expand-deps-tree) ([] |app.util.stack |:refer $ [] |push-path) ([] |clojure.set |:refer $ [] |union |difference) ([] |app.util |:refer $ [] |collect-defs) ([] |clojure.string |:as |string)
:defs $ {}
|load-graph $ [] |defn |load-graph ([] |store |op-data)
[] |let
[]
[] |root-info $ [] |get-in |store ([] |[] |:collection |:root)
[] |files $ [] |get-in |store ([] |[] |:collection |:files)
[] |internal-ns $ [] |:ns |root-info
[] |ns-deps $ [] |parse-ns-deps ([] |get-in |files $ [] |[] |internal-ns |:ns)
[] |def-expr $ [] |get-in |files
[] |[] ([] |:ns |root-info) (, |:defs) ([] |:def |root-info)
[] |pkg $ [] |get-in |store ([] |[] |:collection |:package)
[] |this-file $ [] |get |files |internal-ns
[] |deps-tree $ [] |expand-deps-tree |internal-ns ([] |:def |root-info) (, |files |pkg) ([] |#{})
[] |; |println |ns-deps
[] |println
[] |-> |store $ [] |assoc-in ([] |[] |:graph |:tree) (, |deps-tree)
|view-path $ [] |defn |view-path ([] |store |op-data)
[] |assoc-in |store ([] |[] |:graph |:path) (, |op-data)
|view-ns $ [] |defn |view-ns ([] |store |op-data)
[] |assoc-in |store ([] |[] |:graph |:ns-path) (, |op-data)
|edit-current $ [] |defn |edit-current ([] |store |op)
[] |let
[] $ [] |maybe-path
[] |last $ [] |get-in |store ([] |[] |:graph |:path)
[] |if ([] |some? |maybe-path)
[] |-> |store
[] |update |:writer $ [] |push-path
[] |{} ([] |:ns $ [] |:ns |maybe-path) ([] |:kind |:defs) ([] |:extra $ [] |:def |maybe-path) ([] |:focus $ [] |[])
[] |assoc |:router $ [] |{} ([] |:name |:workspace) ([] |:data |nil)
, |store
|show-orphans $ [] |defn |show-orphans ([] |store |op-data)
[] |let
[]
[] |all-defs $ [] |->> ([] |get-in |store $ [] |[] |:collection |:files)
[] |map $ [] |fn ([] |file-entry)
[] |let
[] ([] |ns-text $ [] |first |file-entry)
[] |defs $ [] |keys ([] |:defs $ [] |val |file-entry)
[] |->> |defs
[] |map $ [] |fn ([] |def-text)
[] |{} ([] |:ns |ns-text) ([] |:def |def-text)
[] |into $ [] |#{}
[] |apply |union
[] |deps-tree $ [] |get-in |store ([] |[] |:graph |:tree)
[] |defs-in-tree $ [] |collect-defs |deps-tree
[] |update |store |:modal-stack $ [] |fn ([] |xs)
[] |conj |xs $ [] |{} ([] |:title |:orphans) ([] |:data $ [] |difference |all-defs |defs-in-tree)
:procs $ []
|schema $ {} (:ns $ [] |ns |app.schema)
:defs $ {}
|store $ [] |def |store
[] |{}
[] |:router $ [] |{} ([] |:name |:loading) ([] |:data |:definitions) ([] |:show-palette? |false)
[] |:collection $ [] |{} ([] |:package |nil) ([] |:root |nil) ([] |:files $ [] |{})
[] |:graph $ [] |{} ([] |:tree |nil) ([] |:orphans |nil) ([] |:path $ [] |[]) ([] |:ns-path $ [] |[])
[] |:writer $ [] |{} ([] |:stack $ [] |[]) ([] |:pointer |0) ([] |:clipboard $ [] |[])
[] |:notifications $ [] |[]
[] |:modal-stack $ [] |[]
[] |:states $ [] |{}
:procs $ []
|comp.container $ {}
:ns $ [] |ns |app.comp.container
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.comp.inspect |:refer $ [] |[] |comp-inspect) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |>> |<> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.comp.loading |:refer $ [] |[] |comp-loading) ([] |[] |app.comp.workspace |:refer $ [] |[] |comp-workspace) ([] |[] |app.comp.notifications |:refer $ [] |[] |comp-notifications) ([] |[] |app.comp.palette |:refer $ [] |[] |comp-palette) ([] |[] |app.comp.modal-stack |:refer $ [] |[] |comp-modal-stack) ([] |[] |app.comp.graph |:refer $ [] |[] |comp-graph) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.util.dom |:as |dom) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.comp.file-tree |:refer $ [] |[] |comp-file-tree)
:defs $ {}
|comp-container $ [] |defcomp |comp-container ([] |store)
[] |let
[] ([] |router $ [] |:router |store) ([] |states $ [] |:states |store) ([] |page $ [] |:name |router)
[] |if ([] |= |:router $ [] |:name |router) ([] |comp-loading)
[] |div
[] |{} $ [] |:style
[] |merge |ui/global |ui/fullscreen |ui/column $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:color $ [] |hsl |0 |0 |70)
[] |div
[] |{} $ [] |:style
[] |merge |ui/row-middle $ [] |{} ([] |:padding "|\"0 8px")
[] |comp-tab "|\"Files" |:file-tree $ [] |= |page |:file-tree
[] |comp-tab "|\"Editor" |:workspace $ [] |= |page |:workspace
[] |comp-tab "|\"Graph" |:graph $ [] |= |page |:graph
[] |case ([] |:name |router) ([] |:workspace $ [] |comp-workspace |store) ([] |:graph $ [] |comp-graph |store)
[] |:file-tree $ [] |comp-file-tree ([] |>> |states |:file-tree) (, |store)
[] |<> ([] |str |router) (, |nil)
[] |comp-notifications $ [] |:notifications |store
[] |; |comp-inspect ||Store |store $ [] |{} ([] |:bottom |0) ([] |:background-color $ [] |hsl |0 |0 |0) ([] |:opacity |1) ([] |:color |:white)
[] |if ([] |:show-palette? |router)
[] |comp-palette ([] |>> |states |:palette) ([] |:files $ [] |:collection |store)
[] |comp-modal-stack |states $ [] |:modal-stack |store
|comp-tab $ [] |defcomp |comp-tab ([] |title |code |selected?)
[] |div
[] |{}
[] |:style $ [] |merge
[] |{} ([] |:font-family |ui/font-fancy) ([] |:font-size |18) ([] |:font-weight |300) ([] |:min-width |60) ([] |:color $ [] |hsl |0 |0 |50) ([] |:cursor |:pointer)
[] |if |selected? $ [] |{} ([] |:color $ [] |hsl |0 |0 |100)
[] |:on-click $ [] |fn ([] |e |d!)
[] |d! |:router/route $ [] |{} ([] |:name |code)
[] |<> |title
:procs $ []
|comp.def $ {}
:ns $ [] |ns |app.comp.def
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |respo.comp.space |:refer $ [] |[] |=<)
:defs $ {}
|comp-def $ [] |defcomp |comp-def ([] |child-node |path |selected?)
[] |div
[] |{}
[] |:style $ [] |merge |style-def
[] |if ([] |:external? |child-node) (, |style-external)
[] |if |selected? |style-highlight
[] |if ([] |:circular? |child-node) (, |style-circular)
[] |:on-click $ [] |on-view |path |child-node
[] |<> |span
[] |str ([] |:ns |child-node) (, "|| / ") ([] |:def |child-node)
, |nil
[] |=< |4 |nil
[] |let
[] $ [] |many-deps ([] |count $ [] |:deps |child-node)
[] |if ([] |pos? |many-deps) ([] |<> |span |many-deps |style-count)
|on-view $ [] |defn |on-view ([] |path |child-node)
[] |fn ([] |e |dispatch!)
[] |if ([] |.-metaKey $ [] |:original-event |e)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:defs) ([] |:ns $ [] |:ns |child-node) ([] |:extra $ [] |:def |child-node) ([] |:focus $ [] |[])
[] |dispatch! |:graph/view-path $ [] |conj |path
[] |{} ([] |:ns $ [] |:ns |child-node) ([] |:def $ [] |:def |child-node)
|style-circular $ [] |def |style-circular ([] |{} $ [] |:text-decoration |:underline)
|style-def $ [] |def |style-def
[] |{} ([] |:color $ [] |hsl |0 |0 |70 |0.7) ([] |:font-size |14) ([] |:cursor |:pointer) ([] |:white-space |:nowrap)
|style-external $ [] |def |style-external
[] |{} ([] |:color $ [] |hsl |260 |16 |44) ([] |:font-size |12) ([] |:cursor |:default)
|style-highlight $ [] |def |style-highlight
[] |{} $ [] |:color ([] |hsl |0 |0 |100 |0.86)
|style-count $ [] |def |style-count
[] |{} ([] |:font-size |12) ([] |:color $ [] |hsl |0 |0 |100 |0.4)
:procs $ []
|comp.modal-stack $ {}
:ns $ [] |ns |app.comp.modal-stack
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |list-> |div |<> |>> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.comp.rename-path |:refer $ [] |[] |comp-rename-path) ([] |[] |app.comp.hydrate |:refer $ [] |[] |comp-hydrate) ([] |[] |app.comp.orphans |:refer $ [] |[] |comp-orphans)
:defs $ {}
|on-tip $ [] |defn |on-tip ([] |e |dispatch!)
|style-modal $ [] |def |style-modal
[] |merge |ui/center $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |0 |0.6) ([] |:z-index |900) ([] |:position |:fixed) ([] |:top |0) ([] |:right |0) ([] |:width ||100%) ([] |:height ||100%)
|on-recycle $ [] |defn |on-recycle ([] |e |dispatch!) ([] |dispatch! |:modal/recycle |nil)
|renderer $ [] |defn |renderer ([] |states |kind |title |data)
[] |div ([] |{})
[] |case |title
[] |:rename-path $ [] |comp-rename-path ([] |>> |states |:rename-path) (, |data)
[] |:hydrate $ [] |comp-hydrate ([] |>> |states |:hydrate)
[] |:orphans $ [] |comp-orphans |data
[] |<> |span |title |nil
|comp-modal-stack $ [] |defcomp |comp-modal-stack ([] |states |modal-stack)
[] |list-> ([] |{})
[] |->> |modal-stack $ [] |map-indexed
[] |fn ([] |idx |modal)
[] |let
[] ([] |kind $ [] |:kind |modal) ([] |title $ [] |:title |modal) ([] |data $ [] |:data |modal)
[] |[] |idx $ [] |div
[] |{} ([] |:style |style-modal) ([] |:on-click |on-recycle)
[] |div ([] |{} $ [] |:on-click |on-tip) ([] |renderer |states |kind |title |data)
:procs $ []
|comp.rename-path $ {}
:ns $ [] |ns |app.comp.rename-path
[] |:require ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.keycode |:as |keycode)
:defs $ {}
|init-state $ [] |defn |init-state ([] |code-path)
[] |let
[] $ []
[] |{} ([] |ns-part |:ns) ([] |kind |:kind) ([] |extra-name |:extra)
, |code-path
[] |if ([] |= |kind |:defs) ([] |str |ns-part ||/ |extra-name) (, |ns-part)
|comp-rename-path $ [] |defcomp |comp-rename-path ([] |states |code-path)
[] |let
[] $ [] |state
[] |or ([] |:data |states) ([] |init-state |code-path)
[] |div ([] |{})
[] |div ([] |{})
[] |<> |span
[] |str "||Rename: " ([] |:ns |code-path) (, ||/) ([] |:extra |code-path)
, |nil
[] |div ([] |{})
[] |input $ [] |{} ([] |:value |state) ([] |:id ||rename-box)
[] |:style $ [] |merge |ui/input ([] |{} $ [] |:width |400)
[] |:on-input |on-input
[] |:on-keydown $ [] |on-keydown |code-path |state
[] |=< |16 |nil
[] |div $ [] |{} ([] |:inner-text ||Rename) ([] |:style |widget/button) ([] |:on-click $ [] |on-rename |code-path |state)
|on-input $ [] |defn |on-input ([] |e |dispatch! |m!) ([] |m! $ [] |:value |e)
|on-rename $ [] |defn |on-rename ([] |code-path |text)
[] |fn ([] |e |d! |m!) ([] |d! |:collection/rename $ [] |[] |code-path |text) ([] |d! |:modal/recycle |nil) ([] |m! |nil)
|on-keydown $ [] |defn |on-keydown ([] |code-path |text)
[] |fn ([] |e |d! |m!) ([] |println |keycode/key-esc)
[] |cond
[]
[] |= ([] |:key-code |e) (, |keycode/key-enter)
[] |do ([] |d! |:collection/rename $ [] |[] |code-path |text) ([] |d! |:modal/recycle |nil) ([] |m! |nil)
[]
[] |= ([] |:key-code |e) (, |keycode/key-esc)
[] |d! |:modal/recycle |nil
[] |:else |nil
:procs $ []
|util.dom $ {} (:ns $ [] |ns |app.util.dom)
:defs $ {}
|focus-palette! $ [] |defn |focus-palette! ([])
[] |js/requestAnimationFrame $ [] |fn ([])
[] |let
[] $ [] |target ([] |.querySelector |js/document ||#command-palette)
[] |if ([] |some? |target) ([] |.focus |target)
|focus-rename! $ [] |defn |focus-rename! ([])
[] |-> ([] |.querySelector |js/document ||#rename-box) ([] |.focus)
:procs $ []
|main $ {}
:ns $ [] |ns |app.main
[] |:require ([] |[] |respo.core |:refer $ [] |[] |render! |clear-cache! |render-element |realize-ssr!) ([] |[] |app.schema |:as |schema) ([] |[] |app.comp.container |:refer $ [] |[] |comp-container) ([] |[] |cljs.reader |:refer $ [] |[] |read-string) ([] |[] |app.updater |:refer $ [] |[] |updater) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.util.dom |:as |dom) ([] |[] |app.util |:refer $ [] |[] |now!) ([] |[] |app.actions |:refer $ [] |[] |load-collection! |submit-collection! |submit-changes! |display-code!) ([] |[] |cirru-editor.util.dom |:refer $ [] |[] |focus!)
:defs $ {}
|ssr? $ [] |def |ssr? ([] |some? $ [] |.querySelector |js/document ||meta.server-rendered)
|*focus-moved? $ [] |def |*focus-moved? ([] |atom |false)
|dispatch! $ [] |defn |dispatch! ([] |op |op-data) ([] |println ||Dispatch! |op)
[] |case |op
[] |:effect/submit $ [] |let
[] ([] |shift? |op-data) ([] |sepal-data $ [] |:collection |@*store)
[] |if |shift? ([] |submit-collection! |sepal-data |dispatch!) ([] |submit-changes! |sepal-data |dispatch!)
[] |:effect/dehydrate $ [] |display-code! |@*store
[] |:effect/load $ [] |load-collection! |dispatch! |false
[] |let
[] $ [] |new-store ([] |updater |@*store |op |op-data $ [] |now!)
[] |reset! |*focus-moved? $ [] |not
[] |and
[] |identical? ([] |:collection |@*store) ([] |:collection |new-store)
[] |identical? ([] |:writer |@*store) ([] |:writer |new-store)
[] |reset! |*store |new-store
|*store $ [] |defonce |*store ([] |atom |schema/store)
|main! $ [] |defn |main! ([]) ([] |if |ssr? $ [] |render-app! |realize-ssr!) ([] |render-app! |render!)
[] |add-watch |*store |:changes $ [] |fn ([]) ([] |render-app! |render!)
[] |.addEventListener |js/window ||keydown $ [] |fn ([] |event)
[] |let
[] ([] |code $ [] |.-keyCode |event)
[] |command? $ [] |or ([] |.-metaKey |event) ([] |.-ctrlKey |event)
[] |shift? $ [] |.-shiftKey |event
[] |cond
[] ([] |and |command? $ [] |= |code |keycode/key-p)
[] |do ([] |.preventDefault |event) ([] |.stopPropagation |event) ([] |dispatch! |:router/toggle-palette |nil) ([] |dom/focus-palette!)
[] ([] |and |shift? |command? $ [] |= |code |keycode/key-a)
[] |do $ [] |let
[] ([] |router $ [] |:router |@*store) ([] |writer $ [] |:writer |@*store)
[] |if
[] |= ([] |:name |router) (, |:workspace)
[] |dispatch! |:router/route $ [] |{} ([] |:name |:graph) ([] |:data |nil)
[] |if
[] |not $ [] |empty? ([] |:stack |writer)
[] |dispatch! |:router/route $ [] |{} ([] |:name |:workspace) ([] |:data |nil)
[] |:else |nil
[] |println "||app started!"
[] |load-collection! |dispatch! |true
|render-app! $ [] |defn |render-app! ([] |renderer)
[] |renderer |mount-target ([] |comp-container |@*store) (, |dispatch!)
[] |if |@*focus-moved? $ [] |do ([] |reset! |*focus-moved? |false) ([] |focus!)
|reload! $ [] |defn |reload! ([]) ([] |clear-cache!) ([] |render-app! |render!) ([] |println "||Code updated.")
|mount-target $ [] |def |mount-target ([] |.querySelector |js/document ||.app)
:procs $ []
|updater.notification $ {} (:ns $ [] |ns |app.updater.notification)
:defs $ {}
|add-one $ [] |defn |add-one ([] |store |op-data |op-id)
[] |let ([] $ [] |notification |op-data)
[] |-> |store $ [] |update |:notifications
[] |fn ([] |notifications)
[] |into ([] |[])
[] |cons ([] |[] |op-id |notification) ([] |take |3 |notifications)
|remove-since $ [] |defn |remove-since ([] |store |op-data)
[] |let ([] $ [] |pos |op-data)
[] |-> |store $ [] |update |:notifications
[] |fn ([] |notifications) ([] |take |pos |notifications)
|remove-one $ [] |defn |remove-one ([] |store |op-data)
[] |let ([] $ [] |notification-id |op-data)
[] |-> |store $ [] |update |:notifications
[] |fn ([] |notifications)
[] |filterv
[] |fn ([] |notification) ([] |not= |notification-id $ [] |first |notification)
, |notifications
:procs $ []
|comp.orphans $ {}
:ns $ [] |ns |app.comp.orphans
[] |:require ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |list-> |<> |span |input) ([] |[] |respo-ui.core |:as |ui)
:defs $ {}
|comp-orphans $ [] |defcomp |comp-orphans ([] |orphans)
[] |div ([] |{} $ [] |:style |style-container)
[] |div ([] |{}) ([] |<> |span ||Orphans: |style-title)
[] |list-> ([] |{})
[] |->> |orphans $ [] |map
[] |fn ([] |def-info)
[] |let
[] $ [] |def-id
[] |str ([] |:ns |def-info) (, ||/) ([] |:def |def-info)
[] |[] |def-id $ [] |div
[] |{} ([] |:inner-text |def-id) ([] |:style |style-def) ([] |:on-click $ [] |on-edit |def-info)
|style-container $ [] |def |style-container
[] |{} ([] |:width |800) ([] |:height |400) ([] |:overflow |:auto) ([] |:padding |16) ([] |:background $ [] |hsl |0 |0 |0 |0.9)
|style-def $ [] |def |style-def
[] |{} ([] |:min-width |200) ([] |:display |:inline-block) ([] |:cursor |:pointer)
|style-title $ [] |def |style-title
[] |{} ([] |:font-size |24) ([] |:font-weight |100) ([] |:font-family "||Josefin Sans")
|on-edit $ [] |defn |on-edit ([] |def-info)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:collection/edit $ [] |{} ([] |:kind |:defs) ([] |:ns $ [] |:ns |def-info) ([] |:extra $ [] |:def |def-info) ([] |:focus $ [] |[] |1)
[] |dispatch! |:modal/recycle |nil
:procs $ []
|comp.palette $ {}
:ns $ [] |ns |app.comp.palette
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.core |:refer $ [] |[] |defcomp |list-> |div |<> |span |input) ([] |[] |respo-ui.core |:as |ui) ([] |[] |cirru-editor.util.dom |:refer $ [] |[] |focus!) ([] |[] |app.comp.command |:refer $ [] |[] |comp-command) ([] |[] |app.util.keycode |:as |keycode) ([] |[] |app.style.widget |:as |widget) ([] |[] |app.util.detect |:refer $ [] |[] |fuzzy-search)
:defs $ {}
|on-input $ [] |defn |on-input ([] |cursor |state)
[] |fn ([] |e |dispatch!)
[] |dispatch! |:states $ [] |[] |cursor
[] |merge |state $ [] |{} ([] |:text $ [] |:value |e) ([] |:cursor |0)
|handle-command $ [] |defn |handle-command ([] |cursor |commands |files |dispatch!)
[] |let
[] $ [] |command
[] |get
[] |into ([] |[]) (, |commands)
, |cursor
[] |println ||Command $ [] |pr-str |command
[] |dispatch! |:router/toggle-palette |nil
[] |case ([] |first |command) ([] |:load $ [] |dispatch! |:effect/load |nil) ([] |:patch $ [] |dispatch! |:effect/submit |true) ([] |:dehydrate $ [] |dispatch! |:effect/dehydrate |nil)
[] |:hydrate $ [] |dispatch! |:modal/mould
[] |{} ([] |:title |:hydrate) ([] |:data |nil)
[] |:graph $ [] |dispatch! |:router/route
[] |{} ([] |:name |:graph) ([] |:data |nil)
[] |:defs $ [] |do
[] |dispatch! |:collection/edit $ [] |{} ([] |:ns $ [] |get |command |1) ([] |:kind |:defs) ([] |:extra $ [] |last |command) ([] |:focus $ [] |[] |0)
[] |:ns $ [] |do
[] |dispatch! |:collection/edit $ [] |{} ([] |:ns $ [] |get |command |1) ([] |:kind |:ns) ([] |:extra |nil) ([] |:focus $ [] |[] |0)
[] |:procs $ [] |do
[] |dispatch! |:collection/edit $ [] |{} ([] |:ns $ [] |get |command |1) ([] |:kind |:procs) ([] |:extra |nil) ([] |:focus $ [] |[] |0)
, |nil
|comp-palette $ [] |defcomp |comp-palette ([] |states |files)
[] |let
[]
[] |ns-names $ [] |->> ([] |keys |files)
[] |map $ [] |fn ([] |path) ([] |[] |:ns |path)
[] |cursor $ [] |:cursor |states
[] |state $ [] |or ([] |:data |states) (, |initial-state)
[] |def-paths $ [] |->> |files
[] |map $ [] |fn ([] |entry)
[] |let
[] $ [] ([] |[] |ns-part |tree) (, |entry)
[] |->> ([] |:defs |tree) ([] |keys)
[] |map $ [] |fn ([] |def-name) ([] |[] |:defs |ns-part |def-name)
[] |apply |concat
[] |procedure-names $ [] |->> ([] |keys |files)
[] |map $ [] |fn ([] |proc-name) ([] |[] |:procs |proc-name)
[] |queries $ [] |string/split ([] |:text |state) (, "|| ")
[] |commands $ [] |->> ([] |concat |def-paths |ns-names |procedure-names |basic-commands)
[] |filter $ [] |fn ([] |command) ([] |fuzzy-search |command |queries)
[] |div
[] |{} $ [] |:style ([] |merge |ui/fullscreen |ui/row |style-container)
[] |div
[] |{} $ [] |:style
[] |merge |ui/column $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |0 |0.8) ([] |:width ||800px)
[] |input $ [] |{} ([] |:placeholder "||write command...") ([] |:id ||command-palette) ([] |:value $ [] |:text |state)
[] |:style $ [] |merge |widget/input
[] |{} ([] |:width ||100%) ([] |:line-height ||40px)
[] |:autocomplete "|\"off"
[] |:on-input $ [] |on-input |cursor |state
[] |:on-keydown $ [] |on-keydown |cursor |state |commands ([] |:cursor |state) (, |files)
[] |list->
[] |{} $ [] |:style
[] |merge |ui/flex $ [] |{} ([] |:overflow ||auto)
[] |->> |commands $ [] |map-indexed
[] |fn ([] |idx |command)
[] |[] |idx $ [] |comp-command |command ([] |= |idx $ [] |:cursor |state) ([] |on-select |idx |commands |files)
|style-container $ [] |def |style-container
[] |{} ([] |:position ||fixed) ([] |:background-color $ [] |hsl |200 |40 |10 |0.8) ([] |:justify-content ||center)
|on-select $ [] |defn |on-select ([] |cursor |commands |files)
[] |fn ([] |dispatch!) ([] |handle-command |cursor |commands |files |dispatch!)
|initial-state $ [] |def |initial-state
[] |{} ([] |:text ||) ([] |:cursor |0)
|basic-commands $ [] |def |basic-commands
[] |[] ([] |[] |:save) ([] |[] |:load) ([] |[] |:hydrate) ([] |[] |:dehydrate) ([] |[] |:graph)