@object-ui/plugin-workflow 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2482 -1870
- package/dist/index.umd.cjs +3 -3
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,1878 +1,2490 @@
|
|
|
1
|
-
import { ComponentRegistry as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
|
|
8
|
-
var
|
|
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
|
-
|
|
1
|
+
import { ComponentRegistry as e } from "@object-ui/core";
|
|
2
|
+
import { useCallback as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
3
|
+
import { Badge as a, Button as o, Card as s, CardContent as c, CardHeader as l, CardTitle as u, Input as d, Label as f, Select as p, SelectContent as m, SelectItem as h, SelectTrigger as g, SelectValue as _, Separator as v, Switch as y } from "@object-ui/components";
|
|
4
|
+
import { AlertCircle as b, ArrowRight as x, Bell as S, Check as C, CheckCircle as w, Circle as T, Clock as E, Code as D, Download as ee, FileEdit as O, GitBranch as k, GitMerge as A, Globe as j, History as te, Link as ne, Loader2 as M, Mail as re, MessageSquare as ie, PanelRightClose as ae, PanelRightOpen as oe, Play as N, Plus as P, Redo2 as se, RefreshCw as F, RotateCcw as ce, Save as le, Settings as I, SkipForward as L, Square as R, Trash2 as z, Undo2 as ue, Upload as de, User as B, Users as V, X as H, Zap as fe, ZoomIn as pe, ZoomOut as me } from "lucide-react";
|
|
5
|
+
import { clsx as he } from "clsx";
|
|
6
|
+
import { twMerge as ge } from "tailwind-merge";
|
|
7
|
+
//#region \0rolldown/runtime.js
|
|
8
|
+
var U = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), _e = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
9
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
10
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
11
|
+
}), W = /* @__PURE__ */ U(((e) => {
|
|
12
|
+
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
13
|
+
function r(e, n, r) {
|
|
14
|
+
var i = null;
|
|
15
|
+
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
16
|
+
else r = n;
|
|
17
|
+
return n = r.ref, {
|
|
18
|
+
$$typeof: t,
|
|
19
|
+
type: e,
|
|
20
|
+
key: i,
|
|
21
|
+
ref: n === void 0 ? null : n,
|
|
22
|
+
props: r
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
26
|
+
})), ve = /* @__PURE__ */ U(((e) => {
|
|
27
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
28
|
+
function t(e) {
|
|
29
|
+
if (e == null) return null;
|
|
30
|
+
if (typeof e == "function") return e.$$typeof === ee ? null : e.displayName || e.name || null;
|
|
31
|
+
if (typeof e == "string") return e;
|
|
32
|
+
switch (e) {
|
|
33
|
+
case _: return "Fragment";
|
|
34
|
+
case y: return "Profiler";
|
|
35
|
+
case v: return "StrictMode";
|
|
36
|
+
case C: return "Suspense";
|
|
37
|
+
case w: return "SuspenseList";
|
|
38
|
+
case D: return "Activity";
|
|
39
|
+
}
|
|
40
|
+
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
41
|
+
case g: return "Portal";
|
|
42
|
+
case x: return e.displayName || "Context";
|
|
43
|
+
case b: return (e._context.displayName || "Context") + ".Consumer";
|
|
44
|
+
case S:
|
|
45
|
+
var n = e.render;
|
|
46
|
+
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
47
|
+
case T: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
48
|
+
case E:
|
|
49
|
+
n = e._payload, e = e._init;
|
|
50
|
+
try {
|
|
51
|
+
return t(e(n));
|
|
52
|
+
} catch {}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function n(e) {
|
|
57
|
+
return "" + e;
|
|
58
|
+
}
|
|
59
|
+
function r(e) {
|
|
60
|
+
try {
|
|
61
|
+
n(e);
|
|
62
|
+
var t = !1;
|
|
63
|
+
} catch {
|
|
64
|
+
t = !0;
|
|
65
|
+
}
|
|
66
|
+
if (t) {
|
|
67
|
+
t = console;
|
|
68
|
+
var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
69
|
+
return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function i(e) {
|
|
73
|
+
if (e === _) return "<>";
|
|
74
|
+
if (typeof e == "object" && e && e.$$typeof === E) return "<...>";
|
|
75
|
+
try {
|
|
76
|
+
var n = t(e);
|
|
77
|
+
return n ? "<" + n + ">" : "<...>";
|
|
78
|
+
} catch {
|
|
79
|
+
return "<...>";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function a() {
|
|
83
|
+
var e = O.A;
|
|
84
|
+
return e === null ? null : e.getOwner();
|
|
85
|
+
}
|
|
86
|
+
function o() {
|
|
87
|
+
return Error("react-stack-top-frame");
|
|
88
|
+
}
|
|
89
|
+
function s(e) {
|
|
90
|
+
if (k.call(e, "key")) {
|
|
91
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
92
|
+
if (t && t.isReactWarning) return !1;
|
|
93
|
+
}
|
|
94
|
+
return e.key !== void 0;
|
|
95
|
+
}
|
|
96
|
+
function c(e, t) {
|
|
97
|
+
function n() {
|
|
98
|
+
te || (te = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
99
|
+
}
|
|
100
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
101
|
+
get: n,
|
|
102
|
+
configurable: !0
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function l() {
|
|
106
|
+
var e = t(this.type);
|
|
107
|
+
return ne[e] || (ne[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
108
|
+
}
|
|
109
|
+
function u(e, t, n, r, i, a) {
|
|
110
|
+
var o = n.ref;
|
|
111
|
+
return e = {
|
|
112
|
+
$$typeof: h,
|
|
113
|
+
type: e,
|
|
114
|
+
key: t,
|
|
115
|
+
props: n,
|
|
116
|
+
_owner: r
|
|
117
|
+
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
118
|
+
enumerable: !1,
|
|
119
|
+
value: null
|
|
120
|
+
}) : Object.defineProperty(e, "ref", {
|
|
121
|
+
enumerable: !1,
|
|
122
|
+
get: l
|
|
123
|
+
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
124
|
+
configurable: !1,
|
|
125
|
+
enumerable: !1,
|
|
126
|
+
writable: !0,
|
|
127
|
+
value: 0
|
|
128
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
129
|
+
configurable: !1,
|
|
130
|
+
enumerable: !1,
|
|
131
|
+
writable: !0,
|
|
132
|
+
value: null
|
|
133
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
134
|
+
configurable: !1,
|
|
135
|
+
enumerable: !1,
|
|
136
|
+
writable: !0,
|
|
137
|
+
value: i
|
|
138
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
139
|
+
configurable: !1,
|
|
140
|
+
enumerable: !1,
|
|
141
|
+
writable: !0,
|
|
142
|
+
value: a
|
|
143
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
144
|
+
}
|
|
145
|
+
function d(e, n, i, o, l, d) {
|
|
146
|
+
var p = n.children;
|
|
147
|
+
if (p !== void 0) if (o) if (A(p)) {
|
|
148
|
+
for (o = 0; o < p.length; o++) f(p[o]);
|
|
149
|
+
Object.freeze && Object.freeze(p);
|
|
150
|
+
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
151
|
+
else f(p);
|
|
152
|
+
if (k.call(n, "key")) {
|
|
153
|
+
p = t(e);
|
|
154
|
+
var m = Object.keys(n).filter(function(e) {
|
|
155
|
+
return e !== "key";
|
|
156
|
+
});
|
|
157
|
+
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ie[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), ie[p + o] = !0);
|
|
158
|
+
}
|
|
159
|
+
if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
160
|
+
else i = n;
|
|
161
|
+
return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
|
|
162
|
+
}
|
|
163
|
+
function f(e) {
|
|
164
|
+
p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === E && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
165
|
+
}
|
|
166
|
+
function p(e) {
|
|
167
|
+
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
168
|
+
}
|
|
169
|
+
var m = _e("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), ee = Symbol.for("react.client.reference"), O = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, A = Array.isArray, j = console.createTask ? console.createTask : function() {
|
|
170
|
+
return null;
|
|
171
|
+
};
|
|
172
|
+
m = { react_stack_bottom_frame: function(e) {
|
|
173
|
+
return e();
|
|
174
|
+
} };
|
|
175
|
+
var te, ne = {}, M = m.react_stack_bottom_frame.bind(m, o)(), re = j(i(o)), ie = {};
|
|
176
|
+
e.Fragment = _, e.jsx = function(e, t, n) {
|
|
177
|
+
var r = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
178
|
+
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : re);
|
|
179
|
+
}, e.jsxs = function(e, t, n) {
|
|
180
|
+
var r = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
181
|
+
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : re);
|
|
182
|
+
};
|
|
183
|
+
})();
|
|
184
|
+
})), G = (/* @__PURE__ */ U(((e, t) => {
|
|
185
|
+
process.env.NODE_ENV === "production" ? t.exports = W() : t.exports = ve();
|
|
186
|
+
})))(), K = {
|
|
187
|
+
start: /* @__PURE__ */ (0, G.jsx)(N, { className: "h-4 w-4 text-green-500" }),
|
|
188
|
+
end: /* @__PURE__ */ (0, G.jsx)(w, { className: "h-4 w-4 text-red-500" }),
|
|
189
|
+
task: /* @__PURE__ */ (0, G.jsx)(T, { className: "h-4 w-4 text-blue-500" }),
|
|
190
|
+
approval: /* @__PURE__ */ (0, G.jsx)(V, { className: "h-4 w-4 text-purple-500" }),
|
|
191
|
+
condition: /* @__PURE__ */ (0, G.jsx)(k, { className: "h-4 w-4 text-orange-500" }),
|
|
192
|
+
parallel: /* @__PURE__ */ (0, G.jsx)(x, { className: "h-4 w-4 text-teal-500" }),
|
|
193
|
+
delay: /* @__PURE__ */ (0, G.jsx)(E, { className: "h-4 w-4 text-gray-500" }),
|
|
194
|
+
notification: /* @__PURE__ */ (0, G.jsx)(S, { className: "h-4 w-4 text-yellow-500" }),
|
|
195
|
+
script: /* @__PURE__ */ (0, G.jsx)(D, { className: "h-4 w-4 text-indigo-500" })
|
|
196
|
+
}, ye = {
|
|
197
|
+
start: "border-green-300 bg-green-50",
|
|
198
|
+
end: "border-red-300 bg-red-50",
|
|
199
|
+
task: "border-blue-300 bg-blue-50",
|
|
200
|
+
approval: "border-purple-300 bg-purple-50",
|
|
201
|
+
condition: "border-orange-300 bg-orange-50",
|
|
202
|
+
parallel: "border-teal-300 bg-teal-50",
|
|
203
|
+
delay: "border-gray-300 bg-gray-50",
|
|
204
|
+
notification: "border-yellow-300 bg-yellow-50",
|
|
205
|
+
script: "border-indigo-300 bg-indigo-50"
|
|
206
|
+
}, q = {
|
|
207
|
+
draft: {
|
|
208
|
+
variant: "secondary",
|
|
209
|
+
label: "Draft"
|
|
210
|
+
},
|
|
211
|
+
active: {
|
|
212
|
+
variant: "default",
|
|
213
|
+
label: "Active"
|
|
214
|
+
},
|
|
215
|
+
paused: {
|
|
216
|
+
variant: "outline",
|
|
217
|
+
label: "Paused"
|
|
218
|
+
},
|
|
219
|
+
completed: {
|
|
220
|
+
variant: "default",
|
|
221
|
+
label: "Completed"
|
|
222
|
+
},
|
|
223
|
+
cancelled: {
|
|
224
|
+
variant: "destructive",
|
|
225
|
+
label: "Cancelled"
|
|
226
|
+
}
|
|
227
|
+
}, be = ({ schema: e }) => {
|
|
228
|
+
let { workflow: r, readOnly: p = !1, showToolbar: m = !0 } = e, [h, g] = i(r || {
|
|
229
|
+
type: "workflow",
|
|
230
|
+
title: "New Workflow",
|
|
231
|
+
status: "draft",
|
|
232
|
+
nodes: [{
|
|
233
|
+
id: "start-1",
|
|
234
|
+
type: "start",
|
|
235
|
+
label: "Start",
|
|
236
|
+
position: {
|
|
237
|
+
x: 100,
|
|
238
|
+
y: 100
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
id: "end-1",
|
|
242
|
+
type: "end",
|
|
243
|
+
label: "End",
|
|
244
|
+
position: {
|
|
245
|
+
x: 100,
|
|
246
|
+
y: 400
|
|
247
|
+
}
|
|
248
|
+
}],
|
|
249
|
+
edges: [],
|
|
250
|
+
variables: []
|
|
251
|
+
}), [_, v] = i(null), [y, b] = i(null), S = n(() => h.nodes.find((e) => e.id === _), [h.nodes, _]), C = t((e) => {
|
|
252
|
+
if (p) return;
|
|
253
|
+
let t = `${e}-${Date.now()}`, n = {
|
|
254
|
+
id: t,
|
|
255
|
+
type: e,
|
|
256
|
+
label: `New ${e.charAt(0).toUpperCase() + e.slice(1)}`,
|
|
257
|
+
position: {
|
|
258
|
+
x: 200,
|
|
259
|
+
y: (h.nodes.length + 1) * 80
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
g((e) => ({
|
|
263
|
+
...e,
|
|
264
|
+
nodes: [...e.nodes, n]
|
|
265
|
+
})), v(t);
|
|
266
|
+
}, [p, h.nodes.length]), w = t((e, t) => {
|
|
267
|
+
p || g((n) => ({
|
|
268
|
+
...n,
|
|
269
|
+
nodes: n.nodes.map((n) => n.id === e ? {
|
|
270
|
+
...n,
|
|
271
|
+
...t
|
|
272
|
+
} : n)
|
|
273
|
+
}));
|
|
274
|
+
}, [p]), T = t((e) => {
|
|
275
|
+
p || (g((t) => ({
|
|
276
|
+
...t,
|
|
277
|
+
nodes: t.nodes.filter((t) => t.id !== e),
|
|
278
|
+
edges: t.edges.filter((t) => t.source !== e && t.target !== e)
|
|
279
|
+
})), _ === e && v(null));
|
|
280
|
+
}, [p, _]), E = t((e, t) => {
|
|
281
|
+
if (p) return;
|
|
282
|
+
let n = {
|
|
283
|
+
id: `edge-${Date.now()}`,
|
|
284
|
+
source: e,
|
|
285
|
+
target: t
|
|
286
|
+
};
|
|
287
|
+
g((e) => ({
|
|
288
|
+
...e,
|
|
289
|
+
edges: [...e.edges, n]
|
|
290
|
+
}));
|
|
291
|
+
}, [p]), D = t((e) => {
|
|
292
|
+
p || (g((t) => ({
|
|
293
|
+
...t,
|
|
294
|
+
edges: t.edges.filter((t) => t.id !== e)
|
|
295
|
+
})), y === e && b(null));
|
|
296
|
+
}, [p, y]), ee = () => {
|
|
297
|
+
console.log("Saving workflow:", h), e.onSave;
|
|
298
|
+
}, O = () => {
|
|
299
|
+
g((e) => ({
|
|
300
|
+
...e,
|
|
301
|
+
status: "active"
|
|
302
|
+
})), console.log("Publishing workflow"), e.onPublish;
|
|
303
|
+
}, A = q[h.status || "draft"];
|
|
304
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
305
|
+
className: "space-y-4",
|
|
306
|
+
children: [m && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
307
|
+
className: "flex items-center justify-between gap-2 p-4 bg-card rounded-lg border",
|
|
308
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
309
|
+
className: "flex items-center gap-3",
|
|
310
|
+
children: [/* @__PURE__ */ (0, G.jsx)("div", { children: /* @__PURE__ */ (0, G.jsx)(d, {
|
|
311
|
+
value: h.title || "",
|
|
312
|
+
onChange: (e) => g((t) => ({
|
|
313
|
+
...t,
|
|
314
|
+
title: e.target.value
|
|
315
|
+
})),
|
|
316
|
+
className: "text-lg font-semibold border-none p-0 h-auto focus-visible:ring-0",
|
|
317
|
+
readOnly: p,
|
|
318
|
+
placeholder: "Workflow Title"
|
|
319
|
+
}) }), /* @__PURE__ */ (0, G.jsx)(a, {
|
|
320
|
+
variant: A.variant,
|
|
321
|
+
children: A.label
|
|
322
|
+
})]
|
|
323
|
+
}), !p && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
324
|
+
className: "flex items-center gap-2",
|
|
325
|
+
children: [/* @__PURE__ */ (0, G.jsxs)(o, {
|
|
326
|
+
variant: "outline",
|
|
327
|
+
size: "sm",
|
|
328
|
+
onClick: ee,
|
|
329
|
+
children: [/* @__PURE__ */ (0, G.jsx)(le, { className: "h-4 w-4 mr-2" }), "Save"]
|
|
330
|
+
}), /* @__PURE__ */ (0, G.jsxs)(o, {
|
|
331
|
+
size: "sm",
|
|
332
|
+
onClick: O,
|
|
333
|
+
disabled: h.status === "active",
|
|
334
|
+
children: [/* @__PURE__ */ (0, G.jsx)(N, { className: "h-4 w-4 mr-2" }), "Publish"]
|
|
335
|
+
})]
|
|
336
|
+
})]
|
|
337
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
338
|
+
className: "grid grid-cols-1 lg:grid-cols-4 gap-4",
|
|
339
|
+
children: [
|
|
340
|
+
!p && /* @__PURE__ */ (0, G.jsxs)(s, {
|
|
341
|
+
className: "lg:col-span-1",
|
|
342
|
+
children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsx)(u, {
|
|
343
|
+
className: "text-sm",
|
|
344
|
+
children: "Add Node"
|
|
345
|
+
}) }), /* @__PURE__ */ (0, G.jsx)(c, {
|
|
346
|
+
className: "space-y-2",
|
|
347
|
+
children: [
|
|
348
|
+
"task",
|
|
349
|
+
"approval",
|
|
350
|
+
"condition",
|
|
351
|
+
"parallel",
|
|
352
|
+
"delay",
|
|
353
|
+
"notification",
|
|
354
|
+
"script"
|
|
355
|
+
].map((e) => /* @__PURE__ */ (0, G.jsxs)("button", {
|
|
356
|
+
onClick: () => C(e),
|
|
357
|
+
className: "w-full flex items-center gap-2 p-2 rounded-md border hover:bg-muted/50 transition-colors text-sm",
|
|
358
|
+
children: [K[e], /* @__PURE__ */ (0, G.jsx)("span", {
|
|
359
|
+
className: "capitalize",
|
|
360
|
+
children: e
|
|
361
|
+
})]
|
|
362
|
+
}, e))
|
|
363
|
+
})]
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ (0, G.jsxs)(s, {
|
|
366
|
+
className: p ? "lg:col-span-3" : "lg:col-span-2",
|
|
367
|
+
children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsxs)(u, {
|
|
368
|
+
className: "text-sm flex items-center gap-2",
|
|
369
|
+
children: [/* @__PURE__ */ (0, G.jsx)(k, { className: "h-4 w-4" }), "Workflow Flow"]
|
|
370
|
+
}) }), /* @__PURE__ */ (0, G.jsx)(c, { children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
371
|
+
className: "space-y-2",
|
|
372
|
+
children: [
|
|
373
|
+
h.nodes.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
374
|
+
onClick: () => {
|
|
375
|
+
v(e.id), b(null);
|
|
376
|
+
},
|
|
377
|
+
className: `flex items-center justify-between p-3 rounded-lg border-2 cursor-pointer transition-all ${ye[e.type]} ${_ === e.id ? "ring-2 ring-primary shadow-md" : "hover:shadow-sm"}`,
|
|
378
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
379
|
+
className: "flex items-center gap-2",
|
|
380
|
+
children: [
|
|
381
|
+
K[e.type],
|
|
382
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
383
|
+
className: "font-medium text-sm",
|
|
384
|
+
children: e.label
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ (0, G.jsxs)("span", {
|
|
387
|
+
className: "text-xs text-muted-foreground capitalize",
|
|
388
|
+
children: [
|
|
389
|
+
"(",
|
|
390
|
+
e.type,
|
|
391
|
+
")"
|
|
392
|
+
]
|
|
393
|
+
})
|
|
394
|
+
]
|
|
395
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
396
|
+
className: "flex items-center gap-1",
|
|
397
|
+
children: [h.edges.filter((t) => t.source === e.id).length > 0 && /* @__PURE__ */ (0, G.jsxs)(a, {
|
|
398
|
+
variant: "outline",
|
|
399
|
+
className: "text-xs",
|
|
400
|
+
children: [h.edges.filter((t) => t.source === e.id).length, " out"]
|
|
401
|
+
}), !p && e.type !== "start" && e.type !== "end" && /* @__PURE__ */ (0, G.jsx)(o, {
|
|
402
|
+
size: "sm",
|
|
403
|
+
variant: "ghost",
|
|
404
|
+
className: "h-6 w-6 p-0 text-red-500 hover:text-red-700",
|
|
405
|
+
onClick: (t) => {
|
|
406
|
+
t.stopPropagation(), T(e.id);
|
|
407
|
+
},
|
|
408
|
+
children: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-3 w-3" })
|
|
409
|
+
})]
|
|
410
|
+
})]
|
|
411
|
+
}, e.id)),
|
|
412
|
+
h.edges.length > 0 && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
413
|
+
className: "mt-4 pt-4 border-t",
|
|
414
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
415
|
+
className: "text-xs text-muted-foreground mb-2 block",
|
|
416
|
+
children: "Connections"
|
|
417
|
+
}), h.edges.map((e) => {
|
|
418
|
+
let t = h.nodes.find((t) => t.id === e.source), n = h.nodes.find((t) => t.id === e.target);
|
|
419
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
420
|
+
className: "flex items-center gap-2 p-2 text-sm",
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ (0, G.jsx)("span", { children: t?.label || e.source }),
|
|
423
|
+
/* @__PURE__ */ (0, G.jsx)(x, { className: "h-3 w-3 text-muted-foreground" }),
|
|
424
|
+
/* @__PURE__ */ (0, G.jsx)("span", { children: n?.label || e.target }),
|
|
425
|
+
e.label && /* @__PURE__ */ (0, G.jsx)(a, {
|
|
426
|
+
variant: "outline",
|
|
427
|
+
className: "text-xs",
|
|
428
|
+
children: e.label
|
|
429
|
+
}),
|
|
430
|
+
!p && /* @__PURE__ */ (0, G.jsx)(o, {
|
|
431
|
+
size: "sm",
|
|
432
|
+
variant: "ghost",
|
|
433
|
+
className: "h-5 w-5 p-0 ml-auto text-red-500",
|
|
434
|
+
onClick: () => D(e.id),
|
|
435
|
+
children: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-3 w-3" })
|
|
436
|
+
})
|
|
437
|
+
]
|
|
438
|
+
}, e.id);
|
|
439
|
+
})]
|
|
440
|
+
}),
|
|
441
|
+
!p && h.nodes.length >= 2 && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
442
|
+
className: "mt-4 pt-4 border-t",
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ (0, G.jsx)(f, {
|
|
445
|
+
className: "text-xs text-muted-foreground mb-2 block",
|
|
446
|
+
children: "Quick Connect"
|
|
447
|
+
}),
|
|
448
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
449
|
+
className: "grid grid-cols-2 gap-2",
|
|
450
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("select", {
|
|
451
|
+
id: "edge-source",
|
|
452
|
+
className: "border rounded-md p-1.5 text-sm bg-background",
|
|
453
|
+
children: [/* @__PURE__ */ (0, G.jsx)("option", {
|
|
454
|
+
value: "",
|
|
455
|
+
children: "From..."
|
|
456
|
+
}), h.nodes.filter((e) => e.type !== "end").map((e) => /* @__PURE__ */ (0, G.jsx)("option", {
|
|
457
|
+
value: e.id,
|
|
458
|
+
children: e.label
|
|
459
|
+
}, e.id))]
|
|
460
|
+
}), /* @__PURE__ */ (0, G.jsxs)("select", {
|
|
461
|
+
id: "edge-target",
|
|
462
|
+
className: "border rounded-md p-1.5 text-sm bg-background",
|
|
463
|
+
children: [/* @__PURE__ */ (0, G.jsx)("option", {
|
|
464
|
+
value: "",
|
|
465
|
+
children: "To..."
|
|
466
|
+
}), h.nodes.filter((e) => e.type !== "start").map((e) => /* @__PURE__ */ (0, G.jsx)("option", {
|
|
467
|
+
value: e.id,
|
|
468
|
+
children: e.label
|
|
469
|
+
}, e.id))]
|
|
470
|
+
})]
|
|
471
|
+
}),
|
|
472
|
+
/* @__PURE__ */ (0, G.jsxs)(o, {
|
|
473
|
+
size: "sm",
|
|
474
|
+
variant: "outline",
|
|
475
|
+
className: "mt-2 w-full",
|
|
476
|
+
onClick: () => {
|
|
477
|
+
let e = document.getElementById("edge-source")?.value, t = document.getElementById("edge-target")?.value;
|
|
478
|
+
e && t && e !== t && E(e, t);
|
|
479
|
+
},
|
|
480
|
+
children: [/* @__PURE__ */ (0, G.jsx)(P, { className: "h-3 w-3 mr-1" }), "Connect"]
|
|
481
|
+
})
|
|
482
|
+
]
|
|
483
|
+
})
|
|
484
|
+
]
|
|
485
|
+
}) })]
|
|
486
|
+
}),
|
|
487
|
+
/* @__PURE__ */ (0, G.jsxs)(s, {
|
|
488
|
+
className: "lg:col-span-1",
|
|
489
|
+
children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsxs)(u, {
|
|
490
|
+
className: "text-sm flex items-center gap-2",
|
|
491
|
+
children: [/* @__PURE__ */ (0, G.jsx)(I, { className: "h-4 w-4" }), "Properties"]
|
|
492
|
+
}) }), /* @__PURE__ */ (0, G.jsx)(c, { children: S ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
493
|
+
className: "space-y-3",
|
|
494
|
+
children: [
|
|
495
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
496
|
+
className: "space-y-1",
|
|
497
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
498
|
+
className: "text-xs",
|
|
499
|
+
children: "Label"
|
|
500
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
501
|
+
value: S.label,
|
|
502
|
+
onChange: (e) => w(S.id, { label: e.target.value }),
|
|
503
|
+
className: "h-8 text-sm",
|
|
504
|
+
readOnly: p
|
|
505
|
+
})]
|
|
506
|
+
}),
|
|
507
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
508
|
+
className: "space-y-1",
|
|
509
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
510
|
+
className: "text-xs",
|
|
511
|
+
children: "Type"
|
|
512
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
513
|
+
className: "flex items-center gap-2 p-2 rounded-md bg-muted text-sm",
|
|
514
|
+
children: [K[S.type], /* @__PURE__ */ (0, G.jsx)("span", {
|
|
515
|
+
className: "capitalize",
|
|
516
|
+
children: S.type
|
|
517
|
+
})]
|
|
518
|
+
})]
|
|
519
|
+
}),
|
|
520
|
+
S.description !== void 0 && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
521
|
+
className: "space-y-1",
|
|
522
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
523
|
+
className: "text-xs",
|
|
524
|
+
children: "Description"
|
|
525
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
526
|
+
value: S.description || "",
|
|
527
|
+
onChange: (e) => w(S.id, { description: e.target.value }),
|
|
528
|
+
className: "h-8 text-sm",
|
|
529
|
+
readOnly: p
|
|
530
|
+
})]
|
|
531
|
+
}),
|
|
532
|
+
(S.type === "approval" || S.type === "task") && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
533
|
+
className: "space-y-1",
|
|
534
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
535
|
+
className: "text-xs",
|
|
536
|
+
children: "Assignee"
|
|
537
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
538
|
+
value: S.assignee || "",
|
|
539
|
+
onChange: (e) => w(S.id, { assignee: e.target.value }),
|
|
540
|
+
className: "h-8 text-sm",
|
|
541
|
+
placeholder: "User, role, or expression",
|
|
542
|
+
readOnly: p
|
|
543
|
+
})]
|
|
544
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
545
|
+
className: "space-y-1",
|
|
546
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
547
|
+
className: "text-xs",
|
|
548
|
+
children: "Assignee Type"
|
|
549
|
+
}), /* @__PURE__ */ (0, G.jsxs)("select", {
|
|
550
|
+
className: "w-full border rounded-md h-8 text-sm px-2 bg-background",
|
|
551
|
+
value: S.assigneeType || "user",
|
|
552
|
+
onChange: (e) => w(S.id, { assigneeType: e.target.value }),
|
|
553
|
+
disabled: p,
|
|
554
|
+
children: [
|
|
555
|
+
/* @__PURE__ */ (0, G.jsx)("option", {
|
|
556
|
+
value: "user",
|
|
557
|
+
children: "User"
|
|
558
|
+
}),
|
|
559
|
+
/* @__PURE__ */ (0, G.jsx)("option", {
|
|
560
|
+
value: "role",
|
|
561
|
+
children: "Role"
|
|
562
|
+
}),
|
|
563
|
+
/* @__PURE__ */ (0, G.jsx)("option", {
|
|
564
|
+
value: "group",
|
|
565
|
+
children: "Group"
|
|
566
|
+
}),
|
|
567
|
+
/* @__PURE__ */ (0, G.jsx)("option", {
|
|
568
|
+
value: "expression",
|
|
569
|
+
children: "Expression"
|
|
570
|
+
})
|
|
571
|
+
]
|
|
572
|
+
})]
|
|
573
|
+
})] }),
|
|
574
|
+
S.type === "delay" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
575
|
+
className: "space-y-1",
|
|
576
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
577
|
+
className: "text-xs",
|
|
578
|
+
children: "Timeout (minutes)"
|
|
579
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
580
|
+
type: "number",
|
|
581
|
+
value: S.timeout || 60,
|
|
582
|
+
onChange: (e) => w(S.id, { timeout: Number(e.target.value) }),
|
|
583
|
+
className: "h-8 text-sm",
|
|
584
|
+
readOnly: p
|
|
585
|
+
})]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
588
|
+
className: "text-xs text-muted-foreground mt-2",
|
|
589
|
+
children: ["ID: ", S.id]
|
|
590
|
+
})
|
|
591
|
+
]
|
|
592
|
+
}) : /* @__PURE__ */ (0, G.jsx)("div", {
|
|
593
|
+
className: "text-sm text-muted-foreground text-center py-8",
|
|
594
|
+
children: "Select a node to edit its properties"
|
|
595
|
+
}) })]
|
|
596
|
+
})
|
|
597
|
+
]
|
|
598
|
+
})]
|
|
599
|
+
});
|
|
600
|
+
}, xe = ({ schema: e }) => {
|
|
601
|
+
let { currentNodeId: t, approvalRule: n, history: r = [], data: p, showHistory: m = !0, showComments: h = !0 } = e, [g, _] = i(""), [v, y] = i(!1), b = (e) => {
|
|
602
|
+
y(!0), console.log(`Approval action: ${e}`, {
|
|
603
|
+
currentNodeId: t,
|
|
604
|
+
comment: g,
|
|
605
|
+
data: p
|
|
606
|
+
}), setTimeout(() => {
|
|
607
|
+
y(!1), _("");
|
|
608
|
+
}, 500);
|
|
609
|
+
}, x = (e) => {
|
|
610
|
+
switch (e) {
|
|
611
|
+
case "approve":
|
|
612
|
+
case "approved": return /* @__PURE__ */ (0, G.jsx)(a, {
|
|
613
|
+
variant: "default",
|
|
614
|
+
className: "bg-green-500",
|
|
615
|
+
children: "Approved"
|
|
616
|
+
});
|
|
617
|
+
case "reject":
|
|
618
|
+
case "rejected": return /* @__PURE__ */ (0, G.jsx)(a, {
|
|
619
|
+
variant: "destructive",
|
|
620
|
+
children: "Rejected"
|
|
621
|
+
});
|
|
622
|
+
case "reassign":
|
|
623
|
+
case "reassigned": return /* @__PURE__ */ (0, G.jsx)(a, {
|
|
624
|
+
variant: "secondary",
|
|
625
|
+
children: "Reassigned"
|
|
626
|
+
});
|
|
627
|
+
case "comment": return /* @__PURE__ */ (0, G.jsx)(a, {
|
|
628
|
+
variant: "outline",
|
|
629
|
+
children: "Comment"
|
|
630
|
+
});
|
|
631
|
+
case "escalate":
|
|
632
|
+
case "escalated": return /* @__PURE__ */ (0, G.jsx)(a, {
|
|
633
|
+
variant: "secondary",
|
|
634
|
+
className: "bg-orange-500 text-white",
|
|
635
|
+
children: "Escalated"
|
|
636
|
+
});
|
|
637
|
+
default: return /* @__PURE__ */ (0, G.jsx)(a, {
|
|
638
|
+
variant: "outline",
|
|
639
|
+
children: e
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
644
|
+
className: "space-y-4",
|
|
645
|
+
children: [
|
|
646
|
+
/* @__PURE__ */ (0, G.jsxs)(s, { children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsxs)(u, {
|
|
647
|
+
className: "flex items-center gap-2",
|
|
648
|
+
children: [
|
|
649
|
+
/* @__PURE__ */ (0, G.jsx)(E, { className: "h-5 w-5" }),
|
|
650
|
+
"Pending Approval",
|
|
651
|
+
n && /* @__PURE__ */ (0, G.jsxs)(a, {
|
|
652
|
+
variant: "outline",
|
|
653
|
+
className: "ml-2",
|
|
654
|
+
children: [
|
|
655
|
+
n.type === "any" && "Any approver",
|
|
656
|
+
n.type === "all" && "All must approve",
|
|
657
|
+
n.type === "majority" && "Majority approval",
|
|
658
|
+
n.type === "sequential" && "Sequential"
|
|
659
|
+
]
|
|
660
|
+
})
|
|
661
|
+
]
|
|
662
|
+
}) }), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
663
|
+
className: "space-y-4",
|
|
664
|
+
children: [
|
|
665
|
+
p && Object.keys(p).length > 0 && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
666
|
+
className: "p-3 bg-muted/50 rounded-lg",
|
|
667
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
668
|
+
className: "text-xs text-muted-foreground mb-2 block",
|
|
669
|
+
children: "Request Details"
|
|
670
|
+
}), /* @__PURE__ */ (0, G.jsx)("div", {
|
|
671
|
+
className: "grid grid-cols-2 gap-2",
|
|
672
|
+
children: Object.entries(p).slice(0, 6).map(([e, t]) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
673
|
+
className: "text-sm",
|
|
674
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("span", {
|
|
675
|
+
className: "text-muted-foreground",
|
|
676
|
+
children: [e, ": "]
|
|
677
|
+
}), /* @__PURE__ */ (0, G.jsx)("span", {
|
|
678
|
+
className: "font-medium",
|
|
679
|
+
children: String(t)
|
|
680
|
+
})]
|
|
681
|
+
}, e))
|
|
682
|
+
})]
|
|
683
|
+
}),
|
|
684
|
+
h && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
685
|
+
className: "space-y-2",
|
|
686
|
+
children: [/* @__PURE__ */ (0, G.jsxs)(f, {
|
|
687
|
+
className: "flex items-center gap-2 text-sm",
|
|
688
|
+
children: [/* @__PURE__ */ (0, G.jsx)(ie, { className: "h-4 w-4" }), "Comment"]
|
|
689
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
690
|
+
value: g,
|
|
691
|
+
onChange: (e) => _(e.target.value),
|
|
692
|
+
placeholder: "Add a comment (optional)"
|
|
693
|
+
})]
|
|
694
|
+
}),
|
|
695
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
696
|
+
className: "flex items-center gap-2",
|
|
697
|
+
children: [
|
|
698
|
+
/* @__PURE__ */ (0, G.jsxs)(o, {
|
|
699
|
+
onClick: () => b("approve"),
|
|
700
|
+
disabled: v,
|
|
701
|
+
className: "bg-green-600 hover:bg-green-700",
|
|
702
|
+
children: [/* @__PURE__ */ (0, G.jsx)(C, { className: "h-4 w-4 mr-2" }), "Approve"]
|
|
703
|
+
}),
|
|
704
|
+
/* @__PURE__ */ (0, G.jsxs)(o, {
|
|
705
|
+
variant: "destructive",
|
|
706
|
+
onClick: () => b("reject"),
|
|
707
|
+
disabled: v,
|
|
708
|
+
children: [/* @__PURE__ */ (0, G.jsx)(H, { className: "h-4 w-4 mr-2" }), "Reject"]
|
|
709
|
+
}),
|
|
710
|
+
/* @__PURE__ */ (0, G.jsxs)(o, {
|
|
711
|
+
variant: "outline",
|
|
712
|
+
onClick: () => b("reassign"),
|
|
713
|
+
disabled: v,
|
|
714
|
+
children: [/* @__PURE__ */ (0, G.jsx)(F, { className: "h-4 w-4 mr-2" }), "Reassign"]
|
|
715
|
+
})
|
|
716
|
+
]
|
|
717
|
+
})
|
|
718
|
+
]
|
|
719
|
+
})] }),
|
|
720
|
+
m && r.length > 0 && /* @__PURE__ */ (0, G.jsxs)(s, { children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsx)(u, {
|
|
721
|
+
className: "text-sm",
|
|
722
|
+
children: "Approval History"
|
|
723
|
+
}) }), /* @__PURE__ */ (0, G.jsx)(c, { children: /* @__PURE__ */ (0, G.jsx)("div", {
|
|
724
|
+
className: "space-y-3",
|
|
725
|
+
children: r.map((e, t) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
726
|
+
className: "flex items-start gap-3 p-3 rounded-lg border",
|
|
727
|
+
children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
728
|
+
className: "mt-0.5",
|
|
729
|
+
children: /* @__PURE__ */ (0, G.jsx)(B, { className: "h-4 w-4 text-muted-foreground" })
|
|
730
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
731
|
+
className: "flex-1 min-w-0",
|
|
732
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
733
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
734
|
+
children: [
|
|
735
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
736
|
+
className: "font-medium text-sm",
|
|
737
|
+
children: e.actorName || e.actor
|
|
738
|
+
}),
|
|
739
|
+
x(e.action),
|
|
740
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
741
|
+
className: "text-xs text-muted-foreground",
|
|
742
|
+
children: new Date(e.timestamp).toLocaleString()
|
|
743
|
+
})
|
|
744
|
+
]
|
|
745
|
+
}), e.comment && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
746
|
+
className: "text-sm text-muted-foreground mt-1",
|
|
747
|
+
children: e.comment
|
|
748
|
+
})]
|
|
749
|
+
})]
|
|
750
|
+
}, t))
|
|
751
|
+
}) })] }),
|
|
752
|
+
m && r.length === 0 && /* @__PURE__ */ (0, G.jsx)(s, { children: /* @__PURE__ */ (0, G.jsx)(c, {
|
|
753
|
+
className: "p-6 text-center text-muted-foreground text-sm",
|
|
754
|
+
children: "No approval history yet"
|
|
755
|
+
}) })
|
|
756
|
+
]
|
|
757
|
+
});
|
|
758
|
+
}, J = {
|
|
759
|
+
record_created: "Record Created",
|
|
760
|
+
record_updated: "Record Updated",
|
|
761
|
+
record_deleted: "Record Deleted",
|
|
762
|
+
field_changed: "Field Changed",
|
|
763
|
+
scheduled: "Scheduled"
|
|
764
|
+
}, Se = {
|
|
765
|
+
send_email: "Send Email",
|
|
766
|
+
update_field: "Update Field",
|
|
767
|
+
create_record: "Create Record",
|
|
768
|
+
delete_record: "Delete Record",
|
|
769
|
+
webhook: "Webhook",
|
|
770
|
+
notification: "Notification"
|
|
771
|
+
}, Ce = {
|
|
772
|
+
send_email: /* @__PURE__ */ (0, G.jsx)(re, { className: "h-4 w-4" }),
|
|
773
|
+
update_field: /* @__PURE__ */ (0, G.jsx)(O, { className: "h-4 w-4" }),
|
|
774
|
+
create_record: /* @__PURE__ */ (0, G.jsx)(P, { className: "h-4 w-4" }),
|
|
775
|
+
delete_record: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-4 w-4" }),
|
|
776
|
+
webhook: /* @__PURE__ */ (0, G.jsx)(j, { className: "h-4 w-4" }),
|
|
777
|
+
notification: /* @__PURE__ */ (0, G.jsx)(S, { className: "h-4 w-4" })
|
|
778
|
+
}, we = {
|
|
779
|
+
equals: "Equals",
|
|
780
|
+
not_equals: "Not Equals",
|
|
781
|
+
contains: "Contains",
|
|
782
|
+
greater_than: "Greater Than",
|
|
783
|
+
less_than: "Less Than"
|
|
784
|
+
}, Te = () => ({
|
|
785
|
+
id: `auto-${Date.now()}`,
|
|
786
|
+
name: "",
|
|
787
|
+
description: "",
|
|
788
|
+
enabled: !0,
|
|
789
|
+
trigger: { type: "record_created" },
|
|
790
|
+
actions: [],
|
|
791
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
792
|
+
}), Y = ({ label: e, value: t, placeholder: n, onChange: r }) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
793
|
+
className: "space-y-1",
|
|
794
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
795
|
+
className: "text-xs",
|
|
796
|
+
children: e
|
|
797
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
798
|
+
value: t,
|
|
799
|
+
onChange: (e) => r(e.target.value),
|
|
800
|
+
placeholder: n
|
|
801
|
+
})]
|
|
802
|
+
}), Ee = ({ automation: e, objects: n = [], onSave: r, onCancel: b, className: x }) => {
|
|
803
|
+
let [S, C] = i(e ?? Te()), w = t((e) => {
|
|
804
|
+
C((t) => ({
|
|
805
|
+
...t,
|
|
806
|
+
trigger: {
|
|
807
|
+
...t.trigger,
|
|
808
|
+
...e
|
|
809
|
+
}
|
|
810
|
+
}));
|
|
811
|
+
}, []), T = t(() => {
|
|
812
|
+
C((e) => ({
|
|
813
|
+
...e,
|
|
814
|
+
actions: [...e.actions, {
|
|
815
|
+
type: "send_email",
|
|
816
|
+
params: {}
|
|
817
|
+
}]
|
|
818
|
+
}));
|
|
819
|
+
}, []), D = t((e, t) => {
|
|
820
|
+
C((n) => ({
|
|
821
|
+
...n,
|
|
822
|
+
actions: n.actions.map((n, r) => r === e ? {
|
|
823
|
+
...n,
|
|
824
|
+
...t
|
|
825
|
+
} : n)
|
|
826
|
+
}));
|
|
827
|
+
}, []), ee = t((e) => {
|
|
828
|
+
C((t) => ({
|
|
829
|
+
...t,
|
|
830
|
+
actions: t.actions.filter((t, n) => n !== e)
|
|
831
|
+
}));
|
|
832
|
+
}, []), O = S.trigger.type !== "scheduled", k = S.trigger.type === "field_changed", A = S.trigger.type === "scheduled", j = n.find((e) => e.name === S.trigger.objectName)?.fields, te = (e, t) => {
|
|
833
|
+
let n = (n, r) => D(t, { params: {
|
|
834
|
+
...e.params,
|
|
835
|
+
[n]: r
|
|
836
|
+
} });
|
|
837
|
+
switch (e.type) {
|
|
838
|
+
case "send_email": return /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)(Y, {
|
|
839
|
+
label: "To",
|
|
840
|
+
value: e.params.to ?? "",
|
|
841
|
+
placeholder: "Recipient email",
|
|
842
|
+
onChange: (e) => n("to", e)
|
|
843
|
+
}), /* @__PURE__ */ (0, G.jsx)(Y, {
|
|
844
|
+
label: "Subject",
|
|
845
|
+
value: e.params.subject ?? "",
|
|
846
|
+
placeholder: "Email subject",
|
|
847
|
+
onChange: (e) => n("subject", e)
|
|
848
|
+
})] });
|
|
849
|
+
case "webhook": return /* @__PURE__ */ (0, G.jsx)(Y, {
|
|
850
|
+
label: "URL",
|
|
851
|
+
value: e.params.url ?? "",
|
|
852
|
+
placeholder: "https://...",
|
|
853
|
+
onChange: (e) => n("url", e)
|
|
854
|
+
});
|
|
855
|
+
case "notification": return /* @__PURE__ */ (0, G.jsx)(Y, {
|
|
856
|
+
label: "Message",
|
|
857
|
+
value: e.params.message ?? "",
|
|
858
|
+
placeholder: "Notification message",
|
|
859
|
+
onChange: (e) => n("message", e)
|
|
860
|
+
});
|
|
861
|
+
case "update_field":
|
|
862
|
+
case "create_record":
|
|
863
|
+
case "delete_record": return /* @__PURE__ */ (0, G.jsx)(Y, {
|
|
864
|
+
label: "Target Object",
|
|
865
|
+
value: e.params.objectName ?? "",
|
|
866
|
+
placeholder: "Object name",
|
|
867
|
+
onChange: (e) => n("objectName", e)
|
|
868
|
+
});
|
|
869
|
+
default: return null;
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
873
|
+
className: x ?? "space-y-4",
|
|
874
|
+
children: [
|
|
875
|
+
/* @__PURE__ */ (0, G.jsxs)(s, { children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsxs)(u, {
|
|
876
|
+
className: "flex items-center gap-2 text-sm",
|
|
877
|
+
children: [/* @__PURE__ */ (0, G.jsx)(fe, { className: "h-4 w-4 text-yellow-500" }), "Trigger"]
|
|
878
|
+
}) }), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
879
|
+
className: "space-y-4",
|
|
880
|
+
children: [
|
|
881
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
882
|
+
className: "space-y-1",
|
|
883
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
884
|
+
className: "text-xs",
|
|
885
|
+
children: "Trigger Type"
|
|
886
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
887
|
+
value: S.trigger.type,
|
|
888
|
+
onValueChange: (e) => w({ type: e }),
|
|
889
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, { children: /* @__PURE__ */ (0, G.jsx)(_, { placeholder: "Select trigger type" }) }), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys(J).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
890
|
+
value: e,
|
|
891
|
+
children: J[e]
|
|
892
|
+
}, e)) })]
|
|
893
|
+
})]
|
|
894
|
+
}),
|
|
895
|
+
O && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
896
|
+
className: "space-y-1",
|
|
897
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
898
|
+
className: "text-xs",
|
|
899
|
+
children: "Object"
|
|
900
|
+
}), n.length > 0 ? /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
901
|
+
value: S.trigger.objectName ?? "",
|
|
902
|
+
onValueChange: (e) => w({ objectName: e }),
|
|
903
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, { children: /* @__PURE__ */ (0, G.jsx)(_, { placeholder: "Select object" }) }), /* @__PURE__ */ (0, G.jsx)(m, { children: n.map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
904
|
+
value: e.name,
|
|
905
|
+
children: e.label
|
|
906
|
+
}, e.name)) })]
|
|
907
|
+
}) : /* @__PURE__ */ (0, G.jsx)(d, {
|
|
908
|
+
value: S.trigger.objectName ?? "",
|
|
909
|
+
onChange: (e) => w({ objectName: e.target.value }),
|
|
910
|
+
placeholder: "Object name"
|
|
911
|
+
})]
|
|
912
|
+
}),
|
|
913
|
+
k && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
914
|
+
className: "space-y-1",
|
|
915
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
916
|
+
className: "text-xs",
|
|
917
|
+
children: "Field"
|
|
918
|
+
}), j ? /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
919
|
+
value: S.trigger.fieldName ?? "",
|
|
920
|
+
onValueChange: (e) => w({ fieldName: e }),
|
|
921
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, { children: /* @__PURE__ */ (0, G.jsx)(_, { placeholder: "Select field" }) }), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys(j).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
922
|
+
value: e,
|
|
923
|
+
children: e
|
|
924
|
+
}, e)) })]
|
|
925
|
+
}) : /* @__PURE__ */ (0, G.jsx)(d, {
|
|
926
|
+
value: S.trigger.fieldName ?? "",
|
|
927
|
+
onChange: (e) => w({ fieldName: e.target.value }),
|
|
928
|
+
placeholder: "Field name"
|
|
929
|
+
})]
|
|
930
|
+
}),
|
|
931
|
+
A && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
932
|
+
className: "space-y-1",
|
|
933
|
+
children: [/* @__PURE__ */ (0, G.jsxs)(f, {
|
|
934
|
+
className: "text-xs flex items-center gap-1",
|
|
935
|
+
children: [/* @__PURE__ */ (0, G.jsx)(E, { className: "h-3 w-3" }), " Cron Schedule"]
|
|
936
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
937
|
+
value: S.trigger.schedule ?? "",
|
|
938
|
+
onChange: (e) => w({ schedule: e.target.value }),
|
|
939
|
+
placeholder: "e.g. 0 9 * * 1-5"
|
|
940
|
+
})]
|
|
941
|
+
}),
|
|
942
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
943
|
+
className: "space-y-1",
|
|
944
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
945
|
+
className: "text-xs",
|
|
946
|
+
children: "Condition (optional)"
|
|
947
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
948
|
+
value: S.trigger.condition ?? "",
|
|
949
|
+
onChange: (e) => w({ condition: e.target.value }),
|
|
950
|
+
placeholder: "e.g. ${data.status === \"active\"}"
|
|
951
|
+
})]
|
|
952
|
+
}),
|
|
953
|
+
/* @__PURE__ */ (0, G.jsx)(v, {}),
|
|
954
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
955
|
+
className: "space-y-3",
|
|
956
|
+
children: [
|
|
957
|
+
/* @__PURE__ */ (0, G.jsx)(f, {
|
|
958
|
+
className: "text-xs font-medium",
|
|
959
|
+
children: "Conditional Trigger (optional)"
|
|
960
|
+
}),
|
|
961
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
962
|
+
className: "text-xs text-muted-foreground",
|
|
963
|
+
children: "Run only when a field matches a specific value."
|
|
964
|
+
}),
|
|
965
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
966
|
+
className: "grid grid-cols-3 gap-2",
|
|
967
|
+
children: [
|
|
968
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
969
|
+
className: "space-y-1",
|
|
970
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
971
|
+
className: "text-xs",
|
|
972
|
+
children: "Field"
|
|
973
|
+
}), j ? /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
974
|
+
value: S.trigger.conditionField ?? "",
|
|
975
|
+
onValueChange: (e) => w({ conditionField: e }),
|
|
976
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, { children: /* @__PURE__ */ (0, G.jsx)(_, { placeholder: "Field" }) }), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys(j).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
977
|
+
value: e,
|
|
978
|
+
children: e
|
|
979
|
+
}, e)) })]
|
|
980
|
+
}) : /* @__PURE__ */ (0, G.jsx)(d, {
|
|
981
|
+
value: S.trigger.conditionField ?? "",
|
|
982
|
+
onChange: (e) => w({ conditionField: e.target.value }),
|
|
983
|
+
placeholder: "e.g. status"
|
|
984
|
+
})]
|
|
985
|
+
}),
|
|
986
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
987
|
+
className: "space-y-1",
|
|
988
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
989
|
+
className: "text-xs",
|
|
990
|
+
children: "Operator"
|
|
991
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
992
|
+
value: S.trigger.conditionOperator ?? "equals",
|
|
993
|
+
onValueChange: (e) => w({ conditionOperator: e }),
|
|
994
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, { children: /* @__PURE__ */ (0, G.jsx)(_, { placeholder: "Operator" }) }), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys(we).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
995
|
+
value: e,
|
|
996
|
+
children: we[e]
|
|
997
|
+
}, e)) })]
|
|
998
|
+
})]
|
|
999
|
+
}),
|
|
1000
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1001
|
+
className: "space-y-1",
|
|
1002
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1003
|
+
className: "text-xs",
|
|
1004
|
+
children: "Value"
|
|
1005
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1006
|
+
value: S.trigger.conditionValue ?? "",
|
|
1007
|
+
onChange: (e) => w({ conditionValue: e.target.value }),
|
|
1008
|
+
placeholder: "e.g. urgent"
|
|
1009
|
+
})]
|
|
1010
|
+
})
|
|
1011
|
+
]
|
|
1012
|
+
})
|
|
1013
|
+
]
|
|
1014
|
+
})
|
|
1015
|
+
]
|
|
1016
|
+
})] }),
|
|
1017
|
+
/* @__PURE__ */ (0, G.jsxs)(s, { children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsxs)(u, {
|
|
1018
|
+
className: "flex items-center gap-2 text-sm",
|
|
1019
|
+
children: [
|
|
1020
|
+
/* @__PURE__ */ (0, G.jsx)(I, { className: "h-4 w-4" }),
|
|
1021
|
+
" Actions",
|
|
1022
|
+
/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1023
|
+
variant: "secondary",
|
|
1024
|
+
className: "ml-auto",
|
|
1025
|
+
children: S.actions.length
|
|
1026
|
+
})
|
|
1027
|
+
]
|
|
1028
|
+
}) }), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1029
|
+
className: "space-y-3",
|
|
1030
|
+
children: [
|
|
1031
|
+
S.actions.length > 1 && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1032
|
+
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
1033
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1034
|
+
className: "text-xs",
|
|
1035
|
+
children: "Execution"
|
|
1036
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
1037
|
+
value: S.executionMode ?? "sequential",
|
|
1038
|
+
onValueChange: (e) => C((t) => ({
|
|
1039
|
+
...t,
|
|
1040
|
+
executionMode: e
|
|
1041
|
+
})),
|
|
1042
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
1043
|
+
className: "h-7 w-36",
|
|
1044
|
+
children: /* @__PURE__ */ (0, G.jsx)(_, {})
|
|
1045
|
+
}), /* @__PURE__ */ (0, G.jsxs)(m, { children: [/* @__PURE__ */ (0, G.jsx)(h, {
|
|
1046
|
+
value: "sequential",
|
|
1047
|
+
children: "Sequential"
|
|
1048
|
+
}), /* @__PURE__ */ (0, G.jsx)(h, {
|
|
1049
|
+
value: "parallel",
|
|
1050
|
+
children: "Parallel"
|
|
1051
|
+
})] })]
|
|
1052
|
+
})]
|
|
1053
|
+
}),
|
|
1054
|
+
S.actions.map((e, t) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1055
|
+
className: "rounded-lg border p-3 space-y-3",
|
|
1056
|
+
children: [
|
|
1057
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1058
|
+
className: "flex items-center justify-between",
|
|
1059
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1060
|
+
className: "flex items-center gap-2",
|
|
1061
|
+
children: [
|
|
1062
|
+
Ce[e.type],
|
|
1063
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
1064
|
+
className: "text-sm font-medium",
|
|
1065
|
+
children: S.actions.length > 1 && (S.executionMode ?? "sequential") === "sequential" ? `Step ${t + 1}` : `Action ${t + 1}`
|
|
1066
|
+
}),
|
|
1067
|
+
t > 0 && S.actions.length > 1 && (S.executionMode ?? "sequential") === "sequential" && /* @__PURE__ */ (0, G.jsx)(a, {
|
|
1068
|
+
variant: "outline",
|
|
1069
|
+
className: "text-[10px] px-1",
|
|
1070
|
+
children: "then"
|
|
1071
|
+
})
|
|
1072
|
+
]
|
|
1073
|
+
}), /* @__PURE__ */ (0, G.jsx)(o, {
|
|
1074
|
+
size: "sm",
|
|
1075
|
+
variant: "ghost",
|
|
1076
|
+
className: "h-7 w-7 p-0 text-red-500 hover:text-red-700",
|
|
1077
|
+
onClick: () => ee(t),
|
|
1078
|
+
children: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-4 w-4" })
|
|
1079
|
+
})]
|
|
1080
|
+
}),
|
|
1081
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1082
|
+
className: "space-y-1",
|
|
1083
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1084
|
+
className: "text-xs",
|
|
1085
|
+
children: "Action Type"
|
|
1086
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
1087
|
+
value: e.type,
|
|
1088
|
+
onValueChange: (e) => D(t, {
|
|
1089
|
+
type: e,
|
|
1090
|
+
params: {}
|
|
1091
|
+
}),
|
|
1092
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, { children: /* @__PURE__ */ (0, G.jsx)(_, {}) }), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys(Se).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
1093
|
+
value: e,
|
|
1094
|
+
children: Se[e]
|
|
1095
|
+
}, e)) })]
|
|
1096
|
+
})]
|
|
1097
|
+
}),
|
|
1098
|
+
te(e, t)
|
|
1099
|
+
]
|
|
1100
|
+
}, t)),
|
|
1101
|
+
/* @__PURE__ */ (0, G.jsxs)(o, {
|
|
1102
|
+
variant: "outline",
|
|
1103
|
+
size: "sm",
|
|
1104
|
+
className: "w-full",
|
|
1105
|
+
onClick: T,
|
|
1106
|
+
children: [/* @__PURE__ */ (0, G.jsx)(P, { className: "h-4 w-4 mr-2" }), " Add Action"]
|
|
1107
|
+
})
|
|
1108
|
+
]
|
|
1109
|
+
})] }),
|
|
1110
|
+
/* @__PURE__ */ (0, G.jsxs)(s, { children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsx)(u, {
|
|
1111
|
+
className: "text-sm",
|
|
1112
|
+
children: "Summary"
|
|
1113
|
+
}) }), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
1114
|
+
className: "space-y-4",
|
|
1115
|
+
children: [
|
|
1116
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1117
|
+
className: "space-y-1",
|
|
1118
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1119
|
+
className: "text-xs",
|
|
1120
|
+
children: "Name"
|
|
1121
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1122
|
+
value: S.name,
|
|
1123
|
+
onChange: (e) => C((t) => ({
|
|
1124
|
+
...t,
|
|
1125
|
+
name: e.target.value
|
|
1126
|
+
})),
|
|
1127
|
+
placeholder: "Automation name"
|
|
1128
|
+
})]
|
|
1129
|
+
}),
|
|
1130
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1131
|
+
className: "space-y-1",
|
|
1132
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1133
|
+
className: "text-xs",
|
|
1134
|
+
children: "Description"
|
|
1135
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1136
|
+
value: S.description ?? "",
|
|
1137
|
+
onChange: (e) => C((t) => ({
|
|
1138
|
+
...t,
|
|
1139
|
+
description: e.target.value
|
|
1140
|
+
})),
|
|
1141
|
+
placeholder: "Optional description"
|
|
1142
|
+
})]
|
|
1143
|
+
}),
|
|
1144
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1145
|
+
className: "flex items-center justify-between",
|
|
1146
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1147
|
+
className: "text-sm",
|
|
1148
|
+
children: "Enabled"
|
|
1149
|
+
}), /* @__PURE__ */ (0, G.jsx)(y, {
|
|
1150
|
+
checked: S.enabled,
|
|
1151
|
+
onCheckedChange: (e) => C((t) => ({
|
|
1152
|
+
...t,
|
|
1153
|
+
enabled: e
|
|
1154
|
+
}))
|
|
1155
|
+
})]
|
|
1156
|
+
}),
|
|
1157
|
+
/* @__PURE__ */ (0, G.jsx)(v, {}),
|
|
1158
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1159
|
+
className: "flex items-center gap-2 justify-end",
|
|
1160
|
+
children: [b && /* @__PURE__ */ (0, G.jsx)(o, {
|
|
1161
|
+
variant: "outline",
|
|
1162
|
+
size: "sm",
|
|
1163
|
+
onClick: b,
|
|
1164
|
+
children: "Cancel"
|
|
1165
|
+
}), /* @__PURE__ */ (0, G.jsxs)(o, {
|
|
1166
|
+
size: "sm",
|
|
1167
|
+
onClick: () => r?.(S),
|
|
1168
|
+
children: [/* @__PURE__ */ (0, G.jsx)(fe, { className: "h-4 w-4 mr-2" }), " Save Automation"]
|
|
1169
|
+
})]
|
|
1170
|
+
})
|
|
1171
|
+
]
|
|
1172
|
+
})] })
|
|
1173
|
+
]
|
|
1174
|
+
});
|
|
1175
|
+
}, X = {
|
|
1176
|
+
success: "default",
|
|
1177
|
+
failure: "destructive",
|
|
1178
|
+
running: "secondary",
|
|
1179
|
+
pending: "outline"
|
|
1180
|
+
}, Z = {
|
|
1181
|
+
success: "Success",
|
|
1182
|
+
failure: "Failed",
|
|
1183
|
+
running: "Running",
|
|
1184
|
+
pending: "Pending"
|
|
940
1185
|
};
|
|
941
|
-
function
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
const o = Math.floor(d / 60), t = d % 60;
|
|
948
|
-
return `${o}m ${t}s`;
|
|
1186
|
+
function De(e, t) {
|
|
1187
|
+
if (!t) return "—";
|
|
1188
|
+
let n = new Date(t).getTime() - new Date(e).getTime();
|
|
1189
|
+
if (n < 1e3) return `${n}ms`;
|
|
1190
|
+
let r = Math.floor(n / 1e3);
|
|
1191
|
+
return r < 60 ? `${r}s` : `${Math.floor(r / 60)}m ${r % 60}s`;
|
|
949
1192
|
}
|
|
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
|
-
|
|
1193
|
+
var Oe = ({ runs: e = [], className: t }) => /* @__PURE__ */ (0, G.jsxs)(s, {
|
|
1194
|
+
className: t,
|
|
1195
|
+
children: [/* @__PURE__ */ (0, G.jsx)(l, { children: /* @__PURE__ */ (0, G.jsxs)(u, {
|
|
1196
|
+
className: "flex items-center gap-2 text-sm",
|
|
1197
|
+
children: [
|
|
1198
|
+
/* @__PURE__ */ (0, G.jsx)(E, { className: "h-4 w-4" }),
|
|
1199
|
+
"Automation Run History",
|
|
1200
|
+
/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1201
|
+
variant: "outline",
|
|
1202
|
+
className: "ml-auto",
|
|
1203
|
+
children: e.length
|
|
1204
|
+
})
|
|
1205
|
+
]
|
|
1206
|
+
}) }), /* @__PURE__ */ (0, G.jsx)(c, { children: e.length === 0 ? /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1207
|
+
className: "text-sm text-muted-foreground text-center py-6",
|
|
1208
|
+
children: "No automation runs yet"
|
|
1209
|
+
}) : /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1210
|
+
className: "space-y-2",
|
|
1211
|
+
children: e.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1212
|
+
className: "flex items-start gap-3 rounded-lg border p-3",
|
|
1213
|
+
children: [/* @__PURE__ */ (0, G.jsx)(a, {
|
|
1214
|
+
variant: X[e.status],
|
|
1215
|
+
children: Z[e.status]
|
|
1216
|
+
}), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1217
|
+
className: "flex-1 min-w-0 space-y-1",
|
|
1218
|
+
children: [
|
|
1219
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1220
|
+
className: "flex items-center gap-2 flex-wrap",
|
|
1221
|
+
children: [/* @__PURE__ */ (0, G.jsx)("span", {
|
|
1222
|
+
className: "text-sm font-medium",
|
|
1223
|
+
children: e.automationName
|
|
1224
|
+
}), e.triggerEvent && /* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1225
|
+
className: "text-xs text-muted-foreground",
|
|
1226
|
+
children: ["— ", e.triggerEvent]
|
|
1227
|
+
})]
|
|
1228
|
+
}),
|
|
1229
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1230
|
+
className: "flex items-center gap-3 text-xs text-muted-foreground",
|
|
1231
|
+
children: [/* @__PURE__ */ (0, G.jsx)("span", { children: new Date(e.startedAt).toLocaleString() }), /* @__PURE__ */ (0, G.jsxs)("span", { children: ["Duration: ", De(e.startedAt, e.completedAt)] })]
|
|
1232
|
+
}),
|
|
1233
|
+
e.status === "failure" && e.error && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1234
|
+
className: "text-xs text-red-600 mt-1",
|
|
1235
|
+
children: e.error
|
|
1236
|
+
})
|
|
1237
|
+
]
|
|
1238
|
+
})]
|
|
1239
|
+
}, e.id))
|
|
1240
|
+
}) })]
|
|
1241
|
+
});
|
|
1242
|
+
//#endregion
|
|
1243
|
+
//#region src/FlowDesigner.tsx
|
|
1244
|
+
function ke(...e) {
|
|
1245
|
+
return ge(he(e));
|
|
982
1246
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
},
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
},
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
},
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1247
|
+
var Q = 130, Ae = 52, $ = {
|
|
1248
|
+
start: "Start",
|
|
1249
|
+
end: "End",
|
|
1250
|
+
task: "Task",
|
|
1251
|
+
user_task: "User Task",
|
|
1252
|
+
service_task: "Service Task",
|
|
1253
|
+
script_task: "Script Task",
|
|
1254
|
+
approval: "Approval",
|
|
1255
|
+
condition: "Condition",
|
|
1256
|
+
parallel_gateway: "Parallel Gateway",
|
|
1257
|
+
join_gateway: "Join Gateway",
|
|
1258
|
+
boundary_event: "Boundary Event",
|
|
1259
|
+
delay: "Delay",
|
|
1260
|
+
notification: "Notification",
|
|
1261
|
+
webhook: "Webhook"
|
|
1262
|
+
}, je = {
|
|
1263
|
+
start: /* @__PURE__ */ (0, G.jsx)(N, { className: "h-3.5 w-3.5 text-green-500" }),
|
|
1264
|
+
end: /* @__PURE__ */ (0, G.jsx)(R, { className: "h-3.5 w-3.5 text-red-500" }),
|
|
1265
|
+
task: /* @__PURE__ */ (0, G.jsx)(w, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
1266
|
+
user_task: /* @__PURE__ */ (0, G.jsx)(V, { className: "h-3.5 w-3.5 text-blue-600" }),
|
|
1267
|
+
service_task: /* @__PURE__ */ (0, G.jsx)(I, { className: "h-3.5 w-3.5 text-blue-400" }),
|
|
1268
|
+
script_task: /* @__PURE__ */ (0, G.jsx)(D, { className: "h-3.5 w-3.5 text-indigo-500" }),
|
|
1269
|
+
approval: /* @__PURE__ */ (0, G.jsx)(V, { className: "h-3.5 w-3.5 text-purple-500" }),
|
|
1270
|
+
condition: /* @__PURE__ */ (0, G.jsx)(k, { className: "h-3.5 w-3.5 text-orange-500" }),
|
|
1271
|
+
parallel_gateway: /* @__PURE__ */ (0, G.jsx)(k, { className: "h-3.5 w-3.5 text-teal-500" }),
|
|
1272
|
+
join_gateway: /* @__PURE__ */ (0, G.jsx)(A, { className: "h-3.5 w-3.5 text-teal-600" }),
|
|
1273
|
+
boundary_event: /* @__PURE__ */ (0, G.jsx)(b, { className: "h-3.5 w-3.5 text-amber-500" }),
|
|
1274
|
+
delay: /* @__PURE__ */ (0, G.jsx)(E, { className: "h-3.5 w-3.5 text-gray-500" }),
|
|
1275
|
+
notification: /* @__PURE__ */ (0, G.jsx)(S, { className: "h-3.5 w-3.5 text-yellow-500" }),
|
|
1276
|
+
webhook: /* @__PURE__ */ (0, G.jsx)(j, { className: "h-3.5 w-3.5 text-cyan-500" })
|
|
1277
|
+
}, Me = {
|
|
1278
|
+
start: "border-green-400 bg-green-50 dark:bg-green-950",
|
|
1279
|
+
end: "border-red-400 bg-red-50 dark:bg-red-950",
|
|
1280
|
+
task: "border-blue-300 bg-blue-50 dark:bg-blue-950",
|
|
1281
|
+
user_task: "border-blue-400 bg-blue-50 dark:bg-blue-950",
|
|
1282
|
+
service_task: "border-blue-200 bg-slate-50 dark:bg-slate-900",
|
|
1283
|
+
script_task: "border-indigo-300 bg-indigo-50 dark:bg-indigo-950",
|
|
1284
|
+
approval: "border-purple-400 bg-purple-50 dark:bg-purple-950",
|
|
1285
|
+
condition: "border-orange-400 bg-orange-50 dark:bg-orange-950",
|
|
1286
|
+
parallel_gateway: "border-teal-400 bg-teal-50 dark:bg-teal-950",
|
|
1287
|
+
join_gateway: "border-teal-500 bg-teal-50 dark:bg-teal-950",
|
|
1288
|
+
boundary_event: "border-amber-400 bg-amber-50 dark:bg-amber-950 border-dashed",
|
|
1289
|
+
delay: "border-gray-400 bg-gray-50 dark:bg-gray-900",
|
|
1290
|
+
notification: "border-yellow-400 bg-yellow-50 dark:bg-yellow-950",
|
|
1291
|
+
webhook: "border-cyan-400 bg-cyan-50 dark:bg-cyan-950"
|
|
1292
|
+
}, Ne = {
|
|
1293
|
+
pending: {
|
|
1294
|
+
color: "text-muted-foreground",
|
|
1295
|
+
icon: /* @__PURE__ */ (0, G.jsx)(E, { className: "h-3 w-3" })
|
|
1296
|
+
},
|
|
1297
|
+
running: {
|
|
1298
|
+
color: "text-blue-500",
|
|
1299
|
+
icon: /* @__PURE__ */ (0, G.jsx)(M, { className: "h-3 w-3 animate-spin" })
|
|
1300
|
+
},
|
|
1301
|
+
completed: {
|
|
1302
|
+
color: "text-green-500",
|
|
1303
|
+
icon: /* @__PURE__ */ (0, G.jsx)(w, { className: "h-3 w-3" })
|
|
1304
|
+
},
|
|
1305
|
+
failed: {
|
|
1306
|
+
color: "text-red-500",
|
|
1307
|
+
icon: /* @__PURE__ */ (0, G.jsx)(b, { className: "h-3 w-3" })
|
|
1308
|
+
},
|
|
1309
|
+
skipped: {
|
|
1310
|
+
color: "text-gray-400",
|
|
1311
|
+
icon: /* @__PURE__ */ (0, G.jsx)(L, { className: "h-3 w-3" })
|
|
1312
|
+
}
|
|
1313
|
+
}, Pe = [
|
|
1314
|
+
"task",
|
|
1315
|
+
"user_task",
|
|
1316
|
+
"service_task",
|
|
1317
|
+
"script_task",
|
|
1318
|
+
"approval",
|
|
1319
|
+
"condition",
|
|
1320
|
+
"parallel_gateway",
|
|
1321
|
+
"join_gateway",
|
|
1322
|
+
"boundary_event",
|
|
1323
|
+
"delay",
|
|
1324
|
+
"notification",
|
|
1325
|
+
"webhook"
|
|
1326
|
+
], Fe = {
|
|
1327
|
+
allow: "Allow (run concurrently)",
|
|
1328
|
+
forbid: "Forbid (skip new)",
|
|
1329
|
+
replace: "Replace (cancel existing)",
|
|
1330
|
+
queue: "Queue (run after current)"
|
|
1331
|
+
}, Ie = {
|
|
1332
|
+
condition: "Condition",
|
|
1333
|
+
manual: "Manual",
|
|
1334
|
+
webhook: "Webhook",
|
|
1335
|
+
timer: "Timer",
|
|
1336
|
+
signal: "Signal"
|
|
1337
|
+
}, Le = () => [{
|
|
1338
|
+
id: "start-1",
|
|
1339
|
+
type: "start",
|
|
1340
|
+
label: "Start",
|
|
1341
|
+
position: {
|
|
1342
|
+
x: 80,
|
|
1343
|
+
y: 200
|
|
1344
|
+
}
|
|
1345
|
+
}, {
|
|
1346
|
+
id: "end-1",
|
|
1347
|
+
type: "end",
|
|
1348
|
+
label: "End",
|
|
1349
|
+
position: {
|
|
1350
|
+
x: 500,
|
|
1351
|
+
y: 200
|
|
1352
|
+
}
|
|
1353
|
+
}], Re = () => [];
|
|
1354
|
+
function ze(e) {
|
|
1355
|
+
let [n, r] = i([e]), [a, o] = i(0);
|
|
1356
|
+
return {
|
|
1357
|
+
current: n[a],
|
|
1358
|
+
push: t((e) => {
|
|
1359
|
+
r((t) => [...t.slice(0, a + 1), e]), o((e) => e + 1);
|
|
1360
|
+
}, [a]),
|
|
1361
|
+
undo: t(() => {
|
|
1362
|
+
o((e) => Math.max(0, e - 1));
|
|
1363
|
+
}, []),
|
|
1364
|
+
redo: t(() => {
|
|
1365
|
+
r((e) => (o((t) => Math.min(e.length - 1, t + 1)), e));
|
|
1366
|
+
}, []),
|
|
1367
|
+
canUndo: a > 0,
|
|
1368
|
+
canRedo: a < n.length - 1
|
|
1369
|
+
};
|
|
1071
1370
|
}
|
|
1072
|
-
function
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
};
|
|
1371
|
+
function Be(e, t, n) {
|
|
1372
|
+
let r = [], i = ["boundary_event"];
|
|
1373
|
+
e.forEach((e) => {
|
|
1374
|
+
i.includes(e.type) && r.push(`Node "${e.label}" (${e.type}) has limited BPMN mapping.`);
|
|
1375
|
+
});
|
|
1376
|
+
let a = [
|
|
1377
|
+
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
|
|
1378
|
+
"<definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\"",
|
|
1379
|
+
" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\"",
|
|
1380
|
+
" targetNamespace=\"http://objectui.org/bpmn\">",
|
|
1381
|
+
` <process id="process-1" name="${n}" isExecutable="true">`,
|
|
1382
|
+
...e.map((e) => ` <${Ve(e.type)} id="${e.id}" name="${e.label}" />`),
|
|
1383
|
+
...t.map((e) => ` <sequenceFlow ${[
|
|
1384
|
+
`id="${e.id}"`,
|
|
1385
|
+
`sourceRef="${e.source}"`,
|
|
1386
|
+
`targetRef="${e.target}"`,
|
|
1387
|
+
e.condition ? `conditionExpression="${e.condition}"` : ""
|
|
1388
|
+
].filter(Boolean).join(" ")} />`),
|
|
1389
|
+
" </process>",
|
|
1390
|
+
"</definitions>"
|
|
1391
|
+
].join("\n");
|
|
1392
|
+
return {
|
|
1393
|
+
success: !0,
|
|
1394
|
+
nodeCount: e.length,
|
|
1395
|
+
edgeCount: t.length,
|
|
1396
|
+
warnings: r.length ? r : void 0,
|
|
1397
|
+
bpmnXml: a
|
|
1398
|
+
};
|
|
1101
1399
|
}
|
|
1102
|
-
function
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1400
|
+
function Ve(e) {
|
|
1401
|
+
return {
|
|
1402
|
+
start: "startEvent",
|
|
1403
|
+
end: "endEvent",
|
|
1404
|
+
task: "task",
|
|
1405
|
+
user_task: "userTask",
|
|
1406
|
+
service_task: "serviceTask",
|
|
1407
|
+
script_task: "scriptTask",
|
|
1408
|
+
approval: "userTask",
|
|
1409
|
+
condition: "exclusiveGateway",
|
|
1410
|
+
parallel_gateway: "parallelGateway",
|
|
1411
|
+
join_gateway: "parallelGateway",
|
|
1412
|
+
boundary_event: "boundaryEvent",
|
|
1413
|
+
delay: "intermediateCatchEvent",
|
|
1414
|
+
notification: "sendTask",
|
|
1415
|
+
webhook: "serviceTask"
|
|
1416
|
+
}[e] ?? "task";
|
|
1119
1417
|
}
|
|
1120
|
-
function
|
|
1121
|
-
|
|
1122
|
-
|
|
1418
|
+
function He(e, t) {
|
|
1419
|
+
let n = e.position.x + Q, r = e.position.y + Ae / 2, i = t.position.x, a = t.position.y + Ae / 2, o = (n + i) / 2;
|
|
1420
|
+
return {
|
|
1421
|
+
d: `M ${n} ${r} C ${o} ${r}, ${o} ${a}, ${i} ${a}`,
|
|
1422
|
+
labelX: o,
|
|
1423
|
+
labelY: (r + a) / 2 - 8
|
|
1424
|
+
};
|
|
1123
1425
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
})
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
)
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
)
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1426
|
+
var Ue = ({ node: e, isSelected: t, isConnectSource: n, connectMode: r, readOnly: i, showExecutionOverlay: a, onSelect: o, onDelete: s, onDragStart: c, onPortClick: l }) => {
|
|
1427
|
+
let u = e.executionStatus, d = u ? Ne[u] : null;
|
|
1428
|
+
return /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1429
|
+
className: "absolute select-none",
|
|
1430
|
+
style: {
|
|
1431
|
+
left: e.position.x,
|
|
1432
|
+
top: e.position.y
|
|
1433
|
+
},
|
|
1434
|
+
draggable: !i && !r,
|
|
1435
|
+
onDragStart: (t) => c(t, e.id),
|
|
1436
|
+
onClick: (t) => o(e.id, t.shiftKey),
|
|
1437
|
+
role: "group",
|
|
1438
|
+
"aria-label": e.label,
|
|
1439
|
+
children: [
|
|
1440
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1441
|
+
className: ke("flex items-center gap-2 border-2 rounded px-3 py-2 min-h-[52px] transition-shadow cursor-pointer", Me[e.type], t && "ring-2 ring-primary shadow-md", n && "ring-2 ring-blue-400 shadow-lg", r && !n && "cursor-crosshair", a && u === "running" && "ring-2 ring-blue-400", a && u === "failed" && "ring-2 ring-red-400", a && u === "completed" && "ring-2 ring-green-400"),
|
|
1442
|
+
style: {
|
|
1443
|
+
width: Q,
|
|
1444
|
+
minHeight: Ae
|
|
1445
|
+
},
|
|
1446
|
+
children: [
|
|
1447
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
1448
|
+
className: "shrink-0",
|
|
1449
|
+
children: je[e.type]
|
|
1450
|
+
}),
|
|
1451
|
+
/* @__PURE__ */ (0, G.jsx)("span", {
|
|
1452
|
+
className: "text-xs font-medium leading-tight flex-1 truncate",
|
|
1453
|
+
children: e.label
|
|
1454
|
+
}),
|
|
1455
|
+
a && d && /* @__PURE__ */ (0, G.jsx)("span", {
|
|
1456
|
+
className: ke("shrink-0", d.color),
|
|
1457
|
+
children: d.icon
|
|
1458
|
+
})
|
|
1459
|
+
]
|
|
1460
|
+
}),
|
|
1461
|
+
!i && (t || r) && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1462
|
+
className: "absolute w-3 h-3 rounded-full bg-primary border-2 border-background shadow cursor-crosshair",
|
|
1463
|
+
style: {
|
|
1464
|
+
right: -6,
|
|
1465
|
+
top: Ae / 2 - 6
|
|
1466
|
+
},
|
|
1467
|
+
title: "Connect from this node",
|
|
1468
|
+
onClick: (t) => {
|
|
1469
|
+
t.stopPropagation(), l(e.id);
|
|
1470
|
+
}
|
|
1471
|
+
}), /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1472
|
+
className: "absolute w-3 h-3 rounded-full bg-muted-foreground border-2 border-background shadow cursor-crosshair",
|
|
1473
|
+
style: {
|
|
1474
|
+
left: -6,
|
|
1475
|
+
top: Ae / 2 - 6
|
|
1476
|
+
},
|
|
1477
|
+
title: "Connect to this node",
|
|
1478
|
+
onClick: (t) => {
|
|
1479
|
+
t.stopPropagation(), l(e.id);
|
|
1480
|
+
}
|
|
1481
|
+
})] }),
|
|
1482
|
+
!i && t && !r && /* @__PURE__ */ (0, G.jsx)("button", {
|
|
1483
|
+
className: "absolute -top-2 -right-2 p-0.5 rounded-full bg-destructive text-destructive-foreground shadow",
|
|
1484
|
+
onClick: (t) => {
|
|
1485
|
+
t.stopPropagation(), s(e.id);
|
|
1486
|
+
},
|
|
1487
|
+
"aria-label": `Delete node ${e.label}`,
|
|
1488
|
+
children: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-3 w-3" })
|
|
1489
|
+
})
|
|
1490
|
+
]
|
|
1491
|
+
});
|
|
1492
|
+
}, We = ({ node: e, edge: t, readOnly: n, onNodeChange: r, onEdgeChange: i }) => !e && !t ? /* @__PURE__ */ (0, G.jsx)("div", {
|
|
1493
|
+
className: "p-4 text-sm text-muted-foreground",
|
|
1494
|
+
children: "Select a node or edge to edit its properties."
|
|
1495
|
+
}) : e ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1496
|
+
className: "p-3 space-y-3 overflow-y-auto",
|
|
1497
|
+
children: [
|
|
1498
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1499
|
+
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1500
|
+
children: "Node Properties"
|
|
1501
|
+
}),
|
|
1502
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1503
|
+
className: "space-y-1",
|
|
1504
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1505
|
+
className: "text-xs",
|
|
1506
|
+
children: "Label"
|
|
1507
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1508
|
+
value: e.label,
|
|
1509
|
+
onChange: (t) => r({
|
|
1510
|
+
...e,
|
|
1511
|
+
label: t.target.value
|
|
1512
|
+
}),
|
|
1513
|
+
disabled: n,
|
|
1514
|
+
className: "h-7 text-xs"
|
|
1515
|
+
})]
|
|
1516
|
+
}),
|
|
1517
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1518
|
+
className: "space-y-1",
|
|
1519
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1520
|
+
className: "text-xs",
|
|
1521
|
+
children: "Type"
|
|
1522
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
1523
|
+
value: e.type,
|
|
1524
|
+
onValueChange: (t) => r({
|
|
1525
|
+
...e,
|
|
1526
|
+
type: t
|
|
1527
|
+
}),
|
|
1528
|
+
disabled: n,
|
|
1529
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
1530
|
+
className: "h-7 text-xs",
|
|
1531
|
+
children: /* @__PURE__ */ (0, G.jsx)(_, {})
|
|
1532
|
+
}), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys($).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
1533
|
+
value: e,
|
|
1534
|
+
className: "text-xs",
|
|
1535
|
+
children: $[e]
|
|
1536
|
+
}, e)) })]
|
|
1537
|
+
})]
|
|
1538
|
+
}),
|
|
1539
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1540
|
+
className: "space-y-1",
|
|
1541
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1542
|
+
className: "text-xs",
|
|
1543
|
+
children: "Description"
|
|
1544
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1545
|
+
value: e.description ?? "",
|
|
1546
|
+
onChange: (t) => r({
|
|
1547
|
+
...e,
|
|
1548
|
+
description: t.target.value
|
|
1549
|
+
}),
|
|
1550
|
+
disabled: n,
|
|
1551
|
+
className: "h-7 text-xs",
|
|
1552
|
+
placeholder: "Optional description"
|
|
1553
|
+
})]
|
|
1554
|
+
}),
|
|
1555
|
+
[
|
|
1556
|
+
"task",
|
|
1557
|
+
"user_task",
|
|
1558
|
+
"service_task",
|
|
1559
|
+
"script_task",
|
|
1560
|
+
"delay",
|
|
1561
|
+
"webhook"
|
|
1562
|
+
].includes(e.type) && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [
|
|
1563
|
+
/* @__PURE__ */ (0, G.jsx)(v, {}),
|
|
1564
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1565
|
+
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1566
|
+
children: "Executor"
|
|
1567
|
+
}),
|
|
1568
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1569
|
+
className: "space-y-1",
|
|
1570
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1571
|
+
className: "text-xs",
|
|
1572
|
+
children: "Executor Type"
|
|
1573
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1574
|
+
value: e.executor?.type ?? "",
|
|
1575
|
+
onChange: (t) => r({
|
|
1576
|
+
...e,
|
|
1577
|
+
executor: {
|
|
1578
|
+
...e.executor,
|
|
1579
|
+
type: t.target.value
|
|
1580
|
+
}
|
|
1581
|
+
}),
|
|
1582
|
+
disabled: n,
|
|
1583
|
+
className: "h-7 text-xs",
|
|
1584
|
+
placeholder: "e.g. http, script, email"
|
|
1585
|
+
})]
|
|
1586
|
+
}),
|
|
1587
|
+
e.type === "delay" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1588
|
+
className: "space-y-1",
|
|
1589
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1590
|
+
className: "text-xs",
|
|
1591
|
+
children: "Wait Event Type"
|
|
1592
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
1593
|
+
value: e.executor?.waitEventConfig?.eventType ?? "timer",
|
|
1594
|
+
onValueChange: (t) => r({
|
|
1595
|
+
...e,
|
|
1596
|
+
executor: {
|
|
1597
|
+
...e.executor,
|
|
1598
|
+
type: e.executor?.type ?? "wait",
|
|
1599
|
+
waitEventConfig: {
|
|
1600
|
+
...e.executor?.waitEventConfig,
|
|
1601
|
+
eventType: t
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
}),
|
|
1605
|
+
disabled: n,
|
|
1606
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
1607
|
+
className: "h-7 text-xs",
|
|
1608
|
+
children: /* @__PURE__ */ (0, G.jsx)(_, {})
|
|
1609
|
+
}), /* @__PURE__ */ (0, G.jsx)(m, { children: Object.keys(Ie).map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
1610
|
+
value: e,
|
|
1611
|
+
className: "text-xs",
|
|
1612
|
+
children: Ie[e]
|
|
1613
|
+
}, e)) })]
|
|
1614
|
+
})]
|
|
1615
|
+
}),
|
|
1616
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1617
|
+
className: "space-y-1",
|
|
1618
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1619
|
+
className: "text-xs",
|
|
1620
|
+
children: "Timeout (ms)"
|
|
1621
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1622
|
+
type: "number",
|
|
1623
|
+
value: e.executor?.timeoutMs ?? "",
|
|
1624
|
+
onChange: (t) => r({
|
|
1625
|
+
...e,
|
|
1626
|
+
executor: {
|
|
1627
|
+
...e.executor,
|
|
1628
|
+
type: e.executor?.type ?? "",
|
|
1629
|
+
timeoutMs: t.target.value ? Number(t.target.value) : void 0
|
|
1630
|
+
}
|
|
1631
|
+
}),
|
|
1632
|
+
disabled: n,
|
|
1633
|
+
className: "h-7 text-xs",
|
|
1634
|
+
placeholder: "e.g. 30000"
|
|
1635
|
+
})]
|
|
1636
|
+
})
|
|
1637
|
+
] }),
|
|
1638
|
+
e.type === "boundary_event" && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [
|
|
1639
|
+
/* @__PURE__ */ (0, G.jsx)(v, {}),
|
|
1640
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1641
|
+
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1642
|
+
children: "Boundary Config"
|
|
1643
|
+
}),
|
|
1644
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1645
|
+
className: "space-y-1",
|
|
1646
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1647
|
+
className: "text-xs",
|
|
1648
|
+
children: "Attached To Node ID"
|
|
1649
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1650
|
+
value: e.boundaryConfig?.attachedToNodeId ?? "",
|
|
1651
|
+
onChange: (t) => r({
|
|
1652
|
+
...e,
|
|
1653
|
+
boundaryConfig: {
|
|
1654
|
+
...e.boundaryConfig,
|
|
1655
|
+
attachedToNodeId: t.target.value,
|
|
1656
|
+
eventType: e.boundaryConfig?.eventType ?? "error"
|
|
1657
|
+
}
|
|
1658
|
+
}),
|
|
1659
|
+
disabled: n,
|
|
1660
|
+
className: "h-7 text-xs",
|
|
1661
|
+
placeholder: "Host node id"
|
|
1662
|
+
})]
|
|
1663
|
+
}),
|
|
1664
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1665
|
+
className: "space-y-1",
|
|
1666
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1667
|
+
className: "text-xs",
|
|
1668
|
+
children: "Event Type"
|
|
1669
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
1670
|
+
value: e.boundaryConfig?.eventType ?? "error",
|
|
1671
|
+
onValueChange: (t) => r({
|
|
1672
|
+
...e,
|
|
1673
|
+
boundaryConfig: {
|
|
1674
|
+
...e.boundaryConfig,
|
|
1675
|
+
attachedToNodeId: e.boundaryConfig?.attachedToNodeId ?? "",
|
|
1676
|
+
eventType: t
|
|
1677
|
+
}
|
|
1678
|
+
}),
|
|
1679
|
+
disabled: n,
|
|
1680
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
1681
|
+
className: "h-7 text-xs",
|
|
1682
|
+
children: /* @__PURE__ */ (0, G.jsx)(_, {})
|
|
1683
|
+
}), /* @__PURE__ */ (0, G.jsx)(m, { children: [
|
|
1684
|
+
"error",
|
|
1685
|
+
"timer",
|
|
1686
|
+
"message",
|
|
1687
|
+
"signal",
|
|
1688
|
+
"compensation"
|
|
1689
|
+
].map((e) => /* @__PURE__ */ (0, G.jsx)(h, {
|
|
1690
|
+
value: e,
|
|
1691
|
+
className: "text-xs capitalize",
|
|
1692
|
+
children: e
|
|
1693
|
+
}, e)) })]
|
|
1694
|
+
})]
|
|
1695
|
+
})
|
|
1696
|
+
] })
|
|
1697
|
+
]
|
|
1698
|
+
}) : t ? /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1699
|
+
className: "p-3 space-y-3 overflow-y-auto",
|
|
1700
|
+
children: [
|
|
1701
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1702
|
+
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1703
|
+
children: "Edge Properties"
|
|
1704
|
+
}),
|
|
1705
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1706
|
+
className: "space-y-1",
|
|
1707
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1708
|
+
className: "text-xs",
|
|
1709
|
+
children: "Label"
|
|
1710
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1711
|
+
value: t.label ?? "",
|
|
1712
|
+
onChange: (e) => i({
|
|
1713
|
+
...t,
|
|
1714
|
+
label: e.target.value
|
|
1715
|
+
}),
|
|
1716
|
+
disabled: n,
|
|
1717
|
+
className: "h-7 text-xs"
|
|
1718
|
+
})]
|
|
1719
|
+
}),
|
|
1720
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1721
|
+
className: "space-y-1",
|
|
1722
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1723
|
+
className: "text-xs",
|
|
1724
|
+
children: "Type"
|
|
1725
|
+
}), /* @__PURE__ */ (0, G.jsxs)(p, {
|
|
1726
|
+
value: t.type ?? "default",
|
|
1727
|
+
onValueChange: (e) => i({
|
|
1728
|
+
...t,
|
|
1729
|
+
type: e
|
|
1730
|
+
}),
|
|
1731
|
+
disabled: n,
|
|
1732
|
+
children: [/* @__PURE__ */ (0, G.jsx)(g, {
|
|
1733
|
+
className: "h-7 text-xs",
|
|
1734
|
+
children: /* @__PURE__ */ (0, G.jsx)(_, {})
|
|
1735
|
+
}), /* @__PURE__ */ (0, G.jsxs)(m, { children: [
|
|
1736
|
+
/* @__PURE__ */ (0, G.jsx)(h, {
|
|
1737
|
+
value: "default",
|
|
1738
|
+
className: "text-xs",
|
|
1739
|
+
children: "Default"
|
|
1740
|
+
}),
|
|
1741
|
+
/* @__PURE__ */ (0, G.jsx)(h, {
|
|
1742
|
+
value: "conditional",
|
|
1743
|
+
className: "text-xs",
|
|
1744
|
+
children: "Conditional"
|
|
1745
|
+
}),
|
|
1746
|
+
/* @__PURE__ */ (0, G.jsx)(h, {
|
|
1747
|
+
value: "timeout",
|
|
1748
|
+
className: "text-xs",
|
|
1749
|
+
children: "Timeout"
|
|
1750
|
+
})
|
|
1751
|
+
] })]
|
|
1752
|
+
})]
|
|
1753
|
+
}),
|
|
1754
|
+
t.type === "conditional" && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1755
|
+
className: "space-y-1",
|
|
1756
|
+
children: [/* @__PURE__ */ (0, G.jsx)(f, {
|
|
1757
|
+
className: "text-xs",
|
|
1758
|
+
children: "Condition Expression"
|
|
1759
|
+
}), /* @__PURE__ */ (0, G.jsx)(d, {
|
|
1760
|
+
value: t.condition ?? "",
|
|
1761
|
+
onChange: (e) => i({
|
|
1762
|
+
...t,
|
|
1763
|
+
condition: e.target.value
|
|
1764
|
+
}),
|
|
1765
|
+
disabled: n,
|
|
1766
|
+
className: "h-7 text-xs font-mono",
|
|
1767
|
+
placeholder: "e.g. status === 'approved'"
|
|
1768
|
+
})]
|
|
1769
|
+
}),
|
|
1770
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1771
|
+
className: "flex items-center gap-2",
|
|
1772
|
+
children: [/* @__PURE__ */ (0, G.jsx)("input", {
|
|
1773
|
+
type: "checkbox",
|
|
1774
|
+
id: "edge-isDefault",
|
|
1775
|
+
checked: t.isDefault ?? !1,
|
|
1776
|
+
onChange: (e) => i({
|
|
1777
|
+
...t,
|
|
1778
|
+
isDefault: e.target.checked
|
|
1779
|
+
}),
|
|
1780
|
+
disabled: n,
|
|
1781
|
+
className: "h-3.5 w-3.5"
|
|
1782
|
+
}), /* @__PURE__ */ (0, G.jsx)(f, {
|
|
1783
|
+
htmlFor: "edge-isDefault",
|
|
1784
|
+
className: "text-xs",
|
|
1785
|
+
children: "Default edge (isDefault)"
|
|
1786
|
+
})]
|
|
1787
|
+
})
|
|
1788
|
+
]
|
|
1789
|
+
}) : null, Ge = ({ versions: e }) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1790
|
+
className: "p-3 space-y-2",
|
|
1791
|
+
children: [
|
|
1792
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
1793
|
+
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
1794
|
+
children: "Version History"
|
|
1795
|
+
}),
|
|
1796
|
+
e.length === 0 && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1797
|
+
className: "text-xs text-muted-foreground",
|
|
1798
|
+
children: "No version history available."
|
|
1799
|
+
}),
|
|
1800
|
+
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
1801
|
+
className: "space-y-1.5",
|
|
1802
|
+
children: e.map((e) => /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1803
|
+
className: ke("rounded border p-2 text-xs", e.isCurrent ? "border-primary bg-primary/5" : "border-border bg-muted/30"),
|
|
1804
|
+
children: [
|
|
1805
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
1806
|
+
className: "flex items-center justify-between",
|
|
1807
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("span", {
|
|
1808
|
+
className: "font-medium",
|
|
1809
|
+
children: ["v", e.version]
|
|
1810
|
+
}), e.isCurrent && /* @__PURE__ */ (0, G.jsx)(a, {
|
|
1811
|
+
variant: "default",
|
|
1812
|
+
className: "text-[10px] h-4",
|
|
1813
|
+
children: "Current"
|
|
1814
|
+
})]
|
|
1815
|
+
}),
|
|
1816
|
+
e.changeNote && /* @__PURE__ */ (0, G.jsx)("p", {
|
|
1817
|
+
className: "text-muted-foreground mt-0.5",
|
|
1818
|
+
children: e.changeNote
|
|
1819
|
+
}),
|
|
1820
|
+
/* @__PURE__ */ (0, G.jsxs)("p", {
|
|
1821
|
+
className: "text-muted-foreground mt-0.5",
|
|
1822
|
+
children: [e.author && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [e.author, " · "] }), new Date(e.createdAt).toLocaleDateString()]
|
|
1823
|
+
})
|
|
1824
|
+
]
|
|
1825
|
+
}, e.version))
|
|
1826
|
+
})
|
|
1827
|
+
]
|
|
1828
|
+
}), Ke = ({ schema: e, onSave: f }) => {
|
|
1829
|
+
let { readOnly: p = !1, showToolbar: m = !0, showMinimap: h = !1, showVersionHistory: g = !1, showExecutionOverlay: _ = !1, executionSteps: y = [], versionHistory: b = [], concurrencyPolicy: x, title: S = "New Flow", description: C = "", status: w = "draft" } = e, [T, E] = i(S), [D, O] = i(C), { current: k, push: A, undo: j, redo: M, canUndo: re, canRedo: ie } = ze({
|
|
1830
|
+
nodes: e.nodes ?? Le(),
|
|
1831
|
+
edges: e.edges ?? Re()
|
|
1832
|
+
}), N = k.nodes, P = k.edges, [F, I] = i(null), [L, R] = i(null), [z, B] = i(!1), [V, H] = i(null), [he, ge] = i(!0), [U, _e] = i(g), [W, ve] = i(null), [K, ye] = i(1), q = r(null), be = n(() => N.find((e) => e.id === F) ?? null, [N, F]), xe = n(() => P.find((e) => e.id === L) ?? null, [P, L]), J = n(() => {
|
|
1833
|
+
if (!_ || y.length === 0) return N;
|
|
1834
|
+
let e = new Map(y.map((e) => [e.nodeId, e.status]));
|
|
1835
|
+
return N.map((t) => e.has(t.id) ? {
|
|
1836
|
+
...t,
|
|
1837
|
+
executionStatus: e.get(t.id)
|
|
1838
|
+
} : t);
|
|
1839
|
+
}, [
|
|
1840
|
+
N,
|
|
1841
|
+
_,
|
|
1842
|
+
y
|
|
1843
|
+
]), Se = t((e) => {
|
|
1844
|
+
if (p) return;
|
|
1845
|
+
let t = {
|
|
1846
|
+
id: `${e}-${Date.now()}`,
|
|
1847
|
+
type: e,
|
|
1848
|
+
label: $[e],
|
|
1849
|
+
position: {
|
|
1850
|
+
x: 200,
|
|
1851
|
+
y: 80 + N.length * 70
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
A({
|
|
1855
|
+
nodes: [...N, t],
|
|
1856
|
+
edges: P
|
|
1857
|
+
});
|
|
1858
|
+
}, [
|
|
1859
|
+
p,
|
|
1860
|
+
N,
|
|
1861
|
+
P,
|
|
1862
|
+
A
|
|
1863
|
+
]), Ce = t((e) => {
|
|
1864
|
+
p || (A({
|
|
1865
|
+
nodes: N.filter((t) => t.id !== e),
|
|
1866
|
+
edges: P.filter((t) => t.source !== e && t.target !== e)
|
|
1867
|
+
}), F === e && I(null));
|
|
1868
|
+
}, [
|
|
1869
|
+
p,
|
|
1870
|
+
N,
|
|
1871
|
+
P,
|
|
1872
|
+
A,
|
|
1873
|
+
F
|
|
1874
|
+
]), we = t((e) => {
|
|
1875
|
+
p || A({
|
|
1876
|
+
nodes: N.map((t) => t.id === e.id ? e : t),
|
|
1877
|
+
edges: P
|
|
1878
|
+
});
|
|
1879
|
+
}, [
|
|
1880
|
+
p,
|
|
1881
|
+
N,
|
|
1882
|
+
P,
|
|
1883
|
+
A
|
|
1884
|
+
]), Te = t((e) => {
|
|
1885
|
+
p || (A({
|
|
1886
|
+
nodes: N,
|
|
1887
|
+
edges: P.filter((t) => t.id !== e)
|
|
1888
|
+
}), L === e && R(null));
|
|
1889
|
+
}, [
|
|
1890
|
+
p,
|
|
1891
|
+
N,
|
|
1892
|
+
P,
|
|
1893
|
+
A,
|
|
1894
|
+
L
|
|
1895
|
+
]), Y = t((e) => {
|
|
1896
|
+
p || A({
|
|
1897
|
+
nodes: N,
|
|
1898
|
+
edges: P.map((t) => t.id === e.id ? e : t)
|
|
1899
|
+
});
|
|
1900
|
+
}, [
|
|
1901
|
+
p,
|
|
1902
|
+
N,
|
|
1903
|
+
P,
|
|
1904
|
+
A
|
|
1905
|
+
]), Ee = t((e) => {
|
|
1906
|
+
if (!p) {
|
|
1907
|
+
if (!z) {
|
|
1908
|
+
B(!0), H(e);
|
|
1909
|
+
return;
|
|
1910
|
+
}
|
|
1911
|
+
if (V && V !== e) {
|
|
1912
|
+
let t = {
|
|
1913
|
+
id: `edge-${Date.now()}`,
|
|
1914
|
+
source: V,
|
|
1915
|
+
target: e
|
|
1916
|
+
};
|
|
1917
|
+
A({
|
|
1918
|
+
nodes: N,
|
|
1919
|
+
edges: [...P, t]
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1922
|
+
B(!1), H(null);
|
|
1923
|
+
}
|
|
1924
|
+
}, [
|
|
1925
|
+
p,
|
|
1926
|
+
z,
|
|
1927
|
+
V,
|
|
1928
|
+
N,
|
|
1929
|
+
P,
|
|
1930
|
+
A
|
|
1931
|
+
]), X = r(null), Z = r(null), De = t((e, t) => {
|
|
1932
|
+
X.current = t;
|
|
1933
|
+
let n = N.find((e) => e.id === t);
|
|
1934
|
+
n && (Z.current = {
|
|
1935
|
+
mouseX: e.clientX,
|
|
1936
|
+
mouseY: e.clientY,
|
|
1937
|
+
nodeX: n.position.x,
|
|
1938
|
+
nodeY: n.position.y
|
|
1939
|
+
}), e.dataTransfer.effectAllowed = "move";
|
|
1940
|
+
}, [N]), Oe = t((e) => {
|
|
1941
|
+
if (e.preventDefault(), !X.current || !Z.current || !q.current) return;
|
|
1942
|
+
q.current.getBoundingClientRect();
|
|
1943
|
+
let t = (e.clientX - Z.current.mouseX) / K, n = (e.clientY - Z.current.mouseY) / K, r = Math.max(0, Z.current.nodeX + t), i = Math.max(0, Z.current.nodeY + n), a = X.current;
|
|
1944
|
+
A({
|
|
1945
|
+
nodes: N.map((e) => e.id === a ? {
|
|
1946
|
+
...e,
|
|
1947
|
+
position: {
|
|
1948
|
+
x: r,
|
|
1949
|
+
y: i
|
|
1950
|
+
}
|
|
1951
|
+
} : e),
|
|
1952
|
+
edges: P
|
|
1953
|
+
}), X.current = null, Z.current = null;
|
|
1954
|
+
}, [
|
|
1955
|
+
N,
|
|
1956
|
+
P,
|
|
1957
|
+
A,
|
|
1958
|
+
K
|
|
1959
|
+
]), ke = t(() => {
|
|
1960
|
+
let e = Be(N, P, T);
|
|
1961
|
+
ve(e);
|
|
1962
|
+
let t = new Blob([e.bpmnXml ?? ""], { type: "application/xml" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
1963
|
+
r.href = n, r.download = `${T.replace(/\s+/g, "-").toLowerCase()}.bpmn`, r.click(), URL.revokeObjectURL(n);
|
|
1964
|
+
}, [
|
|
1965
|
+
N,
|
|
1966
|
+
P,
|
|
1967
|
+
T
|
|
1968
|
+
]), Q = t(() => {
|
|
1969
|
+
f?.(N, P);
|
|
1970
|
+
}, [
|
|
1971
|
+
N,
|
|
1972
|
+
P,
|
|
1973
|
+
f
|
|
1974
|
+
]);
|
|
1975
|
+
return /* @__PURE__ */ (0, G.jsxs)(s, {
|
|
1976
|
+
className: "flex flex-col h-full min-h-[600px] outline-none",
|
|
1977
|
+
tabIndex: 0,
|
|
1978
|
+
onKeyDown: t((e) => {
|
|
1979
|
+
let t = e.ctrlKey || e.metaKey;
|
|
1980
|
+
if (t && e.key === "z" && !e.shiftKey) {
|
|
1981
|
+
e.preventDefault(), j();
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
if (t && (e.key === "y" || e.key === "z" && e.shiftKey)) {
|
|
1985
|
+
e.preventDefault(), M();
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1988
|
+
if (t && e.key === "s") {
|
|
1989
|
+
e.preventDefault(), Q();
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
e.key === "Escape" && (B(!1), H(null), I(null), R(null)), (e.key === "Delete" || e.key === "Backspace") && (F ? Ce(F) : L && Te(L));
|
|
1993
|
+
}, [
|
|
1994
|
+
j,
|
|
1995
|
+
M,
|
|
1996
|
+
Q,
|
|
1997
|
+
F,
|
|
1998
|
+
L,
|
|
1999
|
+
Ce,
|
|
2000
|
+
Te
|
|
2001
|
+
]),
|
|
2002
|
+
children: [/* @__PURE__ */ (0, G.jsx)(l, {
|
|
2003
|
+
className: "py-2 px-4 border-b flex-shrink-0",
|
|
2004
|
+
children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2005
|
+
className: "flex items-center gap-3 flex-wrap",
|
|
2006
|
+
children: [
|
|
2007
|
+
/* @__PURE__ */ (0, G.jsx)(fe, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
2008
|
+
/* @__PURE__ */ (0, G.jsx)(u, {
|
|
2009
|
+
className: "text-sm font-semibold",
|
|
2010
|
+
children: p ? /* @__PURE__ */ (0, G.jsx)("span", { children: T }) : /* @__PURE__ */ (0, G.jsx)(d, {
|
|
2011
|
+
value: T,
|
|
2012
|
+
onChange: (e) => E(e.target.value),
|
|
2013
|
+
className: "h-6 text-sm font-semibold border-0 p-0 focus-visible:ring-0 bg-transparent",
|
|
2014
|
+
"aria-label": "Flow title"
|
|
2015
|
+
})
|
|
2016
|
+
}),
|
|
2017
|
+
/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2018
|
+
variant: "outline",
|
|
2019
|
+
className: "text-xs capitalize",
|
|
2020
|
+
children: w
|
|
2021
|
+
}),
|
|
2022
|
+
x && /* @__PURE__ */ (0, G.jsx)(a, {
|
|
2023
|
+
variant: "secondary",
|
|
2024
|
+
className: "text-xs",
|
|
2025
|
+
children: Fe[x]
|
|
2026
|
+
}),
|
|
2027
|
+
/* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2028
|
+
className: "ml-auto flex items-center gap-1",
|
|
2029
|
+
children: [
|
|
2030
|
+
!p && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [
|
|
2031
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2032
|
+
size: "icon",
|
|
2033
|
+
variant: "ghost",
|
|
2034
|
+
className: "h-7 w-7",
|
|
2035
|
+
onClick: j,
|
|
2036
|
+
disabled: !re,
|
|
2037
|
+
title: "Undo (Ctrl+Z)",
|
|
2038
|
+
children: /* @__PURE__ */ (0, G.jsx)(ue, { className: "h-4 w-4" })
|
|
2039
|
+
}),
|
|
2040
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2041
|
+
size: "icon",
|
|
2042
|
+
variant: "ghost",
|
|
2043
|
+
className: "h-7 w-7",
|
|
2044
|
+
onClick: M,
|
|
2045
|
+
disabled: !ie,
|
|
2046
|
+
title: "Redo (Ctrl+Y)",
|
|
2047
|
+
children: /* @__PURE__ */ (0, G.jsx)(se, { className: "h-4 w-4" })
|
|
2048
|
+
}),
|
|
2049
|
+
/* @__PURE__ */ (0, G.jsx)(v, {
|
|
2050
|
+
orientation: "vertical",
|
|
2051
|
+
className: "h-5 mx-1"
|
|
2052
|
+
})
|
|
2053
|
+
] }),
|
|
2054
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2055
|
+
size: "icon",
|
|
2056
|
+
variant: "ghost",
|
|
2057
|
+
className: "h-7 w-7",
|
|
2058
|
+
onClick: () => ye((e) => Math.min(2, e + .1)),
|
|
2059
|
+
title: "Zoom in",
|
|
2060
|
+
children: /* @__PURE__ */ (0, G.jsx)(pe, { className: "h-4 w-4" })
|
|
2061
|
+
}),
|
|
2062
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2063
|
+
size: "icon",
|
|
2064
|
+
variant: "ghost",
|
|
2065
|
+
className: "h-7 w-7",
|
|
2066
|
+
onClick: () => ye(1),
|
|
2067
|
+
title: "Reset zoom",
|
|
2068
|
+
children: /* @__PURE__ */ (0, G.jsx)(ce, { className: "h-4 w-4" })
|
|
2069
|
+
}),
|
|
2070
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2071
|
+
size: "icon",
|
|
2072
|
+
variant: "ghost",
|
|
2073
|
+
className: "h-7 w-7",
|
|
2074
|
+
onClick: () => ye((e) => Math.max(.3, e - .1)),
|
|
2075
|
+
title: "Zoom out",
|
|
2076
|
+
children: /* @__PURE__ */ (0, G.jsx)(me, { className: "h-4 w-4" })
|
|
2077
|
+
}),
|
|
2078
|
+
/* @__PURE__ */ (0, G.jsx)(v, {
|
|
2079
|
+
orientation: "vertical",
|
|
2080
|
+
className: "h-5 mx-1"
|
|
2081
|
+
}),
|
|
2082
|
+
b.length > 0 && /* @__PURE__ */ (0, G.jsx)(o, {
|
|
2083
|
+
size: "icon",
|
|
2084
|
+
variant: U ? "secondary" : "ghost",
|
|
2085
|
+
className: "h-7 w-7",
|
|
2086
|
+
onClick: () => _e((e) => !e),
|
|
2087
|
+
title: "Version history",
|
|
2088
|
+
children: /* @__PURE__ */ (0, G.jsx)(te, { className: "h-4 w-4" })
|
|
2089
|
+
}),
|
|
2090
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2091
|
+
size: "icon",
|
|
2092
|
+
variant: "ghost",
|
|
2093
|
+
className: "h-7 w-7",
|
|
2094
|
+
onClick: ke,
|
|
2095
|
+
title: "Export BPMN",
|
|
2096
|
+
children: /* @__PURE__ */ (0, G.jsx)(ee, { className: "h-4 w-4" })
|
|
2097
|
+
}),
|
|
2098
|
+
!p && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2099
|
+
size: "icon",
|
|
2100
|
+
variant: "ghost",
|
|
2101
|
+
className: "h-7 w-7",
|
|
2102
|
+
title: "Import BPMN (drag & drop)",
|
|
2103
|
+
children: /* @__PURE__ */ (0, G.jsx)(de, { className: "h-4 w-4" })
|
|
2104
|
+
}), /* @__PURE__ */ (0, G.jsxs)(o, {
|
|
2105
|
+
size: "sm",
|
|
2106
|
+
variant: "default",
|
|
2107
|
+
className: "h-7 text-xs gap-1",
|
|
2108
|
+
onClick: Q,
|
|
2109
|
+
title: "Save (Ctrl+S)",
|
|
2110
|
+
children: [/* @__PURE__ */ (0, G.jsx)(le, { className: "h-3.5 w-3.5" }), " Save"]
|
|
2111
|
+
})] }),
|
|
2112
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2113
|
+
size: "icon",
|
|
2114
|
+
variant: "ghost",
|
|
2115
|
+
className: "h-7 w-7",
|
|
2116
|
+
onClick: () => ge((e) => !e),
|
|
2117
|
+
title: he ? "Hide properties" : "Show properties",
|
|
2118
|
+
children: he ? /* @__PURE__ */ (0, G.jsx)(ae, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, G.jsx)(oe, { className: "h-4 w-4" })
|
|
2119
|
+
})
|
|
2120
|
+
]
|
|
2121
|
+
})
|
|
2122
|
+
]
|
|
2123
|
+
})
|
|
2124
|
+
}), /* @__PURE__ */ (0, G.jsxs)(c, {
|
|
2125
|
+
className: "flex flex-1 p-0 overflow-hidden",
|
|
2126
|
+
children: [
|
|
2127
|
+
m && !p && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2128
|
+
className: "w-36 border-r bg-muted/30 flex-shrink-0 overflow-y-auto py-2 px-2",
|
|
2129
|
+
children: [
|
|
2130
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2131
|
+
className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2 px-1",
|
|
2132
|
+
children: "Add Node"
|
|
2133
|
+
}),
|
|
2134
|
+
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
2135
|
+
className: "space-y-1",
|
|
2136
|
+
children: Pe.map((e) => /* @__PURE__ */ (0, G.jsxs)("button", {
|
|
2137
|
+
className: "w-full flex items-center gap-2 text-xs px-2 py-1.5 rounded hover:bg-muted transition-colors text-left",
|
|
2138
|
+
onClick: () => Se(e),
|
|
2139
|
+
title: `Add ${$[e]}`,
|
|
2140
|
+
children: [je[e], /* @__PURE__ */ (0, G.jsx)("span", {
|
|
2141
|
+
className: "truncate",
|
|
2142
|
+
children: $[e]
|
|
2143
|
+
})]
|
|
2144
|
+
}, e))
|
|
2145
|
+
}),
|
|
2146
|
+
z && /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)(v, { className: "my-2" }), /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2147
|
+
className: "px-1",
|
|
2148
|
+
children: [
|
|
2149
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2150
|
+
className: "text-[10px] text-blue-600 font-medium",
|
|
2151
|
+
children: "Connect mode"
|
|
2152
|
+
}),
|
|
2153
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2154
|
+
className: "text-[10px] text-muted-foreground",
|
|
2155
|
+
children: "Click a target node port to connect."
|
|
2156
|
+
}),
|
|
2157
|
+
/* @__PURE__ */ (0, G.jsx)(o, {
|
|
2158
|
+
size: "sm",
|
|
2159
|
+
variant: "outline",
|
|
2160
|
+
className: "h-6 text-xs mt-1 w-full",
|
|
2161
|
+
onClick: () => {
|
|
2162
|
+
B(!1), H(null);
|
|
2163
|
+
},
|
|
2164
|
+
children: "Cancel"
|
|
2165
|
+
})
|
|
2166
|
+
]
|
|
2167
|
+
})] })
|
|
2168
|
+
]
|
|
2169
|
+
}),
|
|
2170
|
+
/* @__PURE__ */ (0, G.jsx)("div", {
|
|
2171
|
+
className: "flex-1 overflow-auto relative bg-dot-pattern",
|
|
2172
|
+
children: /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2173
|
+
ref: q,
|
|
2174
|
+
className: "relative",
|
|
2175
|
+
style: {
|
|
2176
|
+
width: 1200,
|
|
2177
|
+
height: 700,
|
|
2178
|
+
transform: `scale(${K})`,
|
|
2179
|
+
transformOrigin: "top left"
|
|
2180
|
+
},
|
|
2181
|
+
onDrop: Oe,
|
|
2182
|
+
onDragOver: (e) => e.preventDefault(),
|
|
2183
|
+
onClick: (e) => {
|
|
2184
|
+
e.target === q.current && (I(null), R(null));
|
|
2185
|
+
},
|
|
2186
|
+
children: [
|
|
2187
|
+
/* @__PURE__ */ (0, G.jsxs)("svg", {
|
|
2188
|
+
className: "absolute inset-0 pointer-events-none",
|
|
2189
|
+
width: 1200,
|
|
2190
|
+
height: 700,
|
|
2191
|
+
style: { overflow: "visible" },
|
|
2192
|
+
children: [/* @__PURE__ */ (0, G.jsxs)("defs", { children: [
|
|
2193
|
+
/* @__PURE__ */ (0, G.jsx)("marker", {
|
|
2194
|
+
id: "fd-arrowhead",
|
|
2195
|
+
markerWidth: "10",
|
|
2196
|
+
markerHeight: "7",
|
|
2197
|
+
refX: "9",
|
|
2198
|
+
refY: "3.5",
|
|
2199
|
+
orient: "auto",
|
|
2200
|
+
children: /* @__PURE__ */ (0, G.jsx)("polygon", {
|
|
2201
|
+
points: "0 0, 10 3.5, 0 7",
|
|
2202
|
+
fill: "hsl(var(--foreground) / 0.5)"
|
|
2203
|
+
})
|
|
2204
|
+
}),
|
|
2205
|
+
/* @__PURE__ */ (0, G.jsx)("marker", {
|
|
2206
|
+
id: "fd-arrowhead-selected",
|
|
2207
|
+
markerWidth: "10",
|
|
2208
|
+
markerHeight: "7",
|
|
2209
|
+
refX: "9",
|
|
2210
|
+
refY: "3.5",
|
|
2211
|
+
orient: "auto",
|
|
2212
|
+
children: /* @__PURE__ */ (0, G.jsx)("polygon", {
|
|
2213
|
+
points: "0 0, 10 3.5, 0 7",
|
|
2214
|
+
fill: "hsl(var(--primary))"
|
|
2215
|
+
})
|
|
2216
|
+
}),
|
|
2217
|
+
/* @__PURE__ */ (0, G.jsx)("marker", {
|
|
2218
|
+
id: "fd-arrowhead-conditional",
|
|
2219
|
+
markerWidth: "10",
|
|
2220
|
+
markerHeight: "7",
|
|
2221
|
+
refX: "9",
|
|
2222
|
+
refY: "3.5",
|
|
2223
|
+
orient: "auto",
|
|
2224
|
+
children: /* @__PURE__ */ (0, G.jsx)("polygon", {
|
|
2225
|
+
points: "0 0, 10 3.5, 0 7",
|
|
2226
|
+
fill: "hsl(var(--foreground) / 0.6)"
|
|
2227
|
+
})
|
|
2228
|
+
})
|
|
2229
|
+
] }), P.map((e) => {
|
|
2230
|
+
let t = J.find((t) => t.id === e.source), n = J.find((t) => t.id === e.target);
|
|
2231
|
+
if (!t || !n) return null;
|
|
2232
|
+
let { d: r, labelX: i, labelY: a } = He(t, n), o = e.id === L, s = e.type === "conditional", c = e.isDefault;
|
|
2233
|
+
return /* @__PURE__ */ (0, G.jsxs)("g", {
|
|
2234
|
+
className: "pointer-events-auto cursor-pointer",
|
|
2235
|
+
onClick: (t) => {
|
|
2236
|
+
t.stopPropagation(), R(e.id), I(null);
|
|
2237
|
+
},
|
|
2238
|
+
children: [
|
|
2239
|
+
/* @__PURE__ */ (0, G.jsx)("path", {
|
|
2240
|
+
d: r,
|
|
2241
|
+
fill: "none",
|
|
2242
|
+
stroke: o ? "hsl(var(--primary))" : s ? "hsl(var(--foreground) / 0.6)" : "hsl(var(--foreground) / 0.4)",
|
|
2243
|
+
strokeWidth: o ? 2.5 : 2,
|
|
2244
|
+
strokeDasharray: s ? "6 3" : c ? "3 3" : void 0,
|
|
2245
|
+
markerEnd: `url(#fd-arrowhead${o ? "-selected" : s ? "-conditional" : ""})`
|
|
2246
|
+
}),
|
|
2247
|
+
(e.label || c) && /* @__PURE__ */ (0, G.jsx)("text", {
|
|
2248
|
+
x: i,
|
|
2249
|
+
y: a,
|
|
2250
|
+
textAnchor: "middle",
|
|
2251
|
+
className: "text-[10px] fill-muted-foreground",
|
|
2252
|
+
style: { fontSize: 10 },
|
|
2253
|
+
children: e.label ?? (c ? "(default)" : "")
|
|
2254
|
+
}),
|
|
2255
|
+
e.condition && /* @__PURE__ */ (0, G.jsx)("text", {
|
|
2256
|
+
x: i,
|
|
2257
|
+
y: a + 12,
|
|
2258
|
+
textAnchor: "middle",
|
|
2259
|
+
className: "text-[9px] fill-orange-500",
|
|
2260
|
+
style: { fontSize: 9 },
|
|
2261
|
+
children: e.condition.length > 24 ? e.condition.slice(0, 24) + "…" : e.condition
|
|
2262
|
+
}),
|
|
2263
|
+
/* @__PURE__ */ (0, G.jsx)("path", {
|
|
2264
|
+
d: r,
|
|
2265
|
+
fill: "none",
|
|
2266
|
+
stroke: "transparent",
|
|
2267
|
+
strokeWidth: 12
|
|
2268
|
+
})
|
|
2269
|
+
]
|
|
2270
|
+
}, e.id);
|
|
2271
|
+
})]
|
|
2272
|
+
}),
|
|
2273
|
+
J.map((e) => /* @__PURE__ */ (0, G.jsx)(Ue, {
|
|
2274
|
+
node: e,
|
|
2275
|
+
isSelected: F === e.id,
|
|
2276
|
+
isConnectSource: V === e.id,
|
|
2277
|
+
connectMode: z,
|
|
2278
|
+
readOnly: p,
|
|
2279
|
+
showExecutionOverlay: _,
|
|
2280
|
+
onSelect: (e, t) => {
|
|
2281
|
+
t || R(null), I(e);
|
|
2282
|
+
},
|
|
2283
|
+
onDelete: Ce,
|
|
2284
|
+
onDragStart: De,
|
|
2285
|
+
onPortClick: Ee
|
|
2286
|
+
}, e.id)),
|
|
2287
|
+
z && V && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2288
|
+
className: "absolute bottom-4 left-1/2 -translate-x-1/2 bg-blue-600 text-white text-xs px-3 py-1.5 rounded shadow-lg pointer-events-none",
|
|
2289
|
+
children: [/* @__PURE__ */ (0, G.jsx)(ne, { className: "h-3 w-3 inline mr-1" }), "Click a node port to complete the connection — Esc to cancel"]
|
|
2290
|
+
}),
|
|
2291
|
+
N.length === 0 && /* @__PURE__ */ (0, G.jsx)("div", {
|
|
2292
|
+
className: "absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",
|
|
2293
|
+
children: "No nodes yet. Use the toolbar to add nodes."
|
|
2294
|
+
})
|
|
2295
|
+
]
|
|
2296
|
+
})
|
|
2297
|
+
}),
|
|
2298
|
+
U && b.length > 0 && /* @__PURE__ */ (0, G.jsx)("div", {
|
|
2299
|
+
className: "w-48 border-l bg-background flex-shrink-0 overflow-y-auto",
|
|
2300
|
+
children: /* @__PURE__ */ (0, G.jsx)(Ge, { versions: b })
|
|
2301
|
+
}),
|
|
2302
|
+
he && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2303
|
+
className: "w-52 border-l bg-background flex-shrink-0 overflow-y-auto",
|
|
2304
|
+
children: [/* @__PURE__ */ (0, G.jsx)(We, {
|
|
2305
|
+
node: be,
|
|
2306
|
+
edge: xe,
|
|
2307
|
+
readOnly: p,
|
|
2308
|
+
onNodeChange: we,
|
|
2309
|
+
onEdgeChange: Y
|
|
2310
|
+
}), W && /* @__PURE__ */ (0, G.jsxs)("div", {
|
|
2311
|
+
className: "p-3 border-t",
|
|
2312
|
+
children: [
|
|
2313
|
+
/* @__PURE__ */ (0, G.jsx)("p", {
|
|
2314
|
+
className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1",
|
|
2315
|
+
children: "BPMN Export"
|
|
2316
|
+
}),
|
|
2317
|
+
/* @__PURE__ */ (0, G.jsx)(a, {
|
|
2318
|
+
variant: W.success ? "default" : "destructive",
|
|
2319
|
+
className: "text-[10px]",
|
|
2320
|
+
children: W.success ? `Exported ${W.nodeCount} nodes` : "Export failed"
|
|
2321
|
+
}),
|
|
2322
|
+
W.warnings?.map((e, t) => /* @__PURE__ */ (0, G.jsx)("p", {
|
|
2323
|
+
className: "text-[10px] text-amber-600 mt-0.5",
|
|
2324
|
+
children: e
|
|
2325
|
+
}, t))
|
|
2326
|
+
]
|
|
2327
|
+
})]
|
|
2328
|
+
})
|
|
2329
|
+
]
|
|
2330
|
+
})]
|
|
2331
|
+
});
|
|
1878
2332
|
};
|
|
2333
|
+
e.register("workflow-designer", be, {
|
|
2334
|
+
label: "Workflow Designer",
|
|
2335
|
+
category: "Enterprise",
|
|
2336
|
+
inputs: [
|
|
2337
|
+
{
|
|
2338
|
+
name: "workflow",
|
|
2339
|
+
type: "code",
|
|
2340
|
+
label: "Initial Workflow Definition"
|
|
2341
|
+
},
|
|
2342
|
+
{
|
|
2343
|
+
name: "readOnly",
|
|
2344
|
+
type: "boolean",
|
|
2345
|
+
label: "Read Only",
|
|
2346
|
+
defaultValue: !1
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
name: "showToolbar",
|
|
2350
|
+
type: "boolean",
|
|
2351
|
+
label: "Show Toolbar",
|
|
2352
|
+
defaultValue: !0
|
|
2353
|
+
},
|
|
2354
|
+
{
|
|
2355
|
+
name: "showMinimap",
|
|
2356
|
+
type: "boolean",
|
|
2357
|
+
label: "Show Minimap",
|
|
2358
|
+
defaultValue: !1
|
|
2359
|
+
}
|
|
2360
|
+
]
|
|
2361
|
+
}), e.register("approval-process", xe, {
|
|
2362
|
+
label: "Approval Process",
|
|
2363
|
+
category: "Enterprise",
|
|
2364
|
+
inputs: [
|
|
2365
|
+
{
|
|
2366
|
+
name: "workflowId",
|
|
2367
|
+
type: "string",
|
|
2368
|
+
label: "Workflow ID"
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
name: "instanceId",
|
|
2372
|
+
type: "string",
|
|
2373
|
+
label: "Instance ID"
|
|
2374
|
+
},
|
|
2375
|
+
{
|
|
2376
|
+
name: "currentNodeId",
|
|
2377
|
+
type: "string",
|
|
2378
|
+
label: "Current Node ID"
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
name: "approvalRule",
|
|
2382
|
+
type: "code",
|
|
2383
|
+
label: "Approval Rule"
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
name: "history",
|
|
2387
|
+
type: "code",
|
|
2388
|
+
label: "History"
|
|
2389
|
+
},
|
|
2390
|
+
{
|
|
2391
|
+
name: "showHistory",
|
|
2392
|
+
type: "boolean",
|
|
2393
|
+
label: "Show History",
|
|
2394
|
+
defaultValue: !0
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
name: "showComments",
|
|
2398
|
+
type: "boolean",
|
|
2399
|
+
label: "Show Comments",
|
|
2400
|
+
defaultValue: !0
|
|
2401
|
+
}
|
|
2402
|
+
]
|
|
2403
|
+
}), e.register("automation-builder", Ee, {
|
|
2404
|
+
label: "Automation Builder",
|
|
2405
|
+
category: "Enterprise",
|
|
2406
|
+
inputs: [{
|
|
2407
|
+
name: "automation",
|
|
2408
|
+
type: "code",
|
|
2409
|
+
label: "Automation Definition"
|
|
2410
|
+
}, {
|
|
2411
|
+
name: "objects",
|
|
2412
|
+
type: "code",
|
|
2413
|
+
label: "Available Objects"
|
|
2414
|
+
}]
|
|
2415
|
+
}), e.register("automation-run-history", Oe, {
|
|
2416
|
+
label: "Automation Run History",
|
|
2417
|
+
category: "Enterprise",
|
|
2418
|
+
inputs: [{
|
|
2419
|
+
name: "runs",
|
|
2420
|
+
type: "code",
|
|
2421
|
+
label: "Run History"
|
|
2422
|
+
}]
|
|
2423
|
+
}), e.register("flow-designer", Ke, {
|
|
2424
|
+
label: "Flow Designer",
|
|
2425
|
+
category: "Enterprise",
|
|
2426
|
+
inputs: [
|
|
2427
|
+
{
|
|
2428
|
+
name: "nodes",
|
|
2429
|
+
type: "code",
|
|
2430
|
+
label: "Flow Nodes"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
name: "edges",
|
|
2434
|
+
type: "code",
|
|
2435
|
+
label: "Flow Edges"
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
name: "title",
|
|
2439
|
+
type: "string",
|
|
2440
|
+
label: "Flow Title"
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
name: "readOnly",
|
|
2444
|
+
type: "boolean",
|
|
2445
|
+
label: "Read Only",
|
|
2446
|
+
defaultValue: !1
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
name: "showToolbar",
|
|
2450
|
+
type: "boolean",
|
|
2451
|
+
label: "Show Toolbar",
|
|
2452
|
+
defaultValue: !0
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
name: "showMinimap",
|
|
2456
|
+
type: "boolean",
|
|
2457
|
+
label: "Show Minimap",
|
|
2458
|
+
defaultValue: !1
|
|
2459
|
+
},
|
|
2460
|
+
{
|
|
2461
|
+
name: "showVersionHistory",
|
|
2462
|
+
type: "boolean",
|
|
2463
|
+
label: "Show Version History",
|
|
2464
|
+
defaultValue: !1
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
name: "showExecutionOverlay",
|
|
2468
|
+
type: "boolean",
|
|
2469
|
+
label: "Show Execution Overlay",
|
|
2470
|
+
defaultValue: !1
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
name: "concurrencyPolicy",
|
|
2474
|
+
type: "string",
|
|
2475
|
+
label: "Concurrency Policy"
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
name: "versionHistory",
|
|
2479
|
+
type: "code",
|
|
2480
|
+
label: "Version History"
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
name: "executionSteps",
|
|
2484
|
+
type: "code",
|
|
2485
|
+
label: "Execution Steps"
|
|
2486
|
+
}
|
|
2487
|
+
]
|
|
2488
|
+
});
|
|
2489
|
+
//#endregion
|
|
2490
|
+
export { xe as ApprovalProcess, Ee as AutomationBuilder, Oe as AutomationRunHistory, Ke as FlowDesigner, be as WorkflowDesigner };
|