@oanda/labs-instrument-live-rate-widget 1.0.33 → 1.0.35
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 +284 -0
- package/dist/main/InstrumentLiveRateWidget/InstrumentLiveRateWidget.js +27 -27
- package/dist/main/InstrumentLiveRateWidget/InstrumentLiveRateWidget.js.map +1 -1
- package/dist/main/InstrumentLiveRateWidget/Main.js +5 -5
- package/dist/main/InstrumentLiveRateWidget/Main.js.map +1 -1
- package/dist/main/InstrumentLiveRateWidget/ValidationWrapper.js +6 -8
- package/dist/main/InstrumentLiveRateWidget/ValidationWrapper.js.map +1 -1
- package/dist/main/InstrumentLiveRateWidget/constant.js.map +1 -1
- package/dist/main/InstrumentLiveRateWidget/render.js +7 -7
- package/dist/main/InstrumentLiveRateWidget/render.js.map +1 -1
- package/dist/main/InstrumentLiveRateWidget/types.js +1 -1
- package/dist/main/InstrumentLiveRateWidget/types.js.map +1 -1
- package/dist/main/InstrumentLiveRateWidget/utils.js +1 -1
- package/dist/main/InstrumentLiveRateWidget/utils.js.map +1 -1
- package/dist/main/gql/types/fragment-masking.js.map +1 -1
- package/dist/main/gql/types/gql.js +2 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +142 -142
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/gql/types/index.js.map +1 -1
- package/dist/main/index.js +8 -8
- package/dist/main/index.js.map +1 -1
- package/dist/main/translations/index.js +1 -1
- package/dist/main/translations/index.js.map +1 -1
- package/dist/main/translations/translations.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/InstrumentLiveRateWidget.js +28 -27
- package/dist/module/InstrumentLiveRateWidget/InstrumentLiveRateWidget.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/Main.js +5 -5
- package/dist/module/InstrumentLiveRateWidget/Main.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/ValidationWrapper.js +6 -6
- package/dist/module/InstrumentLiveRateWidget/ValidationWrapper.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/constant.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/render.js +7 -7
- package/dist/module/InstrumentLiveRateWidget/render.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/types.js +1 -1
- package/dist/module/InstrumentLiveRateWidget/types.js.map +1 -1
- package/dist/module/InstrumentLiveRateWidget/utils.js +1 -1
- package/dist/module/InstrumentLiveRateWidget/utils.js.map +1 -1
- package/dist/module/gql/types/fragment-masking.js.map +1 -1
- package/dist/module/gql/types/gql.js +2 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +142 -142
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/gql/types/index.js +2 -2
- package/dist/module/gql/types/index.js.map +1 -1
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/translations/index.js +1 -1
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/types/InstrumentLiveRateWidget/InstrumentLiveRateWidget.d.ts +1 -1
- package/dist/types/InstrumentLiveRateWidget/Main.d.ts +1 -1
- package/dist/types/InstrumentLiveRateWidget/ValidationWrapper.d.ts +1 -1
- package/dist/types/InstrumentLiveRateWidget/constant.d.ts +1 -1
- package/dist/types/InstrumentLiveRateWidget/types.d.ts +3 -3
- package/dist/types/InstrumentLiveRateWidget/utils.d.ts +3 -3
- package/dist/types/gql/types/gql.d.ts +4 -4
- package/dist/types/gql/types/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/translations/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/InstrumentLiveRateWidget/InstrumentLiveRateWidget.tsx +32 -30
- package/src/InstrumentLiveRateWidget/Main.tsx +12 -8
- package/src/InstrumentLiveRateWidget/ValidationWrapper.tsx +33 -29
- package/src/InstrumentLiveRateWidget/constant.ts +1 -3
- package/src/InstrumentLiveRateWidget/render.tsx +44 -31
- package/src/InstrumentLiveRateWidget/types.tsx +8 -3
- package/src/InstrumentLiveRateWidget/utils.ts +16 -16
- package/src/gql/types/fragment-masking.ts +41 -21
- package/src/gql/types/gql.ts +12 -5
- package/src/gql/types/graphql.ts +214 -50
- package/src/gql/types/index.ts +2 -2
- package/src/index.ts +1 -1
- package/src/translations/index.ts +4 -4
- package/src/translations/translations.ts +2 -1
- package/test/Main.test.tsx +21 -15
- package/test/mocks.ts +1 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { LiveRatesProvider, ThemeProvider, getLocale, renderComponent } from '@oanda/labs-widget-common';
|
|
1
|
+
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
|
2
|
+
import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import { translations } from '../translations';
|
|
6
5
|
import { Division } from './types';
|
|
7
6
|
import { ValidationWrapper } from './ValidationWrapper';
|
|
@@ -24,30 +23,32 @@ const InstrumentLiveRateWidget = _ref => {
|
|
|
24
23
|
});
|
|
25
24
|
const divisionCode = division === Division.Opt ? Division.Ogm : division;
|
|
26
25
|
const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';
|
|
27
|
-
return React.createElement(
|
|
28
|
-
|
|
26
|
+
return React.createElement(WidgetProvider, {
|
|
27
|
+
withSuspense: true,
|
|
28
|
+
client: client,
|
|
29
|
+
liveRates: {
|
|
30
|
+
url: liveRatesUrl,
|
|
31
|
+
options: {
|
|
32
|
+
divisionCode,
|
|
33
|
+
dataSource
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
locale: locale,
|
|
37
|
+
styling: {
|
|
38
|
+
removePadding
|
|
39
|
+
},
|
|
40
|
+
theme: theme,
|
|
29
41
|
translations: translations
|
|
30
|
-
}, React.createElement(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
theme: theme
|
|
41
|
-
}, renderComponent({
|
|
42
|
-
Component: React.createElement(ValidationWrapper, {
|
|
43
|
-
size: size,
|
|
44
|
-
instrument: instrument,
|
|
45
|
-
division: division,
|
|
46
|
-
isParamError: isParamError
|
|
47
|
-
}),
|
|
48
|
-
logoLink,
|
|
49
|
-
linkArea: 'full'
|
|
50
|
-
}))))));
|
|
42
|
+
}, React.createElement(WidgetWrapper, {
|
|
43
|
+
isParamError: isParamError,
|
|
44
|
+
linkArea: "full",
|
|
45
|
+
logoLink: logoLink
|
|
46
|
+
}, React.createElement(ValidationWrapper, {
|
|
47
|
+
division: division,
|
|
48
|
+
instrument: instrument,
|
|
49
|
+
isParamError: isParamError,
|
|
50
|
+
size: size
|
|
51
|
+
})));
|
|
51
52
|
};
|
|
52
53
|
export { InstrumentLiveRateWidget };
|
|
53
54
|
//# sourceMappingURL=InstrumentLiveRateWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstrumentLiveRateWidget.js","names":["
|
|
1
|
+
{"version":3,"file":"InstrumentLiveRateWidget.js","names":["ApolloClient","InMemoryCache","WidgetProvider","WidgetWrapper","React","translations","Division","ValidationWrapper","InstrumentLiveRateWidget","_ref","graphqlUrl","liveRatesUrl","instrument","division","locale","theme","isParamError","removePadding","size","logoLink","client","uri","cache","divisionCode","Opt","Ogm","dataSource","createElement","withSuspense","liveRates","url","options","styling","linkArea"],"sources":["../../../src/InstrumentLiveRateWidget/InstrumentLiveRateWidget.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 type { InstrumentLiveRateConfig } from './types';\nimport { Division } from './types';\nimport { ValidationWrapper } from './ValidationWrapper';\n\nconst InstrumentLiveRateWidget = ({\n graphqlUrl,\n liveRatesUrl,\n instrument,\n division,\n locale,\n theme,\n isParamError,\n removePadding,\n size,\n logoLink,\n}: InstrumentLiveRateConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n const divisionCode = division === Division.Opt ? Division.Ogm : division;\n const dataSource = divisionCode === Division.Ogm ? 'MT5' : 'V20';\n\n return (\n <WidgetProvider\n withSuspense\n client={client}\n liveRates={{\n url: liveRatesUrl,\n options: { divisionCode, dataSource },\n }}\n locale={locale}\n styling={{\n removePadding,\n }}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper\n isParamError={isParamError}\n linkArea=\"full\"\n logoLink={logoLink}\n >\n <ValidationWrapper\n division={division}\n instrument={instrument}\n isParamError={isParamError}\n size={size}\n />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { InstrumentLiveRateWidget };\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;AAE9C,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,MAAMC,wBAAwB,GAAGC,IAAA,IAWD;EAAA,IAXE;IAChCC,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,IAAI;IACJC;EACwB,CAAC,GAAAV,IAAA;EACzB,MAAMW,MAAM,GAAG,IAAIpB,YAAY,CAAC;IAC9BqB,GAAG,EAAEX,UAAU;IACfY,KAAK,EAAE,IAAIrB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,MAAMsB,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,OACErB,KAAA,CAAAuB,aAAA,CAACzB,cAAc;IACb0B,YAAY;IACZR,MAAM,EAAEA,MAAO;IACfS,SAAS,EAAE;MACTC,GAAG,EAAEnB,YAAY;MACjBoB,OAAO,EAAE;QAAER,YAAY;QAAEG;MAAW;IACtC,CAAE;IACFZ,MAAM,EAAEA,MAAO;IACfkB,OAAO,EAAE;MACPf;IACF,CAAE;IACFF,KAAK,EAAEA,KAAM;IACbV,YAAY,EAAEA;EAAa,GAE3BD,KAAA,CAAAuB,aAAA,CAACxB,aAAa;IACZa,YAAY,EAAEA,YAAa;IAC3BiB,QAAQ,EAAC,MAAM;IACfd,QAAQ,EAAEA;EAAS,GAEnBf,KAAA,CAAAuB,aAAA,CAACpB,iBAAiB;IAChBM,QAAQ,EAAEA,QAAS;IACnBD,UAAU,EAAEA,UAAW;IACvBI,YAAY,EAAEA,YAAa;IAC3BE,IAAI,EAAEA;EAAK,CACZ,CACY,CACD,CAAC;AAErB,CAAC;AAED,SAASV,wBAAwB","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
1
|
import { useBackgroundQuery } from '@apollo/client';
|
|
3
2
|
import { InstrumentRateWithChart, Tooltip, useLiveRatesQuery } from '@oanda/labs-widget-common';
|
|
4
|
-
import {
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
5
4
|
import { getInstrumentsChart } from '../gql/getInstrumentsChart';
|
|
5
|
+
import { INSTRUMENT_TOOLTIP_ID } from './constant';
|
|
6
6
|
const Main = _ref => {
|
|
7
7
|
let {
|
|
8
8
|
division,
|
|
@@ -30,11 +30,11 @@ const Main = _ref => {
|
|
|
30
30
|
}
|
|
31
31
|
}, [record]);
|
|
32
32
|
return React.createElement("div", null, React.createElement(InstrumentRateWithChart, {
|
|
33
|
+
queryRef: queryRef,
|
|
33
34
|
record: record,
|
|
34
|
-
target: target,
|
|
35
35
|
size: widgetSize,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
target: target,
|
|
37
|
+
tooltipId: INSTRUMENT_TOOLTIP_ID
|
|
38
38
|
}), React.createElement(Tooltip, {
|
|
39
39
|
id: INSTRUMENT_TOOLTIP_ID
|
|
40
40
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","names":["
|
|
1
|
+
{"version":3,"file":"Main.js","names":["useBackgroundQuery","InstrumentRateWithChart","Tooltip","useLiveRatesQuery","React","useEffect","getInstrumentsChart","INSTRUMENT_TOOLTIP_ID","Main","_ref","division","size","widgetSize","record","hasInstrument","instrument","queryRef","variables","instruments","fetchPolicy","skip","target","setQuery","createElement","tooltipId","id"],"sources":["../../../src/InstrumentLiveRateWidget/Main.tsx"],"sourcesContent":["import { useBackgroundQuery } from '@apollo/client';\nimport {\n InstrumentRateWithChart,\n Tooltip,\n useLiveRatesQuery,\n} from '@oanda/labs-widget-common';\nimport React, { useEffect } from 'react';\n\nimport { getInstrumentsChart } from '../gql/getInstrumentsChart';\nimport type {\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables,\n} from '../gql/types/graphql';\nimport { INSTRUMENT_TOOLTIP_ID } from './constant';\nimport type { MainProps } from './types';\n\nconst Main = ({\n division,\n size: widgetSize = 'fullWithChart',\n record,\n}: MainProps) => {\n const hasInstrument = !!record.instrument;\n\n const [queryRef] = useBackgroundQuery<\n GetInstrumentsChartQuery,\n GetInstrumentsChartQueryVariables\n >(getInstrumentsChart, {\n variables: {\n instruments: [record.instrument],\n division,\n },\n fetchPolicy: 'network-only',\n skip: !hasInstrument,\n });\n\n const { target, setQuery } = useLiveRatesQuery();\n\n useEffect(() => {\n if (hasInstrument) {\n setQuery({ instruments: [record?.instrument] });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [record]);\n\n return (\n <div>\n <InstrumentRateWithChart<GetInstrumentsChartQuery>\n queryRef={queryRef}\n record={record}\n size={widgetSize}\n target={target}\n tooltipId={INSTRUMENT_TOOLTIP_ID}\n />\n <Tooltip id={INSTRUMENT_TOOLTIP_ID} />\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,gBAAgB;AACnD,SACEC,uBAAuB,EACvBC,OAAO,EACPC,iBAAiB,QACZ,2BAA2B;AAClC,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AAExC,SAASC,mBAAmB,QAAQ,4BAA4B;AAKhE,SAASC,qBAAqB,QAAQ,YAAY;AAGlD,MAAMC,IAAI,GAAGC,IAAA,IAII;EAAA,IAJH;IACZC,QAAQ;IACRC,IAAI,EAAEC,UAAU,GAAG,eAAe;IAClCC;EACS,CAAC,GAAAJ,IAAA;EACV,MAAMK,aAAa,GAAG,CAAC,CAACD,MAAM,CAACE,UAAU;EAEzC,MAAM,CAACC,QAAQ,CAAC,GAAGhB,kBAAkB,CAGnCM,mBAAmB,EAAE;IACrBW,SAAS,EAAE;MACTC,WAAW,EAAE,CAACL,MAAM,CAACE,UAAU,CAAC;MAChCL;IACF,CAAC;IACDS,WAAW,EAAE,cAAc;IAC3BC,IAAI,EAAE,CAACN;EACT,CAAC,CAAC;EAEF,MAAM;IAAEO,MAAM;IAAEC;EAAS,CAAC,GAAGnB,iBAAiB,CAAC,CAAC;EAEhDE,SAAS,CAAC,MAAM;IACd,IAAIS,aAAa,EAAE;MACjBQ,QAAQ,CAAC;QAAEJ,WAAW,EAAE,CAACL,MAAM,EAAEE,UAAU;MAAE,CAAC,CAAC;IACjD;EAEF,CAAC,EAAE,CAACF,MAAM,CAAC,CAAC;EAEZ,OACET,KAAA,CAAAmB,aAAA,cACEnB,KAAA,CAAAmB,aAAA,CAACtB,uBAAuB;IACtBe,QAAQ,EAAEA,QAAS;IACnBH,MAAM,EAAEA,MAAO;IACfF,IAAI,EAAEC,UAAW;IACjBS,MAAM,EAAEA,MAAO;IACfG,SAAS,EAAEjB;EAAsB,CAClC,CAAC,EACFH,KAAA,CAAAmB,aAAA,CAACrB,OAAO;IAACuB,EAAE,EAAElB;EAAsB,CAAE,CAClC,CAAC;AAEV,CAAC;AAED,SAASC,IAAI","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
1
|
import { useSuspenseQuery } from '@apollo/client';
|
|
2
|
+
import { Error, useLayoutProvider } from '@oanda/labs-widget-common';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import
|
|
5
|
-
import { getRecords } from './utils';
|
|
4
|
+
import React from 'react';
|
|
6
5
|
import { validateInstruments } from '../gql/validateInstruments';
|
|
7
6
|
import { Main } from './Main';
|
|
7
|
+
import { getRecords } from './utils';
|
|
8
8
|
const ValidationWrapper = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
instrument,
|
|
@@ -14,7 +14,7 @@ const ValidationWrapper = _ref => {
|
|
|
14
14
|
} = _ref;
|
|
15
15
|
const {
|
|
16
16
|
size
|
|
17
|
-
} =
|
|
17
|
+
} = useLayoutProvider();
|
|
18
18
|
const {
|
|
19
19
|
data,
|
|
20
20
|
error
|
|
@@ -35,9 +35,9 @@ const ValidationWrapper = _ref => {
|
|
|
35
35
|
'lw-h-[54px]': widgetSize === 'compact'
|
|
36
36
|
})
|
|
37
37
|
}, React.createElement(Main, {
|
|
38
|
-
size: widgetSize,
|
|
39
38
|
division: division,
|
|
40
|
-
record: getRecords(data)?.[0]
|
|
39
|
+
record: getRecords(data)?.[0],
|
|
40
|
+
size: widgetSize
|
|
41
41
|
})), showError && React.createElement("div", {
|
|
42
42
|
className: classnames('lw-flex lw-w-full lw-items-center', {
|
|
43
43
|
'lw-h-[82px]': widgetSize !== 'compact',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationWrapper.js","names":["
|
|
1
|
+
{"version":3,"file":"ValidationWrapper.js","names":["useSuspenseQuery","Error","useLayoutProvider","classnames","React","validateInstruments","Main","getRecords","ValidationWrapper","_ref","instrument","division","size","widgetSize","isParamError","data","error","variables","instruments","fetchPolicy","errorPolicy","showError","createElement","Fragment","className","record"],"sources":["../../../src/InstrumentLiveRateWidget/ValidationWrapper.tsx"],"sourcesContent":["import { useSuspenseQuery } from '@apollo/client';\nimport { Error, useLayoutProvider } from '@oanda/labs-widget-common';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport type {\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables,\n} from '../gql/types/graphql';\nimport { validateInstruments } from '../gql/validateInstruments';\nimport { Main } from './Main';\nimport type { ValidationWrapperProps } from './types';\nimport { getRecords } from './utils';\n\nconst ValidationWrapper = ({\n instrument,\n division,\n size: widgetSize,\n isParamError,\n}: ValidationWrapperProps) => {\n const { size } = useLayoutProvider();\n const { data, error } = useSuspenseQuery<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n >(validateInstruments, {\n variables: {\n instruments: [instrument],\n division,\n },\n fetchPolicy: 'network-only',\n errorPolicy: 'all',\n });\n\n const showError = !!error || isParamError;\n\n return (\n <>\n {size && (\n <div className=\"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 {!showError && (\n <div\n className={classnames({\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n })}\n >\n <Main\n division={division}\n record={getRecords(data!)?.[0]!}\n size={widgetSize}\n />\n </div>\n )}\n {showError && (\n <div\n className={classnames('lw-flex lw-w-full lw-items-center', {\n 'lw-h-[82px]': widgetSize !== 'compact',\n 'lw-h-[54px]': widgetSize === 'compact',\n })}\n >\n <Error />\n </div>\n )}\n </div>\n )}\n </>\n );\n};\n\nexport { ValidationWrapper };\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,KAAK,EAAEC,iBAAiB,QAAQ,2BAA2B;AACpE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAMzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,SAASC,IAAI,QAAQ,QAAQ;AAE7B,SAASC,UAAU,QAAQ,SAAS;AAEpC,MAAMC,iBAAiB,GAAGC,IAAA,IAKI;EAAA,IALH;IACzBC,UAAU;IACVC,QAAQ;IACRC,IAAI,EAAEC,UAAU;IAChBC;EACsB,CAAC,GAAAL,IAAA;EACvB,MAAM;IAAEG;EAAK,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EACpC,MAAM;IAAEa,IAAI;IAAEC;EAAM,CAAC,GAAGhB,gBAAgB,CAGtCK,mBAAmB,EAAE;IACrBY,SAAS,EAAE;MACTC,WAAW,EAAE,CAACR,UAAU,CAAC;MACzBC;IACF,CAAC;IACDQ,WAAW,EAAE,cAAc;IAC3BC,WAAW,EAAE;EACf,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAG,CAAC,CAACL,KAAK,IAAIF,YAAY;EAEzC,OACEV,KAAA,CAAAkB,aAAA,CAAAlB,KAAA,CAAAmB,QAAA,QACGX,IAAI,IACHR,KAAA,CAAAkB,aAAA;IAAKE,SAAS,EAAC;EAAuH,GACnI,CAACH,SAAS,IACTjB,KAAA,CAAAkB,aAAA;IACEE,SAAS,EAAErB,UAAU,CAAC;MACpB,aAAa,EAAEU,UAAU,KAAK,SAAS;MACvC,aAAa,EAAEA,UAAU,KAAK;IAChC,CAAC;EAAE,GAEHT,KAAA,CAAAkB,aAAA,CAAChB,IAAI;IACHK,QAAQ,EAAEA,QAAS;IACnBc,MAAM,EAAElB,UAAU,CAACQ,IAAK,CAAC,GAAG,CAAC,CAAG;IAChCH,IAAI,EAAEC;EAAW,CAClB,CACE,CACN,EACAQ,SAAS,IACRjB,KAAA,CAAAkB,aAAA;IACEE,SAAS,EAAErB,UAAU,CAAC,mCAAmC,EAAE;MACzD,aAAa,EAAEU,UAAU,KAAK,SAAS;MACvC,aAAa,EAAEA,UAAU,KAAK;IAChC,CAAC;EAAE,GAEHT,KAAA,CAAAkB,aAAA,CAACrB,KAAK,MAAE,CACL,CAEJ,CAEP,CAAC;AAEP,CAAC;AAED,SAASO,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","names":["INSTRUMENT_TOOLTIP_ID"],"sources":["../../../src/InstrumentLiveRateWidget/constant.ts"],"sourcesContent":["const INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';\n\nexport {
|
|
1
|
+
{"version":3,"file":"constant.js","names":["INSTRUMENT_TOOLTIP_ID"],"sources":["../../../src/InstrumentLiveRateWidget/constant.ts"],"sourcesContent":["const INSTRUMENT_TOOLTIP_ID = 'instrument_tooltip_id';\n\nexport { INSTRUMENT_TOOLTIP_ID };\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAG,uBAAuB;AAErD,SAASA,qBAAqB","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
import { InstrumentLiveRateWidget } from './InstrumentLiveRateWidget';
|
|
5
4
|
import { Division } from '../gql/types/graphql';
|
|
5
|
+
import { InstrumentLiveRateWidget } from './InstrumentLiveRateWidget';
|
|
6
6
|
const {
|
|
7
7
|
graphqlUrl,
|
|
8
8
|
liveRatesUrl
|
|
@@ -39,14 +39,14 @@ instrumentLiveRateElements.forEach(element => {
|
|
|
39
39
|
name: 'liveRatesUrl'
|
|
40
40
|
}]);
|
|
41
41
|
root.render(React.createElement(InstrumentLiveRateWidget, {
|
|
42
|
-
graphqlUrl: graphqlUrl,
|
|
43
|
-
liveRatesUrl: liveRatesUrl,
|
|
44
42
|
division: division,
|
|
43
|
+
graphqlUrl: graphqlUrl,
|
|
45
44
|
instrument: instrument,
|
|
46
|
-
locale: locale,
|
|
47
|
-
theme: mode,
|
|
48
45
|
isParamError: isParamError,
|
|
49
|
-
|
|
46
|
+
liveRatesUrl: liveRatesUrl,
|
|
47
|
+
locale: locale,
|
|
48
|
+
size: size,
|
|
49
|
+
theme: mode
|
|
50
50
|
}));
|
|
51
51
|
});
|
|
52
52
|
//# sourceMappingURL=render.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","names":["
|
|
1
|
+
{"version":3,"file":"render.js","names":["validateLocale","validateToolParams","React","createRoot","Division","InstrumentLiveRateWidget","graphqlUrl","liveRatesUrl","window","widgetsConfig","instrumentLiveRateElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","instrument","division","locale","size","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","length","render","createElement","theme"],"sources":["../../../src/InstrumentLiveRateWidget/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 { Division } from '../gql/types/graphql';\nimport { InstrumentLiveRateWidget } from './InstrumentLiveRateWidget';\n\nconst { graphqlUrl, liveRatesUrl } = window.widgetsConfig || {};\n\nconst instrumentLiveRateElements = document.querySelectorAll(\n 'div[data-instrument-live-rate-params]'\n);\n\ninstrumentLiveRateElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-instrument-live-rate-params');\n const mode = element.getAttribute('data-mode');\n const { instrument, division, locale, size } = JSON.parse(params as string);\n\n const isParamError = validateToolParams(\n {\n division,\n locale,\n instrument,\n graphqlUrl,\n liveRatesUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'division',\n valueCheck: (value: Division) =>\n Object.values(Division).includes(value),\n },\n {\n name: 'instrument',\n valueCheck: (value) => (value as string).length > 0,\n },\n {\n name: 'graphqlUrl',\n },\n {\n name: 'liveRatesUrl',\n },\n ]\n );\n\n root.render(\n <InstrumentLiveRateWidget\n division={division}\n graphqlUrl={graphqlUrl}\n instrument={instrument}\n isParamError={isParamError}\n liveRatesUrl={liveRatesUrl}\n locale={locale}\n size={size}\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,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,wBAAwB,QAAQ,4BAA4B;AAErE,MAAM;EAAEC,UAAU;EAAEC;AAAa,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAE/D,MAAMC,0BAA0B,GAAGC,QAAQ,CAACC,gBAAgB,CAC1D,uCACF,CAAC;AAEDF,0BAA0B,CAACG,OAAO,CAAEC,OAAO,IAAK;EAC9C,MAAMC,IAAI,GAAGZ,UAAU,CAACW,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,kCAAkC,CAAC;EACvE,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,UAAU;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAK,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACR,MAAgB,CAAC;EAE3E,MAAMS,YAAY,GAAGxB,kBAAkB,CACrC;IACEmB,QAAQ;IACRC,MAAM;IACNF,UAAU;IACVb,UAAU;IACVC;EACF,CAAC,EACD,CACE;IACEmB,IAAI,EAAE,QAAQ;IACdC,UAAU,EAAGC,KAAyB,IAAK5B,cAAc,CAAC4B,KAAK;EACjE,CAAC,EACD;IACEF,IAAI,EAAE,UAAU;IAChBC,UAAU,EAAGC,KAAe,IAC1BC,MAAM,CAACC,MAAM,CAAC1B,QAAQ,CAAC,CAAC2B,QAAQ,CAACH,KAAK;EAC1C,CAAC,EACD;IACEF,IAAI,EAAE,YAAY;IAClBC,UAAU,EAAGC,KAAK,IAAMA,KAAK,CAAYI,MAAM,GAAG;EACpD,CAAC,EACD;IACEN,IAAI,EAAE;EACR,CAAC,EACD;IACEA,IAAI,EAAE;EACR,CAAC,CAEL,CAAC;EAEDX,IAAI,CAACkB,MAAM,CACT/B,KAAA,CAAAgC,aAAA,CAAC7B,wBAAwB;IACvBe,QAAQ,EAAEA,QAAS;IACnBd,UAAU,EAAEA,UAAW;IACvBa,UAAU,EAAEA,UAAW;IACvBM,YAAY,EAAEA,YAAa;IAC3BlB,YAAY,EAAEA,YAAa;IAC3Bc,MAAM,EAAEA,MAAO;IACfC,IAAI,EAAEA,IAAK;IACXa,KAAK,EAAEjB;EAAc,CACtB,CACH,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["
|
|
1
|
+
{"version":3,"file":"types.js","names":["Division","Locale"],"sources":["../../../src/InstrumentLiveRateWidget/types.tsx"],"sourcesContent":["import type {\n DataRecord,\n WidgetConfig,\n WidgetSize,\n} from '@oanda/labs-widget-common';\n\nimport type { Division } from '../gql/types/graphql';\n\nexport { Division } from '../gql/types/graphql';\nexport { Locale } from '@oanda/mono-i18n';\n\nexport interface InstrumentLiveRateConfig extends WidgetConfig {\n division: Division;\n liveRatesUrl: string;\n instrument: string;\n removePadding?: boolean;\n size?: WidgetSize;\n}\n\nexport interface ValidationWrapperProps {\n instrument: string;\n division: Division;\n size?: WidgetSize;\n isParamError?: boolean;\n}\nexport interface MainProps {\n record: DataRecord;\n division: Division;\n size?: WidgetSize;\n}\n"],"mappings":"AAQA,SAASA,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,MAAM,QAAQ,kBAAkB","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
1
|
import { useLiveRatesMessage } from '@oanda/labs-widget-common';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
3
|
const getRecords = data => data?.mapInstrumentNames?.map(item => ({
|
|
4
4
|
instrument: item?.name || '',
|
|
5
5
|
displayName: item?.displayName || ''
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["
|
|
1
|
+
{"version":3,"file":"utils.js","names":["useLiveRatesMessage","useEffect","useState","getRecords","data","mapInstrumentNames","map","item","instrument","name","displayName","useRecords","record","target","updatedRecord","setUpdatedRecord","sentiment","error","setError","update","liveRatesError","buy","ask","buyPriceMovement","askPriceMovement","dailyPercentChange","dailyPercentChangeFromOpen","dailyPipsChange","dailyPipsChangeFromOpen","displayPrecision"],"sources":["../../../src/InstrumentLiveRateWidget/utils.ts"],"sourcesContent":["import type {\n DataRecord,\n LiveRatesErrorMessage,\n} from '@oanda/labs-widget-common';\nimport { useLiveRatesMessage } from '@oanda/labs-widget-common';\nimport { useEffect, useState } from 'react';\n\nimport type { ValidateInstrumentsQuery } from '../gql/types/graphql';\n\nconst getRecords = (data: ValidateInstrumentsQuery) =>\n data?.mapInstrumentNames?.map((item) => ({\n instrument: item?.name || '',\n displayName: item?.displayName || '',\n }));\n\nconst useRecords = (record: DataRecord, target: EventTarget | null) => {\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\n const { update, error: liveRatesError } = useLiveRatesMessage(\n record.instrument,\n target\n );\n\n useEffect(() => {\n setUpdatedRecord({\n displayName: record.displayName,\n instrument: record.instrument,\n buy: update?.ask,\n buyPriceMovement: update?.askPriceMovement,\n dailyPercentChange: update?.dailyPercentChangeFromOpen,\n dailyPipsChange: update?.dailyPipsChangeFromOpen,\n displayPrecision: update?.displayPrecision,\n });\n setError(liveRatesError);\n }, [update, record, liveRatesError]);\n\n return {\n updatedRecord,\n error,\n };\n};\n\nexport { getRecords, useRecords };\n"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAI3C,MAAMC,UAAU,GAAIC,IAA8B,IAChDA,IAAI,EAAEC,kBAAkB,EAAEC,GAAG,CAAEC,IAAI,KAAM;EACvCC,UAAU,EAAED,IAAI,EAAEE,IAAI,IAAI,EAAE;EAC5BC,WAAW,EAAEH,IAAI,EAAEG,WAAW,IAAI;AACpC,CAAC,CAAC,CAAC;AAEL,MAAMC,UAAU,GAAGA,CAACC,MAAkB,EAAEC,MAA0B,KAAK;EACrE,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGb,QAAQ,CAAa;IAC7DQ,WAAW,EAAEE,MAAM,CAACF,WAAW;IAC/BF,UAAU,EAAEI,MAAM,CAACJ,UAAU;IAC7BQ,SAAS,EAAEJ,MAAM,CAACI;EACpB,CAAC,CAAC;EACF,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGhB,QAAQ,CAA+B,IAAI,CAAC;EAEtE,MAAM;IAAEiB,MAAM;IAAEF,KAAK,EAAEG;EAAe,CAAC,GAAGpB,mBAAmB,CAC3DY,MAAM,CAACJ,UAAU,EACjBK,MACF,CAAC;EAEDZ,SAAS,CAAC,MAAM;IACdc,gBAAgB,CAAC;MACfL,WAAW,EAAEE,MAAM,CAACF,WAAW;MAC/BF,UAAU,EAAEI,MAAM,CAACJ,UAAU;MAC7Ba,GAAG,EAAEF,MAAM,EAAEG,GAAG;MAChBC,gBAAgB,EAAEJ,MAAM,EAAEK,gBAAgB;MAC1CC,kBAAkB,EAAEN,MAAM,EAAEO,0BAA0B;MACtDC,eAAe,EAAER,MAAM,EAAES,uBAAuB;MAChDC,gBAAgB,EAAEV,MAAM,EAAEU;IAC5B,CAAC,CAAC;IACFX,QAAQ,CAACE,cAAc,CAAC;EAC1B,CAAC,EAAE,CAACD,MAAM,EAAEP,MAAM,EAAEQ,cAAc,CAAC,CAAC;EAEpC,OAAO;IACLN,aAAa;IACbG;EACF,CAAC;AACH,CAAC;AAED,SAASd,UAAU,EAAEQ,UAAU","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 {
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import * as types from './graphql';
|
|
2
2
|
const documents = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
'\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\n name\n chart\n }\n }\n': types.GetInstrumentsChartDocument,
|
|
4
|
+
'\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n': types.ValidateInstrumentsDocument
|
|
5
5
|
};
|
|
6
6
|
export function graphql(source) {
|
|
7
7
|
return documents[source] ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.js","names":["types","documents","GetInstrumentsChartDocument","ValidateInstrumentsDocument","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
|
|
1
|
+
{"version":3,"file":"gql.js","names":["types","documents","GetInstrumentsChartDocument","ValidateInstrumentsDocument","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 GetInstrumentsChart($instruments: [String!], $division: Division) {\\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\\n name\\n chart\\n }\\n }\\n':\n types.GetInstrumentsChartDocument,\n '\\n query validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n':\n types.ValidateInstrumentsDocument,\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 GetInstrumentsChart($instruments: [String!], $division: Division) {\\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\\n name\\n chart\\n }\\n }\\n'\n): (typeof documents)['\\n query GetInstrumentsChart($instruments: [String!], $division: Division) {\\n topicalInstrumentsCharts(instruments: $instruments, division: $division) {\\n name\\n chart\\n }\\n }\\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 validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\n }\\n }\\n'\n): (typeof documents)['\\n query validateInstruments($instruments: [String]!, $division: Division) {\\n mapInstrumentNames(instruments: $instruments, division: $division) {\\n name\\n displayName\\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,sMAAsM,EACpMD,KAAK,CAACE,2BAA2B;EACnC,sMAAsM,EACpMF,KAAK,CAACG;AACV,CAAC;AA6BD,OAAO,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQJ,SAAS,CAASI,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
|