@oanda/labs-currency-cross-table 1.0.23 → 1.0.24

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,106 @@
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.24 (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
+ **Note:** Version bump only for package @oanda/labs-currency-cross-table
101
+
102
+
103
+
104
+
105
+
6
106
  ## 1.0.23 (2024-11-29)
7
107
 
8
108
 
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CurrencyCrossTableWidget = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
7
+ var _react = _interopRequireDefault(require("react"));
8
8
  var _client = require("@apollo/client");
9
- var _monoI18n = require("@oanda/mono-i18n");
10
9
  var _labsWidgetCommon = require("@oanda/labs-widget-common");
11
10
  var _translations = require("../translations");
12
11
  var _ValidationWrapper = require("./ValidationWrapper");
13
12
  var _graphql = require("../gql/types/graphql");
14
- 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); }
15
- 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; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
14
  const CurrencyCrossTableWidget = _ref => {
17
15
  let {
18
16
  graphqlUrl,
@@ -31,29 +29,30 @@ const CurrencyCrossTableWidget = _ref => {
31
29
  });
32
30
  const divisionCode = division === _graphql.Division.Opt ? _graphql.Division.Ogm : division;
33
31
  const dataSource = divisionCode === _graphql.Division.Ogm ? 'MT5' : 'V20';
34
- return _react.default.createElement(_monoI18n.LocaleProvider, {
35
- locale: (0, _labsWidgetCommon.getLocale)(locale),
36
- translations: _translations.translations
37
- }, _react.default.createElement(_labsWidgetCommon.LiveRatesProvider, {
38
- url: liveRatesUrl,
39
- options: {
40
- divisionCode,
41
- dataSource
32
+ return _react.default.createElement(_labsWidgetCommon.WidgetProvider, {
33
+ withSuspense: true,
34
+ locale: locale,
35
+ translations: _translations.translations,
36
+ client: client,
37
+ theme: theme,
38
+ styling: {
39
+ removePadding
40
+ },
41
+ liveRates: {
42
+ url: liveRatesUrl,
43
+ options: {
44
+ divisionCode,
45
+ dataSource
46
+ }
42
47
  }
43
- }, _react.default.createElement(_client.ApolloProvider, {
44
- client: client
45
- }, _react.default.createElement(_react.Suspense, null, _react.default.createElement(_labsWidgetCommon.ThemeProvider, {
46
- removePadding: removePadding,
47
- theme: theme
48
- }, (0, _labsWidgetCommon.renderComponent)({
49
- Component: _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
50
- currencies: currencies,
51
- division: division,
52
- isParamError: isParamError
53
- }),
54
- logoLink,
55
- linkArea: 'full'
56
- }))))));
48
+ }, _react.default.createElement(_labsWidgetCommon.WidgetWrapper, {
49
+ logoLink: logoLink,
50
+ linkArea: "full"
51
+ }, _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
52
+ currencies: currencies,
53
+ division: division,
54
+ isParamError: isParamError
55
+ })));
57
56
  };
58
57
  exports.CurrencyCrossTableWidget = CurrencyCrossTableWidget;
59
58
  //# sourceMappingURL=CurrencyCrossTableWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyCrossTableWidget.js","names":["_react","_interopRequireWildcard","require","_client","_monoI18n","_labsWidgetCommon","_translations","_ValidationWrapper","_graphql","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","Suspense","ThemeProvider","renderComponent","Component","ValidationWrapper","linkArea","exports"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n LiveRatesProvider, ThemeProvider, getLocale,\n renderComponent,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\nimport { Division } from '../gql/types/graphql';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme}>\n {renderComponent({\n Component: <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />,\n logoLink,\n linkArea: 'full',\n })}\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAIA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,G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ACI,CACC,CACL,CAAC;AAErB,CAAC;AAACC,OAAA,CAAAnC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"CurrencyCrossTableWidget.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_translations","_ValidationWrapper","_graphql","e","__esModule","default","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","WidgetProvider","withSuspense","translations","styling","liveRates","url","options","WidgetWrapper","linkArea","ValidationWrapper","exports"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\nimport { Division } from '../gql/types/graphql';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <WidgetProvider\n withSuspense\n locale={locale}\n translations={translations}\n client={client}\n theme={theme}\n styling={{\n removePadding,\n }}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n >\n <WidgetWrapper\n logoLink={logoLink}\n linkArea=\"full\"\n >\n <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA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AEA,QAAS;IACnBoB,QAAQ,EAAC;EAAM,GAEfzC,MAAA,CAAAU,OAAA,CAAAsB,aAAA,CAAC1B,kBAAA,CAAAoC,iBAAiB;IAChB3B,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACY,CACD,CAAC;AAErB,CAAC;AAACwB,OAAA,CAAAhC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,7 +1,6 @@
