@almadar/std 14.7.1 → 14.8.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.
@@ -111,8 +111,6 @@
111
111
  "render-ui",
112
112
  "main",
113
113
  {
114
- "type": "stack",
115
- "align": "center",
116
114
  "children": [
117
115
  {
118
116
  "align": "center",
@@ -123,9 +121,9 @@
123
121
  "type": "icon"
124
122
  },
125
123
  {
126
- "type": "typography",
127
124
  "content": "Payment",
128
- "variant": "h2"
125
+ "variant": "h2",
126
+ "type": "typography"
129
127
  }
130
128
  ],
131
129
  "direction": "horizontal",
@@ -135,19 +133,18 @@
135
133
  "type": "divider"
136
134
  },
137
135
  {
138
- "type": "stack",
139
136
  "direction": "vertical",
140
137
  "children": [
141
138
  {
142
- "placeholder": "0.00",
139
+ "inputType": "number",
143
140
  "type": "input",
144
- "inputType": "number"
141
+ "placeholder": "0.00"
145
142
  },
146
143
  {
147
144
  "options": [
148
145
  {
149
- "label": "USD",
150
- "value": "usd"
146
+ "value": "usd",
147
+ "label": "USD"
151
148
  },
152
149
  {
153
150
  "value": "eur",
@@ -161,18 +158,21 @@
161
158
  "type": "select"
162
159
  }
163
160
  ],
164
- "gap": "md"
161
+ "gap": "md",
162
+ "type": "stack"
165
163
  },
166
164
  {
165
+ "action": "CREATE_PAYMENT",
167
166
  "type": "button",
168
167
  "icon": "credit-card",
169
168
  "variant": "primary",
170
- "label": "Pay",
171
- "action": "CREATE_PAYMENT"
169
+ "label": "Pay"
172
170
  }
173
171
  ],
172
+ "align": "center",
173
+ "direction": "vertical",
174
174
  "gap": "lg",
175
- "direction": "vertical"
175
+ "type": "stack"
176
176
  }
177
177
  ]
178
178
  ]
@@ -253,6 +253,16 @@
253
253
  "type": "object"
254
254
  }
255
255
  ]
256
+ },
257
+ {
258
+ "event": "FAILED",
259
+ "payloadSchema": [
260
+ {
261
+ "name": "error",
262
+ "type": "string",
263
+ "required": true
264
+ }
265
+ ]
256
266
  }
257
267
  ],
258
268
  "listens": [
@@ -413,12 +423,12 @@
413
423
  "render-ui",
414
424
  "main",
415
425
  {
416
- "gap": "md",
417
- "type": "stack",
418
426
  "direction": "vertical",
419
427
  "children": [
420
428
  "@config.uiTrait"
421
- ]
429
+ ],
430
+ "gap": "md",
431
+ "type": "stack"
422
432
  }
423
433
  ]
424
434
  ]
@@ -442,14 +452,14 @@
442
452
  "stripe",
443
453
  "createPaymentIntent",
444
454
  {
445
- "currency": "@entity.currency",
446
455
  "amount": "@entity.amount",
456
+ "currency": "@entity.currency",
447
457
  "metadata": "@config.metadata"
448
458
  },
449
459
  {
450
460
  "emit": {
451
- "success": "PAYMENT_CREATED",
452
- "failure": "ServiceStripeStripeFailed"
461
+ "failure": "FAILED",
462
+ "success": "PAYMENT_CREATED"
453
463
  }
454
464
  }
455
465
  ]
@@ -484,9 +494,9 @@
484
494
  "render-ui",
485
495
  "main",
486
496
  {
497
+ "message": "Processing your payment.",
487
498
  "type": "loading-state",
488
- "title": "Confirming payment...",
489
- "message": "Processing your payment."
499
+ "title": "Confirming payment..."
490
500
  }
491
501
  ],
492
502
  [
@@ -498,8 +508,8 @@
498
508
  },
499
509
  {
500
510
  "emit": {
501
- "failure": "ServiceStripeStripeFailed",
502
- "success": "PAYMENT_CONFIRMED"
511
+ "success": "PAYMENT_CONFIRMED",
512
+ "failure": "FAILED"
503
513
  }
504
514
  }
505
515
  ]
@@ -515,14 +525,22 @@
515
525
  "@entity.error",
516
526
  "@payload.error"
517
527
  ],
528
+ [
529
+ "emit",
530
+ "ServiceStripeStripeFailed",
531
+ {
532
+ "error": "@entity.error",
533
+ "code": "create_payment_failed"
534
+ }
535
+ ],
518
536
  [
519
537
  "render-ui",
520
538
  "main",
521
539
  {
522
540
  "message": "@entity.error",
523
- "type": "error-state",
524
541
  "onRetry": "RETRY",
525
- "title": "Payment Failed"
542
+ "title": "Payment Failed",
543
+ "type": "error-state"
526
544
  }
527
545
  ]
