@oanda/labs-sentiment-widget 1.0.126 → 1.0.128

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/CHANGELOG.md CHANGED
@@ -3,6 +3,1002 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.0.128 (2024-06-17)
7
+
8
+
9
+
10
+ ## 1.0.127 (2024-06-10)
11
+
12
+
13
+
14
+ ## 1.0.126 (2024-05-29)
15
+
16
+
17
+
18
+ ## 1.0.125 (2024-05-29)
19
+
20
+
21
+
22
+ ## 1.0.124 (2024-05-29)
23
+
24
+
25
+
26
+ ## 1.0.123 (2024-05-28)
27
+
28
+
29
+
30
+ ## 1.0.122 (2024-05-27)
31
+
32
+
33
+
34
+ ## 1.0.121 (2024-05-27)
35
+
36
+
37
+
38
+ ## 1.0.120 (2024-05-24)
39
+
40
+
41
+
42
+ ## 1.0.119 (2024-05-17)
43
+
44
+
45
+
46
+ ## 1.0.118 (2024-05-09)
47
+
48
+
49
+
50
+ ## 1.0.117 (2024-05-07)
51
+
52
+
53
+
54
+ ## 1.0.116 (2024-04-23)
55
+
56
+
57
+
58
+ ## 1.0.115 (2024-04-22)
59
+
60
+
61
+
62
+ ## 1.0.114 (2024-04-19)
63
+
64
+
65
+
66
+ ## 1.0.113 (2024-04-19)
67
+
68
+
69
+
70
+ ## 1.0.112 (2024-04-15)
71
+
72
+
73
+
74
+ ## 1.0.111 (2024-04-11)
75
+
76
+
77
+
78
+ ## 1.0.110 (2024-04-05)
79
+
80
+
81
+
82
+ ## 1.0.109 (2024-04-05)
83
+
84
+
85
+
86
+ ## 1.0.108 (2024-04-04)
87
+
88
+
89
+
90
+ ## 1.0.107 (2024-04-03)
91
+
92
+
93
+
94
+ ## 1.0.106 (2024-03-29)
95
+
96
+
97
+
98
+ ## 1.0.105 (2024-03-28)
99
+
100
+
101
+
102
+ ## 1.0.104 (2024-03-21)
103
+
104
+
105
+
106
+ ## 1.0.103 (2024-03-20)
107
+
108
+
109
+
110
+ ## 1.0.102 (2024-03-20)
111
+
112
+
113
+
114
+ ## 1.0.101 (2024-03-13)
115
+
116
+
117
+
118
+ ## 1.0.100 (2024-03-12)
119
+
120
+
121
+
122
+ ## 1.0.99 (2024-03-11)
123
+
124
+
125
+
126
+ ## 1.0.98 (2024-03-07)
127
+
128
+
129
+
130
+ ## 1.0.97 (2024-03-06)
131
+
132
+
133
+
134
+ ## 1.0.96 (2024-03-06)
135
+
136
+
137
+
138
+ ## 1.0.95 (2024-03-04)
139
+
140
+
141
+
142
+ ## 1.0.94 (2024-02-29)
143
+
144
+
145
+
146
+ ## 1.0.93 (2024-02-28)
147
+
148
+
149
+
150
+ ## 1.0.92 (2024-02-28)
151
+
152
+
153
+
154
+ ## 1.0.91 (2024-02-23)
155
+
156
+
157
+
158
+ ## 1.0.90 (2024-02-23)
159
+
160
+
161
+
162
+ ## 1.0.89 (2024-02-21)
163
+
164
+
165
+
166
+ ## 1.0.88 (2024-02-21)
167
+
168
+
169
+
170
+ ## 1.0.87 (2024-02-20)
171
+
172
+
173
+
174
+ ## 1.0.86 (2024-02-20)
175
+
176
+
177
+
178
+ ## 1.0.85 (2024-02-13)
179
+
180
+
181
+
182
+ ## 1.0.84 (2024-02-13)
183
+
184
+
185
+
186
+ ## 1.0.83 (2024-02-09)
187
+
188
+
189
+
190
+ ## 1.0.82 (2024-02-05)
191
+
192
+
193
+
194
+ ## 1.0.81 (2024-02-05)
195
+
196
+
197
+
198
+ ## 1.0.80 (2024-02-05)
199
+
200
+
201
+
202
+ ## 1.0.79 (2024-02-05)
203
+
204
+
205
+
206
+ ## 1.0.78 (2024-01-30)
207
+
208
+
209
+
210
+ ## 1.0.77 (2024-01-25)
211
+
212
+
213
+
214
+ ## 1.0.76 (2024-01-25)
215
+
216
+
217
+
218
+ ## 1.0.75 (2024-01-22)
219
+
220
+
221
+
222
+ ## 1.0.74 (2024-01-22)
223
+
224
+
225
+
226
+ ## 1.0.73 (2024-01-22)
227
+
228
+
229
+
230
+ ## 1.0.72 (2024-01-19)
231
+
232
+
233
+
234
+ ## 1.0.71 (2024-01-18)
235
+
236
+
237
+
238
+ ## 1.0.70 (2024-01-17)
239
+
240
+
241
+
242
+ ## 1.0.69 (2024-01-17)
243
+
244
+
245
+
246
+ ## 1.0.68 (2024-01-15)
247
+
248
+
249
+
250
+ ## 1.0.67 (2024-01-15)
251
+
252
+
253
+
254
+ ## 1.0.66 (2024-01-12)
255
+
256
+
257
+
258
+ ## 1.0.65 (2024-01-11)
259
+
260
+
261
+
262
+ ## 1.0.64 (2024-01-11)
263
+
264
+
265
+
266
+ ## 1.0.63 (2024-01-11)
267
+
268
+
269
+
270
+ ## 1.0.62 (2024-01-10)
271
+
272
+
273
+
274
+ ## 1.0.61 (2024-01-09)
275
+
276
+
277
+
278
+ ## 1.0.60 (2024-01-05)
279
+
280
+
281
+
282
+ ## 1.0.59 (2023-12-27)
283
+
284
+
285
+
286
+ ## 1.0.58 (2023-12-22)
287
+
288
+
289
+
290
+ ## 1.0.57 (2023-12-22)
291
+
292
+
293
+
294
+ ## 1.0.56 (2023-12-21)
295
+
296
+
297
+
298
+ ## 1.0.55 (2023-12-19)
299
+
300
+
301
+
302
+ ## 1.0.54 (2023-12-15)
303
+
304
+
305
+
306
+ ## 1.0.53 (2023-12-13)
307
+
308
+
309
+
310
+ ## 1.0.52 (2023-12-13)
311
+
312
+
313
+
314
+ ## 1.0.51 (2023-12-07)
315
+
316
+
317
+
318
+ ## 1.0.50 (2023-12-04)
319
+
320
+
321
+
322
+ ## 1.0.49 (2023-12-01)
323
+
324
+
325
+
326
+ ## 1.0.48 (2023-12-01)
327
+
328
+
329
+
330
+ ## 1.0.47 (2023-11-29)
331
+
332
+
333
+
334
+ ## 1.0.46 (2023-11-28)
335
+
336
+
337
+
338
+ ## 1.0.45 (2023-11-23)
339
+
340
+
341
+
342
+ ## 1.0.44 (2023-11-22)
343
+
344
+
345
+
346
+ ## 1.0.43 (2023-11-15)
347
+
348
+
349
+
350
+ ## 1.0.42 (2023-11-10)
351
+
352
+
353
+
354
+ ## 1.0.41 (2023-11-03)
355
+
356
+
357
+
358
+ ## 1.0.40 (2023-11-02)
359
+
360
+
361
+
362
+ ## 1.0.39 (2023-11-02)
363
+
364
+
365
+
366
+ ## 1.0.38 (2023-10-26)
367
+
368
+
369
+
370
+ ## 1.0.37 (2023-10-26)
371
+
372
+
373
+
374
+ ## 1.0.36 (2023-10-25)
375
+
376
+
377
+
378
+ ## 1.0.35 (2023-10-24)
379
+
380
+
381
+
382
+ ## 1.0.34 (2023-10-23)
383
+
384
+
385
+
386
+ ## 1.0.33 (2023-10-23)
387
+
388
+
389
+
390
+ ## 1.0.32 (2023-10-23)
391
+
392
+
393
+
394
+ ## 1.0.31 (2023-10-20)
395
+
396
+
397
+
398
+ ## 1.0.30 (2023-10-19)
399
+
400
+
401
+
402
+ ## 1.0.29 (2023-10-19)
403
+
404
+
405
+
406
+ ## 1.0.28 (2023-10-19)
407
+
408
+
409
+
410
+ ## 1.0.27 (2023-10-18)
411
+
412
+
413
+
414
+ ## 1.0.26 (2023-10-18)
415
+
416
+
417
+
418
+ ## 1.0.25 (2023-10-17)
419
+
420
+
421
+
422
+ ## 1.0.24 (2023-10-13)
423
+
424
+
425
+
426
+ ## 1.0.23 (2023-10-13)
427
+
428
+
429
+
430
+ ## 1.0.22 (2023-10-11)
431
+
432
+
433
+
434
+ ## 1.0.21 (2023-10-10)
435
+
436
+
437
+
438
+ ## 1.0.20 (2023-10-06)
439
+
440
+
441
+
442
+ ## 1.0.19 (2023-10-06)
443
+
444
+
445
+
446
+ ## 1.0.18 (2023-10-05)
447
+
448
+
449
+
450
+ ## 1.0.17 (2023-10-04)
451
+
452
+
453
+
454
+ ## 1.0.16 (2023-10-04)
455
+
456
+
457
+
458
+ ## 1.0.15 (2023-10-04)
459
+
460
+
461
+
462
+ ## 1.0.14 (2023-10-03)
463
+
464
+
465
+
466
+ ## 1.0.13 (2023-10-03)
467
+
468
+
469
+
470
+ ## 1.0.12 (2023-10-03)
471
+
472
+
473
+
474
+ ## 1.0.11 (2023-10-02)
475
+
476
+
477
+
478
+ ## 1.0.10 (2023-09-29)
479
+
480
+
481
+
482
+ ## 1.0.9 (2023-09-28)
483
+
484
+
485
+
486
+ ## 1.0.8 (2023-09-27)
487
+
488
+
489
+
490
+ ## 1.0.7 (2023-09-26)
491
+
492
+
493
+
494
+ ## 1.0.6 (2023-09-21)
495
+
496
+
497
+
498
+ ## 1.0.5 (2023-09-13)
499
+
500
+ **Note:** Version bump only for package @oanda/labs-sentiment-widget
501
+
502
+
503
+
504
+
505
+
506
+ ## 1.0.127 (2024-06-10)
507
+
508
+
509
+
510
+ ## 1.0.126 (2024-05-29)
511
+
512
+
513
+
514
+ ## 1.0.125 (2024-05-29)
515
+
516
+
517
+
518
+ ## 1.0.124 (2024-05-29)
519
+
520
+
521
+
522
+ ## 1.0.123 (2024-05-28)
523
+
524
+
525
+
526
+ ## 1.0.122 (2024-05-27)
527
+
528
+
529
+
530
+ ## 1.0.121 (2024-05-27)
531
+
532
+
533
+
534
+ ## 1.0.120 (2024-05-24)
535
+
536
+
537
+
538
+ ## 1.0.119 (2024-05-17)
539
+
540
+
541
+
542
+ ## 1.0.118 (2024-05-09)
543
+
544
+
545
+
546
+ ## 1.0.117 (2024-05-07)
547
+
548
+
549
+
550
+ ## 1.0.116 (2024-04-23)
551
+
552
+
553
+
554
+ ## 1.0.115 (2024-04-22)
555
+
556
+
557
+
558
+ ## 1.0.114 (2024-04-19)
559
+
560
+
561
+
562
+ ## 1.0.113 (2024-04-19)
563
+
564
+
565
+
566
+ ## 1.0.112 (2024-04-15)
567
+
568
+
569
+
570
+ ## 1.0.111 (2024-04-11)
571
+
572
+
573
+
574
+ ## 1.0.110 (2024-04-05)
575
+
576
+
577
+
578
+ ## 1.0.109 (2024-04-05)
579
+
580
+
581
+
582
+ ## 1.0.108 (2024-04-04)
583
+
584
+
585
+
586
+ ## 1.0.107 (2024-04-03)
587
+
588
+
589
+
590
+ ## 1.0.106 (2024-03-29)
591
+
592
+
593
+
594
+ ## 1.0.105 (2024-03-28)
595
+
596
+
597
+
598
+ ## 1.0.104 (2024-03-21)
599
+
600
+
601
+
602
+ ## 1.0.103 (2024-03-20)
603
+
604
+
605
+
606
+ ## 1.0.102 (2024-03-20)
607
+
608
+
609
+
610
+ ## 1.0.101 (2024-03-13)
611
+
612
+
613
+
614
+ ## 1.0.100 (2024-03-12)
615
+
616
+
617
+
618
+ ## 1.0.99 (2024-03-11)
619
+
620
+
621
+
622
+ ## 1.0.98 (2024-03-07)
623
+
624
+
625
+
626
+ ## 1.0.97 (2024-03-06)
627
+
628
+
629
+
630
+ ## 1.0.96 (2024-03-06)
631
+
632
+
633
+
634
+ ## 1.0.95 (2024-03-04)
635
+
636
+
637
+
638
+ ## 1.0.94 (2024-02-29)
639
+
640
+
641
+
642
+ ## 1.0.93 (2024-02-28)
643
+
644
+
645
+
646
+ ## 1.0.92 (2024-02-28)
647
+
648
+
649
+
650
+ ## 1.0.91 (2024-02-23)
651
+
652
+
653
+
654
+ ## 1.0.90 (2024-02-23)
655
+
656
+
657
+
658
+ ## 1.0.89 (2024-02-21)
659
+
660
+
661
+
662
+ ## 1.0.88 (2024-02-21)
663
+
664
+
665
+
666
+ ## 1.0.87 (2024-02-20)
667
+
668
+
669
+
670
+ ## 1.0.86 (2024-02-20)
671
+
672
+
673
+
674
+ ## 1.0.85 (2024-02-13)
675
+
676
+
677
+
678
+ ## 1.0.84 (2024-02-13)
679
+
680
+
681
+
682
+ ## 1.0.83 (2024-02-09)
683
+
684
+
685
+
686
+ ## 1.0.82 (2024-02-05)
687
+
688
+
689
+
690
+ ## 1.0.81 (2024-02-05)
691
+
692
+
693
+
694
+ ## 1.0.80 (2024-02-05)
695
+
696
+
697
+
698
+ ## 1.0.79 (2024-02-05)
699
+
700
+
701
+
702
+ ## 1.0.78 (2024-01-30)
703
+
704
+
705
+
706
+ ## 1.0.77 (2024-01-25)
707
+
708
+
709
+
710
+ ## 1.0.76 (2024-01-25)
711
+
712
+
713
+
714
+ ## 1.0.75 (2024-01-22)
715
+
716
+
717
+
718
+ ## 1.0.74 (2024-01-22)
719
+
720
+
721
+
722
+ ## 1.0.73 (2024-01-22)
723
+
724
+
725
+
726
+ ## 1.0.72 (2024-01-19)
727
+
728
+
729
+
730
+ ## 1.0.71 (2024-01-18)
731
+
732
+
733
+
734
+ ## 1.0.70 (2024-01-17)
735
+
736
+
737
+
738
+ ## 1.0.69 (2024-01-17)
739
+
740
+
741
+
742
+ ## 1.0.68 (2024-01-15)
743
+
744
+
745
+
746
+ ## 1.0.67 (2024-01-15)
747
+
748
+
749
+
750
+ ## 1.0.66 (2024-01-12)
751
+
752
+
753
+
754
+ ## 1.0.65 (2024-01-11)
755
+
756
+
757
+
758
+ ## 1.0.64 (2024-01-11)
759
+
760
+
761
+
762
+ ## 1.0.63 (2024-01-11)
763
+
764
+
765
+
766
+ ## 1.0.62 (2024-01-10)
767
+
768
+
769
+
770
+ ## 1.0.61 (2024-01-09)
771
+
772
+
773
+
774
+ ## 1.0.60 (2024-01-05)
775
+
776
+
777
+
778
+ ## 1.0.59 (2023-12-27)
779
+
780
+
781
+
782
+ ## 1.0.58 (2023-12-22)
783
+
784
+
785
+
786
+ ## 1.0.57 (2023-12-22)
787
+
788
+
789
+
790
+ ## 1.0.56 (2023-12-21)
791
+
792
+
793
+
794
+ ## 1.0.55 (2023-12-19)
795
+
796
+
797
+
798
+ ## 1.0.54 (2023-12-15)
799
+
800
+
801
+
802
+ ## 1.0.53 (2023-12-13)
803
+
804
+
805
+
806
+ ## 1.0.52 (2023-12-13)
807
+
808
+
809
+
810
+ ## 1.0.51 (2023-12-07)
811
+
812
+
813
+
814
+ ## 1.0.50 (2023-12-04)
815
+
816
+
817
+
818
+ ## 1.0.49 (2023-12-01)
819
+
820
+
821
+
822
+ ## 1.0.48 (2023-12-01)
823
+
824
+
825
+
826
+ ## 1.0.47 (2023-11-29)
827
+
828
+
829
+
830
+ ## 1.0.46 (2023-11-28)
831
+
832
+
833
+
834
+ ## 1.0.45 (2023-11-23)
835
+
836
+
837
+
838
+ ## 1.0.44 (2023-11-22)
839
+
840
+
841
+
842
+ ## 1.0.43 (2023-11-15)
843
+
844
+
845
+
846
+ ## 1.0.42 (2023-11-10)
847
+
848
+
849
+
850
+ ## 1.0.41 (2023-11-03)
851
+
852
+
853
+
854
+ ## 1.0.40 (2023-11-02)
855
+
856
+
857
+
858
+ ## 1.0.39 (2023-11-02)
859
+
860
+
861
+
862
+ ## 1.0.38 (2023-10-26)
863
+
864
+
865
+
866
+ ## 1.0.37 (2023-10-26)
867
+
868
+
869
+
870
+ ## 1.0.36 (2023-10-25)
871
+
872
+
873
+
874
+ ## 1.0.35 (2023-10-24)
875
+
876
+
877
+
878
+ ## 1.0.34 (2023-10-23)
879
+
880
+
881
+
882
+ ## 1.0.33 (2023-10-23)
883
+
884
+
885
+
886
+ ## 1.0.32 (2023-10-23)
887
+
888
+
889
+
890
+ ## 1.0.31 (2023-10-20)
891
+
892
+
893
+
894
+ ## 1.0.30 (2023-10-19)
895
+
896
+
897
+
898
+ ## 1.0.29 (2023-10-19)
899
+
900
+
901
+
902
+ ## 1.0.28 (2023-10-19)
903
+
904
+
905
+
906
+ ## 1.0.27 (2023-10-18)
907
+
908
+
909
+
910
+ ## 1.0.26 (2023-10-18)
911
+
912
+
913
+
914
+ ## 1.0.25 (2023-10-17)
915
+
916
+
917
+
918
+ ## 1.0.24 (2023-10-13)
919
+
920
+
921
+
922
+ ## 1.0.23 (2023-10-13)
923
+
924
+
925
+
926
+ ## 1.0.22 (2023-10-11)
927
+
928
+
929
+
930
+ ## 1.0.21 (2023-10-10)
931
+
932
+
933
+
934
+ ## 1.0.20 (2023-10-06)
935
+
936
+
937
+
938
+ ## 1.0.19 (2023-10-06)
939
+
940
+
941
+
942
+ ## 1.0.18 (2023-10-05)
943
+
944
+
945
+
946
+ ## 1.0.17 (2023-10-04)
947
+
948
+
949
+
950
+ ## 1.0.16 (2023-10-04)
951
+
952
+
953
+
954
+ ## 1.0.15 (2023-10-04)
955
+
956
+
957
+
958
+ ## 1.0.14 (2023-10-03)
959
+
960
+
961
+
962
+ ## 1.0.13 (2023-10-03)
963
+
964
+
965
+
966
+ ## 1.0.12 (2023-10-03)
967
+
968
+
969
+
970
+ ## 1.0.11 (2023-10-02)
971
+
972
+
973
+
974
+ ## 1.0.10 (2023-09-29)
975
+
976
+
977
+
978
+ ## 1.0.9 (2023-09-28)
979
+
980
+
981
+
982
+ ## 1.0.8 (2023-09-27)
983
+
984
+
985
+
986
+ ## 1.0.7 (2023-09-26)
987
+
988
+
989
+
990
+ ## 1.0.6 (2023-09-21)
991
+
992
+
993
+
994
+ ## 1.0.5 (2023-09-13)
995
+
996
+ **Note:** Version bump only for package @oanda/labs-sentiment-widget
997
+
998
+
999
+
1000
+
1001
+
6
1002
  ## 1.0.126 (2024-05-29)