1
- import React, { Suspense } from 'react';
2
- import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
3
- import { LocaleProvider } from '@oanda/mono-i18n';
4
- import { LiveRatesProvider, ThemeProvider, getLocale, renderComponent } from '@oanda/labs-widget-common';
1
+ import React from 'react';
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 { ValidationWrapper } from './ValidationWrapper';
7
6
  import { Division } from '../gql/types/graphql';
@@ -23,29 +22,30 @@ const CurrencyCrossTableWidget = _ref => {
23
22
  });
24
23
  const divisionCode = division === Division.Opt ? Division.Ogm : division;
25
24
  const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';
26
- return React.createElement(LocaleProvider, {
27
- locale: getLocale(locale),
28
- translations: translations
29
- }, React.createElement(LiveRatesProvider, {
30
- url: liveRatesUrl,
31
- options: {
32
- divisionCode,
33
- dataSource
25
+ return React.createElement(WidgetProvider, {
26
+ withSuspense: true,
27
+ locale: locale,
28
+ translations: translations,
29
+ client: client,
30
+ theme: theme,
31
+ styling: {
32
+ removePadding
33
+ },
34
+ liveRates: {
35
+ url: liveRatesUrl,
36
+ options: {
37
+ divisionCode,
38
+ dataSource
39
+ }
34
40
  }
35
- }, React.createElement(ApolloProvider, {
36
- client: client
37
- }, React.createElement(Suspense, null, React.createElement(ThemeProvider, {
38
- removePadding: removePadding,
39
- theme: theme
40
- }, renderComponent({
41
- Component: React.createElement(ValidationWrapper, {
42
- currencies: currencies,
43
- division: division,
44
- isParamError: isParamError
45
- }),
46
- logoLink,
47
- linkArea: 'full'
48
- }))))));
41
+ }, React.createElement(WidgetWrapper, {
42
+ logoLink: logoLink,
43
+ linkArea: "full"
44
+ }, React.createElement(ValidationWrapper, {
45
+ currencies: currencies,
46
+ division: division,
47
+ isParamError: isParamError
48
+ })));
49
49
  };
50
50
  export { CurrencyCrossTableWidget };
51
51
  //# sourceMappingURL=CurrencyCrossTableWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyCrossTableWidget.js","names":["React","Suspense","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","LiveRatesProvider","ThemeProvider","getLocale","renderComponent","translations","ValidationWrapper","Division","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options","Component","linkArea"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport {\n LiveRatesProvider, ThemeProvider, getLocale,\n renderComponent,\n} from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\nimport { Division } from '../gql/types/graphql';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme}>\n {renderComponent({\n Component: <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />,\n logoLink,\n linkArea: 'full',\n })}\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,EAC3CC,eAAe,QACV,2BAA2B;AAClC,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAMC,wBAAwB,GAAGC,IAAA,IAUD;EAAA,IAVE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC;EACwB,CAAC,GAAAT,IAAA;EACzB,MAAMU,MAAM,GAAG,IAAItB,YAAY,CAAC;IAC9BuB,GAAG,EAAEV,UAAU;IACfW,KAAK,EAAE,IAAIvB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMwB,YAAY,GAAGT,QAAQ,KAAKN,QAAQ,CAACgB,GAAG,GAAGhB,QAAQ,CAACiB,GAAG,GAAGX,QAAQ;EACxE,MAAMY,UAAU,GAAGH,YAAY,KAAKf,QAAQ,CAACiB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE7B,KAAA,CAAA+B,aAAA,CAAC1B,cAAc;IAACc,MAAM,EAAEX,SAAS,CAACW,MAAM,CAAE;IAACT,YAAY,EAAEA;EAAa,GACpEV,KAAA,CAAA+B,aAAA,CAACzB,iBAAiB;IAChB0B,GAAG,EAAEhB,YAAa;IAClBiB,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtC9B,KAAA,CAAA+B,aAAA,CAAC3B,cAAc;IAACoB,MAAM,EAAEA;EAAO,GAC7BxB,KAAA,CAAA+B,aAAA,CAAC9B,QAAQ,QACPD,KAAA,CAAA+B,aAAA,CAACxB,aAAa;IAACe,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA;EAAM,GACvDX,eAAe,CAAC;IACfyB,SAAS,EAAElC,KAAA,CAAA+B,aAAA,CAACpB,iBAAiB;MAC3BM,UAAU,EAAEA,UAAW;MACvBC,QAAQ,EAAEA,QAAS;MACnBG,YAAY,EAAEA;IAAa,CAC5B,CAAC;IACFE,QAAQ;IACRY,QAAQ,EAAE;EACZ,CAAC,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAED,SAAStB,wBAAwB","ignoreList":[]}
