@oanda/labs-live-rates-table-widget 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/dist/main/LiveRatesTableWidget/utils.js +4 -4
- package/dist/main/LiveRatesTableWidget/utils.js.map +1 -1
- package/dist/module/LiveRatesTableWidget/utils.js +4 -4
- package/dist/module/LiveRatesTableWidget/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/LiveRatesTableWidget/utils.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,90 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.20 (2024-08-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.153 (2024-08-23)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.152 (2024-08-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.151 (2024-08-20)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.150 (2024-08-19)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.149 (2024-08-07)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.148 (2024-08-01)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.147 (2024-08-01)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.146 (2024-07-26)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.145 (2024-07-25)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.144 (2024-07-22)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.143 (2024-07-19)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.142 (2024-07-16)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.141 (2024-07-16)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.140 (2024-07-12)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.139 (2024-07-12)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.138 (2024-07-10)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.137 (2024-07-05)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.136 (2024-07-03)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.135 (2024-07-03)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @oanda/labs-live-rates-table-widget
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
6
90
|
## 1.0.19 (2024-08-23)
|
|
7
91
|
|
|
8
92
|
|
|
@@ -35,10 +35,10 @@ const useRecords = (record, target) => {
|
|
|
35
35
|
displayName: record.displayName,
|
|
36
36
|
instrument: record.instrument,
|
|
37
37
|
sentiment: record.sentiment,
|
|
38
|
-
buy: update?.
|
|
39
|
-
sell: update?.
|
|
40
|
-
sellPriceMovement: update?.
|
|
41
|
-
buyPriceMovement: update?.
|
|
38
|
+
buy: update?.ask,
|
|
39
|
+
sell: update?.bid,
|
|
40
|
+
sellPriceMovement: update?.bidPriceMovement,
|
|
41
|
+
buyPriceMovement: update?.askPriceMovement,
|
|
42
42
|
dailyPercentChange: update?.dailyPercentChangeFromOpen,
|
|
43
43
|
spread: update?.spread,
|
|
44
44
|
displayPrecision: update?.displayPrecision
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_react","require","_labsWidgetCommon","_usehooksTs","_types","_config","getRecords","data","mapInstrumentNames","map","item","instrument","name","displayName","exports","getHeaderConfig","activeColumns","ColumnsNames","INSTRUMENT","headerConfig","useRecords","record","target","updatedRecord","setUpdatedRecord","useState","sentiment","error","setError","entry","useIntersectionObserver","isVisible","isIntersecting","update","liveRatesError","useLiveRatesMessage","useEffect","buy","
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_react","require","_labsWidgetCommon","_usehooksTs","_types","_config","getRecords","data","mapInstrumentNames","map","item","instrument","name","displayName","exports","getHeaderConfig","activeColumns","ColumnsNames","INSTRUMENT","headerConfig","useRecords","record","target","updatedRecord","setUpdatedRecord","useState","sentiment","error","setError","entry","useIntersectionObserver","isVisible","isIntersecting","update","liveRatesError","useLiveRatesMessage","useEffect","buy","ask","sell","bid","sellPriceMovement","bidPriceMovement","buyPriceMovement","askPriceMovement","dailyPercentChange","dailyPercentChangeFromOpen","spread","displayPrecision","ref"],"sources":["../../../src/LiveRatesTableWidget/utils.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { HeaderColumns, LiveRatesErrorMessage, useLiveRatesMessage } from '@oanda/labs-widget-common';\nimport { useIntersectionObserver } from 'usehooks-ts';\nimport { ColumnsNames, DataRecord, EmptyRecord } from './types';\nimport { headerConfig } from './config';\nimport { ValidateInstrumentsQuery } from '../gql/types/graphql';\n\nconst getRecords = (data: ValidateInstrumentsQuery) => data?.mapInstrumentNames?.map((item) => ({\n instrument: item?.name || '',\n displayName: item?.displayName || '',\n}));\n\n// eslint-disable-next-line max-len\nconst getHeaderConfig = (activeColumns: ColumnsNames[]): HeaderColumns[] => [ColumnsNames.INSTRUMENT, ...activeColumns].map((item) => headerConfig[item]);\n\nconst useRecords = (\n record: DataRecord | EmptyRecord,\n target: EventTarget | null,\n) => {\n const [updatedRecord, setUpdatedRecord] = useState<DataRecord>({\n displayName: record.displayName,\n instrument: record.instrument,\n sentiment: record.sentiment,\n });\n const [error, setError] = useState<LiveRatesErrorMessage | null>(null);\n const entry = useIntersectionObserver();\n const isVisible = !!entry?.isIntersecting;\n\n const { update, error: liveRatesError } = useLiveRatesMessage(\n record.instrument,\n target,\n );\n\n useEffect(() => {\n if (isVisible) {\n setUpdatedRecord({\n displayName: record.displayName,\n instrument: record.instrument,\n sentiment: record.sentiment,\n buy: update?.ask,\n sell: update?.bid,\n sellPriceMovement: update?.bidPriceMovement,\n buyPriceMovement: update?.askPriceMovement,\n dailyPercentChange: update?.dailyPercentChangeFromOpen,\n spread: update?.spread,\n displayPrecision: update?.displayPrecision,\n });\n setError(liveRatesError);\n }\n }, [update, record, isVisible, liveRatesError]);\n\n return {\n updatedRecord,\n error,\n ref: entry.ref,\n };\n};\n\nexport {\n getRecords,\n getHeaderConfig,\n useRecords,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAGA,MAAMK,UAAU,GAAIC,IAA8B,IAAKA,IAAI,EAAEC,kBAAkB,EAAEC,GAAG,CAAEC,IAAI,KAAM;EAC9FC,UAAU,EAAED,IAAI,EAAEE,IAAI,IAAI,EAAE;EAC5BC,WAAW,EAAEH,IAAI,EAAEG,WAAW,IAAI;AACpC,CAAC,CAAC,CAAC;AAACC,OAAA,CAAAR,UAAA,GAAAA,UAAA;AAGJ,MAAMS,eAAe,GAAIC,aAA6B,IAAsB,CAACC,mBAAY,CAACC,UAAU,EAAE,GAAGF,aAAa,CAAC,CAACP,GAAG,CAAEC,IAAI,IAAKS,oBAAY,CAACT,IAAI,CAAC,CAAC;AAACI,OAAA,CAAAC,eAAA,GAAAA,eAAA;AAE1J,MAAMK,UAAU,GAAGA,CACjBC,MAAgC,EAChCC,MAA0B,KACvB;EACH,MAAM,CAACC,aAAa,EAA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AAAM,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -27,10 +27,10 @@ const useRecords = (record, target) => {
|
|
|
27
27
|
displayName: record.displayName,
|
|
28
28
|
instrument: record.instrument,
|
|
29
29
|
sentiment: record.sentiment,
|
|
30
|
-
buy: update?.
|
|
31
|
-
sell: update?.
|
|
32
|
-
sellPriceMovement: update?.
|
|
33
|
-
buyPriceMovement: update?.
|
|
30
|
+
buy: update?.ask,
|
|
31
|
+
sell: update?.bid,
|
|
32
|
+
sellPriceMovement: update?.bidPriceMovement,
|
|
33
|
+
buyPriceMovement: update?.askPriceMovement,
|
|
34
34
|
dailyPercentChange: update?.dailyPercentChangeFromOpen,
|
|
35
35
|
spread: update?.spread,
|
|
36
36
|
displayPrecision: update?.displayPrecision
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["useState","useEffect","useLiveRatesMessage","useIntersectionObserver","ColumnsNames","headerConfig","getRecords","data","mapInstrumentNames","map","item","instrument","name","displayName","getHeaderConfig","activeColumns","INSTRUMENT","useRecords","record","target","updatedRecord","setUpdatedRecord","sentiment","error","setError","entry","isVisible","isIntersecting","update","liveRatesError","buy","
|
|
1
|
+
{"version":3,"file":"utils.js","names":["useState","useEffect","useLiveRatesMessage","useIntersectionObserver","ColumnsNames","headerConfig","getRecords","data","mapInstrumentNames","map","item","instrument","name","displayName","getHeaderConfig","activeColumns","INSTRUMENT","useRecords","record","target","updatedRecord","setUpdatedRecord","sentiment","error","setError","entry","isVisible","isIntersecting","update","liveRatesError","buy","ask","sell","bid","sellPriceMovement","bidPriceMovement","buyPriceMovement","askPriceMovement","dailyPercentChange","dailyPercentChangeFromOpen","spread","displayPrecision","ref"],"sources":["../../../src/LiveRatesTableWidget/utils.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { HeaderColumns, LiveRatesErrorMessage, useLiveRatesMessage } from '@oanda/labs-widget-common';\nimport { useIntersectionObserver } from 'usehooks-ts';\nimport { ColumnsNames, DataRecord, EmptyRecord } from './types';\nimport { headerConfig } from './config';\nimport { ValidateInstrumentsQuery } from '../gql/types/graphql';\n\nconst getRecords = (data: ValidateInstrumentsQuery) => data?.mapInstrumentNames?.map((item) => ({\n instrument: item?.name || '',\n displayName: item?.displayName || '',\n}));\n\n// eslint-disable-next-line max-len\nconst getHeaderConfig = (activeColumns: ColumnsNames[]): HeaderColumns[] => [ColumnsNames.INSTRUMENT, ...activeColumns].map((item) => headerConfig[item]);\n\nconst useRecords = (\n record: DataRecord | EmptyRecord,\n target: EventTarget | null,\n) => {\n const [updatedRecord, setUpdatedRecord] = useState<DataRecord>({\n displayName: record.displayName,\n instrument: record.instrument,\n sentiment: record.sentiment,\n });\n const [error, setError] = useState<LiveRatesErrorMessage | null>(null);\n const entry = useIntersectionObserver();\n const isVisible = !!entry?.isIntersecting;\n\n const { update, error: liveRatesError } = useLiveRatesMessage(\n record.instrument,\n target,\n );\n\n useEffect(() => {\n if (isVisible) {\n setUpdatedRecord({\n displayName: record.displayName,\n instrument: record.instrument,\n sentiment: record.sentiment,\n buy: update?.ask,\n sell: update?.bid,\n sellPriceMovement: update?.bidPriceMovement,\n buyPriceMovement: update?.askPriceMovement,\n dailyPercentChange: update?.dailyPercentChangeFromOpen,\n spread: update?.spread,\n displayPrecision: update?.displayPrecision,\n });\n setError(liveRatesError);\n }\n }, [update, record, isVisible, liveRatesError]);\n\n return {\n updatedRecord,\n error,\n ref: entry.ref,\n };\n};\n\nexport {\n getRecords,\n getHeaderConfig,\n useRecords,\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAA+CC,mBAAmB,QAAQ,2BAA2B;AACrG,SAASC,uBAAuB,QAAQ,aAAa;AACrD,SAASC,YAAY,QAAiC,SAAS;AAC/D,SAASC,YAAY,QAAQ,UAAU;AAGvC,MAAMC,UAAU,GAAIC,IAA8B,IAAKA,IAAI,EAAEC,kBAAkB,EAAEC,GAAG,CAAEC,IAAI,KAA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,MAAM,EAAEW,0BAA0B;QACtDC,MAAM,EAAEZ,MAAM,EAAEY,MAAM;QACtBC,gBAAgB,EAAEb,MAAM,EAAEa;MAC5B,CAAC,CAAC;MACFjB,QAAQ,CAACK,cAAc,CAAC;IAC1B;EACF,CAAC,EAAE,CAACD,MAAM,EAAEV,MAAM,EAAEQ,SAAS,EAAEG,cAAc,CAAC,CAAC;EAE/C,OAAO;IACLT,aAAa;IACbG,KAAK;IACLmB,GAAG,EAAEjB,KAAK,CAACiB;EACb,CAAC;AACH,CAAC;AAED,SACEpC,UAAU,EACVQ,eAAe,EACfG,UAAU","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-live-rates-table-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "Labs Live Rates Table Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "OANDA",
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
15
|
+
"@oanda/labs-widget-common": "^1.0.154",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"graphql": "16.8.1"
|
|
18
18
|
},
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"@graphql-codegen/cli": "5.0.0",
|
|
21
21
|
"@graphql-codegen/client-preset": "4.1.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "c243cddcf6c1cb5f70403bae1c8c927356f33a78"
|
|
24
24
|
}
|
|
@@ -37,10 +37,10 @@ const useRecords = (
|
|
|
37
37
|
displayName: record.displayName,
|
|
38
38
|
instrument: record.instrument,
|
|
39
39
|
sentiment: record.sentiment,
|
|
40
|
-
buy: update?.
|
|
41
|
-
sell: update?.
|
|
42
|
-
sellPriceMovement: update?.
|
|
43
|
-
buyPriceMovement: update?.
|
|
40
|
+
buy: update?.ask,
|
|
41
|
+
sell: update?.bid,
|
|
42
|
+
sellPriceMovement: update?.bidPriceMovement,
|
|
43
|
+
buyPriceMovement: update?.askPriceMovement,
|
|
44
44
|
dailyPercentChange: update?.dailyPercentChangeFromOpen,
|
|
45
45
|
spread: update?.spread,
|
|
46
46
|
displayPrecision: update?.displayPrecision,
|