7
1003
 
8
1004
 
@@ -34,7 +34,7 @@ if (sentimentParamsElements.length > 0) {
34
34
  graphqlUrl
35
35
  }, [{
36
36
  name: 'locale',
37
- valueCheck: value => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh'
37
+ valueCheck: value => (0, _labsWidgetCommon.validateLocale)(value)
38
38
  }, {
39
39
  name: 'division',
40
40
  valueCheck: value => Object.values(_graphql.Division).includes(value)
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_SentimentWidget","_graphql","obj","__esModule","default","graphqlUrl","configGraphQl","division","configDivision","instrument","configInstrument","renderElementId","configRenderElementId","locale","configLocale","window","sentimentWidgetConfig","widgetsConfig","sentimentParamsElements","document","querySelectorAll","length","forEach","element","root","createRoot","params","getAttribute","mode","includeDescriptionLabels","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","split","Object","values","Division","includes","render","createElement","SentimentWidget","theme","container","getElementById"],"sources":["../../../src/SentimentWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateToolParams } from '@oanda/labs-widget-common';\nimport { SentimentWidget } from './SentimentWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl: configGraphQl,\n division: configDivision,\n instrument: configInstrument,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.sentimentWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst sentimentParamsElements = document.querySelectorAll('div[data-sentiment-params]');\n\nif (sentimentParamsElements.length > 0) {\n sentimentParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-sentiment-params');\n const mode = element.getAttribute('data-mode');\n const {\n instrument, division, locale, includeDescriptionLabels,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ division, locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh',\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <SentimentWidget\n graphqlUrl={graphqlUrl}\n division={division}\n instrument={instrument}\n locale={locale}\n theme={mode as Theme}\n includeDescriptionLabels={includeDescriptionLabels}\n isParamError={isParamError}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n root.render(\n <SentimentWidget\n graphqlUrl={configGraphQl}\n division={configDivision}\n instrument={configInstrument}\n locale={configLocale}\n />,\n );\n}\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAgD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,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CAAC,EAAE;MACDF,IAAI,EAAE;IACR,CAAC,CAAC,CAAC;IACLV,IAAI,CAACkB,MAAM,CACT/C,MAAA,CAAAS,OAAA,CAAAuC,aAAA,CAAC3C,gBAAA,CAAA4C,eAAe;MACdvC,UAAU,EAAEA,UAAW;MACvBE,QAAQ,EAAEA,QAAS;MACnBE,UAAU,EAAEA,UAAW;MACvBI,MAAM,EAAEA,MAAO;MACfgC,KAAK,EAAEjB,IAAc;MACrBC,wBAAwB,EAAEA,wBAAyB;MACnDG,YAAY,EAAEA;IAAa,CAC5B,CACH,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,MAAM;EACL,MAAMc,SAAS,GAAG3B,QAAQ,CAAC4B,cAAc,CAACnC,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAG,IAAAC,kBAAU,EAACqB,SAAU,CAAC;EACnCtB,IAAI,CAACkB,MAAM,CACT/C,MAAA,CAAAS,OAAA,CAAAuC,aAAA,CAAC3C,gBAAA,CAAA4C,eAAe;IACdvC,UAAU,EAAEC,aAAc;IAC1BC,QAAQ,EAAEC,cAAe;IACzBC,UAAU,EAAEC,gBAAiB;IAC7BG,MAAM,EAAEC;EAAa,CACtB,CACH,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_SentimentWidget","_graphql","obj","__esModule","default","graphqlUrl","configGraphQl","division","configDivision","instrument","configInstrument","renderElementId","configRenderElementId","locale","configLocale","window","sentimentWidgetConfig","widgetsConfig","sentimentParamsElements","document","querySelectorAll","length","forEach","element","root","createRoot","params","getAttribute","mode","includeDescriptionLabels","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","validateLocale","Object","values","Division","includes","render","createElement","SentimentWidget","theme","container","getElementById"],"sources":["../../../src/SentimentWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { SentimentWidget } from './SentimentWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl: configGraphQl,\n division: configDivision,\n instrument: configInstrument,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.sentimentWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst sentimentParamsElements = document.querySelectorAll('div[data-sentiment-params]');\n\nif (sentimentParamsElements.length > 0) {\n sentimentParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-sentiment-params');\n const mode = element.getAttribute('data-mode');\n const {\n instrument, division, locale, includeDescriptionLabels,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ division, locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <SentimentWidget\n graphqlUrl={graphqlUrl}\n division={division}\n instrument={instrument}\n locale={locale}\n theme={mode as Theme}\n includeDescriptionLabels={includeDescriptionLabels}\n isParamError={isParamError}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n root.render(\n <SentimentWidget\n graphqlUrl={configGraphQl}\n division={configDivision}\n instrument={configInstrument}\n locale={configLocale}\n />,\n );\n}\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAgD,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhD,MAAM;EACJG,UAAU,EAAEC,aAAa;EACzBC,QAAQ,EAAEC,cAAc;EACxBC,UAAU,EAAEC,gBAAgB;EAC5BC,eAAe,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A,MAAO;MACfgC,KAAK,EAAEjB,IAAc;MACrBC,wBAAwB,EAAEA,wBAAyB;MACnDG,YAAY,EAAEA;IAAa,CAC5B,CACH,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,MAAM;EACL,MAAMc,SAAS,GAAG3B,QAAQ,CAAC4B,cAAc,CAACnC,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAG,IAAAC,kBAAU,EAACqB,SAAU,CAAC;EACnCtB,IAAI,CAACkB,MAAM,CACT/C,MAAA,CAAAS,OAAA,CAAAuC,aAAA,CAAC3C,gBAAA,CAAA4C,eAAe;IACdvC,UAAU,EAAEC,aAAc;IAC1BC,QAAQ,EAAEC,cAAe;IACzBC,UAAU,EAAEC,gBAAiB;IAC7BG,MAAM,EAAEC;EAAa,CACtB,CACH,CAAC;AACH","ignoreList":[]}
@@ -7,6 +7,8 @@ exports.translations = void 0;
7
7
  var _monoI18n = require("@oanda/mono-i18n");
8
8
  var _en = _interopRequireDefault(require("./sources/en.json"));
9
9
  var _zh_TW = _interopRequireDefault(require("./sources/zh_TW.json"));
10
+ var _es = _interopRequireDefault(require("./sources/es.json"));
11
+ var _th = _interopRequireDefault(require("./sources/th.json"));
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
13
  const translations = exports.translations = {
12
14
  [_monoI18n.Locale.en]: {
@@ -14,6 +16,12 @@ const translations = exports.translations = {
14
16
  },
15
17
  [_monoI18n.Locale.zhTW]: {
16
18
  translation: _zh_TW.default
19
+ },
20
+ [_monoI18n.Locale.es]: {
21
+ translation: _es.default
22
+ },
23
+ [_monoI18n.Locale.th]: {
24
+ translation: _th.default
17
25
  }
18
26
  };
19
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_zh_TW","obj","__esModule","default","translations","exports","Locale","en","translation","zhTW"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import { Locale, Translations } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport zhTW from './sources/zh_TW.json';\n\nimport { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAwC,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAMjC,MAAMG,YAA0B,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACxC,CAACE,gBAAM,CAACC,EAAE,GAAG;IAAEC,WAAW,EAAED;EAAG,CAAC;EAChC,CAACD,gBAAM,CAACG,IAAI,GAAG;IAAED,WAAW,EAAEC;EAAK;AACrC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_zh_TW","_es","_th","obj","__esModule","default","translations","exports","Locale","en","translation","zhTW","es","th"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import { Locale, Translations } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport zhTW from './sources/zh_TW.json';\nimport es from './sources/es.json';\nimport th from './sources/th.json';\n\nimport { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n [Locale.es]: { translation: es },\n [Locale.th]: { translation: th },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,GAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,GAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAmC,SAAAE,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAM5B,MAAMG,YAA0B,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACxC,CAACE,gBAAM,CAACC,EAAE,GAAG;IAAEC,WAAW,EAAED;EAAG,CAAC;EAChC,CAACD,gBAAM,CAACG,IAAI,GAAG;IAAED,WAAW,EAAEC;EAAK,CAAC;EACpC,CAACH,gBAAM,CAACI,EAAE,GAAG;IAAEF,WAAW,EAAEE;EAAG,CAAC;EAChC,CAACJ,gBAAM,CAACK,EAAE,GAAG;IAAEH,WAAW,EAAEG;EAAG;AACjC,CAAC","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ {
2
+ "data_unavailable": "No hay datos disponibles",
3
+ "last_updated": "Última actualización",
4
+ "net_long": "Neto largo",
5
+ "net_short": "Neto corto",
6
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
7
+ "today": "Hoy"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
3
+ "last_updated": "ปรับปรุงล่าสุด",
4
+ "net_long": "การซื้อสุทธิ",
5
+ "net_short": "การขายสุทธิ",
6
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
7
+ "today": "วันนี้"
8
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
- import { validateToolParams } from '@oanda/labs-widget-common';
3
+ import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
4
4
  import { SentimentWidget } from './SentimentWidget';
5
5
  import { Division } from '../gql/types/graphql';
6
6
  const {
@@ -31,7 +31,7 @@ if (sentimentParamsElements.length > 0) {
31
31
  graphqlUrl
32
32
  }, [{
33
33
  name: 'locale',
34
- valueCheck: value => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh'
34
+ valueCheck: value => validateLocale(value)
35
35
  }, {
36
36
  name: 'division',
37
37
  valueCheck: value => Object.values(Division).includes(value)
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["React","createRoot","validateToolParams","SentimentWidget","Division","graphqlUrl","configGraphQl","division","configDivision","instrument","configInstrument","renderElementId","configRenderElementId","locale","configLocale","window","sentimentWidgetConfig","widgetsConfig","sentimentParamsElements","document","querySelectorAll","length","forEach","element","root","params","getAttribute","mode","includeDescriptionLabels","JSON","parse","isParamError","name","valueCheck","value","split","Object","values","includes","render","createElement","theme","container","getElementById"],"sources":["../../../src/SentimentWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateToolParams } from '@oanda/labs-widget-common';\nimport { SentimentWidget } from './SentimentWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl: configGraphQl,\n division: configDivision,\n instrument: configInstrument,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.sentimentWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst sentimentParamsElements = document.querySelectorAll('div[data-sentiment-params]');\n\nif (sentimentParamsElements.length > 0) {\n sentimentParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-sentiment-params');\n const mode = element.getAttribute('data-mode');\n const {\n instrument, division, locale, includeDescriptionLabels,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ division, locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh',\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <SentimentWidget\n graphqlUrl={graphqlUrl}\n division={division}\n instrument={instrument}\n locale={locale}\n theme={mode as Theme}\n includeDescriptionLabels={includeDescriptionLabels}\n isParamError={isParamError}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n root.render(\n <SentimentWidget\n graphqlUrl={configGraphQl}\n division={configDivision}\n instrument={configInstrument}\n locale={configLocale}\n />,\n );\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,kBAAkB,QAAQ,2BAA2B;AACrE,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAM;EACJC,UAAU,EAAEC,aAAa;EACzBC,QAAQ,EAAEC,cAAc;EACxBC,UAAU,EAAEC,gBAAgB;EAC5BC,eAAe,EAAEC,qBAAqB;EACtCC,MAAM,EAAEC;AACV,CAAC,GAAGC,MAAM,CAACC,qBAAqB,IAAI,CAAC,CAAC;AAEtC,MAAM;EACJX;AACF,CAAC,GAAGU,MAAM,CAACE,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,uBAAuB,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,4BAA4B,CAAC;AAEvF,IAAIF,uBAAuB,CAACG,MAAM,GAAG,CAAC,EAAE;EACtCH,uBAAuB,CAACI,OAAO,CAAEC,OAAO,IAAK;IAC3C,MAAMC,IAAI,GAAGvB,UAAU,CAACsB,OAAO,CAAC;IAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,uBAAuB,CAAC;IAC5D,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;IAC9C,MAAM;MACJjB,UAAU;MAAEF,QAAQ;MAAEM,MAAM;MAAEe;IAChC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACL,MAAgB,CAAC;IAEhC,MAAMM,YAAY,GAAG7B,kBAAkB,CAAC;MAAEK,QAAQ;MAAEM,MAAM;MAAER;IAAW,CAAC,EAAE,CACxE;MACE2B,IAAI,EAAE,QAAQ;MACdC,UAAU,EAAGC,KAAK,IAAKA,KAAK,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,IAAID,KAAK,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;IACjF,CAAC,EAAE;MACDH,IAAI,EAAE,UAAU;MAChBC,UAAU,EAAGC,KAAK,IAAKE,MAAM,CAACC,MAAM,CAACjC,QAAQ,CAAC,CAACkC,QAAQ,CAACJ,KAAK;IAC/D,CAAC,EAAE;MACDF,IAAI,EAAE;IACR,CAAC,CAAC,CAAC;IACLR,IAAI,CAACe,MAAM,CACTvC,KAAA,CAAAwC,aAAA,CAACrC,eAAe;MACdE,UAAU,EAAEA,UAAW;MACvBE,QAAQ,EAAEA,QAAS;MACnBE,UAAU,EAAEA,UAAW;MACvBI,MAAM,EAAEA,MAAO;MACf4B,KAAK,EAAEd,IAAc;MACrBC,wBAAwB,EAAEA,wBAAyB;MACnDG,YAAY,EAAEA;IAAa,CAC5B,CACH,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,MAAM;EACL,MAAMW,SAAS,GAAGvB,QAAQ,CAACwB,cAAc,CAAC/B,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAGvB,UAAU,CAACyC,SAAU,CAAC;EACnClB,IAAI,CAACe,MAAM,CACTvC,KAAA,CAAAwC,aAAA,CAACrC,eAAe;IACdE,UAAU,EAAEC,aAAc;IAC1BC,QAAQ,EAAEC,cAAe;IACzBC,UAAU,EAAEC,gBAAiB;IAC7BG,MAAM,EAAEC;EAAa,CACtB,CACH,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","SentimentWidget","Division","graphqlUrl","configGraphQl","division","configDivision","instrument","configInstrument","renderElementId","configRenderElementId","locale","configLocale","window","sentimentWidgetConfig","widgetsConfig","sentimentParamsElements","document","querySelectorAll","length","forEach","element","root","params","getAttribute","mode","includeDescriptionLabels","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","render","createElement","theme","container","getElementById"],"sources":["../../../src/SentimentWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { SentimentWidget } from './SentimentWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl: configGraphQl,\n division: configDivision,\n instrument: configInstrument,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.sentimentWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst sentimentParamsElements = document.querySelectorAll('div[data-sentiment-params]');\n\nif (sentimentParamsElements.length > 0) {\n sentimentParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-sentiment-params');\n const mode = element.getAttribute('data-mode');\n const {\n instrument, division, locale, includeDescriptionLabels,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ division, locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <SentimentWidget\n graphqlUrl={graphqlUrl}\n division={division}\n instrument={instrument}\n locale={locale}\n theme={mode as Theme}\n includeDescriptionLabels={includeDescriptionLabels}\n isParamError={isParamError}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n root.render(\n <SentimentWidget\n graphqlUrl={configGraphQl}\n division={configDivision}\n instrument={configInstrument}\n locale={configLocale}\n />,\n );\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AACrF,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C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AEA,QAAS;MACnBE,UAAU,EAAEA,UAAW;MACvBI,MAAM,EAAEA,MAAO;MACf2B,KAAK,EAAEb,IAAc;MACrBC,wBAAwB,EAAEA,wBAAyB;MACnDG,YAAY,EAAEA;IAAa,CAC5B,CACH,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,MAAM;EACL,MAAMU,SAAS,GAAGtB,QAAQ,CAACuB,cAAc,CAAC9B,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAGxB,UAAU,CAACyC,SAAU,CAAC;EACnCjB,IAAI,CAACc,MAAM,CACTvC,KAAA,CAAAwC,aAAA,CAACpC,eAAe;IACdE,UAAU,EAAEC,aAAc;IAC1BC,QAAQ,EAAEC,cAAe;IACzBC,UAAU,EAAEC,gBAAiB;IAC7BG,MAAM,EAAEC;EAAa,CACtB,CACH,CAAC;AACH","ignoreList":[]}
@@ -1,12 +1,20 @@
1
1
  import { Locale } from '@oanda/mono-i18n';
2
2
  import en from './sources/en.json';
3
3
  import zhTW from './sources/zh_TW.json';
4
+ import es from './sources/es.json';
5
+ import th from './sources/th.json';
4
6
  export const translations = {
5
7
  [Locale.en]: {
6
8
  translation: en
7
9
  },
8
10
  [Locale.zhTW]: {
9
11
  translation: zhTW
12
+ },
13
+ [Locale.es]: {
14
+ translation: es
15
+ },
16
+ [Locale.th]: {
17
+ translation: th
10
18
  }
11
19
  };
12
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Locale","en","zhTW","translations","translation"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import { Locale, Translations } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport zhTW from './sources/zh_TW.json';\n\nimport { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAsB,kBAAkB;AAEvD,OAAOC,EAAE,MAAM,mBAAmB;AAClC,OAAOC,IAAI,MAAM,sBAAsB;AAMvC,OAAO,MAAMC,YAA0B,GAAG;EACxC,CAACH,MAAM,CAACC,EAAE,GAAG;IAAEG,WAAW,EAAEH;EAAG,CAAC;EAChC,CAACD,MAAM,CAACE,IAAI,GAAG;IAAEE,WAAW,EAAEF;EAAK;AACrC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Locale","en","zhTW","es","th","translations","translation"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import { Locale, Translations } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport zhTW from './sources/zh_TW.json';\nimport es from './sources/es.json';\nimport th from './sources/th.json';\n\nimport { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n [Locale.es]: { translation: es },\n [Locale.th]: { translation: th },\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAsB,kBAAkB;AAEvD,OAAOC,EAAE,MAAM,mBAAmB;AAClC,OAAOC,IAAI,MAAM,sBAAsB;AACvC,OAAOC,EAAE,MAAM,mBAAmB;AAClC,OAAOC,EAAE,MAAM,mBAAmB;AAMlC,OAAO,MAAMC,YAA0B,GAAG;EACxC,CAACL,MAAM,CAACC,EAAE,GAAG;IAAEK,WAAW,EAAEL;EAAG,CAAC;EAChC,CAACD,MAAM,CAACE,IAAI,GAAG;IAAEI,WAAW,EAAEJ;EAAK,CAAC;EACpC,CAACF,MAAM,CAACG,EAAE,GAAG;IAAEG,WAAW,EAAEH;EAAG,CAAC;EAChC,CAACH,MAAM,CAACI,EAAE,GAAG;IAAEE,WAAW,EAAEF;EAAG;AACjC,CAAC","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ {
2
+ "data_unavailable": "No hay datos disponibles",
3
+ "last_updated": "Última actualización",
4
+ "net_long": "Neto largo",
5
+ "net_short": "Neto corto",
6
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
7
+ "today": "Hoy"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
3
+ "last_updated": "ปรับปรุงล่าสุด",
4
+ "net_long": "การซื้อสุทธิ",
5
+ "net_short": "การขายสุทธิ",
6
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
7
+ "today": "วันนี้"
8
+ }
@@ -13,6 +13,6 @@
13
13
  "plural_format": "i18next",
14
14
  "export_empty_as": "skip",
15
15
  "include_tags": ["common_widgets", "sentiment_widget"],
16
- "filter_langs": ["en", "zh_TW"]
16
+ "filter_langs": ["en", "zh_TW", "es", "th"]
17
17
  }
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oanda/labs-sentiment-widget",
3
- "version": "1.0.126",
3
+ "version": "1.0.128",
4
4
  "description": "Labs Sentiment Widget",
5
5
  "main": "dist/main/index.js",
6
6
  "module": "dist/module/index.js",
@@ -13,7 +13,7 @@
13
13
  "license": "UNLICENSED",
14
14
  "dependencies": {
15
15
  "@apollo/client": "3.9.9",
16
- "@oanda/labs-widget-common": "^1.0.126",
16
+ "@oanda/labs-widget-common": "^1.0.128",
17
17
  "@oanda/mono-i18n": "10.0.1",
18
18
  "graphql": "16.8.1"
19
19
  },
@@ -21,5 +21,5 @@
21
21
  "@graphql-codegen/cli": "5.0.0",
22
22
  "@graphql-codegen/client-preset": "4.1.0"
23
23
  },
24
- "gitHead": "e712df1e25b3a504fde4f85430d672465eef6d54"
24
+ "gitHead": "ef4a5be528631095c98dd0d5ee1a86e43327f5f3"
25
25
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
- import { Theme, validateToolParams } from '@oanda/labs-widget-common';
3
+ import { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';
4
4
  import { SentimentWidget } from './SentimentWidget';
5
5
  import { Division } from '../gql/types/graphql';
6
6
 
@@ -30,7 +30,7 @@ if (sentimentParamsElements.length > 0) {
30
30
  const isParamError = validateToolParams({ division, locale, graphqlUrl }, [
31
31
  {
32
32
  name: 'locale',
33
- valueCheck: (value) => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh',
33
+ valueCheck: (value) => validateLocale(value),
34
34
  }, {
35
35
  name: 'division',
36
36
  valueCheck: (value) => Object.values(Division).includes(value),
@@ -2,6 +2,8 @@ import { Locale, Translations } from '@oanda/mono-i18n';
2
2
 
3
3
  import en from './sources/en.json';
4
4
  import zhTW from './sources/zh_TW.json';
5
+ import es from './sources/es.json';
6
+ import th from './sources/th.json';
5
7
 
6
8
  import { defaultTranslations } from './translations';
7
9
 
@@ -10,4 +12,6 @@ export type TranslationKey = keyof typeof defaultTranslations;
10
12
  export const translations: Translations = {
11
13
  [Locale.en]: { translation: en },
12
14
  [Locale.zhTW]: { translation: zhTW },
15
+ [Locale.es]: { translation: es },
16
+ [Locale.th]: { translation: th },
13
17
  };
@@ -0,0 +1,8 @@
1
+ {
2
+ "data_unavailable": "No hay datos disponibles",
3
+ "last_updated": "Última actualización",
4
+ "net_long": "Neto largo",
5
+ "net_short": "Neto corto",
6
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
7
+ "today": "Hoy"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
3
+ "last_updated": "ปรับปรุงล่าสุด",
4
+ "net_long": "การซื้อสุทธิ",
5
+ "net_short": "การขายสุทธิ",
6
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
7
+ "today": "วันนี้"
8
+ }