1
+ {"version":3,"file":"CurrencyCrossTableWidget.js","names":["React","ApolloClient","InMemoryCache","WidgetProvider","WidgetWrapper","translations","ValidationWrapper","Division","CurrencyCrossTableWidget","_ref","graphqlUrl","liveRatesUrl","currencies","division","locale","theme","isParamError","removePadding","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","withSuspense","styling","liveRates","url","options","linkArea"],"sources":["../../../src/CurrencyCrossTableWidget/CurrencyCrossTableWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { CurrencyCrossTableConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\nimport { Division } from '../gql/types/graphql';\n\nconst CurrencyCrossTableWidget = ({\n graphqlUrl,\n liveRatesUrl,\n currencies,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n logoLink,\n}: CurrencyCrossTableConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <WidgetProvider\n withSuspense\n locale={locale}\n translations={translations}\n client={client}\n theme={theme}\n styling={{\n removePadding,\n }}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n >\n <WidgetWrapper\n logoLink={logoLink}\n linkArea=\"full\"\n >\n <ValidationWrapper\n currencies={currencies}\n division={division}\n isParamError={isParamError}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyCrossTableWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,aAAa,QAAQ,gBAAgB;AAC5D,SAASC,cAAc,EAAEC,aAAa,QAAQ,2BAA2B;AACzE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAMC,wBAAwB,GAAGC,IAAA,IAUD;EAAA,IAVE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC;EACwB,CAAC,GAAAT,IAAA;EACzB,MAAMU,MAAM,GAAG,IAAIlB,YAAY,CAAC;IAC9BmB,GAAG,EAAEV,UAAU;IACfW,KAAK,EAAE,IAAInB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMoB,YAAY,GAAGT,QAAQ,KAAKN,QAAQ,CAACgB,GAAG,GAAGhB,QAAQ,CAACiB,GAAG,GAAGX,QAAQ;EACxE,MAAMY,UAAU,GAAGH,YAAY,KAAKf,QAAQ,CAACiB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACExB,KAAA,CAAA0B,aAAA,CAACvB,cAAc;IACbwB,YAAY;IACZb,MAAM,EAAEA,MAAO;IACfT,YAAY,EAAEA,YAAa;IAC3Bc,MAAM,EAAEA,MAAO;IACfJ,KAAK,EAAEA,KAAM;IACba,OAAO,EAAE;MACPX;IACF,CAAE;IACFY,SAAS,EAAE;MACTC,GAAG,EAAEnB,YAAY;MACjBoB,OAAO,EAAE;QAAET,YAAY;QAAEG;MAAW;IACtC;EAAE,GAEFzB,KAAA,CAAA0B,aAAA,CAACtB,aAAa;IACZc,QAAQ,EAAEA,QAAS;IACnBc,QAAQ,EAAC;EAAM,GAEfhC,KAAA,CAAA0B,aAAA,CAACpB,iBAAiB;IAChBM,UAAU,EAAEA,UAAW;IACvBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACY,CACD,CAAC;AAErB,CAAC;AAED,SAASR,wBAAwB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oanda/labs-currency-cross-table",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Labs Currency Cross Table",
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.172",
15
+ "@oanda/labs-widget-common": "^1.0.173",
16
16
  "@oanda/mono-i18n": "10.0.1",
17
17
  "graphql": "16.8.1"
18
18
  },
@@ -20,5 +20,5 @@
20
20
  "@graphql-codegen/cli": "5.0.0",
21
21
  "@graphql-codegen/client-preset": "4.1.0"
22
22
  },