528
546
  ]
@@ -548,33 +566,33 @@
548
566
  "render-ui",
549
567
  "main",
550
568
  {
569
+ "direction": "vertical",
551
570
  "gap": "lg",
552
- "align": "center",
553
571
  "children": [
554
572
  {
555
- "name": "check-circle",
556
- "type": "icon"
573
+ "type": "icon",
574
+ "name": "check-circle"
557
575
  },
558
576
  {
559
- "variant": "success",
577
+ "message": "Payment successful!",
560
578
  "type": "alert",
561
- "message": "Payment successful!"
579
+ "variant": "success"
562
580
  },
563
581
  {
564
- "variant": "body",
565
582
  "content": "@entity.paymentIntentId",
566
583
  "type": "typography",
584
+ "variant": "body",
567
585
  "color": "muted"
568
586
  },
569
587
  {
588
+ "variant": "ghost",
570
589
  "icon": "rotate-ccw",
571
- "label": "New Payment",
572
- "type": "button",
573
590
  "action": "RESET",
574
- "variant": "ghost"
591
+ "type": "button",
592
+ "label": "New Payment"
575
593
  }
576
594
  ],
577
- "direction": "vertical",
595
+ "align": "center",
578
596
  "type": "stack"
579
597
  }
580
598
  ]
@@ -590,13 +608,21 @@
590
608
  "@entity.error",
591
609
  "@payload.error"
592
610
  ],
611
+ [
612
+ "emit",
613
+ "ServiceStripeStripeFailed",
614
+ {
615
+ "code": "confirm_payment_failed",
616
+ "error": "@entity.error"
617
+ }
618
+ ],
593
619
  [
594
620
  "render-ui",
595
621
  "main",
596
622
  {
597
- "title": "Payment Failed",
598
- "onRetry": "RETRY",
599
623
  "message": "@entity.error",
624
+ "onRetry": "RETRY",
625
+ "title": "Payment Failed",
600
626
  "type": "error-state"
601
627
  }
602
628
  ]
@@ -612,10 +638,11 @@
612
638
  "main",
613
639
  {
614
640
  "type": "stack",
641
+ "gap": "lg",
642
+ "align": "center",
615
643
  "direction": "vertical",
616
644
  "children": [
617
645
  {
618
- "type": "stack",
619
646
  "children": [
620
647
  {
621
648
  "type": "icon",
@@ -623,27 +650,28 @@
623
650
  },
624
651
  {
625
652
  "type": "typography",
626
- "variant": "h2",
627
- "content": "Payment"
653
+ "content": "Payment",
654
+ "variant": "h2"
628
655
  }
629
656
  ],
630
657
  "direction": "horizontal",
631
- "gap": "md",
632
- "align": "center"
658
+ "type": "stack",
659
+ "align": "center",
660
+ "gap": "md"
633
661
  },
634
662
  {
635
663
  "type": "divider"
636
664
  },
637
665
  {
638
- "gap": "md",
639
- "type": "stack",
666
+ "direction": "vertical",
640
667
  "children": [
641
668
  {
642
- "inputType": "number",
643
669
  "type": "input",
670
+ "inputType": "number",
644
671
  "placeholder": "0.00"
645
672
  },
646
673
  {
674
+ "type": "select",
647
675
  "options": [
648
676
  {
649
677
  "value": "usd",
@@ -657,22 +685,20 @@
657
685
  "value": "gbp",
658
686
  "label": "GBP"
659
687
  }
660
- ],
661
- "type": "select"
688
+ ]
662
689
  }
663
690
  ],
664
- "direction": "vertical"
691
+ "gap": "md",
692
+ "type": "stack"
665
693
  },
666
694
  {
667
- "label": "Pay",
668
- "variant": "primary",
669
695
  "type": "button",
670
696
  "icon": "credit-card",
671
- "action": "CREATE_PAYMENT"
697
+ "action": "CREATE_PAYMENT",
698
+ "label": "Pay",
699
+ "variant": "primary"
672
700
  }
673
- ],
674
- "gap": "lg",
675
- "align": "center"
701
+ ]
676
702
  }
677
703
  ]
678
704
  ]
@@ -696,43 +722,44 @@
696
722
  "render-ui",
697
723
  "main",
