@oanda/labs-currency-power-balance-widget 1.0.66 → 1.0.67

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,278 @@
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.67 (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
+ **Note:** Version bump only for package @oanda/labs-currency-power-balance-widget
273
+
274
+
275
+
276
+
277
+
6
278
  ## 1.0.66 (2024-06-10)
7
279
 
8
280
 
@@ -29,7 +29,7 @@ if (currencyPowerBalanceParamsElements.length > 0) {
29
29
  graphqlUrl
30
30
  }, [{
31
31
  name: 'locale',
32
- valueCheck: value => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh'
32
+ valueCheck: value => (0, _labsWidgetCommon.validateLocale)(value)
33
33
  }, {
34
34
  name: 'graphqlUrl'
35
35
  }]);
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_CurrencyPowerBalance","obj","__esModule","default","graphqlUrl","configGraphQl","renderElementId","configRenderElementId","locale","configLocale","window","currencyPowerBalanceWidgetConfig","widgetsConfig","currencyPowerBalanceParamsElements","document","querySelectorAll","length","forEach","element","root","createRoot","params","getAttribute","mode","timeUnit","currencies","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","split","render","createElement","CurrencyPowerBalance","theme","container","getElementById"],"sources":["../../../src/CurrencyPowerBalanceWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { Theme, validateToolParams } from '@oanda/labs-widget-common';\nimport { CurrencyPowerBalance } from './CurrencyPowerBalance';\n\nconst {\n graphqlUrl: configGraphQl,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.currencyPowerBalanceWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst currencyPowerBalanceParamsElements = document.querySelectorAll('div[data-currency-power-balance-params]');\n\nif (currencyPowerBalanceParamsElements.length > 0) {\n currencyPowerBalanceParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-power-balance-params');\n const mode = element.getAttribute('data-mode');\n const { timeUnit, currencies, locale } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh',\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <CurrencyPowerBalance\n graphqlUrl={graphqlUrl}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n timeUnit={timeUnit}\n currencies={currencies}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n\n root.render(\n <CurrencyPowerBalance\n locale={configLocale}\n graphqlUrl={configGraphQl}\n />,\n );\n}\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAA8D,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE9D,MAAM;EACJG,UAAU,EAAEC,aAAa;EACzBC,eAAe,EAAEC,qBAAqB;EACtCC,MAAM,EAAEC;AACV,CAAC,GAAGC,MAAM,CAACC,gCAAgC,IAAI,CAAC,C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,CAACyB,cAAc,CAAChC,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAG,IAAAC,kBAAU,EAACkB,SAAU,CAAC;EAEnCnB,IAAI,CAACe,MAAM,CACTvC,MAAA,CAAAQ,OAAA,CAAAgC,aAAA,CAACnC,qBAAA,CAAAoC,oBAAoB;IACnB5B,MAAM,EAAEC,YAAa;IACrBL,UAAU,EAAEC;EAAc,CAC3B,CACH,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_CurrencyPowerBalance","obj","__esModule","default","graphqlUrl","configGraphQl","renderElementId","configRenderElementId","locale","configLocale","window","currencyPowerBalanceWidgetConfig","widgetsConfig","currencyPowerBalanceParamsElements","document","querySelectorAll","length","forEach","element","root","createRoot","params","getAttribute","mode","timeUnit","currencies","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","validateLocale","render","createElement","CurrencyPowerBalance","theme","container","getElementById"],"sources":["../../../src/CurrencyPowerBalanceWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { CurrencyPowerBalance } from './CurrencyPowerBalance';\n\nconst {\n graphqlUrl: configGraphQl,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.currencyPowerBalanceWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst currencyPowerBalanceParamsElements = document.querySelectorAll('div[data-currency-power-balance-params]');\n\nif (currencyPowerBalanceParamsElements.length > 0) {\n currencyPowerBalanceParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-power-balance-params');\n const mode = element.getAttribute('data-mode');\n const { timeUnit, currencies, locale } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <CurrencyPowerBalance\n graphqlUrl={graphqlUrl}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n timeUnit={timeUnit}\n currencies={currencies}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n\n root.render(\n <CurrencyPowerBalance\n locale={configLocale}\n graphqlUrl={configGraphQl}\n />,\n );\n}\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAA8D,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE9D,MAAM;EACJG,UAAU,EAAEC,aAAa;EACzBC,eAAe,EAAEC,qBAAqB;EACtCC,MAAM,EAAEC;AACV,CAAC,GAAGC,MAAM,CAACC,gCAAgC,IAAI,CAAC,CAAC;AAEjD,MAAM;EACJP;AACF,CAAC,GAAGM,MAAM,CAACE,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,kCAAkC,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,yCAAyC,CAAC;AAE/G,IAAIF,kCAAkC,CAACG,MAAM,GAAG,CAAC,EAAE;EACjDH,kCAAkC,CAACI,OAAO,CAAEC,OAAO,IAAK;IACtD,MAAMC,IAAI,GAAG,IAAAC,kBAAU,EAACF,OAAO,CAAC;IAChC,MAAMG,MAAM,GAAGH,OAAO,CAACI,YAAY,CAAC,oCAAoC,CAAC;IACzE,MAAMC,IAAI,GAAGL,OAAO,CAACI,YAAY,CAAC,WAAW,CAAC;IAC9C,MAAM;MAAEE,QAAQ;MAAEC,UAAU;MAAEjB;IAAO,CAAC,GAAGkB,IAAI,CAACC,KAAK,CAACN,MAAgB,CAAC;IAErE,MAAMO,YAAY,GAAG,IAAAC,oCAAkB,EAAC;MAAErB,MAAM;MAAEJ;IAAW,CAAC,EAAE,CAC9D;MACE0B,IAAI,EAAE,QAAQ;MACdC,UAAU,EAAGC,KAAK,IAAK,IAAAC,gCAAc,EAACD,KAAK;IAC7C,CAAC,EAAE;MACDF,IAAI,EAAE;IACR,CAAC,CAAC,CAAC;IACLX,IAAI,CAACe,MAAM,CACTvC,MAAA,CAAAQ,OAAA,CAAAgC,aAAA,CAACnC,qBAAA,CAAAoC,oBAAoB;MACnBhC,UAAU,EAAEA,UAAW;MACvBI,MAAM,EAAEA,MAAO;MACf6B,KAAK,EAAEd,IAAc;MACrBK,YAAY,EAAEA,YAAa;MAC3BJ,QAAQ,EAAEA,QAAS;MACnBC,UAAU,EAAEA;IAAW,CACxB,CACH,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,MAAM;EACL,MAAMa,SAAS,GAAGxB,QAAQ,CAACyB,cAAc,CAAChC,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAG,IAAAC,kBAAU,EAACkB,SAAU,CAAC;EAEnCnB,IAAI,CAACe,MAAM,CACTvC,MAAA,CAAAQ,OAAA,CAAAgC,aAAA,CAACnC,qBAAA,CAAAoC,oBAAoB;IACnB5B,MAAM,EAAEC,YAAa;IACrBL,UAAU,EAAEC;EAAc,CAC3B,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,20 @@
1
+ {
2
+ "1m": "1M",
3
+ "1w": "1S",
4
+ "24h": "24H",
5
+ "3m": "3M",
6
+ "4h": "4H",
7
+ "8h": "8H",
8
+ "current_business_day": "Día laborable actual",
9
+ "data_unavailable": "No hay datos disponibles",
10
+ "hour": "{{count}} Hora",
11
+ "hour_plural": "{{count}} Horas",
12
+ "last_updated": "Última actualización",
13
+ "month": "{{count}} Mes",
14
+ "month_plural": "{{count}} Meses",
15
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
16
+ "previous_business_day": "Día laborable anterior",
17
+ "today": "Hoy",
18
+ "week": "{{count}} Semana",
19
+ "week_plural": "{{count}} Semanas"
20
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "1m": "1 เดือน",
3
+ "1w": "1 สัปดาห์",
4
+ "24h": "24 ชม.",
5
+ "3m": "3 เดือน",
6
+ "4h": "4 ชม.",
7
+ "8h": "8 ชม.",
8
+ "current_business_day": "วันทำการปัจจุบัน",
9
+ "data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
10
+ "hour_0": "{{count}} ชั่วโมง",
11
+ "last_updated": "ปรับปรุงล่าสุด",
12
+ "month_0": "{{count}} เดือน",
13
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
14
+ "previous_business_day": "วันทำการก่อนหน้า",
15
+ "today": "วันนี้",
16
+ "week_0": "{{count}} สัปดาห์"
17
+ }
@@ -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 { CurrencyPowerBalance } from './CurrencyPowerBalance';
5
5
  const {
6
6
  graphqlUrl: configGraphQl,
@@ -26,7 +26,7 @@ if (currencyPowerBalanceParamsElements.length > 0) {
26
26
  graphqlUrl
27
27
  }, [{
28
28
  name: 'locale',
29
- valueCheck: value => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh'
29
+ valueCheck: value => validateLocale(value)
30
30
  }, {
31
31
  name: 'graphqlUrl'
32
32
  }]);
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["React","createRoot","validateToolParams","CurrencyPowerBalance","graphqlUrl","configGraphQl","renderElementId","configRenderElementId","locale","configLocale","window","currencyPowerBalanceWidgetConfig","widgetsConfig","currencyPowerBalanceParamsElements","document","querySelectorAll","length","forEach","element","root","params","getAttribute","mode","timeUnit","currencies","JSON","parse","isParamError","name","valueCheck","value","split","render","createElement","theme","container","getElementById"],"sources":["../../../src/CurrencyPowerBalanceWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { Theme, validateToolParams } from '@oanda/labs-widget-common';\nimport { CurrencyPowerBalance } from './CurrencyPowerBalance';\n\nconst {\n graphqlUrl: configGraphQl,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.currencyPowerBalanceWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst currencyPowerBalanceParamsElements = document.querySelectorAll('div[data-currency-power-balance-params]');\n\nif (currencyPowerBalanceParamsElements.length > 0) {\n currencyPowerBalanceParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-power-balance-params');\n const mode = element.getAttribute('data-mode');\n const { timeUnit, currencies, locale } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh',\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <CurrencyPowerBalance\n graphqlUrl={graphqlUrl}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n timeUnit={timeUnit}\n currencies={currencies}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n\n root.render(\n <CurrencyPowerBalance\n locale={configLocale}\n graphqlUrl={configGraphQl}\n />,\n );\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAAgBC,kBAAkB,QAAQ,2BAA2B;AACrE,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,MAAM;EACJC,UAAU,EAAEC,aAAa;EACzBC,eAAe,EAAEC,qBAAqB;EACtCC,MAAM,EAAEC;AACV,CAAC,GAAGC,MAAM,CAACC,gCAAgC,IAAI,CAAC,CAAC;AAEjD,MAAM;EACJP;AACF,CAAC,GAAGM,MAAM,CAACE,aAAa,IAAI,CAAC,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AAM,CACThC,KAAA,CAAAiC,aAAA,CAAC9B,oBAAoB;IACnBK,MAAM,EAAEC,YAAa;IACrBL,UAAU,EAAEC;EAAc,CAC3B,CACH,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","CurrencyPowerBalance","graphqlUrl","configGraphQl","renderElementId","configRenderElementId","locale","configLocale","window","currencyPowerBalanceWidgetConfig","widgetsConfig","currencyPowerBalanceParamsElements","document","querySelectorAll","length","forEach","element","root","params","getAttribute","mode","timeUnit","currencies","JSON","parse","isParamError","name","valueCheck","value","render","createElement","theme","container","getElementById"],"sources":["../../../src/CurrencyPowerBalanceWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { CurrencyPowerBalance } from './CurrencyPowerBalance';\n\nconst {\n graphqlUrl: configGraphQl,\n renderElementId: configRenderElementId,\n locale: configLocale,\n} = window.currencyPowerBalanceWidgetConfig || {};\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst currencyPowerBalanceParamsElements = document.querySelectorAll('div[data-currency-power-balance-params]');\n\nif (currencyPowerBalanceParamsElements.length > 0) {\n currencyPowerBalanceParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-power-balance-params');\n const mode = element.getAttribute('data-mode');\n const { timeUnit, currencies, locale } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'graphqlUrl',\n }]);\n root.render(\n <CurrencyPowerBalance\n graphqlUrl={graphqlUrl}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n timeUnit={timeUnit}\n currencies={currencies}\n />,\n );\n });\n} else {\n const container = document.getElementById(configRenderElementId);\n const root = createRoot(container!);\n\n root.render(\n <CurrencyPowerBalance\n locale={configLocale}\n graph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K,EAAEX,IAAc;MACrBK,YAAY,EAAEA,YAAa;MAC3BJ,QAAQ,EAAEA,QAAS;MACnBC,UAAU,EAAEA;IAAW,CACxB,CACH,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,MAAM;EACL,MAAMU,SAAS,GAAGpB,QAAQ,CAACqB,cAAc,CAAC5B,qBAAqB,CAAC;EAChE,MAAMY,IAAI,GAAGnB,UAAU,CAACkC,SAAU,CAAC;EAEnCf,IAAI,CAACY,MAAM,CACThC,KAAA,CAAAiC,aAAA,CAAC7B,oBAAoB;IACnBK,MAAM,EAAEC,YAAa;IACrBL,UAAU,EAAEC;EAAc,CAC3B,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,20 @@
1
+ {
2
+ "1m": "1M",
3
+ "1w": "1S",
4
+ "24h": "24H",
5
+ "3m": "3M",
6
+ "4h": "4H",
7
+ "8h": "8H",
8
+ "current_business_day": "Día laborable actual",
9
+ "data_unavailable": "No hay datos disponibles",
10
+ "hour": "{{count}} Hora",
11
+ "hour_plural": "{{count}} Horas",
12
+ "last_updated": "Última actualización",
13
+ "month": "{{count}} Mes",
14
+ "month_plural": "{{count}} Meses",
15
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
16
+ "previous_business_day": "Día laborable anterior",
17
+ "today": "Hoy",
18
+ "week": "{{count}} Semana",
19
+ "week_plural": "{{count}} Semanas"
20
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "1m": "1 เดือน",
3
+ "1w": "1 สัปดาห์",
4
+ "24h": "24 ชม.",
5
+ "3m": "3 เดือน",
6
+ "4h": "4 ชม.",
7
+ "8h": "8 ชม.",
8
+ "current_business_day": "วันทำการปัจจุบัน",
9
+ "data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
10
+ "hour_0": "{{count}} ชั่วโมง",
11
+ "last_updated": "ปรับปรุงล่าสุด",
12
+ "month_0": "{{count}} เดือน",
13
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
14
+ "previous_business_day": "วันทำการก่อนหน้า",
15
+ "today": "วันนี้",
16
+ "week_0": "{{count}} สัปดาห์"
17
+ }
@@ -13,6 +13,6 @@
13
13
  "plural_format": "i18next",
14
14
  "export_empty_as": "skip",
15
15
  "include_tags": ["common_widgets", "currency_balance_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-currency-power-balance-widget",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
4
4
  "description": "Labs Currency Power Balance 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.127",
16
+ "@oanda/labs-widget-common": "^1.0.128",
17
17
  "@oanda/mono-i18n": "10.0.1",
18
18
  "echarts": "5.5.0",
19
19
  "echarts-for-react": "3.0.2",
@@ -23,5 +23,5 @@
23
23
  "@graphql-codegen/cli": "5.0.0",
24
24
  "@graphql-codegen/client-preset": "4.1.0"
25
25
  },
26
- "gitHead": "8c3874ccf695d8f7debc2e9fd912a87e041c7871"
26
+ "gitHead": "ef4a5be528631095c98dd0d5ee1a86e43327f5f3"
27
27
  }
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
-
4
- import { Theme, validateToolParams } from '@oanda/labs-widget-common';
3
+ import { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';
5
4
  import { CurrencyPowerBalance } from './CurrencyPowerBalance';
6
5
 
7
6
  const {
@@ -26,7 +25,7 @@ if (currencyPowerBalanceParamsElements.length > 0) {
26
25
  const isParamError = validateToolParams({ locale, graphqlUrl }, [
27
26
  {
28
27
  name: 'locale',
29
- valueCheck: (value) => value.split('-')[0] === 'en' || value.split('-')[0] === 'zh',
28
+ valueCheck: (value) => validateLocale(value),
30
29
  }, {
31
30
  name: 'graphqlUrl',
32
31
  }]);
@@ -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,20 @@
1
+ {
2
+ "1m": "1M",
3
+ "1w": "1S",
4
+ "24h": "24H",
5
+ "3m": "3M",
6
+ "4h": "4H",
7
+ "8h": "8H",
8
+ "current_business_day": "Día laborable actual",
9
+ "data_unavailable": "No hay datos disponibles",
10
+ "hour": "{{count}} Hora",
11
+ "hour_plural": "{{count}} Horas",
12
+ "last_updated": "Última actualización",
13
+ "month": "{{count}} Mes",
14
+ "month_plural": "{{count}} Meses",
15
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} de {{itemCount}} entradas",
16
+ "previous_business_day": "Día laborable anterior",
17
+ "today": "Hoy",
18
+ "week": "{{count}} Semana",
19
+ "week_plural": "{{count}} Semanas"
20
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "1m": "1 เดือน",
3
+ "1w": "1 สัปดาห์",
4
+ "24h": "24 ชม.",
5
+ "3m": "3 เดือน",
6
+ "4h": "4 ชม.",
7
+ "8h": "8 ชม.",
8
+ "current_business_day": "วันทำการปัจจุบัน",
9
+ "data_unavailable": "ข้อมูลไม่พร้อมใช้งาน",
10
+ "hour_0": "{{count}} ชั่วโมง",
11
+ "last_updated": "ปรับปรุงล่าสุด",
12
+ "month_0": "{{count}} เดือน",
13
+ "pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} จาก {{itemCount}} รายการ",
14
+ "previous_business_day": "วันทำการก่อนหน้า",
15
+ "today": "วันนี้",
16
+ "week_0": "{{count}} สัปดาห์"
17
+ }