@almadar/std 14.29.3 → 14.30.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-wizard",
3
- "version": "2.0.0",
4
- "description": "std-wizard — generic N-step branching wizard. `config.steps` is an array of step definitions (each with its own `fields` list); @entity.currentStepIndex walks through them; ADVANCE/RETREAT self-loop, COMPLETE/CANCEL terminate. Topology = loading / running / completed / cancelled / error — running state owns N via data, not states.",
3
+ "version": "3.0.0",
4
+ "description": "std-wizard — generic N-step data-collection wizard (Vercel deploy / GitHub repo create / Stripe Connect onboarding style). Each step has its own form fields. Topology = loading / running / completed / cancelled / error. ADVANCE is guard-routed: not-last-step advances; last-step transitions to completed. Distinct from std-step-flow (approval-decision) wizard collects data via form-section per step, step-flow collects yes/no decisions.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "WizardOrbital",
@@ -15,39 +15,61 @@
15
15
  "required": true
16
16
  },
17
17
  {
18
- "name": "steps",
18
+ "name": "title",
19
+ "type": "string",
20
+ "required": true
21
+ },
22
+ {
23
+ "name": "description",
24
+ "type": "string",
25
+ "default": ""
26
+ },
27
+ {
28
+ "name": "category",
29
+ "type": "string",
30
+ "default": "",
31
+ "values": [
32
+ "marketing",
33
+ "engineering",
34
+ "design",
35
+ "operations",
36
+ ""
37
+ ]
38
+ },
39
+ {
40
+ "name": "priority",
41
+ "type": "string",
42
+ "default": "",
43
+ "values": [
44
+ "low",
45
+ "medium",
46
+ "high",
47
+ "urgent",
48
+ ""
49
+ ]
50
+ },
51
+ {
52
+ "name": "notes",
53
+ "type": "string",
54
+ "default": ""
55
+ },
56
+ {
57
+ "name": "wizardSteps",
19
58
  "type": "array",
20
59
  "default": [],
21
60
  "items": {
22
61
  "type": "object",
23
62
  "properties": {
24
- "label": {
25
- "name": "label",
26
- "type": "string"
27
- },
28
- "status": {
29
- "name": "status",
30
- "type": "string",
31
- "values": [
32
- "pending",
33
- "current",
34
- "completed"
35
- ]
36
- },
37
- "number": {
38
- "name": "number",
39
- "type": "number"
40
- },
41
- "key": {
42
- "name": "key",
63
+ "description": {
64
+ "name": "description",
43
65
  "type": "string"
44
66
  },
45
- "icon": {
46
- "name": "icon",
67
+ "id": {
68
+ "name": "id",
47
69
  "type": "string"
48
70
  },
49
- "description": {
50
- "name": "description",
71
+ "title": {
72
+ "name": "title",
51
73
  "type": "string"
52
74
  }
53
75
  }
@@ -63,6 +85,49 @@
63
85
  "type": "number",
64
86
  "default": 0.0
65
87
  },
88
+ {
89
+ "name": "currentStepLabel",
90
+ "type": "string",
91
+ "default": ""
92
+ },
93
+ {
94
+ "name": "currentStepDescription",
95
+ "type": "string",
96
+ "default": ""
97
+ },
98
+ {
99
+ "name": "currentStepIcon",
100
+ "type": "string",
101
+ "default": "circle"
102
+ },
103
+ {
104
+ "name": "currentFields",
105
+ "type": "array",
106
+ "default": [],
107
+ "items": {
108
+ "type": "string"
109
+ }
110
+ },
111
+ {
112
+ "name": "isFirstStep",
113
+ "type": "boolean",
114
+ "default": true
115
+ },
116
+ {
117
+ "name": "isLastStep",
118
+ "type": "boolean",
119
+ "default": false
120
+ },
121
+ {
122
+ "name": "primaryActionLabel",
123
+ "type": "string",
124
+ "default": "Next"
125
+ },
126
+ {
127
+ "name": "primaryActionIcon",
128
+ "type": "string",
129
+ "default": "chevron-right"
130
+ },
66
131
  {
67
132
  "name": "completionMessage",
68
133
  "type": "string",
@@ -98,18 +163,6 @@
98
163
  {
99
164
  "event": "RETREAT"
100
165
  },
101
- {
102
- "event": "SKIP"
103
- },
104
- {
105
- "event": "COMPLETE",
106
- "payloadSchema": [
107
- {
108
- "name": "data",
109
- "type": "object"
110
- }
111
- ]
112
- },
113
166
  {
114
167
  "event": "CANCEL",
115
168
  "payloadSchema": [
@@ -143,6 +196,28 @@
143
196
  "type": "string"
144
197
  }
145
198
  ]
199
+ },
200
+ {
201
+ "event": "WizardSaved",
202
+ "payloadSchema": [
203
+ {
204
+ "name": "row",
205
+ "type": "object"
206
+ }
207
+ ]
208
+ },
209
+ {
210
+ "event": "WizardSaveFailed",
211
+ "payloadSchema": [
212
+ {
213
+ "name": "error",
214
+ "type": "string"
215
+ },
216
+ {
217
+ "name": "code",
218
+ "type": "string"
219
+ }
220
+ ]
146
221
  }
147
222
  ],
148
223
  "stateMachine": {
@@ -231,20 +306,6 @@
231
306
  "key": "RETREAT",
232
307
  "name": "Retreat"
233
308
  },
234
- {
235
- "key": "SKIP",
236
- "name": "Skip"
237
- },
238
- {
239
- "key": "COMPLETE",
240
- "name": "Complete",
241
- "payloadSchema": [
242
- {
243
- "name": "data",
244
- "type": "object"
245
- }
246
- ]
247
- },
248
309
  {
249
310
  "key": "CANCEL",
250
311
  "name": "Cancel",
@@ -271,8 +332,8 @@
271
332
  "WizardView",
272
333
  {
273
334
  "emit": {
274
- "failure": "WizardLoadFailed",
275
- "success": "WizardLoaded"
335
+ "success": "WizardLoaded",
336
+ "failure": "WizardLoadFailed"
276
337
  }
277
338
  }
278
339
  ],
@@ -306,7 +367,7 @@
306
367
  ],
307
368
  [
308
369
  "set",
309
- "@entity.steps",
370
+ "@entity.wizardSteps",
310
371
  [
311
372
  "array/map",
312
373
  "@config.steps",
@@ -314,160 +375,250 @@
314
375
  "fn",
315
376
  "step",
316
377
  {
317
- "label": [
318
- "object/get",
319
- "@step",
320
- "label"
321
- ],
322
- "key": [
378
+ "description": [
323
379
  "object/get",
324
380
  "@step",
325
- "key"
381
+ "description",
382
+ ""
326
383
  ],
327
- "icon": [
384
+ "title": [
328
385
  "object/get",
329
386
  "@step",
330
- "icon",
331
- "circle"
387
+ "label"
332
388
  ],
333
- "status": "current",
334
- "number": 1.0,
335
- "description": [
389
+ "id": [
336
390
  "object/get",
337
391
  "@step",
338
- "description",
339
- ""
392
+ "key"
340
393
  ]
341
394
  }
342
395
  ]
343
396
  ]
344
397
  ],
398
+ [
399
+ "set",
400
+ "@entity.currentStepLabel",
401
+ [
402
+ "object/get",
403
+ [
404
+ "array/nth",
405
+ "@config.steps",
406
+ 0.0
407
+ ],
408
+ "label"
409
+ ]
410
+ ],
411
+ [
412
+ "set",
413
+ "@entity.currentStepDescription",
414
+ [
415
+ "object/get",
416
+ [
417
+ "array/nth",
418
+ "@config.steps",
419
+ 0.0
420
+ ],
421
+ "description",
422
+ ""
423
+ ]
424
+ ],
425
+ [
426
+ "set",
427
+ "@entity.currentStepIcon",
428
+ [
429
+ "object/get",
430
+ [
431
+ "array/nth",
432
+ "@config.steps",
433
+ 0.0
434
+ ],
435
+ "icon",
436
+ "circle"
437
+ ]
438
+ ],
439
+ [
440
+ "set",
441
+ "@entity.currentFields",
442
+ [
443
+ "object/get",
444
+ [
445
+ "array/nth",
446
+ "@config.steps",
447
+ 0.0
448
+ ],
449
+ "fields",
450
+ []
451
+ ]
452
+ ],
453
+ [
454
+ "set",
455
+ "@entity.isFirstStep",
456
+ true
457
+ ],
458
+ [
459
+ "set",
460
+ "@entity.isLastStep",
461
+ [
462
+ "=",
463
+ [
464
+ "array/len",
465
+ "@config.steps"
466
+ ],
467
+ 1.0
468
+ ]
469
+ ],
470
+ [
471
+ "set",
472
+ "@entity.primaryActionLabel",
473
+ [
474
+ "if",
475
+ [
476
+ "=",
477
+ [
478
+ "array/len",
479
+ "@config.steps"
480
+ ],
481
+ 1.0
482
+ ],
483
+ "Submit",
484
+ "Next"
485
+ ]
486
+ ],
487
+ [
488
+ "set",
489
+ "@entity.primaryActionIcon",
490
+ [
491
+ "if",
492
+ [
493
+ "=",
494
+ [
495
+ "array/len",
496
+ "@config.steps"
497
+ ],
498
+ 1.0
499
+ ],
500
+ "check-circle",
501
+ "chevron-right"
502
+ ]
503
+ ],
345
504
  [
346
505
  "render-ui",
347
506
  "main",
348
507
  {
508
+ "type": "stack",
349
509
  "direction": "vertical",
510
+ "gap": "lg",
350
511
  "children": [
351
512
  {
352
513
  "children": [
353
514
  {
354
- "type": "icon",
355
- "name": "list-checks"
515
+ "name": "list-checks",
516
+ "type": "icon"
356
517
  },
357
518
  {
358
519
  "variant": "h3",
359
- "type": "typography",
360
- "content": "@config.title"
520
+ "content": "@config.title",
521
+ "type": "typography"
361
522
  }
362
523
  ],
363
- "direction": "horizontal",
364
524
  "type": "stack",
365
525
  "gap": "sm",
526
+ "direction": "horizontal",
366
527
  "align": "center"
367
528
  },
368
529
  {
369
- "type": "divider"
530
+ "allowNavigation": false,
531
+ "steps": "@entity.wizardSteps",
532
+ "currentStep": "@entity.currentStepIndex",
533
+ "type": "wizard-progress"
370
534
  },
371
535
  {
372
- "gap": "sm",
373
- "type": "data-list",
374
- "renderItem": [
375
- "fn",
376
- "step",
536
+ "type": "card",
537
+ "children": [
377
538
  {
378
- "type": "card",
539
+ "type": "stack",
540
+ "gap": "md",
541
+ "direction": "vertical",
379
542
  "children": [
380
543
  {
381
- "type": "stack",
382
544
  "align": "center",
545
+ "direction": "horizontal",
383
546
  "children": [
384
547
  {
548
+ "size": "lg",
385
549
  "type": "icon",
386
- "name": "@step.icon"
550
+ "name": "@entity.currentStepIcon"
387
551
  },
388
552
  {
389
553
  "type": "stack",
390
- "direction": "vertical",
391
554
  "gap": "xs",
392
555
  "children": [
393
556
  {
394
557
  "type": "typography",
395
- "variant": "h4",
396
- "content": "@step.label"
558
+ "content": "@entity.currentStepLabel",
559
+ "variant": "h2"
397
560
  },
398
561
  {
399
- "variant": "caption",
400
- "color": "muted",
562
+ "variant": "body",
401
563
  "type": "typography",
402
- "content": "@step.description"
564
+ "color": "muted",
565
+ "content": "@entity.currentStepDescription"
403
566
  }
404
- ]
405
- },
406
- {
407
- "type": "badge",
408
- "variant": "primary",
409
- "label": "@step.status"
567
+ ],
568
+ "direction": "vertical"
410
569
  }
411
570
  ],
412
- "direction": "horizontal",
571
+ "type": "stack",
413
572
  "gap": "sm"
573
+ },
574
+ {
575
+ "type": "divider"
576
+ },
577
+ {
578
+ "submitEvent": "ADVANCE",
579
+ "mode": "edit",
580
+ "cancelEvent": "CANCEL",
581
+ "showCancel": false,
582
+ "fields": "@entity.currentFields",
583
+ "entity": "@entity",
584
+ "showSubmit": false,
585
+ "type": "form-section"
414
586
  }
415
587
  ]
416
588
  }
417
- ],
418
- "entity": "@entity.steps",
419
- "fields": []
420
- },
421
- {
422
- "type": "divider"
423
- },
424
- {
425
- "submitEvent": "ADVANCE",
426
- "cancelEvent": "CANCEL",
427
- "entity": "@entity",
428
- "fields": "@config.currentFields",
429
- "type": "form-section",
430
- "mode": "edit"
589
+ ]
431
590
  },
432
591
  {
433
- "type": "stack",
434
592
  "direction": "horizontal",
435
- "gap": "sm",
436
- "align": "center",
437
593
  "children": [
438
594
  {
439
- "icon": "arrow-left",
440
- "variant": "ghost",
441
595
  "action": "RETREAT",
596
+ "icon": "chevron-left",
597
+ "disabled": "@entity.isFirstStep",
598
+ "label": "Back",
442
599
  "type": "button",
443
- "label": "Back"
444
- },
445
- {
446
- "action": "SKIP",
447
- "variant": "secondary",
448
- "icon": "skip-forward",
449
- "type": "button",
450
- "label": "Skip"
600
+ "variant": "ghost"
451
601
  },
452
602
  {
453
- "label": "Submit",
603
+ "action": "CANCEL",
604
+ "variant": "ghost",
454
605
  "type": "button",
455
- "action": "COMPLETE",
456
- "variant": "success",
457
- "icon": "check-circle"
606
+ "label": "Cancel wizard",
607
+ "icon": "x"
458
608
  },
459
609
  {
460
- "icon": "x",
461
- "label": "Cancel",
462
- "type": "button",
463
- "action": "CANCEL",
464
- "variant": "ghost"
610
+ "action": "ADVANCE",
611
+ "label": "@entity.primaryActionLabel",
612
+ "variant": "primary",
613
+ "icon": "@entity.primaryActionIcon",
614
+ "type": "button"
465
615
  }
466
- ]
616
+ ],
617
+ "gap": "sm",
618
+ "type": "stack",
619
+ "align": "center"
467
620
  }
468
- ],
469
- "gap": "md",
470
- "type": "stack"
621
+ ]
471
622
  }
472
623
  ]
473
624
  ]