23
- "gitHead": "f3c94dbb01bc271f175ba95700c51001c4099a52"
23
+ "gitHead": "67a7801f99f0bab94dd6067a102761f51de786c1"
24
24
  }
@@ -1,10 +1,6 @@
1
- import React, { Suspense } from 'react';
2
- import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
3
- import { LocaleProvider } from '@oanda/mono-i18n';
4
- import {
5
- LiveRatesProvider, ThemeProvider, getLocale,
6
- renderComponent,
7
- } from '@oanda/labs-widget-common';
1
+ import React from 'react';
2
+ import { ApolloClient, InMemoryCache } from '@apollo/client';
3
+ import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
8
4
  import { translations } from '../translations';
9
5
  import { CurrencyCrossTableConfig } from './types';
10
6
  import { ValidationWrapper } from './ValidationWrapper';
@@ -30,28 +26,31 @@ const CurrencyCrossTableWidget = ({
30
26
  const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';
31
27
 
32
28
  return (
33
- <LocaleProvider locale={getLocale(locale)} translations={translations}>
34
- <LiveRatesProvider
35
- url={liveRatesUrl}
36
- options={{ divisionCode, dataSource }}
29
+ <WidgetProvider
30
+ withSuspense
31
+ locale={locale}
32
+ translations={translations}
33
+ client={client}
34
+ theme={theme}
35
+ styling={{
36
+ removePadding,
37
+ }}
38
+ liveRates={{
39
+ url: liveRatesUrl,
40
+ options: { divisionCode, dataSource },
41
+ }}
42
+ >
43
+ <WidgetWrapper
44
+ logoLink={logoLink}
45
+ linkArea="full"
37
46
  >
38
- <ApolloProvider client={client}>
39
- <Suspense>
40
- <ThemeProvider removePadding={removePadding} theme={theme}>
41
- {renderComponent({
42
- Component: <ValidationWrapper
43
- currencies={currencies}
44
- division={division}
45
- isParamError={isParamError}
46
- />,
47
- logoLink,
48
- linkArea: 'full',
49
- })}
50
- </ThemeProvider>
51
- </Suspense>
52
- </ApolloProvider>
53
- </LiveRatesProvider>
54
- </LocaleProvider>
47
+ <ValidationWrapper
48
+ currencies={currencies}
49
+ division={division}
50
+ isParamError={isParamError}
51
+ />
52
+ </WidgetWrapper>
53
+ </WidgetProvider>
55
54
  );
56
55
  };
57
56
 
@@ -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 { ThemeContext, Size } from '@oanda/labs-widget-common';
7
+ import { LiveRatesProvider, MockLayoutProvider } from '@oanda/labs-widget-common';
8
8
  import { Main } from '../src/CurrencyCrossTableWidget/Main';
9
9
  import { Division } from '../src/gql/types/graphql';
10
10
  import { widgetMocks } from './mocks';
@@ -15,13 +15,15 @@ describe('Main component', () => {
15
15
 
16
16
  const { getByTestId } = render(
17
17
  <MockedProvider mocks={widgetMocks}>
18
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: true }}>
19
- <Main
20
- currencies={currencies}
21
- division={Division.Oc}
22
- validInstruments={['EUR_USD', 'EUR_GBP', 'EUR_CHF', 'USD_GBP', 'USD_CHF', 'GBP_CHF', 'CHF_EUR']}
23
- />
24
- </ThemeContext.Provider>
18
+ <LiveRatesProvider url="oanda.com">
19
+ <MockLayoutProvider>
20
+ <Main
21
+ currencies={currencies}
22
+ division={Division.Oc}
23
+ validInstruments={['EUR_USD', 'EUR_GBP', 'EUR_CHF', 'USD_GBP', 'USD_CHF', 'GBP_CHF', 'CHF_EUR']}
24
+ />
25
+ </MockLayoutProvider>
26
+ </LiveRatesProvider>
25
27
  </MockedProvider>,
26
28
  );
27
29