@oanda/labs-ticker-tape-widget 1.0.16 → 1.0.18
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 +148 -0
- package/dist/main/TickerTapeWidget/Main.js +10 -9
- package/dist/main/TickerTapeWidget/Main.js.map +1 -1
- package/dist/main/TickerTapeWidget/TickerTapeWidget.js +5 -2
- package/dist/main/TickerTapeWidget/TickerTapeWidget.js.map +1 -1
- package/dist/main/TickerTapeWidget/ValidationWrapper.js +3 -1
- package/dist/main/TickerTapeWidget/ValidationWrapper.js.map +1 -1
- package/dist/main/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.js +24 -0
- package/dist/main/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.js.map +1 -0
- package/dist/main/TickerTapeWidget/components/MarqueeWrapper/index.js +17 -0
- package/dist/main/TickerTapeWidget/components/MarqueeWrapper/index.js.map +1 -0
- package/dist/main/TickerTapeWidget/components/MarqueeWrapper/types.js +6 -0
- package/dist/main/TickerTapeWidget/components/MarqueeWrapper/types.js.map +1 -0
- package/dist/main/TickerTapeWidget/render.js +4 -2
- package/dist/main/TickerTapeWidget/render.js.map +1 -1
- package/dist/main/TickerTapeWidget/types.js.map +1 -1
- package/dist/module/TickerTapeWidget/Main.js +10 -9
- package/dist/module/TickerTapeWidget/Main.js.map +1 -1
- package/dist/module/TickerTapeWidget/TickerTapeWidget.js +5 -2
- package/dist/module/TickerTapeWidget/TickerTapeWidget.js.map +1 -1
- package/dist/module/TickerTapeWidget/ValidationWrapper.js +3 -1
- package/dist/module/TickerTapeWidget/ValidationWrapper.js.map +1 -1
- package/dist/module/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.js +17 -0
- package/dist/module/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.js.map +1 -0
- package/dist/module/TickerTapeWidget/components/MarqueeWrapper/index.js +2 -0
- package/dist/module/TickerTapeWidget/components/MarqueeWrapper/index.js.map +1 -0
- package/dist/module/TickerTapeWidget/components/MarqueeWrapper/types.js +2 -0
- package/dist/module/TickerTapeWidget/components/MarqueeWrapper/types.js.map +1 -0
- package/dist/module/TickerTapeWidget/render.js +4 -2
- package/dist/module/TickerTapeWidget/render.js.map +1 -1
- package/dist/module/TickerTapeWidget/types.js.map +1 -1
- package/dist/types/TickerTapeWidget/Main.d.ts +1 -1
- package/dist/types/TickerTapeWidget/TickerTapeWidget.d.ts +1 -1
- package/dist/types/TickerTapeWidget/ValidationWrapper.d.ts +1 -1
- package/dist/types/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.d.ts +4 -0
- package/dist/types/TickerTapeWidget/components/MarqueeWrapper/index.d.ts +1 -0
- package/dist/types/TickerTapeWidget/components/MarqueeWrapper/types.d.ts +5 -0
- package/dist/types/TickerTapeWidget/types.d.ts +4 -0
- package/package.json +3 -3
- package/src/TickerTapeWidget/Main.tsx +6 -9
- package/src/TickerTapeWidget/TickerTapeWidget.tsx +3 -1
- package/src/TickerTapeWidget/ValidationWrapper.tsx +2 -0
- package/src/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.tsx +24 -0
- package/src/TickerTapeWidget/components/MarqueeWrapper/index.tsx +1 -0
- package/src/TickerTapeWidget/components/MarqueeWrapper/types.ts +5 -0
- package/src/TickerTapeWidget/render.tsx +2 -1
- package/src/TickerTapeWidget/{types.tsx → types.ts} +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,154 @@
|
|
|
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.18 (2024-09-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.161 (2024-09-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.160 (2024-09-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.159 (2024-09-09)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.158 (2024-09-04)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.157 (2024-09-04)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.156 (2024-09-02)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.155 (2024-08-29)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.154 (2024-08-29)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.153 (2024-08-23)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.152 (2024-08-23)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.151 (2024-08-20)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.150 (2024-08-19)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.149 (2024-08-07)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.148 (2024-08-01)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.147 (2024-08-01)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.146 (2024-07-26)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.145 (2024-07-25)
|
|
75
|
+
|
|
76
|
+
**Note:** Version bump only for package @oanda/labs-ticker-tape-widget
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.17 (2024-09-11)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.160 (2024-09-10)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.159 (2024-09-09)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.158 (2024-09-04)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.157 (2024-09-04)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.156 (2024-09-02)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.155 (2024-08-29)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.154 (2024-08-29)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.153 (2024-08-23)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.152 (2024-08-23)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## 1.0.151 (2024-08-20)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 1.0.150 (2024-08-19)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.0.149 (2024-08-07)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## 1.0.148 (2024-08-01)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## 1.0.147 (2024-08-01)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## 1.0.146 (2024-07-26)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.145 (2024-07-25)
|
|
147
|
+
|
|
148
|
+
**Note:** Version bump only for package @oanda/labs-ticker-tape-widget
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
6
154
|
## 1.0.16 (2024-09-10)
|
|
7
155
|
|
|
8
156
|
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Main = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactFastMarquee = _interopRequireDefault(require("react-fast-marquee"));
|
|
9
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
9
|
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
11
10
|
var _constant = require("./constant");
|
|
12
11
|
var _InstrumentRateWithData = require("./components/InstrumentRateWithData");
|
|
12
|
+
var _MarqueeWrapper = require("./components/MarqueeWrapper");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -17,7 +17,8 @@ const Main = _ref => {
|
|
|
17
17
|
let {
|
|
18
18
|
records,
|
|
19
19
|
division,
|
|
20
|
-
size: widgetSize = 'fullWithChart'
|
|
20
|
+
size: widgetSize = 'fullWithChart',
|
|
21
|
+
motion = 'linear'
|
|
21
22
|
} = _ref;
|
|
22
23
|
const {
|
|
23
24
|
target,
|
|
@@ -37,17 +38,17 @@ const Main = _ref => {
|
|
|
37
38
|
}
|
|
38
39
|
}, [records]);
|
|
39
40
|
return _react.default.createElement("div", {
|
|
40
|
-
"data-testid": "ticker-tape-wrapper"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
speed: 60
|
|
41
|
+
"data-testid": "ticker-tape-wrapper",
|
|
42
|
+
className: "lw-flex"
|
|
43
|
+
}, _react.default.createElement(_MarqueeWrapper.MarqueeWrapper, {
|
|
44
|
+
shouldPlay: records.length > 0,
|
|
45
|
+
isStatic: motion === 'none'
|
|
46
46
|
}, records.map(record => _react.default.createElement("div", {
|
|
47
47
|
key: record.instrument,
|
|
48
48
|
className: (0, _classnames.default)('lw-flex lw-border lw-border-r-0 lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {
|
|
49
49
|
'lw-h-[82px]': widgetSize !== 'compact',
|
|
50
|
-
'lw-h-[54px]': widgetSize === 'compact'
|
|
50
|
+
'lw-h-[54px]': widgetSize === 'compact',
|
|
51
|
+
'lw-w-fit last:lw-border-r': motion === 'none'
|
|
51
52
|
})
|
|
52
53
|
}, _react.default.createElement(_InstrumentRateWithData.InstrumentRateWithData, {
|
|
53
54
|
record: record,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_labsWidgetCommon","_constant","_InstrumentRateWithData","_MarqueeWrapper","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Main","_ref","records","division","size","widgetSize","motion","target","setQuery","useLiveRatesQuery","instrumentsNames","map","_ref2","instrument","instrumentName","useEffect","instruments","createElement","className","MarqueeWrapper","shouldPlay","length","isStatic","record","key","classnames","InstrumentRateWithData","Tooltip","id","INSTRUMENT_TOOLTIP_ID","exports"],"sources":["../../../src/TickerTapeWidget/Main.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport classnames from 'classnames';\nimport { Tooltip, useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport { MainProps } from './types';\nimport { INSTRUMENT_TOOLTIP_ID } from './constant';\nimport { InstrumentRateWithData } from './components/InstrumentRateWithData';\nimport { MarqueeWrapper } from './components/MarqueeWrapper';\n\nconst Main = ({\n records,\n division,\n size: widgetSize = 'fullWithChart',\n motion = 'linear',\n}: MainProps) => {\n const { target, setQuery } = useLiveRatesQuery();\n\n const instrumentsNames = records.map(({ instrument: instrumentName }) => instrumentName);\n\n useEffect(() => {\n if (instrumentsNames[0]) {\n setQuery({ instruments: instrumentsNames });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [records]);\n\n return (\n <div data-testid=\"ticker-tape-wrapper\" className=\"lw-flex\">\n <MarqueeWrapper shouldPlay={records.length > 0} isStatic={motion === 'none'}>\n {records.map((record) => (\n <div\n key={record.instrument}\n className={classnames('lw-flex lw-border lw-border-r-0 lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n 'lw-w-fit last:lw-border-r': motion === 'none',\n })}\n >\n <InstrumentRateWithData\n record={record}\n target={target}\n division={division}\n size={widgetSize}\n />\n </div>\n ))}\n </MarqueeWrapper>\n <Tooltip id={INSTRUMENT_TOOLTIP_ID} />\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAA6D,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAA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,CAClC,CAAC;AAEV,CAAC;AAACC,OAAA,CAAA9B,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -23,7 +23,8 @@ const TickerTapeWidget = _ref => {
|
|
|
23
23
|
theme,
|
|
24
24
|
isParamError,
|
|
25
25
|
removePadding,
|
|
26
|
-
size
|
|
26
|
+
size,
|
|
27
|
+
motion
|
|
27
28
|
} = _ref;
|
|
28
29
|
const client = new _client.ApolloClient({
|
|
29
30
|
uri: graphqlUrl,
|
|
@@ -44,9 +45,11 @@ const TickerTapeWidget = _ref => {
|
|
|
44
45
|
client: client
|
|
45
46
|
}, _react.default.createElement(_react.Suspense, null, _react.default.createElement(_labsWidgetCommon.ThemeProvider, {
|
|
46
47
|
removePadding: removePadding,
|
|
47
|
-
theme: theme
|
|
48
|
+
theme: theme,
|
|
49
|
+
fitContent: motion === 'none'
|
|
48
50
|
}, _react.default.createElement(_ValidationWrapper.ValidationWrapper, {
|
|
49
51
|
size: size,
|
|
52
|
+
motion: motion,
|
|
50
53
|
instruments: instruments,
|
|
51
54
|
division: division,
|
|
52
55
|
isParamError: isParamError
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TickerTapeWidget.js","names":["_react","_interopRequireWildcard","require","_client","_monoI18n","_labsWidgetCommon","_translations","_types","_ValidationWrapper","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TickerTapeWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","locale","theme","isParamError","removePadding","size","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","Suspense","ThemeProvider","ValidationWrapper","exports"],"sources":["../../../src/TickerTapeWidget/TickerTapeWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { LiveRatesProvider, ThemeProvider, getLocale } from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Division, TickerTapeConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst TickerTapeWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n size,\n}: TickerTapeConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme}>\n <ValidationWrapper\n size={size}\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { TickerTapeWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAwD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAExD,MAAMW,gBAAgB,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"file":"TickerTapeWidget.js","names":["_react","_interopRequireWildcard","require","_client","_monoI18n","_labsWidgetCommon","_translations","_types","_ValidationWrapper","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TickerTapeWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","locale","theme","isParamError","removePadding","size","motion","client","ApolloClient","uri","cache","InMemoryCache","divisionCode","Division","Opt","Ogm","dataSource","createElement","LocaleProvider","getLocale","translations","LiveRatesProvider","url","options","ApolloProvider","Suspense","ThemeProvider","fitContent","ValidationWrapper","exports"],"sources":["../../../src/TickerTapeWidget/TickerTapeWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { LiveRatesProvider, ThemeProvider, getLocale } from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Division, TickerTapeConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst TickerTapeWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n size,\n motion,\n}: TickerTapeConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme} fitContent={motion === 'none'}>\n <ValidationWrapper\n size={size}\n motion={motion}\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { TickerTapeWidget };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAwD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,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@@ -19,6 +19,7 @@ const ValidationWrapper = _ref => {
|
|
|
19
19
|
instruments,
|
|
20
20
|
division,
|
|
21
21
|
size: widgetSize,
|
|
22
|
+
motion,
|
|
22
23
|
isParamError
|
|
23
24
|
} = _ref;
|
|
24
25
|
const {
|
|
@@ -39,7 +40,8 @@ const ValidationWrapper = _ref => {
|
|
|
39
40
|
return _react.default.createElement(_react.default.Fragment, null, !showError && size && _react.default.createElement(_Main.Main, {
|
|
40
41
|
size: widgetSize,
|
|
41
42
|
division: division,
|
|
42
|
-
records: (0, _utils.getRecords)(data)
|
|
43
|
+
records: (0, _utils.getRecords)(data),
|
|
44
|
+
motion: motion
|
|
43
45
|
}), showError && _react.default.createElement("div", {
|
|
44
46
|
className: (0, _classnames.default)('lw-flex lw-border lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {
|
|
45
47
|
'lw-h-[82px]': widgetSize !== 'compact',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationWrapper.js","names":["_react","_interopRequireWildcard","require","_client","_classnames","_interopRequireDefault","_labsWidgetCommon","_validateInstruments","_Main","_utils","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ValidationWrapper","_ref","instruments","division","size","widgetSize","isParamError","useContext","ThemeContext","data","error","useSuspenseQuery","validateInstruments","variables","fetchPolicy","errorPolicy","showError","createElement","Fragment","Main","records","getRecords","className","classnames","Error","exports"],"sources":["../../../src/TickerTapeWidget/ValidationWrapper.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useSuspenseQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport { Error, ThemeContext } from '@oanda/labs-widget-common';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../gql/types/graphql';\nimport { Main } from './Main';\nimport { getRecords } from './utils';\nimport { ValidationWrapperProps } from './types';\n\nconst ValidationWrapper = ({\n instruments,\n division,\n size: widgetSize,\n isParamError,\n}: ValidationWrapperProps) => {\n const { size } = useContext(ThemeContext);\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const showError = !!error || isParamError;\n\n return (\n <>\n {!showError && size && (\n <Main\n size={widgetSize}\n division={division}\n records={getRecords(data!)!}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-border lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n })}\n >\n <Error />\n </div>\n )}\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAqC,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAP,OAAA,GAAAF,CAAA,EAAAM,CAAA,IAAAA,CAAA,CAAAa,GAAA,CAAAnB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAGrC,MAAMW,iBAAiB,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"file":"ValidationWrapper.js","names":["_react","_interopRequireWildcard","require","_client","_classnames","_interopRequireDefault","_labsWidgetCommon","_validateInstruments","_Main","_utils","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ValidationWrapper","_ref","instruments","division","size","widgetSize","motion","isParamError","useContext","ThemeContext","data","error","useSuspenseQuery","validateInstruments","variables","fetchPolicy","errorPolicy","showError","createElement","Fragment","Main","records","getRecords","className","classnames","Error","exports"],"sources":["../../../src/TickerTapeWidget/ValidationWrapper.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useSuspenseQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport { Error, ThemeContext } from '@oanda/labs-widget-common';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../gql/types/graphql';\nimport { Main } from './Main';\nimport { getRecords } from './utils';\nimport { ValidationWrapperProps } from './types';\n\nconst ValidationWrapper = ({\n instruments,\n division,\n size: widgetSize,\n motion,\n isParamError,\n}: ValidationWrapperProps) => {\n const { size } = useContext(ThemeContext);\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const showError = !!error || isParamError;\n\n return (\n <>\n {!showError && size && (\n <Main\n size={widgetSize}\n division={division}\n records={getRecords(data!)!}\n motion={motion}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-border lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n })}\n >\n <Error />\n </div>\n )}\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAqC,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAA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AC;EACzC,MAAM;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAG,IAAAC,wBAAgB,EAGtCC,wCAAmB,EAAE;IACrBC,SAAS,EAAE;MACTZ,WAAW;MACXC;IACF,CAAC;IACDY,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAG,CAAC,CAACN,KAAK,IAAIJ,YAAY;EAEzC,OACErC,MAAA,CAAAY,OAAA,CAAAoC,aAAA,CAAAhD,MAAA,CAAAY,OAAA,CAAAqC,QAAA,QACG,CAACF,SAAS,IAAIb,IAAI,IACjBlC,MAAA,CAAAY,OAAA,CAAAoC,aAAA,CAACxC,KAAA,CAAA0C,IAAI;IACHhB,IAAI,EAAEC,UAAW;IACjBF,QAAQ,EAAEA,QAAS;IACnBkB,OAAO,EAAE,IAAAC,iBAAU,EAACZ,IAAK,CAAG;IAC5BJ,MAAM,EAAEA;EAAO,CAChB,CACF,EACAW,SAAS,IACV/C,MAAA,CAAAY,OAAA,CAAAoC,aAAA;IAAKK,SAAS,EAAE,IAAAC,mBAAU,EAAC,uHAAuH,EAAE;MAClJ,aAAa,EAAEnB,UAAU,KAAK,SAAS;MACvC,aAAa,EAAEA,UAAU,KAAK;IAChC,CAAC;EAAE,GAEDnC,MAAA,CAAAY,OAAA,CAAAoC,aAAA,CAAC1C,iBAAA,CAAAiD,KAAK,MAAE,CACL,CAEL,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA1B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MarqueeWrapper = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactFastMarquee = _interopRequireDefault(require("react-fast-marquee"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const MarqueeWrapper = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
children,
|
|
13
|
+
shouldPlay,
|
|
14
|
+
isStatic
|
|
15
|
+
} = _ref;
|
|
16
|
+
return _react.default.createElement(_react.default.Fragment, null, !isStatic ? _react.default.createElement(_reactFastMarquee.default, {
|
|
17
|
+
play: shouldPlay,
|
|
18
|
+
autoFill: true,
|
|
19
|
+
pauseOnHover: true,
|
|
20
|
+
speed: 60
|
|
21
|
+
}, children) : children);
|
|
22
|
+
};
|
|
23
|
+
exports.MarqueeWrapper = MarqueeWrapper;
|
|
24
|
+
//# sourceMappingURL=MarqueeWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarqueeWrapper.js","names":["_react","_interopRequireDefault","require","_reactFastMarquee","e","__esModule","default","MarqueeWrapper","_ref","children","shouldPlay","isStatic","createElement","Fragment","play","autoFill","pauseOnHover","speed","exports"],"sources":["../../../../../src/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport Marquee from 'react-fast-marquee';\nimport { MarqueeWrapperProps } from './types';\n\nconst MarqueeWrapper = ({\n children,\n shouldPlay,\n isStatic,\n}: MarqueeWrapperProps) => (\n <>\n {!isStatic ? (\n <Marquee\n play={shouldPlay}\n autoFill\n pauseOnHover\n speed={60}\n >\n {children}\n </Marquee>\n ) : children}\n </>\n);\n\nexport { MarqueeWrapper };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAyC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGzC,MAAMG,cAAc,GAAGC,IAAA;EAAA,IAAC;IACtBC,QAAQ;IACRC,UAAU;IACVC;EACmB,CAAC,GAAAH,IAAA;EAAA,OACpBR,MAAA,CAAAM,OAAA,CAAAM,aAAA,CAAAZ,MAAA,CAAAM,OAAA,CAAAO,QAAA,QACG,CAACF,QAAQ,GACRX,MAAA,CAAAM,OAAA,CAAAM,aAAA,CAACT,iBAAA,CAAAG,OAAO;IACNQ,IAAI,EAAEJ,UAAW;IACjBK,QAAQ;IACRC,YAAY;IACZC,KAAK,EAAE;EAAG,GAETR,QACM,CAAC,GACRA,QACJ,CAAC;AAAA,CACJ;AAACS,OAAA,CAAAX,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _MarqueeWrapper = require("./MarqueeWrapper");
|
|
7
|
+
Object.keys(_MarqueeWrapper).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _MarqueeWrapper[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _MarqueeWrapper[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_MarqueeWrapper","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../../../src/TickerTapeWidget/components/MarqueeWrapper/index.tsx"],"sourcesContent":["export * from './MarqueeWrapper';\n"],"mappings":";;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,eAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,eAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,eAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/TickerTapeWidget/components/MarqueeWrapper/types.ts"],"sourcesContent":["export interface MarqueeWrapperProps {\n children: React.ReactNode;\n shouldPlay: boolean;\n isStatic: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -19,7 +19,8 @@ dataTickerTapeParamsElements.forEach(element => {
|
|
|
19
19
|
instruments,
|
|
20
20
|
division,
|
|
21
21
|
locale,
|
|
22
|
-
size
|
|
22
|
+
size,
|
|
23
|
+
motion
|
|
23
24
|
} = JSON.parse(params);
|
|
24
25
|
const isParamError = (0, _labsWidgetCommon.validateToolParams)({
|
|
25
26
|
division,
|
|
@@ -49,7 +50,8 @@ dataTickerTapeParamsElements.forEach(element => {
|
|
|
49
50
|
locale: locale,
|
|
50
51
|
theme: mode,
|
|
51
52
|
isParamError: isParamError,
|
|
52
|
-
size: size
|
|
53
|
+
size: size,
|
|
54
|
+
motion: motion
|
|
53
55
|
}));
|
|
54
56
|
});
|
|
55
57
|
//# sourceMappingURL=render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_TickerTapeWidget","_graphql","e","__esModule","default","graphqlUrl","liveRatesUrl","window","widgetsConfig","dataTickerTapeParamsElements","document","querySelectorAll","forEach","element","root","createRoot","params","getAttribute","mode","instruments","division","locale","size","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","validateLocale","Object","values","Division","includes","length","render","createElement","TickerTapeWidget","theme"],"sources":["../../../src/TickerTapeWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { TickerTapeWidget } from './TickerTapeWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl,\n liveRatesUrl,\n} = window.widgetsConfig || {};\n\nconst dataTickerTapeParamsElements = document.querySelectorAll('div[data-ticker-tape-params]');\n\ndataTickerTapeParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-ticker-tape-params');\n const mode = element.getAttribute('data-mode');\n const {\n instruments, division, locale, size,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({\n division, locale, graphqlUrl, liveRatesUrl, instruments,\n }, [{\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'instruments',\n valueCheck: (value) => value.length > 0 && value.length <= 10,\n }, {\n name: 'graphqlUrl',\n }, {\n name: 'liveRatesUrl',\n }]);\n\n root.render(\n <TickerTapeWidget\n graphqlUrl={graphqlUrl}\n liveRatesUrl={liveRatesUrl}\n division={division}\n instruments={instruments}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n size={size}\n />,\n );\n});\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAgD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhD,MAAM;EACJG,UAAU;EACVC;AACF,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,4BAA4B,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,8BAA8B,CAAC;AAE9FF,4BAA4B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAChD,MAAMC,IAAI,GAAG,IAAAC,kBAAU,EAACF,OAAO,CAAC;EAChC,MAAMG,MAAM,GAAGH,OAAO,CAACI,YAAY,CAAC,yBAAyB,CAAC;EAC9D,MAAMC,IAAI,GAAGL,OAAO,CAACI,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IACJE,WAAW;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;
|
|
1
|
+
{"version":3,"file":"render.js","names":["_react","_interopRequireDefault","require","_client","_labsWidgetCommon","_TickerTapeWidget","_graphql","e","__esModule","default","graphqlUrl","liveRatesUrl","window","widgetsConfig","dataTickerTapeParamsElements","document","querySelectorAll","forEach","element","root","createRoot","params","getAttribute","mode","instruments","division","locale","size","motion","JSON","parse","isParamError","validateToolParams","name","valueCheck","value","validateLocale","Object","values","Division","includes","length","render","createElement","TickerTapeWidget","theme"],"sources":["../../../src/TickerTapeWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { TickerTapeWidget } from './TickerTapeWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl,\n liveRatesUrl,\n} = window.widgetsConfig || {};\n\nconst dataTickerTapeParamsElements = document.querySelectorAll('div[data-ticker-tape-params]');\n\ndataTickerTapeParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-ticker-tape-params');\n const mode = element.getAttribute('data-mode');\n const {\n instruments, division, locale, size, motion,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({\n division, locale, graphqlUrl, liveRatesUrl, instruments,\n }, [{\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'instruments',\n valueCheck: (value) => value.length > 0 && value.length <= 10,\n }, {\n name: 'graphqlUrl',\n }, {\n name: 'liveRatesUrl',\n }]);\n\n root.render(\n <TickerTapeWidget\n graphqlUrl={graphqlUrl}\n liveRatesUrl={liveRatesUrl}\n division={division}\n instruments={instruments}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n size={size}\n motion={motion}\n />,\n );\n});\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAgD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhD,MAAM;EACJG,UAAU;EACVC;AACF,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,4BAA4B,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,8BAA8B,CAAC;AAE9FF,4BAA4B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAChD,MAAMC,IAAI,GAAG,IAAAC,kBAAU,EAACF,OAAO,CAAC;EAChC,MAAMG,MAAM,GAAGH,OAAO,CAACI,YAAY,CAAC,yBAAyB,CAAC;EAC9D,MAAMC,IAAI,GAAGL,OAAO,CAACI,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IACJE,WAAW;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EACvC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACT,MAAgB,CAAC;EAEhC,MAAMU,YAAY,GAAG,IAAAC,oCAAkB,EAAC;IACtCP,QAAQ;IAAEC,MAAM;IAAEhB,UAAU;IAAEC,YAAY;IAAEa;EAC9C,CAAC,EAAE,CAAC;IACFS,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAK,IAAK,IAAAC,gCAAc,EAACD,KAAK;EAC7C,CAAC,EAAE;IACDF,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAGC,KAAK,IAAKE,MAAM,CAACC,MAAM,CAACC,iBAAQ,CAAC,CAACC,QAAQ,CAACL,KAAK;EAC/D,CAAC,EAAE;IACDF,IAAI,EAAE,aAAa;IACnBC,UAAU,EAAGC,KAAK,IAAKA,KAAK,CAACM,MAAM,GAAG,CAAC,IAAIN,KAAK,CAACM,MAAM,IAAI;EAC7D,CAAC,EAAE;IACDR,IAAI,EAAE;EACR,CAAC,EAAE;IACDA,IAAI,EAAE;EACR,CAAC,CAAC,CAAC;EAEHd,IAAI,CAACuB,MAAM,CACT1C,MAAA,CAAAS,OAAA,CAAAkC,aAAA,CAACtC,iBAAA,CAAAuC,gBAAgB;IACflC,UAAU,EAAEA,UAAW;IACvBC,YAAY,EAAEA,YAAa;IAC3Bc,QAAQ,EAAEA,QAAS;IACnBD,WAAW,EAAEA,WAAY;IACzBE,MAAM,EAAEA,MAAO;IACfmB,KAAK,EAAEtB,IAAc;IACrBQ,YAAY,EAAEA,YAAa;IAC3BJ,IAAI,EAAEA,IAAK;IACXC,MAAM,EAAEA;EAAO,CAChB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["_monoI18n","require","_graphql"],"sources":["../../../src/TickerTapeWidget/types.
|
|
1
|
+
{"version":3,"file":"types.js","names":["_monoI18n","require","_graphql"],"sources":["../../../src/TickerTapeWidget/types.ts"],"sourcesContent":["import { Locale } from '@oanda/mono-i18n';\nimport { DataRecord, Theme, WidgetSize } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\nexport { Division } from '../gql/types/graphql';\n\nexport interface TickerTapeConfig {\n graphqlUrl: string;\n division: Division;\n liveRatesUrl: string;\n instruments: string[];\n locale: Locale;\n theme?: Theme;\n isParamError?: boolean;\n removePadding?: boolean;\n size?: WidgetSize;\n motion?: Motion;\n}\n\nexport interface ValidationWrapperProps {\n instruments: string[];\n division: Division;\n size?: WidgetSize;\n motion?: Motion;\n isParamError?: boolean;\n}\n\nexport interface MainProps {\n records: DataRecord[];\n division: Division;\n size?: WidgetSize;\n motion?: Motion;\n}\n\ntype Motion = 'linear' | 'none';\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import Marquee from 'react-fast-marquee';
|
|
3
2
|
import classnames from 'classnames';
|
|
4
3
|
import { Tooltip, useLiveRatesQuery } from '@oanda/labs-widget-common';
|
|
5
4
|
import { INSTRUMENT_TOOLTIP_ID } from './constant';
|
|
6
5
|
import { InstrumentRateWithData } from './components/InstrumentRateWithData';
|
|
6
|
+
import { MarqueeWrapper } from './components/MarqueeWrapper';
|
|
7
7
|
const Main = _ref => {
|
|
8
8
|
let {
|
|
9
9
|
records,
|
|
10
10
|
division,
|
|
11
|
-
size: widgetSize = 'fullWithChart'
|
|
11
|
+
size: widgetSize = 'fullWithChart',
|
|
12
|
+
motion = 'linear'
|
|
12
13
|
} = _ref;
|
|
13
14
|
const {
|
|
14
15
|
target,
|
|
@@ -28,17 +29,17 @@ const Main = _ref => {
|
|
|
28
29
|
}
|
|
29
30
|
}, [records]);
|
|
30
31
|
return React.createElement("div", {
|
|
31
|
-
"data-testid": "ticker-tape-wrapper"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
speed: 60
|
|
32
|
+
"data-testid": "ticker-tape-wrapper",
|
|
33
|
+
className: "lw-flex"
|
|
34
|
+
}, React.createElement(MarqueeWrapper, {
|
|
35
|
+
shouldPlay: records.length > 0,
|
|
36
|
+
isStatic: motion === 'none'
|
|
37
37
|
}, records.map(record => React.createElement("div", {
|
|
38
38
|
key: record.instrument,
|
|
39
39
|
className: classnames('lw-flex lw-border lw-border-r-0 lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {
|
|
40
40
|
'lw-h-[82px]': widgetSize !== 'compact',
|
|
41
|
-
'lw-h-[54px]': widgetSize === 'compact'
|
|
41
|
+
'lw-h-[54px]': widgetSize === 'compact',
|
|
42
|
+
'lw-w-fit last:lw-border-r': motion === 'none'
|
|
42
43
|
})
|
|
43
44
|
}, React.createElement(InstrumentRateWithData, {
|
|
44
45
|
record: record,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["React","useEffect","
|
|
1
|
+
{"version":3,"file":"Main.js","names":["React","useEffect","classnames","Tooltip","useLiveRatesQuery","INSTRUMENT_TOOLTIP_ID","InstrumentRateWithData","MarqueeWrapper","Main","_ref","records","division","size","widgetSize","motion","target","setQuery","instrumentsNames","map","_ref2","instrument","instrumentName","instruments","createElement","className","shouldPlay","length","isStatic","record","key","id"],"sources":["../../../src/TickerTapeWidget/Main.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport classnames from 'classnames';\nimport { Tooltip, useLiveRatesQuery } from '@oanda/labs-widget-common';\nimport { MainProps } from './types';\nimport { INSTRUMENT_TOOLTIP_ID } from './constant';\nimport { InstrumentRateWithData } from './components/InstrumentRateWithData';\nimport { MarqueeWrapper } from './components/MarqueeWrapper';\n\nconst Main = ({\n records,\n division,\n size: widgetSize = 'fullWithChart',\n motion = 'linear',\n}: MainProps) => {\n const { target, setQuery } = useLiveRatesQuery();\n\n const instrumentsNames = records.map(({ instrument: instrumentName }) => instrumentName);\n\n useEffect(() => {\n if (instrumentsNames[0]) {\n setQuery({ instruments: instrumentsNames });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [records]);\n\n return (\n <div data-testid=\"ticker-tape-wrapper\" className=\"lw-flex\">\n <MarqueeWrapper shouldPlay={records.length > 0} isStatic={motion === 'none'}>\n {records.map((record) => (\n <div\n key={record.instrument}\n className={classnames('lw-flex lw-border lw-border-r-0 lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n 'lw-w-fit last:lw-border-r': motion === 'none',\n })}\n >\n <InstrumentRateWithData\n record={record}\n target={target}\n division={division}\n size={widgetSize}\n />\n </div>\n ))}\n </MarqueeWrapper>\n <Tooltip id={INSTRUMENT_TOOLTIP_ID} />\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,2BAA2B;AAEtE,SAASC,qBAAqB,QAAQ,YAAY;AAClD,SAASC,sBAAsB,QAAQ,qCAAqC;AAC5E,SAASC,cAAc,QAAQ,6BAA6B;AAE5D,MAAMC,IAAI,GAAGC,IAAA,IAKI;EAAA,IALH;IACZC,OAAO;IACPC,QAAQ;IACRC,IAAI,EAAEC,UAAU,GAAG,eAAe;IAClCC,MAAM,GAAG;EACA,CAAC,GAAAL,IAAA;EACV,MAAM;IAAEM,MAAM;IAAEC;EAAS,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EAEhD,MAAMa,gBAAgB,GAAGP,OAAO,CAACQ,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEC,UAAU,EAAEC;IAAe,CAAC,GAAAF,KAAA;IAAA,OAAKE,cAAc;EAAA,EAAC;EAExFpB,SAAS,CAAC,MAAM;IACd,IAAIgB,gBAAgB,CAAC,CAAC,CAAC,EAAE;MACvBD,QAAQ,CAAC;QAAEM,WAAW,EAAEL;MAAiB,CAAC,CAAC;IAC7C;EAEF,CAAC,EAAE,CAACP,OAAO,CAAC,CAAC;EAEb,OACEV,KAAA,CAAAuB,aAAA;IAAK,eAAY,qBAAqB;IAACC,SAAS,EAAC;EAAS,GACxDxB,KAAA,CAAAuB,aAAA,CAAChB,cAAc;IAACkB,UAAU,EAAEf,OAAO,CAACgB,MAAM,GAAG,CAAE;IAACC,QAAQ,EAAEb,MAAM,KAAK;EAAO,GACzEJ,OAAO,CAACQ,GAAG,CAAEU,MAAM,IAClB5B,KAAA,CAAAuB,aAAA;IACEM,GAAG,EAAED,MAAM,CAACR,UAAW;IACvBI,SAAS,EAAEtB,UAAU,CAAC,qIAAqI,EAAE;MAC3J,aAAa,EAAEW,UAAU,KAAK,SAAS;MACvC,aAAa,EAAEA,UAAU,KAAK,SAAS;MACvC,2BAA2B,EAAEC,MAAM,KAAK;IAC1C,CAAC;EAAE,GAEHd,KAAA,CAAAuB,aAAA,CAACjB,sBAAsB;IACrBsB,MAAM,EAAEA,MAAO;IACfb,MAAM,EAAEA,MAAO;IACfJ,QAAQ,EAAEA,QAAS;IACnBC,IAAI,EAAEC;EAAW,CAClB,CACE,CACN,CACa,CAAC,EACjBb,KAAA,CAAAuB,aAAA,CAACpB,OAAO;IAAC2B,EAAE,EAAEzB;EAAsB,CAAE,CAClC,CAAC;AAEV,CAAC;AAED,SAASG,IAAI","ignoreList":[]}
|
|
@@ -15,7 +15,8 @@ const TickerTapeWidget = _ref => {
|
|
|
15
15
|
theme,
|
|
16
16
|
isParamError,
|
|
17
17
|
removePadding,
|
|
18
|
-
size
|
|
18
|
+
size,
|
|
19
|
+
motion
|
|
19
20
|
} = _ref;
|
|
20
21
|
const client = new ApolloClient({
|
|
21
22
|
uri: graphqlUrl,
|
|
@@ -36,9 +37,11 @@ const TickerTapeWidget = _ref => {
|
|
|
36
37
|
client: client
|
|
37
38
|
}, React.createElement(Suspense, null, React.createElement(ThemeProvider, {
|
|
38
39
|
removePadding: removePadding,
|
|
39
|
-
theme: theme
|
|
40
|
+
theme: theme,
|
|
41
|
+
fitContent: motion === 'none'
|
|
40
42
|
}, React.createElement(ValidationWrapper, {
|
|
41
43
|
size: size,
|
|
44
|
+
motion: motion,
|
|
42
45
|
instruments: instruments,
|
|
43
46
|
division: division,
|
|
44
47
|
isParamError: isParamError
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TickerTapeWidget.js","names":["React","Suspense","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","LiveRatesProvider","ThemeProvider","getLocale","translations","Division","ValidationWrapper","TickerTapeWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","locale","theme","isParamError","removePadding","size","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options"],"sources":["../../../src/TickerTapeWidget/TickerTapeWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { LiveRatesProvider, ThemeProvider, getLocale } from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Division, TickerTapeConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst TickerTapeWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n size,\n}: TickerTapeConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme}>\n <ValidationWrapper\n size={size}\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { TickerTapeWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,QAAQ,2BAA2B;AACvF,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,QAAQ,QAA0B,SAAS;AACpD,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,gBAAgB,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"file":"TickerTapeWidget.js","names":["React","Suspense","ApolloClient","InMemoryCache","ApolloProvider","LocaleProvider","LiveRatesProvider","ThemeProvider","getLocale","translations","Division","ValidationWrapper","TickerTapeWidget","_ref","graphqlUrl","liveRatesUrl","instruments","division","locale","theme","isParamError","removePadding","size","motion","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","url","options","fitContent"],"sources":["../../../src/TickerTapeWidget/TickerTapeWidget.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';\nimport { LocaleProvider } from '@oanda/mono-i18n';\nimport { LiveRatesProvider, ThemeProvider, getLocale } from '@oanda/labs-widget-common';\nimport { translations } from '../translations';\nimport { Division, TickerTapeConfig } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst TickerTapeWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instruments,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n size,\n motion,\n}: TickerTapeConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <LocaleProvider locale={getLocale(locale)} translations={translations}>\n <LiveRatesProvider\n url={liveRatesUrl}\n options={{ divisionCode, dataSource }}\n >\n <ApolloProvider client={client}>\n <Suspense>\n <ThemeProvider removePadding={removePadding} theme={theme} fitContent={motion === 'none'}>\n <ValidationWrapper\n size={size}\n motion={motion}\n instruments={instruments}\n division={division}\n isParamError={isParamError}\n />\n </ThemeProvider>\n </Suspense>\n </ApolloProvider>\n </LiveRatesProvider>\n </LocaleProvider>\n );\n};\n\nexport { TickerTapeWidget };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,SAAS,QAAQ,2BAA2B;AACvF,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,QAAQ,QAA0B,SAAS;AACpD,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,gBAAgB,GAAGC,IAAA,IAWD;EAAA,IAXE;IACxBC,UAAU;IACVC,YAAY;IACZC,WAAW;IACXC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,IAAI;IACJC;EACgB,CAAC,GAAAV,IAAA;EACjB,MAAMW,MAAM,GAAG,IAAItB,YAAY,CAAC;IAC9BuB,GAAG,EAAEX,UAAU;IACfY,KAAK,EAAE,IAAIvB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMwB,YAAY,GAAGV,QAAQ,KAAKP,QAAQ,CAACkB,GAAG,GAAGlB,QAAQ,CAACmB,GAAG,GAAGZ,QAAQ;EACxE,MAAMa,UAAU,GAAGH,YAAY,KAAKjB,QAAQ,CAACmB,GAAG,GAAG,KAAK,GAAG,KAAK;EAEhE,OACE7B,KAAA,CAAA+B,aAAA,CAAC1B,cAAc;IAACa,MAAM,EAAEV,SAAS,CAACU,MAAM,CAAE;IAACT,YAAY,EAAEA;EAAa,GACpET,KAAA,CAAA+B,aAAA,CAACzB,iBAAiB;IAChB0B,GAAG,EAAEjB,YAAa;IAClBkB,OAAO,EAAE;MAAEN,YAAY;MAAEG;IAAW;EAAE,GAEtC9B,KAAA,CAAA+B,aAAA,CAAC3B,cAAc;IAACoB,MAAM,EAAEA;EAAO,GAC7BxB,KAAA,CAAA+B,aAAA,CAAC9B,QAAQ,QACPD,KAAA,CAAA+B,aAAA,CAACxB,aAAa;IAACc,aAAa,EAAEA,aAAc;IAACF,KAAK,EAAEA,KAAM;IAACe,UAAU,EAAEX,MAAM,KAAK;EAAO,GACvFvB,KAAA,CAAA+B,aAAA,CAACpB,iBAAiB;IAChBW,IAAI,EAAEA,IAAK;IACXC,MAAM,EAAEA,MAAO;IACfP,WAAW,EAAEA,WAAY;IACzBC,QAAQ,EAAEA,QAAS;IACnBG,YAAY,EAAEA;EAAa,CAC5B,CACY,CACP,CACI,CACC,CACL,CAAC;AAErB,CAAC;AAED,SAASR,gBAAgB","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ const ValidationWrapper = _ref => {
|
|
|
10
10
|
instruments,
|
|
11
11
|
division,
|
|
12
12
|
size: widgetSize,
|
|
13
|
+
motion,
|
|
13
14
|
isParamError
|
|
14
15
|
} = _ref;
|
|
15
16
|
const {
|
|
@@ -30,7 +31,8 @@ const ValidationWrapper = _ref => {
|
|
|
30
31
|
return React.createElement(React.Fragment, null, !showError && size && React.createElement(Main, {
|
|
31
32
|
size: widgetSize,
|
|
32
33
|
division: division,
|
|
33
|
-
records: getRecords(data)
|
|
34
|
+
records: getRecords(data),
|
|
35
|
+
motion: motion
|
|
34
36
|
}), showError && React.createElement("div", {
|
|
35
37
|
className: classnames('lw-flex lw-border lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {
|
|
36
38
|
'lw-h-[82px]': widgetSize !== 'compact',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationWrapper.js","names":["React","useContext","useSuspenseQuery","classnames","Error","ThemeContext","validateInstruments","Main","getRecords","ValidationWrapper","_ref","instruments","division","size","widgetSize","isParamError","data","error","variables","fetchPolicy","errorPolicy","showError","createElement","Fragment","records","className"],"sources":["../../../src/TickerTapeWidget/ValidationWrapper.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useSuspenseQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport { Error, ThemeContext } from '@oanda/labs-widget-common';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../gql/types/graphql';\nimport { Main } from './Main';\nimport { getRecords } from './utils';\nimport { ValidationWrapperProps } from './types';\n\nconst ValidationWrapper = ({\n instruments,\n division,\n size: widgetSize,\n isParamError,\n}: ValidationWrapperProps) => {\n const { size } = useContext(ThemeContext);\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const showError = !!error || isParamError;\n\n return (\n <>\n {!showError && size && (\n <Main\n size={widgetSize}\n division={division}\n records={getRecords(data!)!}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-border lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n })}\n >\n <Error />\n </div>\n )}\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,KAAK,EAAEC,YAAY,QAAQ,2BAA2B;AAC/D,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,UAAU,QAAQ,SAAS;AAGpC,MAAMC,iBAAiB,GAAGC,IAAA,
|
|
1
|
+
{"version":3,"file":"ValidationWrapper.js","names":["React","useContext","useSuspenseQuery","classnames","Error","ThemeContext","validateInstruments","Main","getRecords","ValidationWrapper","_ref","instruments","division","size","widgetSize","motion","isParamError","data","error","variables","fetchPolicy","errorPolicy","showError","createElement","Fragment","records","className"],"sources":["../../../src/TickerTapeWidget/ValidationWrapper.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useSuspenseQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport { Error, ThemeContext } from '@oanda/labs-widget-common';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { ValidateInstrumentsQuery, ValidateInstrumentsQueryVariables } from '../gql/types/graphql';\nimport { Main } from './Main';\nimport { getRecords } from './utils';\nimport { ValidationWrapperProps } from './types';\n\nconst ValidationWrapper = ({\n instruments,\n division,\n size: widgetSize,\n motion,\n isParamError,\n}: ValidationWrapperProps) => {\n const { size } = useContext(ThemeContext);\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments,\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const showError = !!error || isParamError;\n\n return (\n <>\n {!showError && size && (\n <Main\n size={widgetSize}\n division={division}\n records={getRecords(data!)!}\n motion={motion}\n />\n )}\n {showError && (\n <div className={classnames('lw-flex lw-border lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n })}\n >\n <Error />\n </div>\n )}\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,KAAK,EAAEC,YAAY,QAAQ,2BAA2B;AAC/D,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,UAAU,QAAQ,SAAS;AAGpC,MAAMC,iBAAiB,GAAGC,IAAA,IAMI;EAAA,IANH;IACzBC,WAAW;IACXC,QAAQ;IACRC,IAAI,EAAEC,UAAU;IAChBC,MAAM;IACNC;EACsB,CAAC,GAAAN,IAAA;EACvB,MAAM;IAAEG;EAAK,CAAC,GAAGZ,UAAU,CAACI,YAAY,CAAC;EACzC,MAAM;IAAEY,IAAI;IAAEC;EAAM,CAAC,GAAGhB,gBAAgB,CAGtCI,mBAAmB,EAAE;IACrBa,SAAS,EAAE;MACTR,WAAW;MACXC;IACF,CAAC;IACDQ,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAG,CAAC,CAACJ,KAAK,IAAIF,YAAY;EAEzC,OACEhB,KAAA,CAAAuB,aAAA,CAAAvB,KAAA,CAAAwB,QAAA,QACG,CAACF,SAAS,IAAIT,IAAI,IACjBb,KAAA,CAAAuB,aAAA,CAAChB,IAAI;IACHM,IAAI,EAAEC,UAAW;IACjBF,QAAQ,EAAEA,QAAS;IACnBa,OAAO,EAAEjB,UAAU,CAACS,IAAK,CAAG;IAC5BF,MAAM,EAAEA;EAAO,CAChB,CACF,EACAO,SAAS,IACVtB,KAAA,CAAAuB,aAAA;IAAKG,SAAS,EAAEvB,UAAU,CAAC,uHAAuH,EAAE;MAClJ,aAAa,EAAEW,UAAU,KAAK,SAAS;MACvC,aAAa,EAAEA,UAAU,KAAK;IAChC,CAAC;EAAE,GAEDd,KAAA,CAAAuB,aAAA,CAACnB,KAAK,MAAE,CACL,CAEL,CAAC;AAEP,CAAC;AAED,SAASK,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Marquee from 'react-fast-marquee';
|
|
3
|
+
const MarqueeWrapper = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
shouldPlay,
|
|
7
|
+
isStatic
|
|
8
|
+
} = _ref;
|
|
9
|
+
return React.createElement(React.Fragment, null, !isStatic ? React.createElement(Marquee, {
|
|
10
|
+
play: shouldPlay,
|
|
11
|
+
autoFill: true,
|
|
12
|
+
pauseOnHover: true,
|
|
13
|
+
speed: 60
|
|
14
|
+
}, children) : children);
|
|
15
|
+
};
|
|
16
|
+
export { MarqueeWrapper };
|
|
17
|
+
//# sourceMappingURL=MarqueeWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarqueeWrapper.js","names":["React","Marquee","MarqueeWrapper","_ref","children","shouldPlay","isStatic","createElement","Fragment","play","autoFill","pauseOnHover","speed"],"sources":["../../../../../src/TickerTapeWidget/components/MarqueeWrapper/MarqueeWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport Marquee from 'react-fast-marquee';\nimport { MarqueeWrapperProps } from './types';\n\nconst MarqueeWrapper = ({\n children,\n shouldPlay,\n isStatic,\n}: MarqueeWrapperProps) => (\n <>\n {!isStatic ? (\n <Marquee\n play={shouldPlay}\n autoFill\n pauseOnHover\n speed={60}\n >\n {children}\n </Marquee>\n ) : children}\n </>\n);\n\nexport { MarqueeWrapper };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,OAAO,MAAM,oBAAoB;AAGxC,MAAMC,cAAc,GAAGC,IAAA;EAAA,IAAC;IACtBC,QAAQ;IACRC,UAAU;IACVC;EACmB,CAAC,GAAAH,IAAA;EAAA,OACpBH,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACG,CAACF,QAAQ,GACRN,KAAA,CAAAO,aAAA,CAACN,OAAO;IACNQ,IAAI,EAAEJ,UAAW;IACjBK,QAAQ;IACRC,YAAY;IACZC,KAAK,EAAE;EAAG,GAETR,QACM,CAAC,GACRA,QACJ,CAAC;AAAA,CACJ;AAED,SAASF,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/TickerTapeWidget/components/MarqueeWrapper/index.tsx"],"sourcesContent":["export * from './MarqueeWrapper';\n"],"mappings":"AAAA,cAAc,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/TickerTapeWidget/components/MarqueeWrapper/types.ts"],"sourcesContent":["export interface MarqueeWrapperProps {\n children: React.ReactNode;\n shouldPlay: boolean;\n isStatic: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -16,7 +16,8 @@ dataTickerTapeParamsElements.forEach(element => {
|
|
|
16
16
|
instruments,
|
|
17
17
|
division,
|
|
18
18
|
locale,
|
|
19
|
-
size
|
|
19
|
+
size,
|
|
20
|
+
motion
|
|
20
21
|
} = JSON.parse(params);
|
|
21
22
|
const isParamError = validateToolParams({
|
|
22
23
|
division,
|
|
@@ -46,7 +47,8 @@ dataTickerTapeParamsElements.forEach(element => {
|
|
|
46
47
|
locale: locale,
|
|
47
48
|
theme: mode,
|
|
48
49
|
isParamError: isParamError,
|
|
49
|
-
size: size
|
|
50
|
+
size: size,
|
|
51
|
+
motion: motion
|
|
50
52
|
}));
|
|
51
53
|
});
|
|
52
54
|
//# sourceMappingURL=render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","TickerTapeWidget","Division","graphqlUrl","liveRatesUrl","window","widgetsConfig","dataTickerTapeParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","instruments","division","locale","size","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","length","render","createElement","theme"],"sources":["../../../src/TickerTapeWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { TickerTapeWidget } from './TickerTapeWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl,\n liveRatesUrl,\n} = window.widgetsConfig || {};\n\nconst dataTickerTapeParamsElements = document.querySelectorAll('div[data-ticker-tape-params]');\n\ndataTickerTapeParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-ticker-tape-params');\n const mode = element.getAttribute('data-mode');\n const {\n instruments, division, locale, size,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({\n division, locale, graphqlUrl, liveRatesUrl, instruments,\n }, [{\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'instruments',\n valueCheck: (value) => value.length > 0 && value.length <= 10,\n }, {\n name: 'graphqlUrl',\n }, {\n name: 'liveRatesUrl',\n }]);\n\n root.render(\n <TickerTapeWidget\n graphqlUrl={graphqlUrl}\n liveRatesUrl={liveRatesUrl}\n division={division}\n instruments={instruments}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n size={size}\n />,\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AACrF,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAM;EACJC,UAAU;EACVC;AACF,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE9B,MAAMC,4BAA4B,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,8BAA8B,CAAC;AAE9FF,4BAA4B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAChD,MAAMC,IAAI,GAAGd,UAAU,CAACa,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,yBAAyB,CAAC;EAC9D,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IACJE,WAAW;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;
|
|
1
|
+
{"version":3,"file":"render.js","names":["React","createRoot","validateLocale","validateToolParams","TickerTapeWidget","Division","graphqlUrl","liveRatesUrl","window","widgetsConfig","dataTickerTapeParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","instruments","division","locale","size","motion","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","length","render","createElement","theme"],"sources":["../../../src/TickerTapeWidget/render.tsx"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { Theme, validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport { TickerTapeWidget } from './TickerTapeWidget';\nimport { Division } from '../gql/types/graphql';\n\nconst {\n graphqlUrl,\n liveRatesUrl,\n} = window.widgetsConfig || {};\n\nconst dataTickerTapeParamsElements = document.querySelectorAll('div[data-ticker-tape-params]');\n\ndataTickerTapeParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-ticker-tape-params');\n const mode = element.getAttribute('data-mode');\n const {\n instruments, division, locale, size, motion,\n } = JSON.parse(params as string);\n\n const isParamError = validateToolParams({\n division, locale, graphqlUrl, liveRatesUrl, instruments,\n }, [{\n name: 'locale',\n valueCheck: (value) => validateLocale(value),\n }, {\n name: 'division',\n valueCheck: (value) => Object.values(Division).includes(value),\n }, {\n name: 'instruments',\n valueCheck: (value) => value.length > 0 && value.length <= 10,\n }, {\n name: 'graphqlUrl',\n }, {\n name: 'liveRatesUrl',\n }]);\n\n root.render(\n <TickerTapeWidget\n graphqlUrl={graphqlUrl}\n liveRatesUrl={liveRatesUrl}\n division={division}\n instruments={instruments}\n locale={locale}\n theme={mode as Theme}\n isParamError={isParamError}\n size={size}\n motion={motion}\n />,\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAAgBC,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AACrF,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,MAAM;EACJC,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A,QAAS;IACnBD,WAAW,EAAEA,WAAY;IACzBE,MAAM,EAAEA,MAAO;IACfe,KAAK,EAAElB,IAAc;IACrBQ,YAAY,EAAEA,YAAa;IAC3BJ,IAAI,EAAEA,IAAK;IACXC,MAAM,EAAEA;EAAO,CAChB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["Locale","Division"],"sources":["../../../src/TickerTapeWidget/types.
|
|
1
|
+
{"version":3,"file":"types.js","names":["Locale","Division"],"sources":["../../../src/TickerTapeWidget/types.ts"],"sourcesContent":["import { Locale } from '@oanda/mono-i18n';\nimport { DataRecord, Theme, WidgetSize } from '@oanda/labs-widget-common';\nimport { Division } from '../gql/types/graphql';\n\nexport { Locale } from '@oanda/mono-i18n';\nexport { Division } from '../gql/types/graphql';\n\nexport interface TickerTapeConfig {\n graphqlUrl: string;\n division: Division;\n liveRatesUrl: string;\n instruments: string[];\n locale: Locale;\n theme?: Theme;\n isParamError?: boolean;\n removePadding?: boolean;\n size?: WidgetSize;\n motion?: Motion;\n}\n\nexport interface ValidationWrapperProps {\n instruments: string[];\n division: Division;\n size?: WidgetSize;\n motion?: Motion;\n isParamError?: boolean;\n}\n\nexport interface MainProps {\n records: DataRecord[];\n division: Division;\n size?: WidgetSize;\n motion?: Motion;\n}\n\ntype Motion = 'linear' | 'none';\n"],"mappings":"AAIA,SAASA,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,sBAAsB","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MainProps } from './types';
|
|
3
|
-
declare const Main: ({ records, division, size: widgetSize, }: MainProps) => React.JSX.Element;
|
|
3
|
+
declare const Main: ({ records, division, size: widgetSize, motion, }: MainProps) => React.JSX.Element;
|
|
4
4
|
export { Main };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TickerTapeConfig } from './types';
|
|
3
|
-
declare const TickerTapeWidget: ({ graphqlUrl, liveRatesUrl, instruments, division, locale, theme, isParamError, removePadding, size, }: TickerTapeConfig) => React.JSX.Element;
|
|
3
|
+
declare const TickerTapeWidget: ({ graphqlUrl, liveRatesUrl, instruments, division, locale, theme, isParamError, removePadding, size, motion, }: TickerTapeConfig) => React.JSX.Element;
|
|
4
4
|
export { TickerTapeWidget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ValidationWrapperProps } from './types';
|
|
3
|
-
declare const ValidationWrapper: ({ instruments, division, size: widgetSize, isParamError, }: ValidationWrapperProps) => React.JSX.Element;
|
|
3
|
+
declare const ValidationWrapper: ({ instruments, division, size: widgetSize, motion, isParamError, }: ValidationWrapperProps) => React.JSX.Element;
|
|
4
4
|
export { ValidationWrapper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MarqueeWrapper';
|
|
@@ -13,15 +13,19 @@ export interface TickerTapeConfig {
|
|
|
13
13
|
isParamError?: boolean;
|
|
14
14
|
removePadding?: boolean;
|
|
15
15
|
size?: WidgetSize;
|
|
16
|
+
motion?: Motion;
|
|
16
17
|
}
|
|
17
18
|
export interface ValidationWrapperProps {
|
|
18
19
|
instruments: string[];
|
|
19
20
|
division: Division;
|
|
20
21
|
size?: WidgetSize;
|
|
22
|
+
motion?: Motion;
|
|
21
23
|
isParamError?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export interface MainProps {
|
|
24
26
|
records: DataRecord[];
|
|
25
27
|
division: Division;
|
|
26
28
|
size?: WidgetSize;
|
|
29
|
+
motion?: Motion;
|
|
27
30
|
}
|
|
31
|
+
type Motion = 'linear' | 'none';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-ticker-tape-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Labs Ticker Tape 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.162",
|
|
16
16
|
"@oanda/mono-i18n": "10.0.1",
|
|
17
17
|
"graphql": "16.8.1",
|
|
18
18
|
"react-fast-marquee": "1.6.5"
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"@graphql-codegen/cli": "5.0.0",
|
|
22
22
|
"@graphql-codegen/client-preset": "4.1.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "0a8efff3797129e4f87075733f6074e16938ae39"
|
|
25
25
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import Marquee from 'react-fast-marquee';
|
|
3
2
|
import classnames from 'classnames';
|
|
4
3
|
import { Tooltip, useLiveRatesQuery } from '@oanda/labs-widget-common';
|
|
5
4
|
import { MainProps } from './types';
|
|
6
5
|
import { INSTRUMENT_TOOLTIP_ID } from './constant';
|
|
7
6
|
import { InstrumentRateWithData } from './components/InstrumentRateWithData';
|
|
7
|
+
import { MarqueeWrapper } from './components/MarqueeWrapper';
|
|
8
8
|
|
|
9
9
|
const Main = ({
|
|
10
10
|
records,
|
|
11
11
|
division,
|
|
12
12
|
size: widgetSize = 'fullWithChart',
|
|
13
|
+
motion = 'linear',
|
|
13
14
|
}: MainProps) => {
|
|
14
15
|
const { target, setQuery } = useLiveRatesQuery();
|
|
15
16
|
|
|
@@ -23,19 +24,15 @@ const Main = ({
|
|
|
23
24
|
}, [records]);
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
|
-
<div data-testid="ticker-tape-wrapper">
|
|
27
|
-
<
|
|
28
|
-
play={records.length > 0}
|
|
29
|
-
autoFill
|
|
30
|
-
pauseOnHover
|
|
31
|
-
speed={60}
|
|
32
|
-
>
|
|
27
|
+
<div data-testid="ticker-tape-wrapper" className="lw-flex">
|
|
28
|
+
<MarqueeWrapper shouldPlay={records.length > 0} isStatic={motion === 'none'}>
|
|
33
29
|
{records.map((record) => (
|
|
34
30
|
<div
|
|
35
31
|
key={record.instrument}
|
|
36
32
|
className={classnames('lw-flex lw-border lw-border-r-0 lw-border-solid lw-border-border-primary lw-px-4 lw-text-sm lw-tracking-normal lw-text-text-primary', {
|
|
37
33
|
'lw-h-[82px]': widgetSize !== 'compact',
|
|
38
34
|
'lw-h-[54px]': widgetSize === 'compact',
|
|
35
|
+
'lw-w-fit last:lw-border-r': motion === 'none',
|
|
39
36
|
})}
|
|
40
37
|
>
|
|
41
38
|
<InstrumentRateWithData
|
|
@@ -46,7 +43,7 @@ const Main = ({
|
|
|
46
43
|
/>
|
|
47
44
|
</div>
|
|
48
45
|
))}
|
|
49
|
-
</
|
|
46
|
+
</MarqueeWrapper>
|
|
50
47
|
<Tooltip id={INSTRUMENT_TOOLTIP_ID} />
|
|
51
48
|
</div>
|
|
52
49
|
);
|
|
@@ -16,6 +16,7 @@ const TickerTapeWidget = ({
|
|
|
16
16
|
isParamError,
|
|
17
17
|
removePadding,
|
|
18
18
|
size,
|
|
19
|
+
motion,
|
|
19
20
|
}: TickerTapeConfig) => {
|
|
20
21
|
const client = new ApolloClient({
|
|
21
22
|
uri: graphqlUrl,
|
|
@@ -33,9 +34,10 @@ const TickerTapeWidget = ({
|
|
|
33
34
|
>
|
|
34
35
|
<ApolloProvider client={client}>
|
|
35
36
|
<Suspense>
|
|
36
|
-
<ThemeProvider removePadding={removePadding} theme={theme}>
|
|
37
|
+
<ThemeProvider removePadding={removePadding} theme={theme} fitContent={motion === 'none'}>
|
|
37
38
|
<ValidationWrapper
|
|
38
39
|
size={size}
|
|
40
|
+
motion={motion}
|
|
39
41
|
instruments={instruments}
|
|
40
42
|
division={division}
|
|
41
43
|
isParamError={isParamError}
|
|
@@ -12,6 +12,7 @@ const ValidationWrapper = ({
|
|
|
12
12
|
instruments,
|
|
13
13
|
division,
|
|
14
14
|
size: widgetSize,
|
|
15
|
+
motion,
|
|
15
16
|
isParamError,
|
|
16
17
|
}: ValidationWrapperProps) => {
|
|
17
18
|
const { size } = useContext(ThemeContext);
|
|
@@ -36,6 +37,7 @@ const ValidationWrapper = ({
|
|
|
36
37
|
size={widgetSize}
|
|
37
38
|
division={division}
|
|
38
39
|
records={getRecords(data!)!}
|
|
40
|
+
motion={motion}
|
|
39
41
|
/>
|
|
40
42
|
)}
|
|
41
43
|
{showError && (
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Marquee from 'react-fast-marquee';
|
|
3
|
+
import { MarqueeWrapperProps } from './types';
|
|
4
|
+
|
|
5
|
+
const MarqueeWrapper = ({
|
|
6
|
+
children,
|
|
7
|
+
shouldPlay,
|
|
8
|
+
isStatic,
|
|
9
|
+
}: MarqueeWrapperProps) => (
|
|
10
|
+
<>
|
|
11
|
+
{!isStatic ? (
|
|
12
|
+
<Marquee
|
|
13
|
+
play={shouldPlay}
|
|
14
|
+
autoFill
|
|
15
|
+
pauseOnHover
|
|
16
|
+
speed={60}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</Marquee>
|
|
20
|
+
) : children}
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export { MarqueeWrapper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MarqueeWrapper';
|
|
@@ -16,7 +16,7 @@ dataTickerTapeParamsElements.forEach((element) => {
|
|
|
16
16
|
const params = element.getAttribute('data-ticker-tape-params');
|
|
17
17
|
const mode = element.getAttribute('data-mode');
|
|
18
18
|
const {
|
|
19
|
-
instruments, division, locale, size,
|
|
19
|
+
instruments, division, locale, size, motion,
|
|
20
20
|
} = JSON.parse(params as string);
|
|
21
21
|
|
|
22
22
|
const isParamError = validateToolParams({
|
|
@@ -46,6 +46,7 @@ dataTickerTapeParamsElements.forEach((element) => {
|
|
|
46
46
|
theme={mode as Theme}
|
|
47
47
|
isParamError={isParamError}
|
|
48
48
|
size={size}
|
|
49
|
+
motion={motion}
|
|
49
50
|
/>,
|
|
50
51
|
);
|
|
51
52
|
});
|
|
@@ -15,15 +15,22 @@ export interface TickerTapeConfig {
|
|
|
15
15
|
isParamError?: boolean;
|
|
16
16
|
removePadding?: boolean;
|
|
17
17
|
size?: WidgetSize;
|
|
18
|
+
motion?: Motion;
|
|
18
19
|
}
|
|
20
|
+
|
|
19
21
|
export interface ValidationWrapperProps {
|
|
20
22
|
instruments: string[];
|
|
21
23
|
division: Division;
|
|
22
24
|
size?: WidgetSize;
|
|
25
|
+
motion?: Motion;
|
|
23
26
|
isParamError?: boolean;
|
|
24
27
|
}
|
|
28
|
+
|
|
25
29
|
export interface MainProps {
|
|
26
30
|
records: DataRecord[];
|
|
27
31
|
division: Division;
|
|
28
32
|
size?: WidgetSize;
|
|
33
|
+
motion?: Motion;
|
|
29
34
|
}
|
|
35
|
+
|
|
36
|
+
type Motion = 'linear' | 'none';
|