@@ -495,9 +646,19 @@
495
646
  },
496
647
  {
497
648
  "from": "loading",
498
- "to": "running",
649
+ "to": "loading",
499
650
  "event": "WizardSaved",
500
651
  "effects": [
652
+ [
653
+ "fetch",
654
+ "WizardView",
655
+ {
656
+ "emit": {
657
+ "success": "WizardLoaded",
658
+ "failure": "WizardLoadFailed"
659
+ }
660
+ }
661
+ ],
501
662
  [
502
663
  "render-ui",
503
664
  "main",
@@ -523,8 +684,8 @@
523
684
  "main",
524
685
  {
525
686
  "message": "@entity.errorMessage",
526
- "type": "error-state",
527
- "title": "Save failed"
687
+ "title": "Save failed",
688
+ "type": "error-state"
528
689
  }
529
690
  ]
530
691
  ]
@@ -533,6 +694,10 @@
533
694
  "from": "running",
534
695
  "to": "running",
535
696
  "event": "ADVANCE",
697
+ "guard": [
698
+ "not",
699
+ "@entity.isLastStep"
700
+ ],
536
701
  "effects": [
537
702
  [
538
703
  "set",
@@ -545,192 +710,303 @@
545
710
  ],
546
711
  [
547
712
  "set",
548
- "@entity.steps",
713
+ "@entity.currentStepLabel",
549
714
  [
550
- "array/map",
551
- "@config.steps",
715
+ "object/get",
552
716
  [
553
- "fn",
554
- "step",
555
- {
556
- "description": [
557
- "object/get",
558
- "@step",
559
- "description",
560
- ""
561
- ],
562
- "icon": [
563
- "object/get",
564
- "@step",
565
- "icon",
566
- "circle"
567
- ],
568
- "label": [
569
- "object/get",
570
- "@step",
571
- "label"
572
- ],
573
- "key": [
574
- "object/get",
575
- "@step",
576
- "key"
577
- ],
578
- "number": 1.0,
579
- "status": "current"
580
- }
581
- ]
717
+ "array/nth",
718
+ "@config.steps",
719
+ "@entity.currentStepIndex"
720
+ ],
721
+ "label"
582
722
  ]
583
723
  ],
584
724
  [
585
- "render-ui",
586
- "main",
587
- {
588
- "direction": "vertical",
589
- "type": "stack",
590
- "children": [
591
- {
592
- "direction": "horizontal",
593
- "children": [
594
- {
595
- "type": "icon",
596
- "name": "list-checks"
725
+ "set",
726
+ "@entity.currentStepDescription",
727
+ [
728
+ "object/get",
729
+ [
730
+ "array/nth",
731
+ "@config.steps",
732
+ "@entity.currentStepIndex"
733
+ ],
734
+ "description",
735
+ ""
736
+ ]
737
+ ],
738
+ [
739
+ "set",
740
+ "@entity.currentStepIcon",
741
+ [
742
+ "object/get",
743
+ [
744
+ "array/nth",
745
+ "@config.steps",
746
+ "@entity.currentStepIndex"
747
+ ],
748
+ "icon",
749
+ "circle"
750
+ ]
751
+ ],
752
+ [
753
+ "set",
754
+ "@entity.currentFields",
755
+ [
756
+ "object/get",
757
+ [
758
+ "array/nth",
759
+ "@config.steps",
760
+ "@entity.currentStepIndex"
761
+ ],
762
+ "fields",
763
+ []
764
+ ]
765
+ ],
766
+ [
767
+ "set",
768
+ "@entity.isFirstStep",
769
+ [
770
+ "=",
771
+ "@entity.currentStepIndex",
772
+ 0.0
773
+ ]
774
+ ],
775
+ [
776
+ "set",
777
+ "@entity.isLastStep",
778
+ [
779
+ "=",
780
+ "@entity.currentStepIndex",
781
+ [
782
+ "-",
783
+ "@entity.totalSteps",
784
+ 1.0
785
+ ]
786
+ ]
787
+ ],
788
+ [
789
+ "set",
790
+ "@entity.primaryActionLabel",
791
+ [
792
+ "if",
793
+ [
794
+ "=",
795
+ "@entity.currentStepIndex",
796
+ [
797
+ "-",
798
+ "@entity.totalSteps",
799
+ 1.0
800
+ ]
801
+ ],
802
+ "Submit",
803
+ "Next"
804
+ ]
805
+ ],
806
+ [
807
+ "set",
808
+ "@entity.primaryActionIcon",
809
+ [
810
+ "if",
811
+ [
812
+ "=",
813
+ "@entity.currentStepIndex",
814
+ [
815
+ "-",
816
+ "@entity.totalSteps",
817
+ 1.0
818
+ ]
819
+ ],
820
+ "check-circle",
821
+ "chevron-right"
822
+ ]
823
+ ],
824
+ [
825
+ "render-ui",
826
+ "main",
827
+ {
828
+ "gap": "lg",
829
+ "type": "stack",
830
+ "direction": "vertical",
831
+ "children": [
832
+ {
833
+ "gap": "sm",
834
+ "align": "center",
835
+ "children": [
836
+ {
837
+ "name": "list-checks",
838
+ "type": "icon"
597
839
  },
598
840
  {
599
- "variant": "h3",
600
841
  "content": "@config.title",
842
+ "variant": "h3",
601
843
  "type": "typography"
602
844
  }
603
845
  ],
604
- "align": "center",
605
- "type": "stack",
606
- "gap": "sm"
846
+ "direction": "horizontal",
847
+ "type": "stack"
607
848
  },
608
849
  {
609
- "type": "divider"
850
+ "currentStep": "@entity.currentStepIndex",
851
+ "steps": "@entity.wizardSteps",
852
+ "type": "wizard-progress",
853
+ "allowNavigation": false
610
854
  },
611
855
  {
612
- "fields": [],
613
- "gap": "sm",
614
- "entity": "@entity.steps",
615
- "renderItem": [
616
- "fn",
617
- "step",
856
+ "type": "card",
857
+ "children": [
618
858
  {
619
- "type": "card",
859
+ "type": "stack",
620
860
  "children": [
621
861
  {
622
862
  "direction": "horizontal",
623
863
  "align": "center",
624
864
  "children": [
625
865
  {
866
+ "size": "lg",
626
867
  "type": "icon",
627
- "name": "@step.icon"
868
+ "name": "@entity.currentStepIcon"
628
869
  },
629
870
  {
871
+ "type": "stack",
872
+ "gap": "xs",
630
873
  "children": [
631
874
  {
632
- "content": "@step.label",
633
- "variant": "h4",
875
+ "variant": "h2",
876
+ "content": "@entity.currentStepLabel",
634
877
  "type": "typography"
635
878
  },
636
879
  {
637
- "type": "typography",
638
- "variant": "caption",
880
+ "variant": "body",
881
+ "content": "@entity.currentStepDescription",
639
882
  "color": "muted",
640
- "content": "@step.description"
883
+ "type": "typography"
641
884
  }
642
885
  ],
643
- "direction": "vertical",
644
- "gap": "xs",
645
- "type": "stack"
646
- },
647
- {
648
- "variant": "primary",
649
- "type": "badge",
650
- "label": "@step.status"
886
+ "direction": "vertical"
651
887
  }
652
888
  ],
653
889
  "gap": "sm",
654
890
  "type": "stack"
891
+ },
892
+ {
893
+ "type": "divider"
894
+ },
895
+ {
896
+ "showCancel": false,
897
+ "showSubmit": false,
898
+ "type": "form-section",
899
+ "cancelEvent": "CANCEL",
900
+ "submitEvent": "ADVANCE",
901
+ "fields": "@entity.currentFields",
902
+ "mode": "edit",
903
+ "entity": "@entity"
655
904
  }
656
- ]
905
+ ],
906
+ "direction": "vertical",
907
+ "gap": "md"
657
908
  }
658
- ],
659
- "type": "data-list"
660
- },
661
- {
662
- "type": "divider"
663
- },
664
- {
665
- "entity": "@entity",
666
- "type": "form-section",
667
- "fields": "@config.currentFields",
668
- "submitEvent": "ADVANCE",
669
- "mode": "edit",
670
- "cancelEvent": "CANCEL"
909
+ ]
671
910
  },
672
911
  {
673
- "direction": "horizontal",
674
912
  "type": "stack",
913
+ "direction": "horizontal",
914
+ "gap": "sm",
675
915
  "children": [
676
916
  {
677
917
  "label": "Back",
678
918
  "variant": "ghost",
679
- "action": "RETREAT",
680
- "icon": "arrow-left",
681
- "type": "button"
682
- },
683
- {
684
919
  "type": "button",
685
- "label": "Skip",
686
- "variant": "secondary",
687
- "action": "SKIP",
688
- "icon": "skip-forward"
920
+ "action": "RETREAT",
921
+ "icon": "chevron-left",
922
+ "disabled": "@entity.isFirstStep"
689
923
  },
690
924
  {
691
- "variant": "success",
692
- "action": "COMPLETE",
925
+ "icon": "x",
693
926
  "type": "button",
694
- "icon": "check-circle",
695
- "label": "Submit"
927
+ "label": "Cancel wizard",
928
+ "variant": "ghost",
929
+ "action": "CANCEL"
696
930
  },
697
931
  {
698
- "variant": "ghost",
699
932
  "type": "button",
700
- "action": "CANCEL",
701
- "icon": "x",
702
- "label": "Cancel"
933
+ "variant": "primary",
934
+ "label": "@entity.primaryActionLabel",
935
+ "action": "ADVANCE",
936
+ "icon": "@entity.primaryActionIcon"
703
937
  }
704
938
  ],
705
- "align": "center",
706
- "gap": "sm"
939
+ "align": "center"
707
940
  }
708
- ],
709
- "gap": "md"
941
+ ]
710
942
  }
711
943
  ]
712
944
  ]
713
945
  },
714
946
  {
715
947
  "from": "running",
716
- "to": "running",
717
- "event": "RETREAT",
948
+ "to": "completed",
949
+ "event": "ADVANCE",
950
+ "guard": "@entity.isLastStep",
718
951
  "effects": [
719
952
  [
720
953
  "set",
721
- "@entity.currentStepIndex",
722
- [
723
- "-",
724
- "@entity.currentStepIndex",
725
- 1.0
726
- ]
954
+ "@entity.completionMessage",
955
+ "All steps completed. Your submission has been recorded."
956
+ ],
957
+ [
958
+ "persist",
959
+ "update",
960
+ "WizardView",
961
+ "@payload.data",
962
+ {
963
+ "emit": {
964
+ "success": "WizardSaved",
965
+ "failure": "WizardSaveFailed"
966
+ }
967
+ }
727
968
  ],
728
969
  [
729
970
  "render-ui",
730
971
  "main",
731
972
  {
732
- "title": "Going back…",
733
- "type": "loading-state"
973
+ "gap": "lg",
974
+ "type": "stack",
975
+ "align": "center",
976
+ "children": [
977
+ {
978
+ "type": "icon",
979
+ "name": "check-circle",
980
+ "size": "lg"
981
+ },
982
+ {
983
+ "variant": "h2",
984
+ "align": "center",
985
+ "content": "Complete",
986
+ "type": "typography"
987
+ },
988
+ {
989
+ "variant": "body",
990
+ "align": "center",
991
+ "type": "typography",
992
+ "content": "@entity.completionMessage",
993
+ "color": "muted"
994
+ },
995
+ {
996
+ "currentStep": "@entity.totalSteps",
997
+ "steps": "@entity.wizardSteps",
998
+ "type": "wizard-progress",
999
+ "allowNavigation": false
1000
+ },
1001
+ {
1002
+ "label": "Start a new wizard",
1003
+ "variant": "secondary",
1004
+ "type": "button",
1005
+ "action": "RESTART",
1006
+ "icon": "rotate-ccw"
1007
+ }
1008
+ ],
1009
+ "direction": "vertical"
734
1010
  }
735
1011
  ]
736
1012
  ]
@@ -738,171 +1014,248 @@
738
1014
  {
739
1015
  "from": "running",
740
1016
  "to": "running",
741
- "event": "SKIP",
1017
+ "event": "RETREAT",
742
1018
  "effects": [
743
1019
  [
744
1020
  "set",
745
1021
  "@entity.currentStepIndex",
746
1022
  [
747
- "+",
1023
+ "-",
748
1024
  "@entity.currentStepIndex",
749
1025
  1.0
750
1026
  ]
751
1027
  ],
752
1028
  [
753
- "render-ui",
754
- "main",
755
- {
756
- "type": "loading-state",
757
- "title": "Skipping…"
758
- }
759
- ]
760
- ]
761
- },
762
- {
763
- "from": "running",
764
- "to": "completed",
765
- "event": "COMPLETE",
766
- "effects": [
1029
+ "set",
1030
+ "@entity.currentStepLabel",
1031
+ [
1032
+ "object/get",
1033
+ [
1034
+ "array/nth",
1035
+ "@config.steps",
1036
+ "@entity.currentStepIndex"
1037
+ ],
1038
+ "label"
1039
+ ]
1040
+ ],
767
1041
  [
768
1042
  "set",
769
- "@entity.completionMessage",
770
- "All steps completed"
1043
+ "@entity.currentStepDescription",
1044
+ [
1045
+ "object/get",
1046
+ [
1047
+ "array/nth",
1048
+ "@config.steps",
1049
+ "@entity.currentStepIndex"
1050
+ ],
1051
+ "description",
1052
+ ""
1053
+ ]
771
1054
  ],
772
1055
  [
773
1056
  "set",
774
- "@entity.steps",
1057
+ "@entity.currentStepIcon",
775
1058
  [
776
- "array/map",
777
- "@config.steps",
1059
+ "object/get",
778
1060
  [
779
- "fn",
780
- "step",
781
- {
782
- "key": [
783
- "object/get",
784
- "@step",
785
- "key"
786
- ],
787
- "description": [
788
- "object/get",
789
- "@step",
790
- "description",
791
- ""
792
- ],
793
- "number": 1.0,
794
- "status": "completed",
795
- "label": [
796
- "object/get",
797
- "@step",
798
- "label"
799
- ],
800
- "icon": [
801
- "object/get",
802
- "@step",
803
- "icon",
804
- "circle"
805
- ]
806
- }
1061
+ "array/nth",
1062
+ "@config.steps",
1063
+ "@entity.currentStepIndex"
1064
+ ],
1065
+ "icon",
1066
+ "circle"
1067
+ ]
1068
+ ],
1069
+ [
1070
+ "set",
1071
+ "@entity.currentFields",
1072
+ [
1073
+ "object/get",
1074
+ [
1075
+ "array/nth",
1076
+ "@config.steps",
1077
+ "@entity.currentStepIndex"
1078
+ ],
1079
+ "fields",
1080
+ []
1081
+ ]
1082
+ ],
1083
+ [
1084
+ "set",
1085
+ "@entity.isFirstStep",
1086
+ [
1087
+ "=",
1088
+ "@entity.currentStepIndex",
1089
+ 0.0
1090
+ ]
1091
+ ],
1092
+ [
1093
+ "set",
1094
+ "@entity.isLastStep",
1095
+ [
1096
+ "=",
1097
+ "@entity.currentStepIndex",
1098
+ [
1099
+ "-",
1100
+ "@entity.totalSteps",
1101
+ 1.0
807
1102
  ]
808
1103
  ]
809
1104
  ],
1105
+ [
1106
+ "set",
1107
+ "@entity.primaryActionLabel",
1108
+ [
1109
+ "if",
1110
+ [
1111
+ "=",
1112
+ "@entity.currentStepIndex",
1113
+ [
1114
+ "-",
1115
+ "@entity.totalSteps",
1116
+ 1.0
1117
+ ]
1118
+ ],
1119
+ "Submit",
1120
+ "Next"
1121
+ ]
1122
+ ],
1123
+ [
1124
+ "set",
1125
+ "@entity.primaryActionIcon",
1126
+ [
1127
+ "if",
1128
+ [
1129
+ "=",
1130
+ "@entity.currentStepIndex",
1131
+ [
1132
+ "-",
1133
+ "@entity.totalSteps",
1134
+ 1.0
1135
+ ]
1136
+ ],
1137
+ "check-circle",
1138
+ "chevron-right"
1139
+ ]
1140
+ ],
810
1141
  [
811
1142
  "render-ui",
812
1143
  "main",
813
1144
  {
814
1145
  "type": "stack",
815
- "gap": "md",
816
1146
  "direction": "vertical",
817
1147
  "children": [
818
1148
  {
819
- "align": "center",
820
- "type": "stack",
821
1149
  "direction": "horizontal",
1150
+ "type": "stack",
822
1151
  "children": [
823
1152
  {
824
- "name": "check-circle",
1153
+ "name": "list-checks",
825
1154
  "type": "icon"
826
1155
  },
827
1156
  {
828
1157
  "type": "typography",
829
- "variant": "h3",
830
- "content": "Complete"
1158
+ "content": "@config.title",
1159
+ "variant": "h3"
831
1160
  }
832
1161
  ],
1162
+ "align": "center",
833
1163
  "gap": "sm"
834
1164
  },
835
1165
  {
836
- "type": "divider"
1166
+ "allowNavigation": false,
1167
+ "steps": "@entity.wizardSteps",
1168
+ "currentStep": "@entity.currentStepIndex",
1169
+ "type": "wizard-progress"
837
1170
  },
838
1171
  {
839
- "renderItem": [
840
- "fn",
841
- "step",
1172
+ "type": "card",
1173
+ "children": [
842
1174
  {
843
- "type": "card",
1175
+ "gap": "md",
1176
+ "direction": "vertical",
844
1177
  "children": [
845
1178
  {
846
1179
  "align": "center",
847
- "gap": "sm",
848
1180
  "type": "stack",
849
1181
  "children": [
850
1182
  {
851
- "type": "icon",
852
- "name": "@step.icon"
1183
+ "size": "lg",
1184
+ "name": "@entity.currentStepIcon",
1185
+ "type": "icon"
853
1186
  },
854
1187
  {
855
1188
  "type": "stack",
1189
+ "gap": "xs",
856
1190
  "children": [
857
1191
  {
858
- "variant": "h4",
859
- "content": "@step.label",
860
- "type": "typography"
1192
+ "type": "typography",
1193
+ "content": "@entity.currentStepLabel",
1194
+ "variant": "h2"
861
1195
  },
862
1196
  {
863
- "color": "muted",
1197
+ "variant": "body",
864
1198
  "type": "typography",
865
- "variant": "caption",
866
- "content": "@step.description"
1199
+ "content": "@entity.currentStepDescription",
1200
+ "color": "muted"
867
1201
  }
868
1202
  ],
869
- "direction": "vertical",
870
- "gap": "xs"
871
- },
872
- {
873
- "variant": "success",
874
- "type": "badge",
875
- "label": "@step.status"
1203
+ "direction": "vertical"
876
1204
  }
877
1205
  ],
1206
+ "gap": "sm",
878
1207
  "direction": "horizontal"
1208
+ },
1209
+ {
1210
+ "type": "divider"
1211
+ },
1212
+ {
1213
+ "type": "form-section",
1214
+ "fields": "@entity.currentFields",
1215
+ "cancelEvent": "CANCEL",
1216
+ "showCancel": false,
1217
+ "showSubmit": false,
1218
+ "entity": "@entity",
1219
+ "submitEvent": "ADVANCE",
1220
+ "mode": "edit"
879
1221
  }
880
- ]
1222
+ ],
1223
+ "type": "stack"
881
1224
  }
882
- ],
883
- "fields": [],
884
- "gap": "sm",
885
- "type": "data-list",
886
- "entity": "@entity.steps"
1225
+ ]
887
1226
  },
888
1227
  {
889
1228
  "children": [
890
1229
  {
891
- "content": "@entity.completionMessage",
892
- "type": "typography",
893
- "variant": "body"
1230
+ "type": "button",
1231
+ "variant": "ghost",
1232
+ "icon": "chevron-left",
1233
+ "label": "Back",
1234
+ "action": "RETREAT",
1235
+ "disabled": "@entity.isFirstStep"
1236
+ },
1237
+ {
1238
+ "label": "Cancel wizard",
1239
+ "variant": "ghost",
1240
+ "type": "button",
1241
+ "action": "CANCEL",
1242
+ "icon": "x"
1243
+ },
1244
+ {
1245
+ "type": "button",
1246
+ "action": "ADVANCE",
1247
+ "label": "@entity.primaryActionLabel",
1248
+ "variant": "primary",
1249
+ "icon": "@entity.primaryActionIcon"
894
1250
  }
895
1251
  ],
896
- "type": "card"
897
- },
898
- {
899
- "type": "button",
900
- "label": "Restart",
901
- "icon": "rotate-ccw",
902
- "action": "RESTART",
903
- "variant": "secondary"
1252
+ "gap": "sm",
1253
+ "type": "stack",
1254
+ "direction": "horizontal",
1255
+ "align": "center"
904
1256
  }
905
- ]
1257
+ ],
1258
+ "gap": "lg"
906
1259
  }
907
1260
  ]
908
1261
  ]
@@ -921,43 +1274,37 @@
921
1274
  "render-ui",
922
1275
  "main",
923
1276
  {
1277
+ "type": "stack",
924
1278
  "direction": "vertical",
1279
+ "gap": "lg",
1280
+ "align": "center",
925
1281
  "children": [
926
1282
  {
927
- "children": [
928
- {
929
- "type": "icon",
930
- "name": "x-circle"
931
- },
932
- {
933
- "content": "Cancelled",
934
- "variant": "h3",
935
- "type": "typography"
936
- }
937
- ],
938
- "gap": "sm",
939
- "type": "stack",
940
- "direction": "horizontal",
941
- "align": "center"
1283
+ "type": "icon",
1284
+ "name": "x-circle",
1285
+ "size": "lg"
942
1286
  },
943
1287
  {
944
- "type": "divider"
1288
+ "align": "center",
1289
+ "variant": "h2",
1290
+ "type": "typography",
1291
+ "content": "Cancelled"
945
1292
  },
946
1293
  {
947
1294
  "type": "typography",
948
1295
  "variant": "body",
949
- "content": "Wizard cancelled."
1296
+ "align": "center",
1297
+ "color": "muted",
1298
+ "content": "The wizard was cancelled. No data was submitted."
950
1299
  },
951
1300
  {
952
- "icon": "rotate-ccw",
953
- "label": "Restart",
954
- "type": "button",
955
1301
  "variant": "secondary",
1302
+ "type": "button",
1303
+ "label": "Start a new wizard",
1304
+ "icon": "rotate-ccw",
956
1305
  "action": "RESTART"
957
1306
  }
958
- ],
959
- "type": "stack",
960
- "gap": "md"
1307
+ ]
961
1308
  }
