@oanda/labs-currency-strength-widget 1.0.90 → 1.0.91
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 +368 -0
- package/dist/main/CurrencyStrengthWidget/ChartsWithData.js +2 -4
- package/dist/main/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
- package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js +12 -17
- package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -1
- package/dist/main/CurrencyStrengthWidget/Main.js +3 -4
- package/dist/main/CurrencyStrengthWidget/Main.js.map +1 -1
- package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js +3 -3
- package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CurrencyStrengthWidget/ChartsWithData.js +3 -3
- package/dist/module/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
- package/dist/module/CurrencyStrengthWidget/CurrencyStrengthWidget.js +14 -19
- package/dist/module/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -1
- package/dist/module/CurrencyStrengthWidget/Main.js +3 -3
- package/dist/module/CurrencyStrengthWidget/Main.js.map +1 -1
- package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js +3 -3
- package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
- package/package.json +3 -3
- package/src/CurrencyStrengthWidget/ChartsWithData.tsx +3 -3
- package/src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx +16 -20
- package/src/CurrencyStrengthWidget/Main.tsx +3 -3
- package/src/CurrencyStrengthWidget/components/Chart/Chart.tsx +3 -3
- package/test/Main.test.tsx +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,374 @@
|
|
|
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.91 (2024-12-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.172 (2024-11-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.171 (2024-11-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.170 (2024-11-28)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.169 (2024-11-20)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.168 (2024-11-19)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.167 (2024-10-14)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.166 (2024-10-07)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.165 (2024-10-03)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.164 (2024-09-26)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.163 (2024-09-18)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.162 (2024-09-12)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.161 (2024-09-11)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.160 (2024-09-10)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.159 (2024-09-09)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.158 (2024-09-04)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.157 (2024-09-04)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.156 (2024-09-02)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.155 (2024-08-29)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.154 (2024-08-29)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.153 (2024-08-23)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.152 (2024-08-23)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.151 (2024-08-20)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.150 (2024-08-19)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.149 (2024-08-07)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.148 (2024-08-01)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.147 (2024-08-01)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.146 (2024-07-26)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.145 (2024-07-25)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.144 (2024-07-22)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.143 (2024-07-19)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.142 (2024-07-16)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.141 (2024-07-16)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.140 (2024-07-12)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.139 (2024-07-12)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.138 (2024-07-10)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## 1.0.137 (2024-07-05)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## 1.0.136 (2024-07-03)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 1.0.135 (2024-07-03)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## 1.0.134 (2024-07-03)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## 1.0.133 (2024-06-28)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## 1.0.132 (2024-06-27)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## 1.0.131 (2024-06-27)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 1.0.130 (2024-06-26)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## 1.0.129 (2024-06-17)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## 1.0.128 (2024-06-17)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## 1.0.127 (2024-06-10)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## 1.0.126 (2024-05-29)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## 1.0.125 (2024-05-29)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 1.0.124 (2024-05-29)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## 1.0.123 (2024-05-28)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 1.0.122 (2024-05-27)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## 1.0.121 (2024-05-27)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
## 1.0.120 (2024-05-24)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## 1.0.119 (2024-05-17)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## 1.0.118 (2024-05-09)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## 1.0.117 (2024-05-07)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
## 1.0.116 (2024-04-23)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## 1.0.115 (2024-04-22)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
## 1.0.114 (2024-04-19)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## 1.0.113 (2024-04-19)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
## 1.0.112 (2024-04-15)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## 1.0.111 (2024-04-11)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
## 1.0.110 (2024-04-05)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## 1.0.109 (2024-04-05)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
## 1.0.108 (2024-04-04)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## 1.0.107 (2024-04-03)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
## 1.0.106 (2024-03-29)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## 1.0.105 (2024-03-28)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
## 1.0.104 (2024-03-21)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
## 1.0.103 (2024-03-20)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## 1.0.102 (2024-03-20)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## 1.0.101 (2024-03-13)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## 1.0.100 (2024-03-12)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
## 1.0.99 (2024-03-11)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
## 1.0.98 (2024-03-07)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## 1.0.97 (2024-03-06)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
## 1.0.96 (2024-03-06)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
## 1.0.95 (2024-03-04)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
## 1.0.94 (2024-02-29)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
## 1.0.93 (2024-02-28)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## 1.0.92 (2024-02-28)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## 1.0.91 (2024-02-23)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
## 1.0.90 (2024-02-23)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
## 1.0.89 (2024-02-21)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
## 1.0.88 (2024-02-21)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
## 1.0.87 (2024-02-20)
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## 1.0.86 (2024-02-20)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
## 1.0.85 (2024-02-13)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
## 1.0.84 (2024-02-13)
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
## 1.0.83 (2024-02-09)
|
|
367
|
+
|
|
368
|
+
**Note:** Version bump only for package @oanda/labs-currency-strength-widget
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
6
374
|
## 1.0.90 (2024-11-29)
|
|
7
375
|
|
|
8
376
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ChartWithData = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _client = require("@apollo/client");
|
|
9
9
|
var _monoI18n = require("@oanda/mono-i18n");
|
|
10
10
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
@@ -13,15 +13,13 @@ var _getCurrencyStrength = require("../gql/getCurrencyStrength");
|
|
|
13
13
|
var _Chart = require("./components/Chart");
|
|
14
14
|
var _formatters = require("./components/Chart/formatters");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
16
|
const ChartWithData = _ref => {
|
|
19
17
|
let {
|
|
20
18
|
currency
|
|
21
19
|
} = _ref;
|
|
22
20
|
const {
|
|
23
21
|
size
|
|
24
|
-
} = (0,
|
|
22
|
+
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
25
23
|
const isDesktop = size === _labsWidgetCommon.Size.DESKTOP;
|
|
26
24
|
const {
|
|
27
25
|
lang
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartsWithData.js","names":["_react","
|
|
1
|
+
{"version":3,"file":"ChartsWithData.js","names":["_react","_interopRequireDefault","require","_client","_monoI18n","_labsWidgetCommon","_classnames","_getCurrencyStrength","_Chart","_formatters","e","__esModule","default","ChartWithData","_ref","currency","size","useLayoutProvider","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","key","Chart","values","strengthRelation","ChartError","LastUpdated","timestamp","updatedAt","labelCallback","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import React from 'react';\nimport { useQuery } from '@apollo/client';\nimport { useLocale } from '@oanda/mono-i18n';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(getCurrencyStrength, {\n fetchPolicy: 'cache-and-network',\n });\n\n const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n data-testid=\"currency-strength-chart-wrapper\"\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n >\n {currencyData && currencyData.map((item) => (\n <div key={item.currency} className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\">\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated timestamp={data?.currencyStrength![0]?.updatedAt} labelCallback={lang} />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAQA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA+D,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG/D,MAAMG,aAAa,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ACmC,OAAA,CAAA3C,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CurrencyStrengthWidget = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _monoI18n = require("@oanda/mono-i18n");
|
|
9
8
|
var _client = require("@apollo/client");
|
|
10
9
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
11
10
|
var _translations = require("../translations");
|
|
@@ -24,23 +23,19 @@ const CurrencyStrengthWidget = _ref => {
|
|
|
24
23
|
uri: graphqlUrl,
|
|
25
24
|
cache: new _client.InMemoryCache()
|
|
26
25
|
});
|
|
27
|
-
return _react.default.createElement(_labsWidgetCommon.
|
|
26
|
+
return _react.default.createElement(_labsWidgetCommon.WidgetProvider, {
|
|
27
|
+
locale: locale,
|
|
28
|
+
translations: _translations.translations,
|
|
29
|
+
client: client,
|
|
28
30
|
theme: theme
|
|
29
|
-
}, _react.default.createElement(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
Component: _react.default.createElement(_Main.Main, {
|
|
38
|
-
currency: currency,
|
|
39
|
-
theme: theme
|
|
40
|
-
}),
|
|
41
|
-
logoLink,
|
|
42
|
-
linkArea: 'logo'
|
|
43
|
-
}))));
|
|
31
|
+
}, _react.default.createElement(_labsWidgetCommon.WidgetWrapper, {
|
|
32
|
+
logoLink: logoLink,
|
|
33
|
+
linkArea: "logo",
|
|
34
|
+
isParamError: isParamError
|
|
35
|
+
}, _react.default.createElement(_Main.Main, {
|
|
36
|
+
currency: currency,
|
|
37
|
+
theme: theme
|
|
38
|
+
})));
|
|
44
39
|
};
|
|
45
40
|
exports.CurrencyStrengthWidget = CurrencyStrengthWidget;
|
|
46
41
|
//# sourceMappingURL=CurrencyStrengthWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyStrengthWidget.js","names":["_react","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"file":"CurrencyStrengthWidget.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_translations","_Main","e","__esModule","default","CurrencyStrengthWidget","_ref","graphqlUrl","currency","locale","theme","isParamError","logoLink","client","ApolloClient","uri","cache","InMemoryCache","createElement","WidgetProvider","translations","WidgetWrapper","linkArea","Main","exports"],"sources":["../../../src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport { CurrencyStrengthConfig } from './types';\nimport { translations } from '../translations';\nimport { Main } from './Main';\n\nconst CurrencyStrengthWidget = ({\n graphqlUrl, currency, locale, theme, isParamError, logoLink,\n}: CurrencyStrengthConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n return (\n <WidgetProvider\n locale={locale}\n translations={translations}\n client={client}\n theme={theme}\n >\n <WidgetWrapper\n logoLink={logoLink}\n linkArea=\"logo\"\n isParamError={isParamError}\n >\n <Main currency={currency} theme={theme} />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyStrengthWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAA8B,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B,MAAMG,sBAAsB,GAAGC,IAAA,IAED;EAAA,IAFE;IAC9BC,UAAU;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC;EAC7B,CAAC,GAAAN,IAAA;EACvB,MAAMO,MAAM,GAAG,IAAIC,oBAAY,CAAC;IAC9BC,GAAG,EAAER,UAAU;IACfS,KAAK,EAAE,IAAIC,qBAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEtB,MAAA,CAAAS,OAAA,CAAAc,aAAA,CAACnB,iBAAA,CAAAoB,cAAc;IACbV,MAAM,EAAEA,MAAO;IACfW,YAAY,EAAEA,0BAAa;IAC3BP,MAAM,EAAEA,MAAO;IACfH,KAAK,EAAEA;EAAM,GAEbf,MAAA,CAAAS,OAAA,CAAAc,aAAA,CAACnB,iBAAA,CAAAsB,aAAa;IACZT,QAAQ,EAAEA,QAAS;IACnBU,QAAQ,EAAC,MAAM;IACfX,YAAY,EAAEA;EAAa,GAE3BhB,MAAA,CAAAS,OAAA,CAAAc,aAAA,CAACjB,KAAA,CAAAsB,IAAI;IAACf,QAAQ,EAAEA,QAAS;IAACE,KAAK,EAAEA;EAAM,CAAE,CAC5B,CACD,CAAC;AAErB,CAAC;AAACc,OAAA,CAAAnB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -4,12 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Main = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _monoI18n = require("@oanda/mono-i18n");
|
|
9
9
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
10
10
|
var _ChartsWithData = require("./ChartsWithData");
|
|
11
|
-
function
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
const Main = _ref => {
|
|
14
13
|
let {
|
|
15
14
|
currency
|
|
@@ -19,7 +18,7 @@ const Main = _ref => {
|
|
|
19
18
|
} = (0, _monoI18n.useLocale)();
|
|
20
19
|
const {
|
|
21
20
|
size
|
|
22
|
-
} = (0,
|
|
21
|
+
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
23
22
|
return _react.default.createElement(_react.default.Fragment, null, size && _react.default.createElement("div", {
|
|
24
23
|
"data-testid": "currency-strength-wrapper"
|
|
25
24
|
}, _react.default.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["_react","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["_react","_interopRequireDefault","require","_monoI18n","_labsWidgetCommon","_ChartsWithData","e","__esModule","default","Main","_ref","currency","lang","useLocale","size","useLayoutProvider","createElement","Fragment","className","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import React from 'react';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { ChartWithData } from './ChartsWithData';\nimport { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAAiD,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,MAAMG,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEpC,OACEf,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,CAAAhB,MAAA,CAAAQ,OAAA,CAAAS,QAAA,QACGH,IAAI,IACLd,MAAA,CAAAQ,OAAA,CAAAQ,aAAA;IAAK,eAAY;EAA2B,GAC1ChB,MAAA,CAAAQ,OAAA,CAAAQ,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFlB,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,eAAO,GAAGJ,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEO,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNnB,MAAA,CAAAQ,OAAA,CAAAQ,aAAA,CAACX,eAAA,CAAAe,aAAa;IAACT,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEL,CAAC;AAEP,CAAC;AAACU,OAAA,CAAAZ,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Chart = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _core = _interopRequireDefault(require("echarts-for-react/lib/core"));
|
|
9
9
|
var echarts = _interopRequireWildcard(require("echarts/core"));
|
|
10
10
|
var _charts = require("echarts/charts");
|
|
@@ -14,9 +14,9 @@ var _monoI18n = require("@oanda/mono-i18n");
|
|
|
14
14
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
15
15
|
var _constants = require("./constants");
|
|
16
16
|
var _getOption = require("./getOption");
|
|
17
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
echarts.use([_components.GridSimpleComponent, _components.GraphicComponent, _components.TooltipComponent, _components.TitleComponent, _charts.BarChart, _renderers.CanvasRenderer]);
|
|
21
21
|
echarts.registerTheme('dark_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Dark));
|
|
22
22
|
echarts.registerTheme('light_theme', (0, _labsWidgetCommon.getChartTheme)(_labsWidgetCommon.Theme.Light));
|
|
@@ -30,7 +30,7 @@ const Chart = _ref => {
|
|
|
30
30
|
} = (0, _monoI18n.useLocale)();
|
|
31
31
|
const {
|
|
32
32
|
isDark
|
|
33
|
-
} = (0,
|
|
33
|
+
} = (0, _labsWidgetCommon.useLayoutProvider)();
|
|
34
34
|
return _react.default.createElement(_core.default, {
|
|
35
35
|
echarts: echarts,
|
|
36
36
|
theme: isDark ? 'dark_theme' : 'light_theme',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["_react","
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["_react","_interopRequireDefault","require","_core","echarts","_interopRequireWildcard","_charts","_renderers","_components","_monoI18n","_labsWidgetCommon","_constants","_getOption","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useLayoutProvider","createElement","theme","style","height","CHART_HEIGHT","width","option","getOption","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import React from 'react';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport * as echarts from 'echarts/core';\nimport { BarChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport {\n GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent,\n} from 'echarts/components';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { Theme, useLayoutProvider, getChartTheme } from '@oanda/labs-widget-common';\nimport {\n CHART_HEIGHT,\n} from './constants';\nimport { getOption } from './getOption';\nimport { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n theme={isDark ? 'dark_theme' : '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AE;IACT,CAAE;IACFC,MAAM,EAAE,IAAAC,oBAAS,EAAC;MAChBb,MAAM;MAAEC,QAAQ;MAAEC,IAAI;MAAEE;IAC1B,CAAC;EAAE,CACJ,CAAC;AAEN,CAAC;AAACU,OAAA,CAAAhB,KAAA,GAAAA,KAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useQuery } from '@apollo/client';
|
|
3
3
|
import { useLocale } from '@oanda/mono-i18n';
|
|
4
|
-
import { ChartError, LastUpdated, Size, Spinner, SpinnerSize,
|
|
4
|
+
import { ChartError, LastUpdated, Size, Spinner, SpinnerSize, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import { getCurrencyStrength } from '../gql/getCurrencyStrength';
|
|
7
7
|
import { Chart } from './components/Chart';
|
|
@@ -12,7 +12,7 @@ const ChartWithData = _ref => {
|
|
|
12
12
|
} = _ref;
|
|
13
13
|
const {
|
|
14
14
|
size
|
|
15
|
-
} =
|
|
15
|
+
} = useLayoutProvider();
|
|
16
16
|
const isDesktop = size === Size.DESKTOP;
|
|
17
17
|
const {
|
|
18
18
|
lang
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartsWithData.js","names":["React","
|
|
1
|
+
{"version":3,"file":"ChartsWithData.js","names":["React","useQuery","useLocale","ChartError","LastUpdated","Size","Spinner","SpinnerSize","useLayoutProvider","classnames","getCurrencyStrength","Chart","sortCurrencies","ChartWithData","_ref","currency","size","isDesktop","DESKTOP","lang","loading","data","error","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","createElement","Fragment","className","lg","map","key","values","strengthRelation","timestamp","updatedAt","labelCallback"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import React from 'react';\nimport { useQuery } from '@apollo/client';\nimport { useLocale } from '@oanda/mono-i18n';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(getCurrencyStrength, {\n fetchPolicy: 'cache-and-network',\n });\n\n const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n data-testid=\"currency-strength-chart-wrapper\"\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n >\n {currencyData && currencyData.map((item) => (\n <div key={item.currency} className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\">\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n })}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-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;IAAKE,SAAS,EAAC;EAAgB,GAC7BnC,KAAA,CAAAiC,aAAA,CAAC7B,WAAW;IAACqC,SAAS,EAAEpB,IAAI,EAAEI,gBAAgB,CAAE,CAAC,CAAC,EAAEiB,SAAU;IAACC,aAAa,EAAExB;EAAK,CAAE,CAClF,CAEP,CAAC;AAEP,CAAC;AAED,SAASN,aAAa","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ChartError, ThemeProvider, getLocale, renderComponent } from '@oanda/labs-widget-common';
|
|
2
|
+
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
|
3
|
+
import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
|
|
5
4
|
import { translations } from '../translations';
|
|
6
5
|
import { Main } from './Main';
|
|
7
6
|
const CurrencyStrengthWidget = _ref => {
|
|
@@ -17,23 +16,19 @@ const CurrencyStrengthWidget = _ref => {
|
|
|
17
16
|
uri: graphqlUrl,
|
|
18
17
|
cache: new InMemoryCache()
|
|
19
18
|
});
|
|
20
|
-
return React.createElement(
|
|
19
|
+
return React.createElement(WidgetProvider, {
|
|
20
|
+
locale: locale,
|
|
21
|
+
translations: translations,
|
|
22
|
+
client: client,
|
|
21
23
|
theme: theme
|
|
22
|
-
}, React.createElement(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
Component: React.createElement(Main, {
|
|
31
|
-
currency: currency,
|
|
32
|
-
theme: theme
|
|
33
|
-
}),
|
|
34
|
-
logoLink,
|
|
35
|
-
linkArea: 'logo'
|
|
36
|
-
}))));
|
|
24
|
+
}, React.createElement(WidgetWrapper, {
|
|
25
|
+
logoLink: logoLink,
|
|
26
|
+
linkArea: "logo",
|
|
27
|
+
isParamError: isParamError
|
|
28
|
+
}, React.createElement(Main, {
|
|
29
|
+
currency: currency,
|
|
30
|
+
theme: theme
|
|
31
|
+
})));
|
|
37
32
|
};
|
|
38
33
|
export { CurrencyStrengthWidget };
|
|
39
34
|
//# sourceMappingURL=CurrencyStrengthWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyStrengthWidget.js","names":["React","
|
|
1
|
+
{"version":3,"file":"CurrencyStrengthWidget.js","names":["React","ApolloClient","InMemoryCache","WidgetProvider","WidgetWrapper","translations","Main","CurrencyStrengthWidget","_ref","graphqlUrl","currency","locale","theme","isParamError","logoLink","client","uri","cache","createElement","linkArea"],"sources":["../../../src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport { CurrencyStrengthConfig } from './types';\nimport { translations } from '../translations';\nimport { Main } from './Main';\n\nconst CurrencyStrengthWidget = ({\n graphqlUrl, currency, locale, theme, isParamError, logoLink,\n}: CurrencyStrengthConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n return (\n <WidgetProvider\n locale={locale}\n translations={translations}\n client={client}\n theme={theme}\n >\n <WidgetWrapper\n logoLink={logoLink}\n linkArea=\"logo\"\n isParamError={isParamError}\n >\n <Main currency={currency} theme={theme} />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyStrengthWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,aAAa,QAAQ,gBAAgB;AAC5D,SAASC,cAAc,EAAEC,aAAa,QAAQ,2BAA2B;AAEzE,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,IAAI,QAAQ,QAAQ;AAE7B,MAAMC,sBAAsB,GAAGC,IAAA,IAED;EAAA,IAFE;IAC9BC,UAAU;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC;EAC7B,CAAC,GAAAN,IAAA;EACvB,MAAMO,MAAM,GAAG,IAAId,YAAY,CAAC;IAC9Be,GAAG,EAAEP,UAAU;IACfQ,KAAK,EAAE,IAAIf,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEF,KAAA,CAAAkB,aAAA,CAACf,cAAc;IACbQ,MAAM,EAAEA,MAAO;IACfN,YAAY,EAAEA,YAAa;IAC3BU,MAAM,EAAEA,MAAO;IACfH,KAAK,EAAEA;EAAM,GAEbZ,KAAA,CAAAkB,aAAA,CAACd,aAAa;IACZU,QAAQ,EAAEA,QAAS;IACnBK,QAAQ,EAAC,MAAM;IACfN,YAAY,EAAEA;EAAa,GAE3Bb,KAAA,CAAAkB,aAAA,CAACZ,IAAI;IAACI,QAAQ,EAAEA,QAAS;IAACE,KAAK,EAAEA;EAAM,CAAE,CAC5B,CACD,CAAC;AAErB,CAAC;AAED,SAASL,sBAAsB","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
-
import {
|
|
3
|
+
import { useLayoutProvider } from '@oanda/labs-widget-common';
|
|
4
4
|
import { ChartWithData } from './ChartsWithData';
|
|
5
5
|
const Main = _ref => {
|
|
6
6
|
let {
|
|
@@ -11,7 +11,7 @@ const Main = _ref => {
|
|
|
11
11
|
} = useLocale();
|
|
12
12
|
const {
|
|
13
13
|
size
|
|
14
|
-
} =
|
|
14
|
+
} = useLayoutProvider();
|
|
15
15
|
return React.createElement(React.Fragment, null, size && React.createElement("div", {
|
|
16
16
|
"data-testid": "currency-strength-wrapper"
|
|
17
17
|
}, React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["React","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["React","useLocale","useLayoutProvider","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import React from 'react';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { ChartWithData } from './ChartsWithData';\nimport { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,MAAMC,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAGN,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEO;EAAK,CAAC,GAAGN,iBAAiB,CAAC,CAAC;EAEpC,OACEF,KAAA,CAAAS,aAAA,CAAAT,KAAA,CAAAU,QAAA,QACGF,IAAI,IACLR,KAAA,CAAAS,aAAA;IAAK,eAAY;EAA2B,GAC1CT,KAAA,CAAAS,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFX,KAAA,CAAAS,aAAA,eAAO,GAAGF,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEK,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNZ,KAAA,CAAAS,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEL,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import ReactEChartsCore from 'echarts-for-react/lib/core';
|
|
3
3
|
import * as echarts from 'echarts/core';
|
|
4
4
|
import { BarChart } from 'echarts/charts';
|
|
5
5
|
import { CanvasRenderer } from 'echarts/renderers';
|
|
6
6
|
import { GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent } from 'echarts/components';
|
|
7
7
|
import { useLocale } from '@oanda/mono-i18n';
|
|
8
|
-
import { Theme,
|
|
8
|
+
import { Theme, useLayoutProvider, getChartTheme } from '@oanda/labs-widget-common';
|
|
9
9
|
import { CHART_HEIGHT } from './constants';
|
|
10
10
|
import { getOption } from './getOption';
|
|
11
11
|
echarts.use([GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent, BarChart, CanvasRenderer]);
|
|
@@ -21,7 +21,7 @@ const Chart = _ref => {
|
|
|
21
21
|
} = useLocale();
|
|
22
22
|
const {
|
|
23
23
|
isDark
|
|
24
|
-
} =
|
|
24
|
+
} = useLayoutProvider();
|
|
25
25
|
return React.createElement(ReactEChartsCore, {
|
|
26
26
|
echarts: echarts,
|
|
27
27
|
theme: isDark ? 'dark_theme' : 'light_theme',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["React","
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","ReactEChartsCore","echarts","BarChart","CanvasRenderer","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","useLocale","Theme","useLayoutProvider","getChartTheme","CHART_HEIGHT","getOption","use","registerTheme","Dark","Light","Chart","_ref","values","currency","lang","isDark","createElement","theme","style","height","width","option"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import React from 'react';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport * as echarts from 'echarts/core';\nimport { BarChart } from 'echarts/charts';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport {\n GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent,\n} from 'echarts/components';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { Theme, useLayoutProvider, getChartTheme } from '@oanda/labs-widget-common';\nimport {\n CHART_HEIGHT,\n} from './constants';\nimport { getOption } from './getOption';\nimport { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n option={getOption({\n values, currency, lang, isDark,\n })}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SACEC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,cAAc,QAClE,oBAAoB;AAC3B,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,KAAK,EAAEC,iBAAiB,EAAEC,aAAa,QAAQ,2BAA2B;AACnF,SACEC,YAAY,QACP,aAAa;AACpB,SAASC,SAAS,QAAQ,aAAa;AAGvCZ,OAAO,CAACa,GAAG,CAAC,CACVV,mBAAmB,EACnBC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdL,QAAQ,EACRC,cAAc,CACf,CAAC;AAEFF,OAAO,CAACc,aAAa,CAAC,YAAY,EAAEJ,aAAa,CAACF,KAAK,CAACO,IAAI,CAAC,CAAC;AAC9Df,OAAO,CAACc,aAAa,CAAC,aAAa,EAAEJ,aAAa,CAACF,KAAK,CAACQ,KAAK,CAAC,CAAC;AAEhE,MAAMC,KAAK,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EAC7C,MAAM;IAAEG;EAAK,CAAC,GAAGd,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEe;EAAO,CAAC,GAAGb,iBAAiB,CAAC,CAAC;EAEtC,OACEX,KAAA,CAAAyB,aAAA,CAACxB,gBAAgB;IACfC,OAAO,EAAEA,OAAQ;IACjBwB,KAAK,EAAEF,MAAM,GAAG,YAAY,GAAG,aAAc;IAC7CG,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGf,YAAY,IAAI;MAC3BgB,KAAK,EAAE;IACT,CAAE;IACFC,MAAM,EAAEhB,SAAS,CAAC;MAChBO,MAAM;MAAEC,QAAQ;MAAEC,IAAI;MAAEC;IAC1B,CAAC;EAAE,CACJ,CAAC;AAEN,CAAC;AAED,SAASL,KAAK","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-currency-strength-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "Labs Currency Strength Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "OANDA",
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
15
|
+
"@oanda/labs-widget-common": "^1.0.173",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"echarts": "5.5.0",
|
|
18
18
|
"echarts-for-react": "3.0.2",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@graphql-codegen/client-preset": "4.1.0",
|
|
24
24
|
"@graphql-codegen/typescript": "4.0.1"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "67a7801f99f0bab94dd6067a102761f51de786c1"
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useQuery } from '@apollo/client';
|
|
3
3
|
import { useLocale } from '@oanda/mono-i18n';
|
|
4
4
|
import {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Size,
|
|
8
8
|
Spinner,
|
|
9
9
|
SpinnerSize,
|
|
10
|
-
|
|
10
|
+
useLayoutProvider,
|
|
11
11
|
} from '@oanda/labs-widget-common';
|
|
12
12
|
import classnames from 'classnames';
|
|
13
13
|
import { getCurrencyStrength } from '../gql/getCurrencyStrength';
|
|
@@ -17,7 +17,7 @@ import { sortCurrencies } from './components/Chart/formatters';
|
|
|
17
17
|
import { WidgetProps } from './types';
|
|
18
18
|
|
|
19
19
|
const ChartWithData = ({ currency }: WidgetProps) => {
|
|
20
|
-
const { size } =
|
|
20
|
+
const { size } = useLayoutProvider();
|
|
21
21
|
const isDesktop = size === Size.DESKTOP;
|
|
22
22
|
const { lang } = useLocale();
|
|
23
23
|
const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(getCurrencyStrength, {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
ChartError, ThemeProvider, getLocale, renderComponent,
|
|
6
|
-
} from '@oanda/labs-widget-common';
|
|
2
|
+
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
|
3
|
+
import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
|
|
7
4
|
import { CurrencyStrengthConfig } from './types';
|
|
8
5
|
import { translations } from '../translations';
|
|
9
6
|
import { Main } from './Main';
|
|
@@ -17,21 +14,20 @@ const CurrencyStrengthWidget = ({
|
|
|
17
14
|
});
|
|
18
15
|
|
|
19
16
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</ThemeProvider>
|
|
17
|
+
<WidgetProvider
|
|
18
|
+
locale={locale}
|
|
19
|
+
translations={translations}
|
|
20
|
+
client={client}
|
|
21
|
+
theme={theme}
|
|
22
|
+
>
|
|
23
|
+
<WidgetWrapper
|
|
24
|
+
logoLink={logoLink}
|
|
25
|
+
linkArea="logo"
|
|
26
|
+
isParamError={isParamError}
|
|
27
|
+
>
|
|
28
|
+
<Main currency={currency} theme={theme} />
|
|
29
|
+
</WidgetWrapper>
|
|
30
|
+
</WidgetProvider>
|
|
35
31
|
);
|
|
36
32
|
};
|
|
37
33
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { useLocale } from '@oanda/mono-i18n';
|
|
3
|
-
import {
|
|
3
|
+
import { useLayoutProvider } from '@oanda/labs-widget-common';
|
|
4
4
|
import { ChartWithData } from './ChartsWithData';
|
|
5
5
|
import { WidgetProps } from './types';
|
|
6
6
|
|
|
7
7
|
const Main = ({ currency }: WidgetProps) => {
|
|
8
8
|
const { lang } = useLocale();
|
|
9
|
-
const { size } =
|
|
9
|
+
const { size } = useLayoutProvider();
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import ReactEChartsCore from 'echarts-for-react/lib/core';
|
|
3
3
|
import * as echarts from 'echarts/core';
|
|
4
4
|
import { BarChart } from 'echarts/charts';
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent,
|
|
8
8
|
} from 'echarts/components';
|
|
9
9
|
import { useLocale } from '@oanda/mono-i18n';
|
|
10
|
-
import { Theme,
|
|
10
|
+
import { Theme, useLayoutProvider, getChartTheme } from '@oanda/labs-widget-common';
|
|
11
11
|
import {
|
|
12
12
|
CHART_HEIGHT,
|
|
13
13
|
} from './constants';
|
|
@@ -28,7 +28,7 @@ echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
|
|
|
28
28
|
|
|
29
29
|
const Chart = ({ values, currency }: ChartProps) => {
|
|
30
30
|
const { lang } = useLocale();
|
|
31
|
-
const { isDark } =
|
|
31
|
+
const { isDark } = useLayoutProvider();
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<ReactEChartsCore
|
package/test/Main.test.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { render } from '@testing-library/react';
|
|
6
6
|
import { MockedProvider } from '@apollo/client/testing';
|
|
7
|
-
import {
|
|
7
|
+
import { MockLayoutProvider } from '@oanda/labs-widget-common';
|
|
8
8
|
import { Main } from '../src/CurrencyStrengthWidget/Main';
|
|
9
9
|
import { mock } from './mocks/responsesMocks';
|
|
10
10
|
|
|
@@ -18,9 +18,9 @@ describe('Main component', () => {
|
|
|
18
18
|
it('should render tool view', async () => {
|
|
19
19
|
const { findByTestId, getByTestId } = render(
|
|
20
20
|
<MockedProvider mocks={mock}>
|
|
21
|
-
<
|
|
21
|
+
<MockLayoutProvider>
|
|
22
22
|
<Main />
|
|
23
|
-
</
|
|
23
|
+
</MockLayoutProvider>
|
|
24
24
|
</MockedProvider>,
|
|
25
25
|
);
|
|
26
26
|
|
|
@@ -32,9 +32,9 @@ describe('Main component', () => {
|
|
|
32
32
|
it('should render widget view', async () => {
|
|
33
33
|
const { findByTestId, getByTestId } = render(
|
|
34
34
|
<MockedProvider mocks={mock}>
|
|
35
|
-
<
|
|
35
|
+
<MockLayoutProvider>
|
|
36
36
|
<Main currency="USD" />
|
|
37
|
-
</
|
|
37
|
+
</MockLayoutProvider>
|
|
38
38
|
</MockedProvider>,
|
|
39
39
|
);
|
|
40
40
|
|