698
724
  {
699
- "type": "stack",
725
+ "direction": "vertical",
726
+ "gap": "lg",
700
727
  "children": [
701
728
  {
702
729
  "type": "stack",
703
- "gap": "md",
704
- "direction": "horizontal",
730
+ "align": "center",
705
731
  "children": [
706
732
  {
707
- "name": "credit-card",
708
- "type": "icon"
733
+ "type": "icon",
734
+ "name": "credit-card"
709
735
  },
710
736
  {
711
- "content": "Payment",
712
737
  "variant": "h2",
713
- "type": "typography"
738
+ "type": "typography",
739
+ "content": "Payment"
714
740
  }
715
741
  ],
716
- "align": "center"
742
+ "direction": "horizontal",
743
+ "gap": "md"
717
744
  },
718
745
  {
719
746
  "type": "divider"
720
747
  },
721
748
  {
722
- "direction": "vertical",
749
+ "type": "stack",
723
750
  "gap": "md",
724
751
  "children": [
725
752
  {
726
- "inputType": "number",
727
753
  "type": "input",
728
- "placeholder": "0.00"
754
+ "placeholder": "0.00",
755
+ "inputType": "number"
729
756
  },
730
757
  {
731
758
  "type": "select",
732
759
  "options": [
733
760
  {
734
- "value": "usd",
735
- "label": "USD"
761
+ "label": "USD",
762
+ "value": "usd"
736
763
  },
737
764
  {
738
765
  "value": "eur",
@@ -745,19 +772,18 @@
745
772
  ]
746
773
  }
747
774
  ],
748
- "type": "stack"
775
+ "direction": "vertical"
749
776
  },
750
777
  {
751
- "type": "button",
752
- "label": "Pay",
753
778
  "action": "CREATE_PAYMENT",
779
+ "label": "Pay",
780
+ "type": "button",
754
781
  "variant": "primary",
755
782
  "icon": "credit-card"
756
783
  }
757
784
  ],
758
- "gap": "lg",
759
785
  "align": "center",
760
- "direction": "vertical"
786
+ "type": "stack"
761
787
  }
762
788
  ]
763
789
  ]
@@ -771,23 +797,21 @@
771
797
  "render-ui",
772
798
  "main",
773
799
  {
774
- "direction": "vertical",
775
- "align": "center",
776
800
  "children": [
777
801
  {
778
- "type": "stack",
802
+ "align": "center",
779
803
  "gap": "md",
780
804
  "direction": "horizontal",
781
- "align": "center",
805
+ "type": "stack",
782
806
  "children": [
783
807
  {
784
- "type": "icon",
785
- "name": "credit-card"
808
+ "name": "credit-card",
809
+ "type": "icon"
786
810
  },
787
811
  {
812
+ "content": "Payment",
788
813
  "type": "typography",
789
- "variant": "h2",
790
- "content": "Payment"
814
+ "variant": "h2"
791
815
  }
792
816
  ]
793
817
  },
@@ -802,37 +826,39 @@
802
826
  "placeholder": "0.00"
803
827
  },
804
828
  {
805
- "type": "select",
806
829
  "options": [
807
830
  {
808
831
  "value": "usd",
809
832
  "label": "USD"
810
833
  },
811
834
  {
812
- "label": "EUR",
813
- "value": "eur"
835
+ "value": "eur",
836
+ "label": "EUR"
814
837
  },
815
838
  {
816
839
  "label": "GBP",
817
840
  "value": "gbp"
818
841
  }
819
- ]
842
+ ],
843
+ "type": "select"
820
844
  }
821
845
  ],
822
- "direction": "vertical",
823
846
  "gap": "md",
847
+ "direction": "vertical",
824
848
  "type": "stack"
825
849
  },
826
850
  {
827
- "type": "button",
828
851
  "variant": "primary",
829
852
  "label": "Pay",
830
853
  "icon": "credit-card",
831
- "action": "CREATE_PAYMENT"
854
+ "action": "CREATE_PAYMENT",
855
+ "type": "button"
832
856
  }
833
857
  ],
834
- "gap": "lg",
835
- "type": "stack"
858
+ "type": "stack",
859
+ "direction": "vertical",
860
+ "align": "center",
861
+ "gap": "lg"
836
862
  }
837
863
  ]
838
864
  ]
@@ -840,17 +866,17 @@
840
866
  ]
841
867
  },
842
868
  "config": {
843
- "uiTrait": {
844
- "type": "trait",
845
- "default": "@trait.ServiceStripeDefaultForm"
869
+ "amount": {
870
+ "type": "number",
871
+ "default": 0.0
846
872
  },
847
873
  "currency": {
848
874
  "type": "string",
849
875
  "default": "usd"
850
876
  },
851
- "amount": {
852
- "type": "number",
853
- "default": 0.0
877
+ "uiTrait": {
878
+ "type": "trait",
879
+ "default": "@trait.ServiceStripeDefaultForm"
854
880
  },
855
881
  "metadata": {
856
882
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/std",
3
- "version": "14.7.1",
3
+ "version": "14.8.0",
4
4
  "description": "Standard library operators for Almadar (math, string, array, etc.)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",