@almadar/std 14.27.0 → 14.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  2. package/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  3. package/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  4. package/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  5. package/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  6. package/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  7. package/behaviors/registry/core/atoms/std-board.orb +1367 -0
  8. package/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  9. package/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  10. package/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  11. package/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  12. package/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  13. package/dist/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  14. package/dist/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  15. package/dist/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  16. package/dist/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  17. package/dist/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  18. package/dist/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  19. package/dist/behaviors/registry/core/atoms/std-board.orb +1367 -0
  20. package/dist/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  21. package/dist/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  22. package/dist/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  23. package/dist/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  24. package/dist/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  25. package/package.json +1 -1
@@ -0,0 +1,1367 @@
1
+ {
2
+ "name": "std-board",
3
+ "version": "1.0.0",
4
+ "description": "std-board — generic N-column board primitive. `config.columns` is an array of column definitions ({ key, label, icon, variant }); the trait `array/map`s them on `BoardItemsLoaded` into `@entity.boards` where each board carries its filtered items + a count. The render is a `data-grid` over `@entity.boards` (one card per column) whose `renderItem` lambda nests a `data-list` over `@col.items` (the cards in that stage). N is config-driven — pass any number of columns; the outer `data-grid`'s `cols` is bound to `@config.gridCols` so the grid wraps if you exceed it. Topology = loading / viewing_board / viewing_card / adding / error — distinct from the cookie-cutter `loading/browsing/viewing_single/error` CRUD shape. App-level atoms (e.g. std-pipeline) compose std-board via `uses` and add a sibling persistor + extended source entity.",
5
+ "orbitals": [
6
+ {
7
+ "name": "BoardOrbital",
8
+ "entity": {
9
+ "name": "BoardView",
10
+ "collection": "board_items",
11
+ "persistence": "persistent",
12
+ "fields": [
13
+ {
14
+ "name": "id",
15
+ "type": "string",
16
+ "required": true
17
+ },
18
+ {
19
+ "name": "title",
20
+ "type": "string",
21
+ "required": true
22
+ },
23
+ {
24
+ "name": "description",
25
+ "type": "string",
26
+ "default": ""
27
+ },
28
+ {
29
+ "name": "stage",
30
+ "type": "string",
31
+ "default": "todo",
32
+ "values": [
33
+ "todo",
34
+ "doing",
35
+ "done"
36
+ ]
37
+ },
38
+ {
39
+ "name": "notes",
40
+ "type": "string",
41
+ "default": ""
42
+ },
43
+ {
44
+ "name": "position",
45
+ "type": "number",
46
+ "default": 0.0
47
+ },
48
+ {
49
+ "name": "boards",
50
+ "type": "array",
51
+ "default": [],
52
+ "items": {
53
+ "type": "object",
54
+ "properties": {
55
+ "items": {
56
+ "name": "items",
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "description": {
62
+ "name": "description",
63
+ "type": "string"
64
+ },
65
+ "id": {
66
+ "name": "id",
67
+ "type": "string"
68
+ },
69
+ "stage": {
70
+ "name": "stage",
71
+ "type": "string"
72
+ },
73
+ "notes": {
74
+ "name": "notes",
75
+ "type": "string"
76
+ },
77
+ "position": {
78
+ "name": "position",
79
+ "type": "number"
80
+ },
81
+ "title": {
82
+ "name": "title",
83
+ "type": "string"
84
+ }
85
+ }
86
+ }
87
+ },
88
+ "label": {
89
+ "name": "label",
90
+ "type": "string"
91
+ },
92
+ "icon": {
93
+ "name": "icon",
94
+ "type": "string"
95
+ },
96
+ "key": {
97
+ "name": "key",
98
+ "type": "string"
99
+ },
100
+ "variant": {
101
+ "name": "variant",
102
+ "type": "string",
103
+ "values": [
104
+ "default",
105
+ "primary",
106
+ "success",
107
+ "warning",
108
+ "error",
109
+ "info"
110
+ ]
111
+ },
112
+ "count": {
113
+ "name": "count",
114
+ "type": "number"
115
+ }
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "name": "currentId",
121
+ "type": "string",
122
+ "default": ""
123
+ },
124
+ {
125
+ "name": "currentTitle",
126
+ "type": "string",
127
+ "default": ""
128
+ },
129
+ {
130
+ "name": "currentDescription",
131
+ "type": "string",
132
+ "default": ""
133
+ },
134
+ {
135
+ "name": "currentStage",
136
+ "type": "string",
137
+ "default": ""
138
+ },
139
+ {
140
+ "name": "currentNotes",
141
+ "type": "string",
142
+ "default": ""
143
+ },
144
+ {
145
+ "name": "errorMessage",
146
+ "type": "string",
147
+ "default": ""
148
+ }
149
+ ]
150
+ },
151
+ "traits": [
152
+ {
153
+ "name": "BoardItemBoard",
154
+ "category": "interaction",
155
+ "linkedEntity": "BoardView",
156
+ "emits": [
157
+ {
158
+ "event": "OPEN_CARD",
159
+ "payloadSchema": [
160
+ {
161
+ "name": "id",
162
+ "type": "string",
163
+ "required": true
164
+ },
165
+ {
166
+ "name": "row",
167
+ "type": "object",
168
+ "required": true
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "event": "CLOSE_CARD"
174
+ },
175
+ {
176
+ "event": "ADD_CARD"
177
+ },
178
+ {
179
+ "event": "CANCEL_ADD"
180
+ },
181
+ {
182
+ "event": "SAVE_CARD",
183
+ "payloadSchema": [
184
+ {
185
+ "name": "data",
186
+ "type": "object",
187
+ "required": true
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "event": "MOVE_CARD",
193
+ "payloadSchema": [
194
+ {
195
+ "name": "id",
196
+ "type": "string",
197
+ "required": true
198
+ },
199
+ {
200
+ "name": "sourceGroup",
201
+ "type": "string"
202
+ },
203
+ {
204
+ "name": "targetGroup",
205
+ "type": "string",
206
+ "required": true
207
+ },
208
+ {
209
+ "name": "newIndex",
210
+ "type": "number"
211
+ }
212
+ ]
213
+ },
214
+ {
215
+ "event": "REORDER_CARD",
216
+ "payloadSchema": [
217
+ {
218
+ "name": "id",
219
+ "type": "string",
220
+ "required": true
221
+ },
222
+ {
223
+ "name": "oldIndex",
224
+ "type": "number"
225
+ },
226
+ {
227
+ "name": "newIndex",
228
+ "type": "number"
229
+ }
230
+ ]
231
+ },
232
+ {
233
+ "event": "DELETE_CARD",
234
+ "payloadSchema": [
235
+ {
236
+ "name": "id",
237
+ "type": "string",
238
+ "required": true
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "event": "BoardItemsLoaded",
244
+ "payloadSchema": [
245
+ {
246
+ "name": "data",
247
+ "type": "[object]"
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "event": "BoardItemsLoadFailed",
253
+ "payloadSchema": [
254
+ {
255
+ "name": "error",
256
+ "type": "string"
257
+ },
258
+ {
259
+ "name": "code",
260
+ "type": "string"
261
+ }
262
+ ]
263
+ },
264
+ {
265
+ "event": "BoardItemsSaved",
266
+ "payloadSchema": [
267
+ {
268
+ "name": "row",
269
+ "type": "object"
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "event": "BoardItemsSaveFailed",
275
+ "payloadSchema": [
276
+ {
277
+ "name": "error",
278
+ "type": "string"
279
+ },
280
+ {
281
+ "name": "code",
282
+ "type": "string"
283
+ }
284
+ ]
285
+ }
286
+ ],
287
+ "stateMachine": {
288
+ "states": [
289
+ {
290
+ "name": "loading",
291
+ "isInitial": true
292
+ },
293
+ {
294
+ "name": "viewing_board"
295
+ },
296
+ {
297
+ "name": "viewing_card"
298
+ },
299
+ {
300
+ "name": "adding"
301
+ },
302
+ {
303
+ "name": "error"
304
+ }
305
+ ],
306
+ "events": [
307
+ {
308
+ "key": "INIT",
309
+ "name": "Initialize"
310
+ },
311
+ {
312
+ "key": "BoardItemsLoaded",
313
+ "name": "Board items loaded",
314
+ "payloadSchema": [
315
+ {
316
+ "name": "data",
317
+ "type": "[object]"
318
+ }
319
+ ]
320
+ },
321
+ {
322
+ "key": "BoardItemsLoadFailed",
323
+ "name": "Board items load failed",
324
+ "payloadSchema": [
325
+ {
326
+ "name": "error",
327
+ "type": "string"
328
+ },
329
+ {
330
+ "name": "code",
331
+ "type": "string"
332
+ }
333
+ ]
334
+ },
335
+ {
336
+ "key": "BoardItemsSaveFailed",
337
+ "name": "Board items save failed",
338
+ "payloadSchema": [
339
+ {
340
+ "name": "error",
341
+ "type": "string"
342
+ },
343
+ {
344
+ "name": "code",
345
+ "type": "string"
346
+ }
347
+ ]
348
+ },
349
+ {
350
+ "key": "OPEN_CARD",
351
+ "name": "Open Card",
352
+ "payloadSchema": [
353
+ {
354
+ "name": "id",
355
+ "type": "string",
356
+ "required": true
357
+ },
358
+ {
359
+ "name": "row",
360
+ "type": "object",
361
+ "required": true
362
+ }
363
+ ]
364
+ },
365
+ {
366
+ "key": "ADD_CARD",
367
+ "name": "Add Card"
368
+ },
369
+ {
370
+ "key": "MOVE_CARD",
371
+ "name": "Move Card",
372
+ "payloadSchema": [
373
+ {
374
+ "name": "id",
375
+ "type": "string",
376
+ "required": true
377
+ },
378
+ {
379
+ "name": "sourceGroup",
380
+ "type": "string"
381
+ },
382
+ {
383
+ "name": "targetGroup",
384
+ "type": "string",
385
+ "required": true
386
+ },
387
+ {
388
+ "name": "newIndex",
389
+ "type": "number"
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ "key": "REORDER_CARD",
395
+ "name": "Reorder Card",
396
+ "payloadSchema": [
397
+ {
398
+ "name": "id",
399
+ "type": "string",
400
+ "required": true
401
+ },
402
+ {
403
+ "name": "oldIndex",
404
+ "type": "number"
405
+ },
406
+ {
407
+ "name": "newIndex",
408
+ "type": "number"
409
+ }
410
+ ]
411
+ },
412
+ {
413
+ "key": "REORDER_POSITION",
414
+ "name": "Reorder Position",
415
+ "payloadSchema": [
416
+ {
417
+ "name": "id",
418
+ "type": "string",
419
+ "required": true
420
+ },
421
+ {
422
+ "name": "position",
423
+ "type": "number",
424
+ "required": true
425
+ }
426
+ ]
427
+ },
428
+ {
429
+ "key": "BoardItemsSaved",
430
+ "name": "Board items saved",
431
+ "payloadSchema": [
432
+ {
433
+ "name": "row",
434
+ "type": "object"
435
+ }
436
+ ]
437
+ },
438
+ {
439
+ "key": "CLOSE_CARD",
440
+ "name": "Close Card"
441
+ },
442
+ {
443
+ "key": "DELETE_CARD",
444
+ "name": "Delete Card",
445
+ "payloadSchema": [
446
+ {
447
+ "name": "id",
448
+ "type": "string",
449
+ "required": true
450
+ }
451
+ ]
452
+ },
453
+ {
454
+ "key": "SAVE_CARD",
455
+ "name": "Save Card",
456
+ "payloadSchema": [
457
+ {
458
+ "name": "data",
459
+ "type": "object",
460
+ "required": true
461
+ }
462
+ ]
463
+ },
464
+ {
465
+ "key": "CANCEL_ADD",
466
+ "name": "Cancel Add"
467
+ }
468
+ ],
469
+ "transitions": [
470
+ {
471
+ "from": "loading",
472
+ "to": "loading",
473
+ "event": "INIT",
474
+ "effects": [
475
+ [
476
+ "fetch",
477
+ "BoardView",
478
+ {
479
+ "emit": {
480
+ "success": "BoardItemsLoaded",
481
+ "failure": "BoardItemsLoadFailed"
482
+ }
483
+ }
484
+ ],
485
+ [
486
+ "render-ui",
487
+ "main",
488
+ {
489
+ "type": "loading-state",
490
+ "title": "Loading board…"
491
+ }
492
+ ]
493
+ ]
494
+ },
495
+ {
496
+ "from": "loading",
497
+ "to": "viewing_board",
498
+ "event": "BoardItemsLoaded",
499
+ "effects": [
500
+ [
501
+ "set",
502
+ "@entity.boards",
503
+ [
504
+ "array/map",
505
+ "@config.columns",
506
+ [
507
+ "fn",
508
+ "col",
509
+ {
510
+ "label": [
511
+ "object/get",
512
+ "@col",
513
+ "label"
514
+ ],
515
+ "variant": [
516
+ "object/get",
517
+ "@col",
518
+ "variant",
519
+ "default"
520
+ ],
521
+ "key": [
522
+ "object/get",
523
+ "@col",
524
+ "key"
525
+ ],
526
+ "count": [
527
+ "array/len",
528
+ [
529
+ "array/filter",
530
+ "@payload.data",
531
+ [
532
+ "fn",
533
+ "item",
534
+ [
535
+ "=",
536
+ [
537
+ "object/get",
538
+ "@item",
539
+ "stage"
540
+ ],
541
+ [
542
+ "object/get",
543
+ "@col",
544
+ "key"
545
+ ]
546
+ ]
547
+ ]
548
+ ]
549
+ ],
550
+ "items": [
551
+ "array/sort",
552
+ [
553
+ "array/filter",
554
+ "@payload.data",
555
+ [
556
+ "fn",
557
+ "item",
558
+ [
559
+ "=",
560
+ [
561
+ "object/get",
562
+ "@item",
563
+ "stage"
564
+ ],
565
+ [
566
+ "object/get",
567
+ "@col",
568
+ "key"
569
+ ]
570
+ ]
571
+ ]
572
+ ],
573
+ "position"
574
+ ],
575
+ "icon": [
576
+ "object/get",
577
+ "@col",
578
+ "icon",
579
+ "circle"
580
+ ]
581
+ }
582
+ ]
583
+ ]
584
+ ],
585
+ [
586
+ "render-ui",
587
+ "main",
588
+ {
589
+ "type": "stack",
590
+ "gap": "md",
591
+ "children": [
592
+ {
593
+ "direction": "horizontal",
594
+ "gap": "sm",
595
+ "type": "stack",
596
+ "align": "center",
597
+ "children": [
598
+ {
599
+ "type": "icon",
600
+ "name": "kanban-square"
601
+ },
602
+ {
603
+ "variant": "h3",
604
+ "type": "typography",
605
+ "content": "@config.title"
606
+ }
607
+ ]
608
+ },
609
+ {
610
+ "type": "divider"
611
+ },
612
+ {
613
+ "dndRoot": true,
614
+ "renderItem": [
615
+ "fn",
616
+ "col",
617
+ {
618
+ "children": [
619
+ {
620
+ "type": "stack",
621
+ "children": [
622
+ {
623
+ "direction": "horizontal",
624
+ "children": [
625
+ {
626
+ "type": "icon",
627
+ "name": "@col.icon"
628
+ },
629
+ {
630
+ "content": "@col.label",
631
+ "type": "typography",
632
+ "variant": "h4"
633
+ },
634
+ {
635
+ "variant": "@col.variant",
636
+ "label": "@col.count",
637
+ "type": "badge"
638
+ }
639
+ ],
640
+ "align": "center",
641
+ "gap": "xs",
642
+ "type": "stack"
643
+ },
644
+ {
645
+ "positionEvent": "REORDER_POSITION",
646
+ "type": "data-list",
647
+ "renderItem": [
648
+ "fn",
649
+ "item",
650
+ {
651
+ "children": [
652
+ {
653
+ "direction": "vertical",
654
+ "children": [
655
+ {
656
+ "content": "@item.title",
657
+ "type": "typography",
658
+ "variant": "h4"
659
+ },
660
+ {
661
+ "type": "typography",
662
+ "variant": "caption",
663
+ "content": "@item.description",
664
+ "color": "muted"
665
+ },
666
+ {
667
+ "type": "stack",
668
+ "gap": "xs",
669
+ "direction": "horizontal",
670
+ "align": "center",
671
+ "children": [
672
+ {
673
+ "icon": "arrow-right",
674
+ "type": "button",
675
+ "action": "OPEN_CARD",
676
+ "actionPayload": {
677
+ "id": "@item.id",
678
+ "row": "@item"
679
+ },
680
+ "label": "Open",
681
+ "variant": "ghost"
682
+ }
683
+ ]
684
+ }
685
+ ],
686
+ "gap": "xs",
687
+ "type": "stack"
688
+ }
689
+ ],
690
+ "type": "card"
691
+ }
692
+ ],
693
+ "reorderEvent": "REORDER_CARD",
694
+ "dropEvent": "MOVE_CARD",
695
+ "entity": "@col.items",
696
+ "gap": "sm",
697
+ "fields": [],
698
+ "accepts": "*",
699
+ "dragGroup": "@col.key",
700
+ "sortable": true
701
+ }
702
+ ],
703
+ "direction": "vertical",
704
+ "gap": "sm"
705
+ }
706
+ ],
707
+ "type": "card"
708
+ }
709
+ ],
710
+ "gap": "md",
711
+ "fields": [],
712
+ "cols": "@config.gridCols",
713
+ "entity": "@entity.boards",
714
+ "type": "data-grid"
715
+ },
716
+ {
717
+ "variant": "primary",
718
+ "icon": "plus",
719
+ "type": "floating-action-button",
720
+ "label": "Add item",
721
+ "action": "ADD_CARD"
722
+ }
723
+ ],
724
+ "direction": "vertical"
725
+ }
726
+ ]
727
+ ]
728
+ },
729
+ {
730
+ "from": "loading",
731
+ "to": "error",
732
+ "event": "BoardItemsLoadFailed",
733
+ "effects": [
734
+ [
735
+ "set",
736
+ "@entity.errorMessage",
737
+ "@payload.error"
738
+ ],
739
+ [
740
+ "render-ui",
741
+ "main",
742
+ {
743
+ "type": "error-state",
744
+ "title": "Failed to load board",
745
+ "message": "@entity.errorMessage"
746
+ }
747
+ ]
748
+ ]
749
+ },
750
+ {
751
+ "from": "loading",
752
+ "to": "error",
753
+ "event": "BoardItemsSaveFailed",
754
+ "effects": [
755
+ [
756
+ "set",
757
+ "@entity.errorMessage",
758
+ "@payload.error"
759
+ ],
760
+ [
761
+ "render-ui",
762
+ "main",
763
+ {
764
+ "type": "error-state",
765
+ "title": "Save failed",
766
+ "message": "@entity.errorMessage"
767
+ }
768
+ ]
769
+ ]
770
+ },
771
+ {
772
+ "from": "viewing_board",
773
+ "to": "viewing_card",
774
+ "event": "OPEN_CARD",
775
+ "effects": [
776
+ [
777
+ "set",
778
+ "@entity.currentId",
779
+ "@payload.row.id"
780
+ ],
781
+ [
782
+ "set",
783
+ "@entity.currentTitle",
784
+ "@payload.row.title"
785
+ ],
786
+ [
787
+ "set",
788
+ "@entity.currentDescription",
789
+ "@payload.row.description"
790
+ ],
791
+ [
792
+ "set",
793
+ "@entity.currentStage",
794
+ "@payload.row.stage"
795
+ ],
796
+ [
797
+ "set",
798
+ "@entity.currentNotes",
799
+ "@payload.row.notes"
800
+ ],
801
+ [
802
+ "render-ui",
803
+ "main",
804
+ {
805
+ "gap": "md",
806
+ "children": [
807
+ {
808
+ "align": "center",
809
+ "gap": "sm",
810
+ "direction": "horizontal",
811
+ "children": [
812
+ {
813
+ "variant": "ghost",
814
+ "type": "button",
815
+ "icon": "arrow-left",
816
+ "label": "Back",
817
+ "action": "CLOSE_CARD"
818
+ },
819
+ {
820
+ "name": "credit-card",
821
+ "type": "icon"
822
+ },
823
+ {
824
+ "content": "@entity.currentTitle",
825
+ "variant": "h3",
826
+ "type": "typography"
827
+ },
828
+ {
829
+ "type": "badge",
830
+ "label": "@entity.currentStage",
831
+ "variant": "primary"
832
+ }
833
+ ],
834
+ "type": "stack"
835
+ },
836
+ {
837
+ "type": "divider"
838
+ },
839
+ {
840
+ "children": [
841
+ {
842
+ "gap": "sm",
843
+ "type": "stack",
844
+ "direction": "vertical",
845
+ "children": [
846
+ {
847
+ "color": "muted",
848
+ "content": "Description",
849
+ "variant": "caption",
850
+ "type": "typography"
851
+ },
852
+ {
853
+ "variant": "body",
854
+ "type": "typography",
855
+ "content": "@entity.currentDescription"
856
+ },
857
+ {
858
+ "type": "divider"
859
+ },
860
+ {
861
+ "type": "typography",
862
+ "color": "muted",
863
+ "variant": "caption",
864
+ "content": "Notes"
865
+ },
866
+ {
867
+ "variant": "body",
868
+ "content": "@entity.currentNotes",
869
+ "type": "typography"
870
+ }
871
+ ]
872
+ }
873
+ ],
874
+ "type": "card"
875
+ },
876
+ {
877
+ "type": "divider"
878
+ },
879
+ {
880
+ "variant": "caption",
881
+ "content": "Move to stage:",
882
+ "color": "muted",
883
+ "type": "typography"
884
+ },
885
+ {
886
+ "gap": "sm",
887
+ "renderItem": [
888
+ "fn",
889
+ "col",
890
+ {
891
+ "actionPayload": {
892
+ "targetGroup": "@col.key",
893
+ "id": "@entity.currentId"
894
+ },
895
+ "icon": "@col.icon",
896
+ "type": "button",
897
+ "variant": "secondary",
898
+ "label": "@col.label",
899
+ "action": "MOVE_CARD"
900
+ }
901
+ ],
902
+ "variant": "default",
903
+ "type": "data-list",
904
+ "fields": [],
905
+ "entity": "@entity.boards"
906
+ },
907
+ {
908
+ "align": "center",
909
+ "gap": "sm",
910
+ "direction": "horizontal",
911
+ "type": "stack",
912
+ "children": [
913
+ {
914
+ "action": "DELETE_CARD",
915
+ "type": "button",
916
+ "actionPayload": {
917
+ "id": "@entity.currentId"
918
+ },
919
+ "variant": "danger",
920
+ "label": "Delete",
921
+ "icon": "trash-2"
922
+ }
923
+ ]
924
+ }
925
+ ],
926
+ "direction": "vertical",
927
+ "type": "stack"
928
+ }
929
+ ]
930
+ ]
931
+ },
932
+ {
933
+ "from": "viewing_board",
934
+ "to": "adding",
935
+ "event": "ADD_CARD",
936
+ "effects": [
937
+ [
938
+ "set",
939
+ "@entity.currentId",
940
+ ""
941
+ ],
942
+ [
943
+ "set",
944
+ "@entity.currentTitle",
945
+ ""
946
+ ],
947
+ [
948
+ "set",
949
+ "@entity.currentDescription",
950
+ ""
951
+ ],
952
+ [
953
+ "set",
954
+ "@entity.currentStage",
955
+ ""
956
+ ],
957
+ [
958
+ "set",
959
+ "@entity.currentNotes",
960
+ ""
961
+ ],
962
+ [
963
+ "render-ui",
964
+ "main",
965
+ {
966
+ "direction": "vertical",
967
+ "type": "stack",
968
+ "gap": "md",
969
+ "children": [
970
+ {
971
+ "type": "stack",
972
+ "align": "center",
973
+ "children": [
974
+ {
975
+ "label": "Cancel",
976
+ "type": "button",
977
+ "variant": "ghost",
978
+ "action": "CANCEL_ADD",
979
+ "icon": "x"
980
+ },
981
+ {
982
+ "name": "plus",
983
+ "type": "icon"
984
+ },
985
+ {
986
+ "type": "typography",
987
+ "content": "New board item",
988
+ "variant": "h3"
989
+ }
990
+ ],
991
+ "direction": "horizontal",
992
+ "gap": "sm"
993
+ },
994
+ {
995
+ "type": "divider"
996
+ },
997
+ {
998
+ "entity": "@entity",
999
+ "mode": "create",
1000
+ "submitEvent": "SAVE_CARD",
1001
+ "fields": "@config.formFields",
1002
+ "type": "form-section",
1003
+ "cancelEvent": "CANCEL_ADD"
1004
+ }
1005
+ ]
1006
+ }
1007
+ ]
1008
+ ]
1009
+ },
1010
+ {
1011
+ "from": "viewing_board",
1012
+ "to": "viewing_board",
1013
+ "event": "MOVE_CARD",
1014
+ "effects": [
1015
+ [
1016
+ "persist",
1017
+ "update",
1018
+ "BoardView",
1019
+ {
1020
+ "id": "@payload.id",
1021
+ "stage": "@payload.targetGroup"
1022
+ },
1023
+ {
1024
+ "emit": {
1025
+ "success": "BoardItemsSaved",
1026
+ "failure": "BoardItemsSaveFailed"
1027
+ }
1028
+ }
1029
+ ]
1030
+ ]
1031
+ },
1032
+ {
1033
+ "from": "viewing_board",
1034
+ "to": "viewing_board",
1035
+ "event": "REORDER_CARD"
1036
+ },
1037
+ {
1038
+ "from": "viewing_board",
1039
+ "to": "viewing_board",
1040
+ "event": "REORDER_POSITION",
1041
+ "effects": [
1042
+ [
1043
+ "persist",
1044
+ "update",
1045
+ "BoardView",
1046
+ {
1047
+ "id": "@payload.id",
1048
+ "position": "@payload.position"
1049
+ },
1050
+ {
1051
+ "emit": {
1052
+ "failure": "BoardItemsSaveFailed",
1053
+ "success": "BoardItemsSaved"
1054
+ }
1055
+ }
1056
+ ]
1057
+ ]
1058
+ },
1059
+ {
1060
+ "from": "viewing_board",
1061
+ "to": "viewing_board",
1062
+ "event": "BoardItemsSaved",
1063
+ "effects": [
1064
+ [
1065
+ "fetch",
1066
+ "BoardView",
1067
+ {
1068
+ "emit": {
1069
+ "failure": "BoardItemsLoadFailed",
1070
+ "success": "BoardItemsLoaded"
1071
+ }
1072
+ }
1073
+ ]
1074
+ ]
1075
+ },
1076
+ {
1077
+ "from": "viewing_board",
1078
+ "to": "viewing_board",
1079
+ "event": "BoardItemsLoaded",
1080
+ "effects": [
1081
+ [
1082
+ "set",
1083
+ "@entity.boards",
1084
+ [
1085
+ "array/map",
1086
+ "@config.columns",
1087
+ [
1088
+ "fn",
1089
+ "col",
1090
+ {
1091
+ "count": [
1092
+ "array/len",
1093
+ [
1094
+ "array/filter",
1095
+ "@payload.data",
1096
+ [
1097
+ "fn",
1098
+ "item",
1099
+ [
1100
+ "=",
1101
+ [
1102
+ "object/get",
1103
+ "@item",
1104
+ "stage"
1105
+ ],
1106
+ [
1107
+ "object/get",
1108
+ "@col",
1109
+ "key"
1110
+ ]
1111
+ ]
1112
+ ]
1113
+ ]
1114
+ ],
1115
+ "key": [
1116
+ "object/get",
1117
+ "@col",
1118
+ "key"
1119
+ ],
1120
+ "icon": [
1121
+ "object/get",
1122
+ "@col",
1123
+ "icon",
1124
+ "circle"
1125
+ ],
1126
+ "label": [
1127
+ "object/get",
1128
+ "@col",
1129
+ "label"
1130
+ ],
1131
+ "items": [
1132
+ "array/sort",
1133
+ [
1134
+ "array/filter",
1135
+ "@payload.data",
1136
+ [
1137
+ "fn",
1138
+ "item",
1139
+ [
1140
+ "=",
1141
+ [
1142
+ "object/get",
1143
+ "@item",
1144
+ "stage"
1145
+ ],
1146
+ [
1147
+ "object/get",
1148
+ "@col",
1149
+ "key"
1150
+ ]
1151
+ ]
1152
+ ]
1153
+ ],
1154
+ "position"
1155
+ ],
1156
+ "variant": [
1157
+ "object/get",
1158
+ "@col",
1159
+ "variant",
1160
+ "default"
1161
+ ]
1162
+ }
1163
+ ]
1164
+ ]
1165
+ ]
1166
+ ]
1167
+ },
1168
+ {
1169
+ "from": "viewing_card",
1170
+ "to": "loading",
1171
+ "event": "CLOSE_CARD",
1172
+ "effects": [
1173
+ [
1174
+ "fetch",
1175
+ "BoardView",
1176
+ {
1177
+ "emit": {
1178
+ "success": "BoardItemsLoaded",
1179
+ "failure": "BoardItemsLoadFailed"
1180
+ }
1181
+ }
1182
+ ],
1183
+ [
1184
+ "render-ui",
1185
+ "main",
1186
+ {
1187
+ "title": "Refreshing board…",
1188
+ "type": "loading-state"
1189
+ }
1190
+ ]
1191
+ ]
1192
+ },
1193
+ {
1194
+ "from": "viewing_card",
1195
+ "to": "loading",
1196
+ "event": "MOVE_CARD",
1197
+ "effects": [
1198
+ [
1199
+ "persist",
1200
+ "update",
1201
+ "BoardView",
1202
+ {
1203
+ "id": "@payload.id",
1204
+ "stage": "@payload.targetGroup"
1205
+ },
1206
+ {
1207
+ "emit": {
1208
+ "success": "BoardItemsSaved",
1209
+ "failure": "BoardItemsSaveFailed"
1210
+ }
1211
+ }
1212
+ ],
1213
+ [
1214
+ "render-ui",
1215
+ "main",
1216
+ {
1217
+ "title": "Moving item…",
1218
+ "type": "loading-state"
1219
+ }
1220
+ ]
1221
+ ]
1222
+ },
1223
+ {
1224
+ "from": "viewing_card",
1225
+ "to": "loading",
1226
+ "event": "DELETE_CARD",
1227
+ "effects": [
1228
+ [
1229
+ "persist",
1230
+ "delete",
1231
+ "BoardView",
1232
+ "@payload.id",
1233
+ {
1234
+ "emit": {
1235
+ "success": "BoardItemsSaved",
1236
+ "failure": "BoardItemsSaveFailed"
1237
+ }
1238
+ }
1239
+ ],
1240
+ [
1241
+ "render-ui",
1242
+ "main",
1243
+ {
1244
+ "type": "loading-state",
1245
+ "title": "Deleting item…"
1246
+ }
1247
+ ]
1248
+ ]
1249
+ },
1250
+ {
1251
+ "from": "adding",
1252
+ "to": "loading",
1253
+ "event": "SAVE_CARD",
1254
+ "effects": [
1255
+ [
1256
+ "persist",
1257
+ "create",
1258
+ "BoardView",
1259
+ "@payload.data",
1260
+ {
1261
+ "emit": {
1262
+ "success": "BoardItemsSaved",
1263
+ "failure": "BoardItemsSaveFailed"
1264
+ }
1265
+ }
1266
+ ],
1267
+ [
1268
+ "render-ui",
1269
+ "main",
1270
+ {
1271
+ "type": "loading-state",
1272
+ "title": "Saving…"
1273
+ }
1274
+ ]
1275
+ ]
1276
+ },
1277
+ {
1278
+ "from": "adding",
1279
+ "to": "viewing_board",
1280
+ "event": "CANCEL_ADD",
1281
+ "effects": [
1282
+ [
1283
+ "render-ui",
1284
+ "main",
1285
+ {
1286
+ "title": "Cancelling…",
1287
+ "type": "loading-state"
1288
+ }
1289
+ ]
1290
+ ]
1291
+ },
1292
+ {
1293
+ "from": "error",
1294
+ "to": "loading",
1295
+ "event": "INIT",
1296
+ "effects": [
1297
+ [
1298
+ "render-ui",
1299
+ "main",
1300
+ {
1301
+ "type": "loading-state",
1302
+ "title": "Retrying…"
1303
+ }
1304
+ ]
1305
+ ]
1306
+ }
1307
+ ]
1308
+ },
1309
+ "config": {
1310
+ "title": {
1311
+ "type": "string",
1312
+ "default": "Board"
1313
+ },
1314
+ "gridCols": {
1315
+ "type": "number",
1316
+ "default": 3.0
1317
+ },
1318
+ "formFields": {
1319
+ "type": "[string]",
1320
+ "default": [
1321
+ "title",
1322
+ "description",
1323
+ "stage",
1324
+ "notes"
1325
+ ]
1326
+ },
1327
+ "columns": {
1328
+ "type": "[object]",
1329
+ "default": [
1330
+ {
1331
+ "key": "todo",
1332
+ "label": "To Do",
1333
+ "variant": "default",
1334
+ "icon": "circle"
1335
+ },
1336
+ {
1337
+ "variant": "primary",
1338
+ "key": "doing",
1339
+ "icon": "circle-dot",
1340
+ "label": "In Progress"
1341
+ },
1342
+ {
1343
+ "key": "done",
1344
+ "icon": "check-circle",
1345
+ "variant": "success",
1346
+ "label": "Done"
1347
+ }
1348
+ ]
1349
+ }
1350
+ },
1351
+ "scope": "instance"
1352
+ }
1353
+ ],
1354
+ "pages": [
1355
+ {
1356
+ "name": "BoardPage",
1357
+ "path": "/board",
1358
+ "traits": [
1359
+ {
1360
+ "ref": "BoardItemBoard"
1361
+ }
1362
+ ]
1363
+ }
1364
+ ]
1365
+ }
1366
+ ]
1367
+ }