@oanda/labs-currency-strength-widget 1.0.90 → 1.0.92

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +740 -0
  2. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js +7 -9
  3. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  4. package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js +13 -18
  5. package/dist/main/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -1
  6. package/dist/main/CurrencyStrengthWidget/Main.js +4 -5
  7. package/dist/main/CurrencyStrengthWidget/Main.js.map +1 -1
  8. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js +14 -14
  9. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  10. package/dist/main/CurrencyStrengthWidget/components/Chart/constants.js.map +1 -1
  11. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  12. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  13. package/dist/main/CurrencyStrengthWidget/components/Chart/types.js.map +1 -1
  14. package/dist/main/CurrencyStrengthWidget/render.js +5 -5
  15. package/dist/main/CurrencyStrengthWidget/render.js.map +1 -1
  16. package/dist/main/CurrencyStrengthWidget/types.js.map +1 -1
  17. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  18. package/dist/main/gql/types/gql.js +1 -1
  19. package/dist/main/gql/types/gql.js.map +1 -1
  20. package/dist/main/gql/types/graphql.js +40 -40
  21. package/dist/main/gql/types/graphql.js.map +1 -1
  22. package/dist/main/gql/types/index.js.map +1 -1
  23. package/dist/main/translations/index.js +1 -1
  24. package/dist/main/translations/index.js.map +1 -1
  25. package/dist/main/translations/translations.js.map +1 -1
  26. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js +7 -7
  27. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  28. package/dist/module/CurrencyStrengthWidget/CurrencyStrengthWidget.js +14 -19
  29. package/dist/module/CurrencyStrengthWidget/CurrencyStrengthWidget.js.map +1 -1
  30. package/dist/module/CurrencyStrengthWidget/Main.js +3 -3
  31. package/dist/module/CurrencyStrengthWidget/Main.js.map +1 -1
  32. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js +13 -13
  33. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  34. package/dist/module/CurrencyStrengthWidget/components/Chart/constants.js.map +1 -1
  35. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js +1 -1
  36. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  37. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js +1 -1
  38. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  39. package/dist/module/CurrencyStrengthWidget/components/Chart/types.js.map +1 -1
  40. package/dist/module/CurrencyStrengthWidget/render.js +5 -5
  41. package/dist/module/CurrencyStrengthWidget/render.js.map +1 -1
  42. package/dist/module/CurrencyStrengthWidget/types.js.map +1 -1
  43. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  44. package/dist/module/gql/types/gql.js +1 -1
  45. package/dist/module/gql/types/gql.js.map +1 -1
  46. package/dist/module/gql/types/graphql.js +40 -40
  47. package/dist/module/gql/types/graphql.js.map +1 -1
  48. package/dist/module/gql/types/index.js +2 -2
  49. package/dist/module/gql/types/index.js.map +1 -1
  50. package/dist/module/translations/index.js +1 -1
  51. package/dist/module/translations/index.js.map +1 -1
  52. package/dist/module/translations/translations.js.map +1 -1
  53. package/dist/types/CurrencyStrengthWidget/ChartsWithData.d.ts +1 -1
  54. package/dist/types/CurrencyStrengthWidget/CurrencyStrengthWidget.d.ts +1 -1
  55. package/dist/types/CurrencyStrengthWidget/Main.d.ts +1 -1
  56. package/dist/types/CurrencyStrengthWidget/components/Chart/Chart.d.ts +1 -1
  57. package/dist/types/CurrencyStrengthWidget/components/Chart/formatters.d.ts +2 -2
  58. package/dist/types/CurrencyStrengthWidget/components/Chart/getOption.d.ts +1 -1
  59. package/dist/types/CurrencyStrengthWidget/components/Chart/types.d.ts +5 -5
  60. package/dist/types/CurrencyStrengthWidget/types.d.ts +1 -1
  61. package/dist/types/gql/types/gql.d.ts +2 -2
  62. package/dist/types/gql/types/index.d.ts +2 -2
  63. package/dist/types/translations/index.d.ts +2 -2
  64. package/package.json +3 -3
  65. package/src/CurrencyStrengthWidget/ChartsWithData.tsx +49 -30
  66. package/src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx +24 -22
  67. package/src/CurrencyStrengthWidget/Main.tsx +10 -9
  68. package/src/CurrencyStrengthWidget/components/Chart/Chart.tsx +25 -16
  69. package/src/CurrencyStrengthWidget/components/Chart/constants.tsx +1 -0
  70. package/src/CurrencyStrengthWidget/components/Chart/formatters.ts +4 -7
  71. package/src/CurrencyStrengthWidget/components/Chart/getOption.ts +22 -18
  72. package/src/CurrencyStrengthWidget/components/Chart/types.ts +8 -8
  73. package/src/CurrencyStrengthWidget/render.tsx +17 -15
  74. package/src/CurrencyStrengthWidget/types.ts +1 -1
  75. package/src/gql/types/fragment-masking.ts +41 -21
  76. package/src/gql/types/gql.ts +7 -3
  77. package/src/gql/types/graphql.ts +98 -45
  78. package/src/gql/types/index.ts +2 -2
  79. package/src/translations/index.ts +4 -4
  80. package/src/translations/translations.ts +1 -3
  81. package/test/Main.test.tsx +28 -16
  82. package/test/chartOptions.test.ts +9 -7
  83. package/test/mocks/currencyStrengthMock.ts +1 -3
  84. package/test/mocks/responsesMocks.ts +2 -4
  85. package/test/sortData.test.ts +10 -12
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.js","names":["AssetClassName","exports","BookType","CorrelationTimeUnit","CurrencyName","CurrencyPowerBalanceTimeUnit","DataSource","Division","Region","Sort","TopicalSort","ValueAtRiskBars","ValueAtRiskDuration","VolatilityChartTimeSpan","VolatilityChartTimeUnit","GetCurrencyStrengthDocument"],"sources":["../../../../src/gql/types/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n};\n\nexport type AssetClass = {\n __typename?: 'AssetClass';\n instruments: Array<Instrument>;\n name: Scalars['String']['output'];\n};\n\nexport enum AssetClassName {\n Commodities = 'COMMODITIES',\n Cryptocurrency = 'CRYPTOCURRENCY',\n Currency = 'CURRENCY',\n EquityShares = 'EQUITY_SHARES',\n Indices = 'INDICES',\n Rates = 'RATES'\n}\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION'\n}\n\nexport type CorrelationHeatmap = {\n __typename?: 'CorrelationHeatmap';\n baseInstrument: Instrument;\n heatmap: Array<Heatmap>;\n};\n\nexport type CorrelationMatrix = {\n __typename?: 'CorrelationMatrix';\n baseTimeUnit: CorrelationTimeUnit;\n matrix: Array<Matrix>;\n};\n\nexport enum CorrelationTimeUnit {\n H1 = 'H1',\n H4 = 'H4',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n M6 = 'M6',\n W1 = 'W1',\n Y1 = 'Y1'\n}\n\nexport enum CurrencyName {\n Aud = 'AUD',\n Cad = 'CAD',\n Chf = 'CHF',\n Eur = 'EUR',\n Gbp = 'GBP',\n Jpy = 'JPY',\n Nzd = 'NZD',\n Usd = 'USD'\n}\n\nexport type CurrencyPower = {\n __typename?: 'CurrencyPower';\n /** UTC Timestamp */\n point: Scalars['String']['output'];\n price: Scalars['Float']['output'];\n};\n\nexport type CurrencyPowerBalance = {\n __typename?: 'CurrencyPowerBalance';\n currency: CurrencyName;\n power: Array<CurrencyPower>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum CurrencyPowerBalanceTimeUnit {\n CurrentDay = 'CURRENT_DAY',\n H4 = 'H4',\n H8 = 'H8',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n PreviousDay = 'PREVIOUS_DAY',\n W1 = 'W1'\n}\n\nexport type CurrencyStrength = {\n __typename?: 'CurrencyStrength';\n currency: CurrencyName;\n strengthRelation?: Maybe<Array<StrengthRelation>>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum DataSource {\n Ny4 = 'NY4',\n Ty3 = 'TY3'\n}\n\nexport enum Division {\n Oap = 'OAP',\n Oau = 'OAU',\n Oc = 'OC',\n Ocan = 'OCAN',\n Oel = 'OEL',\n Ogm = 'OGM',\n Oj = 'OJ',\n Opt = 'OPT',\n Otms = 'OTMS'\n}\n\nexport type Heatmap = {\n __typename?: 'Heatmap';\n instrument: Instrument;\n timeCorrelation: Array<TimeCorrelation>;\n};\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport type InstrumentCorrelation = {\n __typename?: 'InstrumentCorrelation';\n instrument: Instrument;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type Matrix = {\n __typename?: 'Matrix';\n instrument: Instrument;\n instrumentCorrelation: Array<InstrumentCorrelation>;\n};\n\nexport type OrderPositionBucket = {\n __typename?: 'OrderPositionBucket';\n longCountPercent: Scalars['Float']['output'];\n price: Scalars['Float']['output'];\n shortCountPercent: Scalars['Float']['output'];\n};\n\nexport type OrderPositionData = {\n __typename?: 'OrderPositionData';\n bucketWidth: Scalars['Float']['output'];\n buckets: Array<Maybe<OrderPositionBucket>>;\n dataSource?: Maybe<Scalars['String']['output']>;\n instrument: Scalars['String']['output'];\n price?: Maybe<Scalars['Float']['output']>;\n region?: Maybe<Scalars['String']['output']>;\n time: Scalars['String']['output'];\n unixTime: Scalars['Int']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n assetClasses?: Maybe<Array<Maybe<AssetClass>>>;\n correlationHeatmap: CorrelationHeatmap;\n correlationMatrix: CorrelationMatrix;\n currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;\n currencyStrength?: Maybe<Array<CurrencyStrength>>;\n mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n sentiment?: Maybe<Array<SentimentInstrument>>;\n sentimentList?: Maybe<Array<SentimentInstrument>>;\n topicalInstruments?: Maybe<Array<TopicalInstrument>>;\n topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;\n topicalInstrumentsTotalCount: Scalars['Int']['output'];\n valueAtRiskAssetClasses?: Maybe<Array<AssetClass>>;\n valueAtRiskChart?: Maybe<ValueAtRiskChart>;\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;\n};\n\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\n\nexport type QueryCorrelationHeatmapArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;\n};\n\n\nexport type QueryCorrelationMatrixArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n};\n\n\nexport type QueryCurrencyPowerBalanceArgs = {\n timeUnit: CurrencyPowerBalanceTimeUnit;\n};\n\n\nexport type QueryMapInstrumentNamesArgs = {\n division?: InputMaybe<Division>;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\n};\n\n\nexport type QueryOrderPositionBooksArgs = {\n bookType: BookType;\n dataSource?: InputMaybe<DataSource>;\n instrument: Scalars['String']['input'];\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n region?: InputMaybe<Region>;\n};\n\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\n\nexport type QueryTopicalInstrumentsArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\n\nexport type QueryValueAtRiskAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\n\nexport type QueryValueAtRiskChartArgs = {\n bars: ValueAtRiskBars;\n division?: InputMaybe<Division>;\n duration: ValueAtRiskDuration;\n instrument: Scalars['String']['input'];\n};\n\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\n};\n\n\nexport type QueryVolatilityChartAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport enum Region {\n Amer = 'AMER',\n Apac = 'APAC',\n Emea = 'EMEA'\n}\n\nexport type Sentiment = {\n __typename?: 'Sentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport type SentimentInstrument = {\n __typename?: 'SentimentInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum Sort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH'\n}\n\nexport type StrengthRelation = {\n __typename?: 'StrengthRelation';\n currency: CurrencyName;\n percentage: Scalars['Float']['output'];\n};\n\nexport type TimeCorrelation = {\n __typename?: 'TimeCorrelation';\n timeUnit: CorrelationTimeUnit;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n assetClass?: Maybe<AssetClassName>;\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentChart = {\n __typename?: 'TopicalInstrumentChart';\n chart?: Maybe<Array<Scalars['Float']['output']>>;\n name: Scalars['String']['output'];\n};\n\nexport enum TopicalSort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n Hot = 'HOT',\n Popular = 'POPULAR',\n Volatile = 'VOLATILE'\n}\n\nexport enum ValueAtRiskBars {\n C100 = 'C100',\n C200 = 'C200',\n C300 = 'C300'\n}\n\nexport type ValueAtRiskChart = {\n __typename?: 'ValueAtRiskChart';\n down: ValueAtRiskChartData;\n up: ValueAtRiskChartData;\n};\n\nexport type ValueAtRiskChartData = {\n __typename?: 'ValueAtRiskChartData';\n average: Scalars['Float']['output'];\n max: Scalars['Float']['output'];\n median: Scalars['Float']['output'];\n points?: Maybe<Array<ValueAtRiskChartPoint>>;\n threshold: Scalars['Float']['output'];\n};\n\nexport type ValueAtRiskChartPoint = {\n __typename?: 'ValueAtRiskChartPoint';\n percent: Scalars['Float']['output'];\n pips: Scalars['Float']['output'];\n};\n\nexport enum ValueAtRiskDuration {\n C1 = 'C1',\n C2 = 'C2',\n C3 = 'C3',\n C4 = 'C4',\n C5 = 'C5',\n C10 = 'C10'\n}\n\nexport type VolatilityChart = {\n __typename?: 'VolatilityChart';\n pips: Scalars['Float']['output'];\n /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */\n point: Scalars['String']['output'];\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum VolatilityChartTimeSpan {\n /** Valid for: H */\n D5 = 'D5',\n /** Valid for: H */\n D10 = 'D10',\n /** Valid for: D */\n M1 = 'M1',\n /** Valid for: D */\n M3 = 'M3',\n /** Valid for: W */\n W5 = 'W5',\n /** Valid for: W */\n W10 = 'W10'\n}\n\nexport enum VolatilityChartTimeUnit {\n D = 'D',\n H = 'H',\n W = 'W'\n}\n\nexport type GetCurrencyStrengthQueryVariables = Exact<{ [key: string]: never; }>;\n\n\nexport type GetCurrencyStrengthQuery = { __typename?: 'Query', currencyStrength?: Array<{ __typename?: 'CurrencyStrength', currency: CurrencyName, updatedAt: string, strengthRelation?: Array<{ __typename?: 'StrengthRelation', currency: CurrencyName, percentage: number }> | null }> | null };\n\n\nexport const GetCurrencyStrengthDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetCurrencyStrength\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"currencyStrength\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"currency\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"strengthRelation\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"currency\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"percentage\"}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"updatedAt\"}}]}}]}}]} as unknown as DocumentNode<GetCurrencyStrengthQuery, GetCurrencyStrengthQ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,OAAO;IAAC,MAAM,EAAC;MAAC,MAAM,EAAC,MAAM;MAAC,OAAO,EAAC;IAAqB,CAAC;IAAC,cAAc,EAAC;MAAC,MAAM,EAAC,cAAc;MAAC,YAAY,EAAC,CAAC;QAAC,MAAM,EAAC,OAAO;QAAC,MAAM,EAAC;UAAC,MAAM,EAAC,MAAM;UAAC,OAAO,EAAC;QAAkB,CAAC;QAAC,cAAc,EAAC;UAAC,MAAM,EAAC,cAAc;UAAC,YAAY,EAAC,CAAC;YAAC,MAAM,EAAC,OAAO;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAU;UAAC,CAAC,EAAC;YAAC,MAAM,EAAC,OAAO;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAkB,CAAC;YAAC,cAAc,EAAC;cAAC,MAAM,EAAC,cAAc;cAAC,YAAY,EAAC,CAAC;gBAAC,MAAM,EAAC,OAAO;gBAAC,MAAM,EAAC;kBAAC,MAAM,EAAC,MAAM;kBAAC,OAAO,EAAC;gBAAU;cAAC,CAAC,EAAC;gBAAC,MAAM,EAAC,OAAO;gBAAC,MAAM,EAAC;kBAAC,MAAM,EAAC,MAAM;kBAAC,OAAO,EAAC;gBAAY;cAAC,CAAC;YAAC;UAAC,CAAC,EAAC;YAAC,MAAM,EAAC,OAAO;YAAC,MAAM,EAAC;cAAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAW;UAAC,CAAC;QAAC;MAAC,CAAC;IAAC;EAAC,CAAC;AAAC,CAAyF","ignoreList":[]}
1
+ {"version":3,"file":"graphql.js","names":["AssetClassName","exports","BookType","CorrelationTimeUnit","CurrencyName","CurrencyPowerBalanceTimeUnit","DataSource","Division","Region","Sort","TopicalSort","ValueAtRiskBars","ValueAtRiskDuration","VolatilityChartTimeSpan","VolatilityChartTimeUnit","GetCurrencyStrengthDocument","kind","definitions","operation","name","value","selectionSet","selections"],"sources":["../../../../src/gql/types/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = {\n [K in keyof T]: T[K];\n};\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n [SubKey in K]?: Maybe<T[SubKey]>;\n};\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n [SubKey in K]: Maybe<T[SubKey]>;\n};\nexport type MakeEmpty<\n T extends { [key: string]: unknown },\n K extends keyof T,\n> = { [_ in K]?: never };\nexport type Incremental<T> =\n | T\n | {\n [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;\n };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string };\n String: { input: string; output: string };\n Boolean: { input: boolean; output: boolean };\n Int: { input: number; output: number };\n Float: { input: number; output: number };\n};\n\nexport type AssetClass = {\n __typename?: 'AssetClass';\n instruments: Array<Instrument>;\n name: Scalars['String']['output'];\n};\n\nexport enum AssetClassName {\n Commodities = 'COMMODITIES',\n Cryptocurrency = 'CRYPTOCURRENCY',\n Currency = 'CURRENCY',\n EquityShares = 'EQUITY_SHARES',\n Indices = 'INDICES',\n Rates = 'RATES',\n}\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION',\n}\n\nexport type CorrelationHeatmap = {\n __typename?: 'CorrelationHeatmap';\n baseInstrument: Instrument;\n heatmap: Array<Heatmap>;\n};\n\nexport type CorrelationMatrix = {\n __typename?: 'CorrelationMatrix';\n baseTimeUnit: CorrelationTimeUnit;\n matrix: Array<Matrix>;\n};\n\nexport enum CorrelationTimeUnit {\n H1 = 'H1',\n H4 = 'H4',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n M6 = 'M6',\n W1 = 'W1',\n Y1 = 'Y1',\n}\n\nexport enum CurrencyName {\n Aud = 'AUD',\n Cad = 'CAD',\n Chf = 'CHF',\n Eur = 'EUR',\n Gbp = 'GBP',\n Jpy = 'JPY',\n Nzd = 'NZD',\n Usd = 'USD',\n}\n\nexport type CurrencyPower = {\n __typename?: 'CurrencyPower';\n /** UTC Timestamp */\n point: Scalars['String']['output'];\n price: Scalars['Float']['output'];\n};\n\nexport type CurrencyPowerBalance = {\n __typename?: 'CurrencyPowerBalance';\n currency: CurrencyName;\n power: Array<CurrencyPower>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum CurrencyPowerBalanceTimeUnit {\n CurrentDay = 'CURRENT_DAY',\n H4 = 'H4',\n H8 = 'H8',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n PreviousDay = 'PREVIOUS_DAY',\n W1 = 'W1',\n}\n\nexport type CurrencyStrength = {\n __typename?: 'CurrencyStrength';\n currency: CurrencyName;\n strengthRelation?: Maybe<Array<StrengthRelation>>;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum DataSource {\n Ny4 = 'NY4',\n Ty3 = 'TY3',\n}\n\nexport enum Division {\n Oap = 'OAP',\n Oau = 'OAU',\n Oc = 'OC',\n Ocan = 'OCAN',\n Oel = 'OEL',\n Ogm = 'OGM',\n Oj = 'OJ',\n Opt = 'OPT',\n Otms = 'OTMS',\n}\n\nexport type Heatmap = {\n __typename?: 'Heatmap';\n instrument: Instrument;\n timeCorrelation: Array<TimeCorrelation>;\n};\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport type InstrumentCorrelation = {\n __typename?: 'InstrumentCorrelation';\n instrument: Instrument;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type Matrix = {\n __typename?: 'Matrix';\n instrument: Instrument;\n instrumentCorrelation: Array<InstrumentCorrelation>;\n};\n\nexport type OrderPositionBucket = {\n __typename?: 'OrderPositionBucket';\n longCountPercent: Scalars['Float']['output'];\n price: Scalars['Float']['output'];\n shortCountPercent: Scalars['Float']['output'];\n};\n\nexport type OrderPositionData = {\n __typename?: 'OrderPositionData';\n bucketWidth: Scalars['Float']['output'];\n buckets: Array<Maybe<OrderPositionBucket>>;\n dataSource?: Maybe<Scalars['String']['output']>;\n instrument: Scalars['String']['output'];\n price?: Maybe<Scalars['Float']['output']>;\n region?: Maybe<Scalars['String']['output']>;\n time: Scalars['String']['output'];\n unixTime: Scalars['Int']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n assetClasses?: Maybe<Array<Maybe<AssetClass>>>;\n correlationHeatmap: CorrelationHeatmap;\n correlationMatrix: CorrelationMatrix;\n currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;\n currencyStrength?: Maybe<Array<CurrencyStrength>>;\n mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n sentiment?: Maybe<Array<SentimentInstrument>>;\n sentimentList?: Maybe<Array<SentimentInstrument>>;\n topicalInstruments?: Maybe<Array<TopicalInstrument>>;\n topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;\n topicalInstrumentsTotalCount: Scalars['Int']['output'];\n valueAtRiskAssetClasses?: Maybe<Array<AssetClass>>;\n valueAtRiskChart?: Maybe<ValueAtRiskChart>;\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;\n};\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\nexport type QueryCorrelationHeatmapArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;\n};\n\nexport type QueryCorrelationMatrixArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n};\n\nexport type QueryCurrencyPowerBalanceArgs = {\n timeUnit: CurrencyPowerBalanceTimeUnit;\n};\n\nexport type QueryMapInstrumentNamesArgs = {\n division?: InputMaybe<Division>;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\n};\n\nexport type QueryOrderPositionBooksArgs = {\n bookType: BookType;\n dataSource?: InputMaybe<DataSource>;\n instrument: Scalars['String']['input'];\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n region?: InputMaybe<Region>;\n};\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\nexport type QueryTopicalInstrumentsArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\nexport type QueryValueAtRiskAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport type QueryValueAtRiskChartArgs = {\n bars: ValueAtRiskBars;\n division?: InputMaybe<Division>;\n duration: ValueAtRiskDuration;\n instrument: Scalars['String']['input'];\n};\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\n};\n\nexport type QueryVolatilityChartAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport enum Region {\n Amer = 'AMER',\n Apac = 'APAC',\n Emea = 'EMEA',\n}\n\nexport type Sentiment = {\n __typename?: 'Sentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport type SentimentInstrument = {\n __typename?: 'SentimentInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum Sort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n}\n\nexport type StrengthRelation = {\n __typename?: 'StrengthRelation';\n currency: CurrencyName;\n percentage: Scalars['Float']['output'];\n};\n\nexport type TimeCorrelation = {\n __typename?: 'TimeCorrelation';\n timeUnit: CorrelationTimeUnit;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n assetClass?: Maybe<AssetClassName>;\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentChart = {\n __typename?: 'TopicalInstrumentChart';\n chart?: Maybe<Array<Scalars['Float']['output']>>;\n name: Scalars['String']['output'];\n};\n\nexport enum TopicalSort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n Hot = 'HOT',\n Popular = 'POPULAR',\n Volatile = 'VOLATILE',\n}\n\nexport enum ValueAtRiskBars {\n C100 = 'C100',\n C200 = 'C200',\n C300 = 'C300',\n}\n\nexport type ValueAtRiskChart = {\n __typename?: 'ValueAtRiskChart';\n down: ValueAtRiskChartData;\n up: ValueAtRiskChartData;\n};\n\nexport type ValueAtRiskChartData = {\n __typename?: 'ValueAtRiskChartData';\n average: Scalars['Float']['output'];\n max: Scalars['Float']['output'];\n median: Scalars['Float']['output'];\n points?: Maybe<Array<ValueAtRiskChartPoint>>;\n threshold: Scalars['Float']['output'];\n};\n\nexport type ValueAtRiskChartPoint = {\n __typename?: 'ValueAtRiskChartPoint';\n percent: Scalars['Float']['output'];\n pips: Scalars['Float']['output'];\n};\n\nexport enum ValueAtRiskDuration {\n C1 = 'C1',\n C2 = 'C2',\n C3 = 'C3',\n C4 = 'C4',\n C5 = 'C5',\n C10 = 'C10',\n}\n\nexport type VolatilityChart = {\n __typename?: 'VolatilityChart';\n pips: Scalars['Float']['output'];\n /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */\n point: Scalars['String']['output'];\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum VolatilityChartTimeSpan {\n /** Valid for: H */\n D5 = 'D5',\n /** Valid for: H */\n D10 = 'D10',\n /** Valid for: D */\n M1 = 'M1',\n /** Valid for: D */\n M3 = 'M3',\n /** Valid for: W */\n W5 = 'W5',\n /** Valid for: W */\n W10 = 'W10',\n}\n\nexport enum VolatilityChartTimeUnit {\n D = 'D',\n H = 'H',\n W = 'W',\n}\n\nexport type GetCurrencyStrengthQueryVariables = Exact<{ [key: string]: never }>;\n\nexport type GetCurrencyStrengthQuery = {\n __typename?: 'Query';\n currencyStrength?: Array<{\n __typename?: 'CurrencyStrength';\n currency: CurrencyName;\n updatedAt: string;\n strengthRelation?: Array<{\n __typename?: 'StrengthRelation';\n currency: CurrencyName;\n percentage: number;\n }> | null;\n }> | null;\n};\n\nexport const GetCurrencyStrengthDocument = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: { kind: 'Name', value: 'GetCurrencyStrength' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'currencyStrength' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'currency' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'strengthRelation' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'currency' },\n },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'percentage' },\n },\n ],\n },\n },\n { kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<\n GetCurrencyStrengthQuery,\n GetCurrencyStrengthQueryVariables\n>;\n"],"mappings":";;;;;;IAqCYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,a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K,EAAE;IAAsB,CAAC;IACpDC,YAAY,EAAE;MACZL,IAAI,EAAE,cAAc;MACpBM,UAAU,EAAE,CACV;QACEN,IAAI,EAAE,OAAO;QACbG,IAAI,EAAE;UAAEH,IAAI,EAAE,MAAM;UAAEI,KAAK,EAAE;QAAmB,CAAC;QACjDC,YAAY,EAAE;UACZL,IAAI,EAAE,cAAc;UACpBM,UAAU,EAAE,CACV;YAAEN,IAAI,EAAE,OAAO;YAAEG,IAAI,EAAE;cAAEH,IAAI,EAAE,MAAM;cAAEI,KAAK,EAAE;YAAW;UAAE,CAAC,EAC5D;YACEJ,IAAI,EAAE,OAAO;YACbG,IAAI,EAAE;cAAEH,IAAI,EAAE,MAAM;cAAEI,KAAK,EAAE;YAAmB,CAAC;YACjDC,YAAY,EAAE;cACZL,IAAI,EAAE,cAAc;cACpBM,UAAU,EAAE,CACV;gBACEN,IAAI,EAAE,OAAO;gBACbG,IAAI,EAAE;kBAAEH,IAAI,EAAE,MAAM;kBAAEI,KAAK,EAAE;gBAAW;cAC1C,CAAC,EACD;gBACEJ,IAAI,EAAE,OAAO;gBACbG,IAAI,EAAE;kBAAEH,IAAI,EAAE,MAAM;kBAAEI,KAAK,EAAE;gBAAa;cAC5C,CAAC;YAEL;UACF,CAAC,EACD;YAAEJ,IAAI,EAAE,OAAO;YAAEG,IAAI,EAAE;cAAEH,IAAI,EAAE,MAAM;cAAEI,KAAK,EAAE;YAAY;UAAE,CAAC;QAEjE;MACF,CAAC;IAEL;EACF,CAAC;AAEL,CAGC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_fragmentMasking","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_gql"],"sources":["../../../../src/gql/types/index.ts"],"sourcesContent":["export * from \"./fragment-masking\";\nexport * from \"./gql\";"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_fragmentMasking","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_gql"],"sources":["../../../../src/gql/types/index.ts"],"sourcesContent":["export * from './fragment-masking';\nexport * from './gql';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.translations = void 0;
7
7
  var _monoI18n = require("@oanda/mono-i18n");
8
8
  var _en = _interopRequireDefault(require("./sources/en.json"));
9
- var _zh_TW = _interopRequireDefault(require("./sources/zh_TW.json"));
10
9
  var _es = _interopRequireDefault(require("./sources/es.json"));
11
10
  var _th = _interopRequireDefault(require("./sources/th.json"));
11
+ var _zh_TW = _interopRequireDefault(require("./sources/zh_TW.json"));
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  const translations = exports.translations = {
14
14
  [_monoI18n.Locale.en]: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_zh_TW","_es","_th","e","__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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;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":[]}
1
+ {"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_es","_th","_zh_TW","e","__esModule","default","translations","exports","Locale","en","translation","zhTW","es","th"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import type { Translations } from '@oanda/mono-i18n';\nimport { Locale } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport es from './sources/es.json';\nimport th from './sources/th.json';\nimport zhTW from './sources/zh_TW.json';\nimport type { 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":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,GAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,GAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAwC,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKjC,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":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"translations.js","names":["defaultTranslations","exports"],"sources":["../../../src/translations/translations.ts"],"sourcesContent":["export const defaultTranslations = {\n\n};\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,CAEnC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"translations.js","names":["defaultTranslations","exports"],"sources":["../../../src/translations/translations.ts"],"sourcesContent":["export const defaultTranslations = {};\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,CAAC,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import React, { useContext } from 'react';
2
1
  import { useQuery } from '@apollo/client';
2
+ import { ChartError, LastUpdated, Size, Spinner, SpinnerSize, useLayoutProvider } from '@oanda/labs-widget-common';
3
3
  import { useLocale } from '@oanda/mono-i18n';
4
- import { ChartError, LastUpdated, Size, Spinner, SpinnerSize, ThemeContext } from '@oanda/labs-widget-common';
5
4
  import classnames from 'classnames';
5
+ import React from 'react';
6
6
  import { getCurrencyStrength } from '../gql/getCurrencyStrength';
7
7
  import { Chart } from './components/Chart';
8
8
  import { sortCurrencies } from './components/Chart/formatters';
@@ -12,7 +12,7 @@ const ChartWithData = _ref => {
12
12
  } = _ref;
13
13
  const {
14
14
  size
15
- } = useContext(ThemeContext);
15
+ } = useLayoutProvider();
16
16
  const isDesktop = size === Size.DESKTOP;
17
17
  const {
18
18
  lang
@@ -35,11 +35,11 @@ const ChartWithData = _ref => {
35
35
  }, React.createElement(Spinner, {
36
36
  size: SpinnerSize.lg
37
37
  })), !loading && showChart && React.createElement("div", {
38
- "data-testid": "currency-strength-chart-wrapper",
39
38
  className: classnames('lw-grid lw-place-content-center lw-gap-7', {
40
39
  'lw-grid-cols-3 ': isDesktop && !currency,
41
40
  'lw-grid-cols-1': !isDesktop || currency
42
- })
41
+ }),
42
+ "data-testid": "currency-strength-chart-wrapper"
43
43
  }, currencyData && currencyData.map(item => React.createElement("div", {
44
44
  key: item.currency,
45
45
  className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
@@ -54,8 +54,8 @@ const ChartWithData = _ref => {
54
54
  }, React.createElement(ChartError, null)), !loading && !showError && React.createElement("div", {
55
55
  className: "lw-mt-2 lw-h-8"
56
56
  }, React.createElement(LastUpdated, {
57
- timestamp: data?.currencyStrength[0]?.updatedAt,
58
- labelCallback: lang
57
+ labelCallback: lang,
58
+ timestamp: data?.currencyStrength[0]?.updatedAt
59
59
  })));
60
60
  };
61
61
  export { ChartWithData };
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsWithData.js","names":["React","useContext","useQuery","useLocale","ChartError","LastUpdated","Size","Spinner","SpinnerSize","ThemeContext","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, { useContext } 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 ThemeContext,\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 } = useContext(ThemeContext);\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,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SACEC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,YAAY,QACP,2BAA2B;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,cAAc,QAAQ,+BAA+B;AAG9D,MAAMC,aAAa,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EAC9C,MAAM;IAAEE;EAAK,CAAC,GAAGhB,UAAU,CAACQ,YAAY,CAAC;EACzC,MAAMS,SAAS,GAAGD,IAAI,KAAKX,IAAI,CAACa,OAAO;EACvC,MAAM;IAAEC;EAAK,CAAC,GAAGjB,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEkB,OAAO;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGrB,QAAQ,CAA2BS,mBAAmB,EAAE;IACvFa,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAGH,IAAI,EAAEI,gBAAgB,IAAIJ,IAAI,EAAEI,gBAAgB,EAAEC,MAAM,GAAG,CAAC;EAC9E,MAAMC,SAAS,GAAGN,IAAI,EAAEI,gBAAgB,EAAEC,MAAM,KAAK,CAAC,IAAIJ,KAAK;EAE/D,MAAMM,YAAY,GAAGb,QAAQ,GACzBM,IAAI,EAAEI,gBAAgB,EAAEI,MAAM,CAAEC,IAAI,IAAKA,IAAI,CAACf,QAAQ,KAAKA,QAAQ,CAAC,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OAAO,IAAI,CAACO,SAAS,IACrB5B,KAAA,CAAAkC,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BpC,KAAA,CAAAkC,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
+ {"version":3,"file":"ChartsWithData.js","names":["useQuery","ChartError","LastUpdated","Size","Spinner","SpinnerSize","useLayoutProvider","useLocale","classnames","React","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","labelCallback","timestamp","updatedAt"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { 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>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n 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 <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\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 data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\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\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,cAAc,QAAQ,+BAA+B;AAG9D,MAAMC,aAAa,GAAGC,IAAA,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Q;MACzC,gBAAgB,EAAE,CAACE,SAAS,IAAIF;IAClC,CAAC,CAAE;IACH,eAAY;EAAiC,GAE5Ca,YAAY,IACXA,YAAY,CAACS,GAAG,CAAEP,IAAI,IACpBrB,KAAA,CAAAwB,aAAA;IACEK,GAAG,EAAER,IAAI,CAACf,QAAS;IACnBoB,SAAS,EAAC;EAAkE,GAE5E1B,KAAA,CAAAwB,aAAA,CAACtB,KAAK;IACJI,QAAQ,EAAEe,IAAI,CAACf,QAAS;IACxBwB,MAAM,EAAET,IAAI,CAACU,gBAAgB,EAAET,KAAK,CAAC,CAAC,CAACC,IAAI,CAACpB,cAAc;EAAG,CAC9D,CACE,CACN,CACA,CACN,EACA,CAACQ,OAAO,IAAIO,SAAS,IACpBlB,KAAA,CAAAwB,aAAA;IACEE,SAAS,EAAE3B,UAAU,CACnB,sFAAsF,EACtF;MACE,cAAc,EAAE,CAACO,QAAQ;MACzB,cAAc,EAAEA;IAClB,CACF;EAAE,GAEFN,KAAA,CAAAwB,aAAA,CAAChC,UAAU,MAAE,CACV,CACN,EACA,CAACmB,OAAO,IAAI,CAACO,SAAS,IACrBlB,KAAA,CAAAwB,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7B1B,KAAA,CAAAwB,aAAA,CAAC/B,WAAW;IACVuC,aAAa,EAAEtB,IAAK;IACpBuB,SAAS,EAAErB,IAAI,EAAEI,gBAAgB,CAAE,CAAC,CAAC,EAAEkB;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAED,SAAS9B,aAAa","ignoreList":[]}
@@ -1,7 +1,6 @@
1
+ import { ApolloClient, InMemoryCache } from '@apollo/client';
2
+ import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
1
3
  import React from 'react';
2
- import { LocaleProvider } from '@oanda/mono-i18n';
3
- import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
4
- import { ChartError, ThemeProvider, getLocale, renderComponent } 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(ThemeProvider, {
21
- theme: theme
22
- }, React.createElement(LocaleProvider, {
23
- locale: getLocale(locale),
19
+ return React.createElement(WidgetProvider, {
20
+ client: client,
21
+ locale: locale,
22
+ theme: theme,
24
23
  translations: translations
25
- }, React.createElement(ApolloProvider, {
26
- client: client
27
- }, isParamError ? React.createElement("div", {
28
- className: "lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
29
- }, React.createElement(ChartError, null)) : renderComponent({
30
- Component: React.createElement(Main, {
31
- currency: currency,
32
- theme: theme
33
- }),
34
- logoLink,
35
- linkArea: 'logo'
36
- }))));
24
+ }, React.createElement(WidgetWrapper, {
25
+ isParamError: isParamError,
26
+ linkArea: "logo",
27
+ logoLink: logoLink
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","LocaleProvider","ApolloClient","InMemoryCache","ApolloProvider","ChartError","ThemeProvider","getLocale","renderComponent","translations","Main","CurrencyStrengthWidget","_ref","graphqlUrl","currency","locale","theme","isParamError","logoLink","client","uri","cache","createElement","className","Component","linkArea"],"sources":["../../../src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx"],"sourcesContent":["import React from 'react';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport {\n ChartError, ThemeProvider, getLocale, renderComponent,\n} 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 <ThemeProvider theme={theme}>\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <ApolloProvider client={client}>\n {isParamError ? (\n <div className=\"lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n ) : renderComponent({\n Component: <Main currency={currency} theme={theme} />,\n logoLink,\n linkArea: 'logo',\n })}\n </ApolloProvider>\n </LocaleProvider>\n </ThemeProvider>\n );\n};\n\nexport { CurrencyStrengthWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SACEC,UAAU,EAAEC,aAAa,EAAEC,SAAS,EAAEC,eAAe,QAChD,2BAA2B;AAElC,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,IAAIjB,YAAY,CAAC;IAC9BkB,GAAG,EAAEP,UAAU;IACfQ,KAAK,EAAE,IAAIlB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEH,KAAA,CAAAsB,aAAA,CAAChB,aAAa;IAACU,KAAK,EAAEA;EAAM,GAC1BhB,KAAA,CAAAsB,aAAA,CAACrB,cAAc;IAACc,MAAM,EAAER,SAAS,CAACQ,MAAM,CAAE;IAACN,YAAY,EAAEA;EAAa,GACpET,KAAA,CAAAsB,aAAA,CAAClB,cAAc;IAACe,MAAM,EAAEA;EAAO,GAC5BF,YAAY,GACXjB,KAAA,CAAAsB,aAAA;IAAKC,SAAS,EAAC;EAAmG,GAChHvB,KAAA,CAAAsB,aAAA,CAACjB,UAAU,MAAE,CACV,CAAC,GACJG,eAAe,CAAC;IAClBgB,SAAS,EAAExB,KAAA,CAAAsB,aAAA,CAACZ,IAAI;MAACI,QAAQ,EAAEA,QAAS;MAACE,KAAK,EAAEA;IAAM,CAAE,CAAC;IACrDE,QAAQ;IACRO,QAAQ,EAAE;EACZ,CAAC,CACa,CACF,CACH,CAAC;AAEpB,CAAC;AAED,SAASd,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"CurrencyStrengthWidget.js","names":["ApolloClient","InMemoryCache","WidgetProvider","WidgetWrapper","React","translations","Main","CurrencyStrengthWidget","_ref","graphqlUrl","currency","locale","theme","isParamError","logoLink","client","uri","cache","createElement","linkArea"],"sources":["../../../src/CurrencyStrengthWidget/CurrencyStrengthWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport { translations } from '../translations';\nimport { Main } from './Main';\nimport type { CurrencyStrengthConfig } from './types';\n\nconst CurrencyStrengthWidget = ({\n graphqlUrl,\n currency,\n locale,\n theme,\n isParamError,\n logoLink,\n}: CurrencyStrengthConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n return (\n <WidgetProvider\n client={client}\n locale={locale}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper\n isParamError={isParamError}\n linkArea=\"logo\"\n logoLink={logoLink}\n >\n <Main currency={currency} theme={theme} />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { CurrencyStrengthWidget };\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,aAAa,QAAQ,gBAAgB;AAC5D,SAASC,cAAc,EAAEC,aAAa,QAAQ,2BAA2B;AACzE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,IAAI,QAAQ,QAAQ;AAG7B,MAAMC,sBAAsB,GAAGC,IAAA,IAOD;EAAA,IAPE;IAC9BC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC;EACsB,CAAC,GAAAN,IAAA;EACvB,MAAMO,MAAM,GAAG,IAAIf,YAAY,CAAC;IAC9BgB,GAAG,EAAEP,UAAU;IACfQ,KAAK,EAAE,IAAIhB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEG,KAAA,CAAAc,aAAA,CAAChB,cAAc;IACba,MAAM,EAAEA,MAAO;IACfJ,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbP,YAAY,EAAEA;EAAa,GAE3BD,KAAA,CAAAc,aAAA,CAACf,aAAa;IACZU,YAAY,EAAEA,YAAa;IAC3BM,QAAQ,EAAC,MAAM;IACfL,QAAQ,EAAEA;EAAS,GAEnBV,KAAA,CAAAc,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, { useContext } from 'react';
1
+ import { useLayoutProvider } from '@oanda/labs-widget-common';
2
2
  import { useLocale } from '@oanda/mono-i18n';
3
- import { ThemeContext } from '@oanda/labs-widget-common';
3
+ import React from 'react';
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
- } = useContext(ThemeContext);
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","useContext","useLocale","ThemeContext","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { ThemeContext } 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 } = useContext(ThemeContext);\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,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,YAAY,QAAQ,2BAA2B;AACxD,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,GAAGR,UAAU,CAACE,YAAY,CAAC;EAEzC,OACEH,KAAA,CAAAU,aAAA,CAAAV,KAAA,CAAAW,QAAA,QACGF,IAAI,IACLT,KAAA,CAAAU,aAAA;IAAK,eAAY;EAA2B,GAC1CV,KAAA,CAAAU,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFZ,KAAA,CAAAU,aAAA,eAAO,GAAGF,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEK,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNb,KAAA,CAAAU,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEL,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["useLayoutProvider","useLocale","React","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { 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,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,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,GAAGR,iBAAiB,CAAC,CAAC;EAEpC,OACEE,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACGF,IAAI,IACHN,KAAA,CAAAO,aAAA;IAAK,eAAY;EAA2B,GAC1CP,KAAA,CAAAO,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFT,KAAA,CAAAO,aAAA,eAAO,GAAGF,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEK,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNV,KAAA,CAAAO,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
@@ -1,11 +1,11 @@
1
- import React, { useContext } from 'react';
2
- import ReactEChartsCore from 'echarts-for-react/lib/core';
3
- import * as echarts from 'echarts/core';
1
+ import { getChartTheme, Theme, useLayoutProvider } from '@oanda/labs-widget-common';
2
+ import { useLocale } from '@oanda/mono-i18n';
4
3
  import { BarChart } from 'echarts/charts';
4
+ import { GraphicComponent, GridSimpleComponent, TitleComponent, TooltipComponent } from 'echarts/components';
5
+ import * as echarts from 'echarts/core';
5
6
  import { CanvasRenderer } from 'echarts/renderers';
6
- import { GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent } from 'echarts/components';
7
- import { useLocale } from '@oanda/mono-i18n';
8
- import { Theme, ThemeContext, getChartTheme } from '@oanda/labs-widget-common';
7
+ import ReactEChartsCore from 'echarts-for-react/lib/core';
8
+ import React from 'react';
9
9
  import { CHART_HEIGHT } from './constants';
10
10
  import { getOption } from './getOption';
11
11
  echarts.use([GridSimpleComponent, GraphicComponent, TooltipComponent, TitleComponent, BarChart, CanvasRenderer]);
@@ -21,20 +21,20 @@ const Chart = _ref => {
21
21
  } = useLocale();
22
22
  const {
23
23
  isDark
24
- } = useContext(ThemeContext);
24
+ } = useLayoutProvider();
25
25
  return React.createElement(ReactEChartsCore, {
26
26
  echarts: echarts,
27
- theme: isDark ? 'dark_theme' : 'light_theme',
28
- style: {
29
- height: `${CHART_HEIGHT}px`,
30
- width: '100%'
31
- },
32
27
  option: getOption({
33
28
  values,
34
29
  currency,
35
30
  lang,
36
31
  isDark
37
- })
32
+ }),
33
+ style: {
34
+ height: `${CHART_HEIGHT}px`,
35
+ width: '100%'
36
+ },
37
+ theme: isDark ? 'dark_theme' : 'light_theme'
38
38
  });
39
39
  };
40
40
  export { Chart };
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["React","useContext","ReactEChartsCore","echarts","BarChart","CanvasRenderer","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","useLocale","Theme","ThemeContext","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, { useContext } 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, ThemeContext, 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 } = useContext(ThemeContext);\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,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAAS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","Theme","useLayoutProvider","useLocale","BarChart","GraphicComponent","GridSimpleComponent","TitleComponent","TooltipComponent","echarts","CanvasRenderer","ReactEChartsCore","React","CHART_HEIGHT","getOption","use","registerTheme","Dark","Light","Chart","_ref","values","currency","lang","isDark","createElement","option","style","height","width","theme"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { 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 option={getOption({\n values,\n currency,\n lang,\n isDark,\n })}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,KAAK,EACLC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,QACX,oBAAoB;AAC3B,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,SAAS,QAAQ,aAAa;AAGvCL,OAAO,CAACM,GAAG,CAAC,CACVT,mBAAmB,EACnBD,gBAAgB,EAChBG,gBAAgB,EAChBD,cAAc,EACdH,QAAQ,EACRM,cAAc,CACf,CAAC;AAEFD,OAAO,CAACO,aAAa,CAAC,YAAY,EAAEhB,aAAa,CAACC,KAAK,CAACgB,IAAI,CAAC,CAAC;AAC9DR,OAAO,CAACO,aAAa,CAAC,aAAa,EAAEhB,aAAa,CAACC,KAAK,CAACiB,KAAK,CAAC,CAAC;AAEhE,MAAMC,KAAK,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EAC7C,MAAM;IAAEG;EAAK,CAAC,GAAGpB,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEqB;EAAO,CAAC,GAAGtB,iBAAiB,CAAC,CAAC;EAEtC,OACEU,KAAA,CAAAa,aAAA,CAACd,gBAAgB;IACfF,OAAO,EAAEA,OAAQ;IACjBiB,MAAM,EAAEZ,SAAS,CAAC;MAChBO,MAAM;MACNC,QAAQ;MACRC,IAAI;MACJC;IACF,CAAC,CAAE;IACHG,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGf,YAAY,IAAI;MAC3BgB,KAAK,EAAE;IACT,CAAE;IACFC,KAAK,EAAEN,MAAM,GAAG,YAAY,GAAG;EAAc,CAC9C,CAAC;AAEN,CAAC;AAED,SAASL,KAAK","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["colorPalette","CurrencyName","X_LABEL_SIZE","Y_LABEL_SIZE","CHART_WIDTH","CHART_HEIGHT","darkBarColors","positive","bottleGreenLight","negative","orange","zero","grayLight","lightBarColors","raspberryDark","instrumentsConfig","Usd","Eur","Gbp","Cad","Aud","Chf","Jpy","Nzd"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/constants.tsx"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport { CurrencyName } from '../../../gql/types/graphql';\n\nexport const X_LABEL_SIZE = 24;\nexport const Y_LABEL_SIZE = 30;\nexport const CHART_WIDTH = 9999;\nexport const CHART_HEIGHT = 135;\n\nexport const darkBarColors = {\n positive: colorPalette.bottleGreenLight,\n negative: colorPalette.orange,\n zero: colorPalette.grayLight,\n};\n\nexport const lightBarColors = {\n positive: colorPalette.bottleGreenLight,\n negative: colorPalette.raspberryDark,\n zero: colorPalette.grayLight,\n};\n\nexport const instrumentsConfig = [\n CurrencyName.Usd,\n CurrencyName.Eur,\n CurrencyName.Gbp,\n CurrencyName.Cad,\n CurrencyName.Aud,\n CurrencyName.Chf,\n CurrencyName.Jpy,\n CurrencyName.Nzd,\n];\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AACxD,SAASC,YAAY,QAAQ,4BAA4B;AAEzD,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,WAAW,GAAG,IAAI;AAC/B,OAAO,MAAMC,YAAY,GAAG,GAAG;AAE/B,OAAO,MAAMC,aAAa,GAAG;EAC3BC,QAAQ,EAAEP,YAAY,CAACQ,gBAAgB;EACvCC,QAAQ,EAAET,YAAY,CAACU,MAAM;EAC7BC,IAAI,EAAEX,YAAY,CAACY;AACrB,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;EAC5BN,QAAQ,EAAEP,YAAY,CAACQ,gBAAgB;EACvCC,QAAQ,EAAET,YAAY,CAACc,aAAa;EACpCH,IAAI,EAAEX,YAAY,CAACY;AACrB,CAAC;AAED,OAAO,MAAMG,iBAAiB,GAAG,CAC/Bd,YAAY,CAACe,GAAG,EAChBf,YAAY,CAACgB,GAAG,EAChBhB,YAAY,CAACiB,GAAG,EAChBjB,YAAY,CAACkB,GAAG,EAChBlB,YAAY,CAACmB,GAAG,EAChBnB,YAAY,CAACoB,GAAG,EAChBpB,YAAY,CAACqB,GAAG,EAChBrB,YAAY,CAACsB,GAAG,CACjB","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["colorPalette","CurrencyName","X_LABEL_SIZE","Y_LABEL_SIZE","CHART_WIDTH","CHART_HEIGHT","darkBarColors","positive","bottleGreenLight","negative","orange","zero","grayLight","lightBarColors","raspberryDark","instrumentsConfig","Usd","Eur","Gbp","Cad","Aud","Chf","Jpy","Nzd"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/constants.tsx"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\n\nimport { CurrencyName } from '../../../gql/types/graphql';\n\nexport const X_LABEL_SIZE = 24;\nexport const Y_LABEL_SIZE = 30;\nexport const CHART_WIDTH = 9999;\nexport const CHART_HEIGHT = 135;\n\nexport const darkBarColors = {\n positive: colorPalette.bottleGreenLight,\n negative: colorPalette.orange,\n zero: colorPalette.grayLight,\n};\n\nexport const lightBarColors = {\n positive: colorPalette.bottleGreenLight,\n negative: colorPalette.raspberryDark,\n zero: colorPalette.grayLight,\n};\n\nexport const instrumentsConfig = [\n CurrencyName.Usd,\n CurrencyName.Eur,\n CurrencyName.Gbp,\n CurrencyName.Cad,\n CurrencyName.Aud,\n CurrencyName.Chf,\n CurrencyName.Jpy,\n CurrencyName.Nzd,\n];\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAExD,SAASC,YAAY,QAAQ,4BAA4B;AAEzD,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,WAAW,GAAG,IAAI;AAC/B,OAAO,MAAMC,YAAY,GAAG,GAAG;AAE/B,OAAO,MAAMC,aAAa,GAAG;EAC3BC,QAAQ,EAAEP,YAAY,CAACQ,gBAAgB;EACvCC,QAAQ,EAAET,YAAY,CAACU,MAAM;EAC7BC,IAAI,EAAEX,YAAY,CAACY;AACrB,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;EAC5BN,QAAQ,EAAEP,YAAY,CAACQ,gBAAgB;EACvCC,QAAQ,EAAET,YAAY,CAACc,aAAa;EACpCH,IAAI,EAAEX,YAAY,CAACY;AACrB,CAAC;AAED,OAAO,MAAMG,iBAAiB,GAAG,CAC/Bd,YAAY,CAACe,GAAG,EAChBf,YAAY,CAACgB,GAAG,EAChBhB,YAAY,CAACiB,GAAG,EAChBjB,YAAY,CAACkB,GAAG,EAChBlB,YAAY,CAACmB,GAAG,EAChBnB,YAAY,CAACoB,GAAG,EAChBpB,YAAY,CAACqB,GAAG,EAChBrB,YAAY,CAACsB,GAAG,CACjB","ignoreList":[]}
@@ -14,5 +14,5 @@ const tooltipFormatter = _ref => {
14
14
  </div>`;
15
15
  };
16
16
  const sortCurrencies = (a, b) => instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);
17
- export { tooltipFormatter, sortCurrencies };
17
+ export { sortCurrencies, tooltipFormatter };
18
18
  //# sourceMappingURL=formatters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","names":["instrumentsConfig","tooltipFormatter","_ref","marker","name","value","currency","lang","sortCurrencies","a","b","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) => instrumentsConfig\n .indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport {\n tooltipFormatter,\n sortCurrencies,\n};\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,aAAa;AAG/C,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,OAAK;AAC9B;AACA,oCAAoCI,QAAQ,IAAIC,IAAI,CAAC,IAAI,CAAC,IAAIH,IAAI;AAClE,kDAAkDD,MAAM,IAAIE,KAAK;AACjE,OAAO;AAAA;AAEP,MAAMG,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KAAKV,iBAAiB,CAC7EW,OAAO,CAACF,CAAC,CAACH,QAAQ,CAAC,GAAGN,iBAAiB,CAACW,OAAO,CAACD,CAAC,CAACJ,QAAQ,CAAC;AAE9D,SACEL,gBAAgB,EAChBO,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"formatters.js","names":["instrumentsConfig","tooltipFormatter","_ref","marker","name","value","currency","lang","sortCurrencies","a","b","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,aAAa;AAG/C,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,OAAK;AAC9B;AACA,oCAAoCI,QAAQ,IAAIC,IAAI,CAAC,IAAI,CAAC,IAAIH,IAAI;AAClE,kDAAkDD,MAAM,IAAIE,KAAK;AACjE,OAAO;AAAA;AAEP,MAAMG,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDV,iBAAiB,CAACW,OAAO,CAACF,CAAC,CAACH,QAAQ,CAAC,GAAGN,iBAAiB,CAACW,OAAO,CAACD,CAAC,CAACJ,QAAQ,CAAC;AAE/E,SAASE,cAAc,EAAEP,gBAAgB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { getGridLines } from '@oanda/labs-widget-common';
2
- import { CHART_HEIGHT, CHART_WIDTH, X_LABEL_SIZE, Y_LABEL_SIZE, darkBarColors, lightBarColors } from './constants';
2
+ import { CHART_HEIGHT, CHART_WIDTH, darkBarColors, lightBarColors, X_LABEL_SIZE, Y_LABEL_SIZE } from './constants';
3
3
  import { tooltipFormatter } from './formatters';
4
4
  export const getOption = _ref => {
5
5
  let {
@@ -1 +1 @@
1
- {"version":3,"file":"getOption.js","names":["getGridLines","CHART_HEIGHT","CHART_WIDTH","X_LABEL_SIZE","Y_LABEL_SIZE","darkBarColors","lightBarColors","tooltipFormatter","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","animation","title","left","text","textStyle","fontSize","lineHeight","fontWeight","grid","name","top","right","bottom","graphic","tooltip","trigger","formatter","_ref2","marker","value","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n darkBarColors,\n lightBarColors,\n} from './constants';\nimport { GetOptionProps } from './types';\nimport { tooltipFormatter } from './formatters';\n\nexport const getOption = ({\n values, currency, isDark, lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [\n ...gridLines,\n ],\n tooltip: {\n trigger: 'axis',\n formatter: (\n [{ marker, name, value }]\n : { marker: string, name: string, value: number }[],\n ) => tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data } : { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AACxD,SACEC,YAAY,EACZC,WAAW,EACXC,YAAY,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EAAE;YACZ,OAAO/B,SAAS,CAACoD,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAO/B,SAAS,CAACqD,QAAQ;UAC3B;UACA,OAAOrD,SAAS,CAACsD,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"getOption.js","names":["getGridLines","CHART_HEIGHT","CHART_WIDTH","darkBarColors","lightBarColors","X_LABEL_SIZE","Y_LABEL_SIZE","tooltipFormatter","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","animation","title","left","text","textStyle","fontSize","lineHeight","fontWeight","grid","name","top","right","bottom","graphic","tooltip","trigger","formatter","_ref2","marker","value","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAExD,SACEC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,YAAY,QACP,aAAa;AACpB,SAASC,gBAAgB,QAAQ,cAAc;AAG/C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,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C;MAC1BG,SAAS,EAAE;QACTzB,QAAQ,EAAE;MACZ;IACF,CAAC;IACD0B,KAAK,EAAE;MACLP,IAAI,EAAE,OAAO;MACbQ,QAAQ,EAAE,MAAM;MAChBC,GAAG,EAAEC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACD,GAAG,CAAC,GAAGzC,WAAW,CAAC,CAAC;MACzC4C,GAAG,EAAEF,IAAI,CAACG,IAAI,CAACH,IAAI,CAACE,GAAG,CAAC,GAAG5C,WAAW,CAAC,CAAC;MACxC8C,QAAQ,EAAE,CAAC;MACXV,QAAQ,EAAE;QAAED,IAAI,EAAE;MAAM,CAAC;MACzBD,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAM,CAAC;MACzBG,SAAS,EAAE;QACTd,SAAS,EAAE,UAAU;QACrBX,QAAQ,EAAE;MACZ;IACF,CAAC;IACDkC,MAAM,EAAE,CACN;MACEd,IAAI,EAAEjC,WAAW;MACjBgC,IAAI,EAAE,KAAK;MACXgB,QAAQ,EAAE;QACRC,QAAQ,EAAE;MACZ,CAAC;MACDC,SAAS,EAAE;QACTC,OAAO,EAAE,CAAC;QACVC,KAAK,EAAEC,KAAA,IAAgC;UAAA,IAA/B;YAAEpB;UAAuB,CAAC,GAAAoB,KAAA;UAChC,IAAIpB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAO/B,SAAS,CAACoD,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAO/B,SAAS,CAACqD,QAAQ;UAC3B;UACA,OAAOrD,SAAS,CAACsD,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/types.ts"],"sourcesContent":["import { CurrencyName } from '../../../gql/types/graphql';\n\nexport interface CSChartDataValues {\n currency: CurrencyName;\n percentage: number;\n}\nexport interface ChartProps {\n values: CSChartDataValues[];\n currency: CurrencyName;\n}\n\nexport interface TooltipFormatterParams {\n marker: string;\n name: string;\n value: number;\n currency: CurrencyName;\n lang: (label: string) => string;\n}\n\nexport type GetOptionProps = {\n values: CSChartDataValues[],\n currency: CurrencyName,\n lang: (label: string) => string,\n isDark: boolean;\n};\n\nexport type SortingParams = {\n currency: CurrencyName;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/types.ts"],"sourcesContent":["import type { CurrencyName } from '../../../gql/types/graphql';\n\nexport interface CSChartDataValues {\n currency: CurrencyName;\n percentage: number;\n}\nexport interface ChartProps {\n values: CSChartDataValues[];\n currency: CurrencyName;\n}\n\nexport interface TooltipFormatterParams {\n marker: string;\n name: string;\n value: number;\n currency: CurrencyName;\n lang: (label: string) => string;\n}\n\nexport interface GetOptionProps {\n values: CSChartDataValues[];\n currency: CurrencyName;\n lang: (label: string) => string;\n isDark: boolean;\n}\n\nexport interface SortingParams {\n currency: CurrencyName;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,6 @@
1
+ import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
1
2
  import React from 'react';
2
3
  import { createRoot } from 'react-dom/client';
3
- import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
4
4
  import { CurrencyStrengthWidget } from './CurrencyStrengthWidget';
5
5
  const {
6
6
  graphqlUrl
@@ -25,12 +25,12 @@ currencyStrengthParamsElements.forEach(element => {
25
25
  name: 'graphqlUrl'
26
26
  }]);
27
27
  root.render(React.createElement(CurrencyStrengthWidget, {
28
+ currency: currency,
28
29
  graphqlUrl: graphqlUrl,
29
- locale: locale,
30
- theme: mode,
31
30
  isParamError: isParamError,
32
- currency: currency,
33
- logoLink: logoLink
31
+ locale: locale,
32
+ logoLink: logoLink,
33
+ theme: mode
34
34
  }));
35
35
  });
36
36
  //# sourceMappingURL=render.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","CurrencyStrengthWidget","graphqlUrl","window","widgetsConfig","currencyStrengthParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","currency","locale","logoLink","JSON","parse","isParamError","name","valueCheck","value","render","createElement","theme"],"sources":["../../../src/CurrencyStrengthWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { CurrencyStrengthWidget } from './CurrencyStrengthWidget';\n\nconst {\n graphqlUrl,\n} = window.widgetsConfig || {};\n\nconst currencyStrengthParamsElements = document.querySelectorAll('div[data-currency-strength-params]');\n\ncurrencyStrengthParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-strength-params');\n const mode = element.getAttribute('data-mode');\n const {\n currency, locale, logoLink,\n } = 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\n root.render(\n <CurrencyStrengthWidget\n graphqlUrl={graphqlUrl}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n currency={currency}\n logoLink={logoLink}\n />,\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AACrF,SAASC,sBAAsB,QAAQ,0BAA0B;AAEjE,MAAM;EACJC;AACF,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,8BAA8B,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,oCAAoC,CAAC;AAEtGF,8BAA8B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAClD,MAAMC,IAAI,GAAGZ,UAAU,CAACW,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,+BAA+B,CAAC;EACpE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IACJE,QAAQ;IAAEC,MAAM;IAAEC;EACpB,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACP,MAAgB,CAAC;EAEhC,MAAMQ,YAAY,GAAGnB,kBAAkB,CAAC;IAAEe,MAAM;IAAEb;EAAW,CAAC,EAAE,CAC9D;IACEkB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAK,IAAKvB,cAAc,CAACuB,KAAK;EAC7C,CAAC,EAAE;IACDF,IAAI,EAAE;EACR,CAAC,CAAC,CAAC;EAELV,IAAI,CAACa,MAAM,CACT1B,KAAA,CAAA2B,aAAA,CAACvB,sBAAsB;IACrBC,UAAU,EAAEA,UAAW;IACvBa,MAAM,EAAEA,MAAO;IACfU,KAAK,EAAEZ,IAAc;IACrBM,YAAY,EAAEA,YAAa;IAC3BL,QAAQ,EAAEA,QAAS;IACnBE,QAAQ,EAAEA;EAAS,CACpB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"render.js","names":["validateLocale","validateToolParams","React","createRoot","CurrencyStrengthWidget","graphqlUrl","window","widgetsConfig","currencyStrengthParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","currency","locale","logoLink","JSON","parse","isParamError","name","valueCheck","value","render","createElement","theme"],"sources":["../../../src/CurrencyStrengthWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { CurrencyStrengthWidget } from './CurrencyStrengthWidget';\n\nconst { graphqlUrl } = window.widgetsConfig || {};\n\nconst currencyStrengthParamsElements = document.querySelectorAll(\n 'div[data-currency-strength-params]'\n);\n\ncurrencyStrengthParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-currency-strength-params');\n const mode = element.getAttribute('data-mode');\n const { currency, locale, logoLink } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({ locale, graphqlUrl }, [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'graphqlUrl',\n },\n ]);\n\n root.render(\n <CurrencyStrengthWidget\n currency={currency}\n graphqlUrl={graphqlUrl}\n isParamError={isParamError}\n locale={locale}\n logoLink={logoLink}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,sBAAsB,QAAQ,0BAA0B;AAEjE,MAAM;EAAEC;AAAW,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAEjD,MAAMC,8BAA8B,GAAGC,QAAQ,CAACC,gBAAgB,CAC9D,oCACF,CAAC;AAEDF,8BAA8B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAClD,MAAMC,IAAI,GAAGV,UAAU,CAACS,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,+BAA+B,CAAC;EACpE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,QAAQ;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACP,MAAgB,CAAC;EAEnE,MAAMQ,YAAY,GAAGrB,kBAAkB,CAAC;IAAEiB,MAAM;IAAEb;EAAW,CAAC,EAAE,CAC9D;IACEkB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAyB,IAAKzB,cAAc,CAACyB,KAAK;EACjE,CAAC,EACD;IACEF,IAAI,EAAE;EACR,CAAC,CACF,CAAC;EAEFV,IAAI,CAACa,MAAM,CACTxB,KAAA,CAAAyB,aAAA,CAACvB,sBAAsB;IACrBa,QAAQ,EAAEA,QAAS;IACnBZ,UAAU,EAAEA,UAAW;IACvBiB,YAAY,EAAEA,YAAa;IAC3BJ,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBS,KAAK,EAAEZ;EAAc,CACtB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/CurrencyStrengthWidget/types.ts"],"sourcesContent":["import { Theme, WidgetConfig } from '@oanda/labs-widget-common';\n\nexport interface CurrencyStrengthConfig extends WidgetConfig {\n currency?: string;\n}\n\nexport interface CurrencyStrengthWrapperConfig extends CurrencyStrengthConfig {\n renderElementId: string;\n}\n\nexport interface WidgetProps {\n currency?: string;\n theme?: Theme;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/CurrencyStrengthWidget/types.ts"],"sourcesContent":["import type { Theme, WidgetConfig } from '@oanda/labs-widget-common';\n\nexport interface CurrencyStrengthConfig extends WidgetConfig {\n currency?: string;\n}\n\nexport interface CurrencyStrengthWrapperConfig extends CurrencyStrengthConfig {\n renderElementId: string;\n}\n\nexport interface WidgetProps {\n currency?: string;\n theme?: Theme;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\n\nexport type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<\n infer TType,\n any\n>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__\n ?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every(field => data && field in data);\n}\n"],"mappings":"AAoCA,OAAO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAAmJ,EAClG;EACjD,OAAOA,YAAY;AACrB;AAGA,OAAO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACA,OAAO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAAiF,EACtC;EAC3C,MAAMK,cAAc,GAAIF,SAAS,CAAwEG,QAAQ,EAC7GD,cAAc;EAElB,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAAuC;EACjF,MAAMC,QAAQ,GAAGF,OAAO,EAAEG,IAAI,EAAEC,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAACC,KAAK,IAAIf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC1E","ignoreList":[]}
1
+ {"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import {\n ResultOf,\n DocumentTypeDecoration,\n TypedDocumentNode,\n} from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\nexport type FragmentType<\n TDocumentType extends DocumentTypeDecoration<any, any>,\n> =\n TDocumentType extends DocumentTypeDecoration<infer TType, any>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | null\n | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>,\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data:\n | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>\n | null\n | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (\n queryNode as {\n __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };\n }\n ).__meta__?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as\n | FragmentDefinitionNode\n | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every((field) => data && field in data);\n}\n"],"mappings":"AA6CA,OAAO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAIa,EACoC;EACjD,OAAOA,YAAY;AACrB;AAEA,OAAO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACA,OAAO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAGa,EAC8B;EAC3C,MAAMK,cAAc,GAClBF,SAAS,CAGTG,QAAQ,EAAED,cAAc;EAE1B,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAE7B;EACb,MAAMC,QAAQ,GAAGF,OAAO,EAAEG,IAAI,EAAEC,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAAEC,KAAK,IAAKf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC5E","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import * as types from './graphql';
2
2
  const documents = {
3
- "\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n": types.GetCurrencyStrengthDocument
3
+ '\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n': types.GetCurrencyStrengthDocument
4
4
  };
5
5
  export function graphql(source) {
6
6
  return documents[source] ?? {};
@@ -1 +1 @@
1
- {"version":3,"file":"gql.js","names":["types","documents","GetCurrencyStrengthDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n \"\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n\": types.GetCurrencyStrengthDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(source: \"\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n\"];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,WAAW;AAalC,MAAMC,SAAS,GAAG;EACd,iLAAiL,EAAED,KAAK,CAACE;AAC7L,CAAC;AAqBD,OAAO,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
1
+ {"version":3,"file":"gql.js","names":["types","documents","GetCurrencyStrengthDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n':\n types.GetCurrencyStrengthDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'\n): (typeof documents)['\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,WAAW;AAalC,MAAMC,SAAS,GAAG;EAChB,iLAAiL,EAC/KD,KAAK,CAACE;AACV,CAAC;AAuBD,OAAO,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}