962
1309
  ]
963
1310
  ]
@@ -972,12 +1319,27 @@
972
1319
  "@entity.currentStepIndex",
973
1320
  0.0
974
1321
  ],
1322
+ [
1323
+ "set",
1324
+ "@entity.completionMessage",
1325
+ ""
1326
+ ],
1327
+ [
1328
+ "fetch",
1329
+ "WizardView",
1330
+ {
1331
+ "emit": {
1332
+ "success": "WizardLoaded",
1333
+ "failure": "WizardLoadFailed"
1334
+ }
1335
+ }
1336
+ ],
975
1337
  [
976
1338
  "render-ui",
977
1339
  "main",
978
1340
  {
979
- "title": "Restarting…",
980
- "type": "loading-state"
1341
+ "type": "loading-state",
1342
+ "title": "Restarting…"
981
1343
  }
982
1344
  ]
983
1345
  ]
@@ -992,6 +1354,21 @@
992
1354
  "@entity.currentStepIndex",
993
1355
  0.0
994
1356
  ],
1357
+ [
1358
+ "set",
1359
+ "@entity.cancelReason",
1360
+ ""
1361
+ ],
1362
+ [
1363
+ "fetch",
1364
+ "WizardView",
1365
+ {
1366
+ "emit": {
1367
+ "success": "WizardLoaded",
1368
+ "failure": "WizardLoadFailed"
1369
+ }
1370
+ }
1371
+ ],
995
1372
  [
996
1373
  "render-ui",
997
1374
  "main",
@@ -1024,43 +1401,36 @@
1024
1401
  "type": "[object]",
1025
1402
  "default": [
1026
1403
  {
1027
- "description": "Basic information",
1028
- "key": "details",
1404
+ "label": "Details",
1405
+ "icon": "file-text",
1029
1406
  "fields": [
1030
1407
  "title",
1031
1408
  "description"
1032
1409
  ],
1033
- "icon": "file-text",
1034
- "label": "Details"
1410
+ "key": "details",
1411
+ "description": "Basic information"
1035
1412
  },
1036
1413
  {
1037
- "icon": "settings",
1038
- "description": "Configure preferences",
1414
+ "key": "options",
1039
1415
  "fields": [
1040
1416
  "category",
1041
1417
  "priority"
1042
1418
  ],
1043
1419
  "label": "Options",
1044
- "key": "options"
1420
+ "icon": "settings",
1421
+ "description": "Configure preferences"
1045
1422
  },
1046
1423
  {
1047
- "key": "review",
1048
- "label": "Review",
1049
1424
  "icon": "check-circle",
1050
- "description": "Confirm and submit",
1425
+ "key": "review",
1051
1426
  "fields": [
1052
1427
  "notes"
1053
- ]
1428
+ ],
1429
+ "label": "Review",
1430
+ "description": "Confirm and submit"
1054
1431
  }
1055
1432
  ]
1056
1433
  },
1057
- "currentFields": {
1058
- "type": "[string]",
1059
- "default": [
1060
- "title",
1061
- "description"
1062
- ]
1063
- },
1064
1434
  "title": {
1065
1435
  "type": "string",
1066
1436
  "default": "Wizard"