@xframes/node 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{xframes.node → lib/xframes.node} +0 -0
  2. package/package.json +3 -3
  3. package/dist/App.d.ts +0 -1
  4. package/dist/App.js +0 -10
  5. package/dist/components/TradingGuiDemo/CryptoAssetPanels/CryptoAssetPanels.d.ts +0 -3
  6. package/dist/components/TradingGuiDemo/CryptoAssetPanels/CryptoAssetPanels.js +0 -49
  7. package/dist/components/TradingGuiDemo/CryptoAssetsList/CryptoAssetsList.d.ts +0 -3
  8. package/dist/components/TradingGuiDemo/CryptoAssetsList/CryptoAssetsList.js +0 -62
  9. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoCandlestickPlot.d.ts +0 -5
  10. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoCandlestickPlot.js +0 -39
  11. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoCandlestickPlots.d.ts +0 -3
  12. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoCandlestickPlots.js +0 -17
  13. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoLinePlot.d.ts +0 -5
  14. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoLinePlot.js +0 -33
  15. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoLinePlots.d.ts +0 -3
  16. package/dist/components/TradingGuiDemo/CryptoPlots/CryptoLinePlots.js +0 -17
  17. package/dist/components/TradingGuiDemo/CryptoQuotePrice/CryptoQuotePrice.d.ts +0 -5
  18. package/dist/components/TradingGuiDemo/CryptoQuotePrice/CryptoQuotePrice.js +0 -76
  19. package/dist/components/TradingGuiDemo/CryptoSymbolBlock/CryptoSymbolBlock.d.ts +0 -5
  20. package/dist/components/TradingGuiDemo/CryptoSymbolBlock/CryptoSymbolBlock.js +0 -56
  21. package/dist/components/TradingGuiDemo/CryptoSymbolPairs/CryptoSymbolPair.d.ts +0 -5
  22. package/dist/components/TradingGuiDemo/CryptoSymbolPairs/CryptoSymbolPair.js +0 -25
  23. package/dist/components/TradingGuiDemo/Sidebar/Sidebar.d.ts +0 -1
  24. package/dist/components/TradingGuiDemo/Sidebar/Sidebar.js +0 -52
  25. package/dist/components/TradingGuiDemo/Tabs/Tabs.d.ts +0 -7
  26. package/dist/components/TradingGuiDemo/Tabs/Tabs.js +0 -95
  27. package/dist/components/TradingGuiDemo/TradingGuiDemo.d.ts +0 -1
  28. package/dist/components/TradingGuiDemo/TradingGuiDemo.js +0 -299
  29. package/dist/components/TradingGuiDemo/cryptoSymbols.d.ts +0 -1
  30. package/dist/components/TradingGuiDemo/cryptoSymbols.js +0 -64
  31. package/dist/components/TradingGuiDemo/dataService.d.ts +0 -22
  32. package/dist/components/TradingGuiDemo/dataService.js +0 -33
  33. package/dist/components/TradingGuiDemo/dataServiceContext.d.ts +0 -3
  34. package/dist/components/TradingGuiDemo/dataServiceContext.js +0 -13
  35. package/dist/components/TradingGuiDemo/store.d.ts +0 -17
  36. package/dist/components/TradingGuiDemo/store.js +0 -35
  37. package/dist/index.d.ts +0 -1
  38. package/dist/themes.d.ts +0 -26
  39. package/dist/themes.js +0 -145
  40. /package/dist/{glfw3.dll → lib/glfw3.dll} +0 -0
  41. /package/dist/{xframes.exp → lib/xframes.exp} +0 -0
  42. /package/dist/{xframes.lib → lib/xframes.lib} +0 -0
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@xframes/node",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "DOM-less, GPU-accelerated GUI development for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
- "dist/*",
7
+ "dist/lib/*.*",
8
8
  "CMakeLists.txt",
9
9
  "vcpkg.json"
10
10
  ],
@@ -25,7 +25,7 @@
25
25
  "tsc": "rimraf ./dist && tsc --project ./tsconfig-build.json && yarn copy-artifacts-to-dist-folder",
26
26
  "tsup": "tsup --format cjs --external react",
27
27
  "copy-artifacts-to-lib-folder": "cpy --flat ./build/Release/*.* ./src/lib",
28
- "copy-artifacts-to-dist-folder": "cpy --flat ./build/Release/*.* ./dist",
28
+ "copy-artifacts-to-dist-folder": "cpy --flat ./build/Release/*.* ./dist/lib",
29
29
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
30
30
  "cpp:compile": "cmake-js compile && yarn copy-artifacts-to-lib-folder",
31
31
  "cpp:generate-module": "prebuild --strip --backend cmake-js -t 9 -r napi --include-regex \"\\.(node|dll|o)$\" --tag-prefix xframes-node- --verbose",
package/dist/App.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const App: () => import("react/jsx-runtime").JSX.Element;
package/dist/App.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.App = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const XFrames_1 = require("./lib/XFrames");
6
- const TradingGuiDemo_1 = require("./components/TradingGuiDemo/TradingGuiDemo");
7
- const App = () => {
8
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { root: true, style: { width: "100%", height: "100%" }, children: (0, jsx_runtime_1.jsx)(TradingGuiDemo_1.TradingGuiDemo, {}) }));
9
- };
10
- exports.App = App;
@@ -1,3 +0,0 @@
1
- type Props = {};
2
- export declare const CryptoAssetPanels: ({}: Props) => import("react/jsx-runtime").JSX.Element;
3
- export {};
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoAssetPanels = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const store_1 = require("../store");
7
- const CryptoQuotePrice_1 = require("../CryptoQuotePrice/CryptoQuotePrice");
8
- const common_1 = require("@xframes/common");
9
- const XFrames_1 = require("src/lib/XFrames");
10
- const CryptoAssetPanels = ({}) => {
11
- const cryptoAssets = (0, store_1.useStore)((state) => state.cryptoAssets.sort((a, b) => {
12
- if (a.symbol < b.symbol) {
13
- return -1;
14
- }
15
- else if (a.symbol > b.symbol) {
16
- return 1;
17
- }
18
- return 0;
19
- }));
20
- const styleSheet = (0, react_1.useMemo)(() => common_1.RWStyleSheet.create({
21
- mainWrapperNode: {
22
- width: "100%",
23
- height: "auto",
24
- flexDirection: "row",
25
- flexWrap: "wrap",
26
- gap: { row: 5, column: 5 },
27
- },
28
- asset: {
29
- minWidth: 200,
30
- maxWidth: 240,
31
- flex: 1,
32
- height: "auto",
33
- border: {
34
- color: "#000",
35
- thickness: 1,
36
- },
37
- alignItems: "center",
38
- padding: { vertical: 5 },
39
- gap: { row: 5 },
40
- },
41
- symbol: {
42
- font: { name: "roboto-regular", size: 24 },
43
- },
44
- }), []);
45
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.mainWrapperNode, children: cryptoAssets.map((asset) => {
46
- return ((0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.asset, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { style: styleSheet.symbol, text: asset.symbol }), (0, jsx_runtime_1.jsx)(CryptoQuotePrice_1.CryptoQuotePrice, { symbol: asset.symbol })] }, asset.id));
47
- }) }));
48
- };
49
- exports.CryptoAssetPanels = CryptoAssetPanels;
@@ -1,3 +0,0 @@
1
- type Props = {};
2
- export declare const CryptoAssetsList: ({}: Props) => import("react/jsx-runtime").JSX.Element;
3
- export {};
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoAssetsList = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const dataServiceContext_1 = require("../dataServiceContext");
7
- const XFrames_1 = require("src/lib/XFrames");
8
- const CryptoAssetsList = ({}) => {
9
- const dataService = (0, dataServiceContext_1.useDataService)();
10
- const tableRef = (0, react_1.useRef)(null);
11
- const tableColumns = (0, react_1.useMemo)(() => [
12
- {
13
- heading: "Symbol",
14
- fieldId: "symbol",
15
- },
16
- {
17
- heading: "ASK",
18
- fieldId: "askPrice",
19
- },
20
- {
21
- heading: "Change",
22
- fieldId: "askChange",
23
- },
24
- {
25
- heading: "BID",
26
- fieldId: "bidPrice",
27
- },
28
- {
29
- heading: "Change",
30
- fieldId: "bidChange",
31
- },
32
- ], []);
33
- (0, react_1.useEffect)(() => {
34
- const subscription = dataService
35
- .getCryptoSnapshots()
36
- .subscribe((snapshots) => {
37
- const data = Object.entries(snapshots).map(([symbol, snapshot]) => ({
38
- symbol,
39
- askPrice: snapshot.LatestQuote.AskPrice.toFixed(6),
40
- bidPrice: snapshot.LatestQuote.BidPrice.toFixed(6),
41
- // todo: totally unsure here
42
- askChange: (snapshot.LatestQuote.AskPrice - snapshot.DailyBar.Open).toFixed(6),
43
- bidChange: (snapshot.LatestQuote.BidPrice - snapshot.DailyBar.Open).toFixed(6),
44
- }));
45
- data.sort((a, b) => {
46
- if (a.symbol < b.symbol) {
47
- return -1;
48
- }
49
- else if (a.symbol > b.symbol) {
50
- return 1;
51
- }
52
- return 0;
53
- });
54
- tableRef.current?.setTableData(data);
55
- });
56
- return () => {
57
- subscription.unsubscribe();
58
- };
59
- }, [dataService]);
60
- return (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Table, { ref: tableRef, columns: tableColumns });
61
- };
62
- exports.CryptoAssetsList = CryptoAssetsList;
@@ -1,5 +0,0 @@
1
- type Props = {
2
- symbol: string;
3
- };
4
- export declare const CryptoCandlestickPlot: ({ symbol }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoCandlestickPlot = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const rxjs_1 = require("rxjs");
7
- const dataServiceContext_1 = require("../dataServiceContext");
8
- const XFrames_1 = require("src/lib/XFrames");
9
- const CryptoCandlestickPlot = ({ symbol }) => {
10
- const dataService = (0, dataServiceContext_1.useDataService)();
11
- const plotRef = (0, react_1.useRef)(null);
12
- // const [axisAutoFit, setAxisAutoFit] = useState(true);
13
- (0, react_1.useEffect)(() => {
14
- const subscription = dataService
15
- .getCryptoBarDatasets()
16
- .pipe((0, rxjs_1.map)((cryptoBars) => cryptoBars[symbol]))
17
- .subscribe((cryptoBarsForSymbol) => {
18
- if (plotRef.current) {
19
- const data = cryptoBarsForSymbol.map((cryptoBar) => ({
20
- date: Number(new Date(cryptoBar.Timestamp)) / 1000,
21
- open: cryptoBar.Open,
22
- close: cryptoBar.Close,
23
- high: cryptoBar.High,
24
- low: cryptoBar.Low,
25
- }));
26
- // console.log(data);
27
- plotRef.current.setData(data);
28
- }
29
- });
30
- return () => {
31
- subscription.unsubscribe();
32
- };
33
- }, [dataService]);
34
- // const toggleAxisAutoFit = useCallback(() => {
35
- // setAxisAutoFit((val) => !val);
36
- // }, []);
37
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.PlotCandlestick, { ref: plotRef, style: { width: "100%", height: 400 } }));
38
- };
39
- exports.CryptoCandlestickPlot = CryptoCandlestickPlot;
@@ -1,3 +0,0 @@
1
- type Props = {};
2
- export declare const CryptoCandlestickPlots: ({}: Props) => import("react/jsx-runtime").JSX.Element;
3
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoCandlestickPlots = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const store_1 = require("../store");
6
- const CryptoCandlestickPlot_1 = require("./CryptoCandlestickPlot");
7
- const XFrames_1 = require("src/lib/XFrames");
8
- const CryptoCandlestickPlots = ({}) => {
9
- const symbols = (0, store_1.useStore)((state) => state.symbols);
10
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: {
11
- width: "100%",
12
- height: "100%",
13
- flexDirection: "column",
14
- gap: { row: 5 },
15
- }, children: symbols.map((sym) => ((0, jsx_runtime_1.jsx)(CryptoCandlestickPlot_1.CryptoCandlestickPlot, { symbol: sym }, sym))) }));
16
- };
17
- exports.CryptoCandlestickPlots = CryptoCandlestickPlots;
@@ -1,5 +0,0 @@
1
- type Props = {
2
- symbol: string;
3
- };
4
- export declare const CryptoLinePlot: ({ symbol }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoLinePlot = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const dataServiceContext_1 = require("../dataServiceContext");
7
- const common_1 = require("@xframes/common");
8
- const rxjs_1 = require("rxjs");
9
- const XFrames_1 = require("src/lib/XFrames");
10
- const CryptoLinePlot = ({ symbol }) => {
11
- const dataService = (0, dataServiceContext_1.useDataService)();
12
- const plotRef = (0, react_1.useRef)(null);
13
- // const [axisAutoFit, setAxisAutoFit] = useState(true);
14
- (0, react_1.useEffect)(() => {
15
- const subscription = dataService
16
- .getCryptoQuotes()
17
- .pipe((0, rxjs_1.filter)((cryptoQuote) => cryptoQuote.S === symbol))
18
- .subscribe((quote) => {
19
- if (plotRef.current) {
20
- const date = new Date(quote.Timestamp);
21
- plotRef.current.appendData(Number(date) / 1000, quote.BidPrice);
22
- }
23
- });
24
- return () => {
25
- subscription.unsubscribe();
26
- };
27
- }, [dataService]);
28
- // const toggleAxisAutoFit = useCallback(() => {
29
- // setAxisAutoFit((val) => !val);
30
- // }, []);
31
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.PlotLine, { xAxisScale: common_1.ImPlotScale.Time, ref: plotRef, style: { width: "100%", height: 400 } }));
32
- };
33
- exports.CryptoLinePlot = CryptoLinePlot;
@@ -1,3 +0,0 @@
1
- type Props = {};
2
- export declare const CryptoLinePlots: ({}: Props) => import("react/jsx-runtime").JSX.Element;
3
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoLinePlots = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const store_1 = require("../store");
6
- const CryptoLinePlot_1 = require("./CryptoLinePlot");
7
- const XFrames_1 = require("src/lib/XFrames");
8
- const CryptoLinePlots = ({}) => {
9
- const symbols = (0, store_1.useStore)((state) => state.symbols);
10
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: {
11
- width: "100%",
12
- height: "100%",
13
- flexDirection: "column",
14
- gap: { row: 5 },
15
- }, children: symbols.map((sym) => ((0, jsx_runtime_1.jsx)(CryptoLinePlot_1.CryptoLinePlot, { symbol: sym }, sym))) }));
16
- };
17
- exports.CryptoLinePlots = CryptoLinePlots;
@@ -1,5 +0,0 @@
1
- type Props = {
2
- symbol: string;
3
- };
4
- export declare const CryptoQuotePrice: ({ symbol }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoQuotePrice = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const rxjs_1 = require("rxjs");
7
- const common_1 = require("@xframes/common");
8
- const dataServiceContext_1 = require("../dataServiceContext");
9
- const XFrames_1 = require("src/lib/XFrames");
10
- const themes_1 = require("src/themes");
11
- const CryptoQuotePrice = ({ symbol }) => {
12
- const [data, setData] = (0, react_1.useState)({
13
- lastUpdated: "n/a",
14
- });
15
- // const [lastUpdated, setLastUpdated] = useState<string>("n/a");
16
- const dataService = (0, dataServiceContext_1.useDataService)();
17
- (0, react_1.useEffect)(() => {
18
- const subscription = dataService
19
- .getCryptoQuotes()
20
- .pipe((0, rxjs_1.filter)((cryptoQuote) => cryptoQuote.S === symbol))
21
- .subscribe((quote) => {
22
- const newData = {
23
- quote,
24
- lastUpdated: "n/a",
25
- };
26
- setData((oldData) => {
27
- // if (oldData.quote) {
28
- // const quoteDate = new Date(quote.Timestamp);
29
- // const previousDate = new Date(oldData.quote.Timestamp);
30
- // const msDiff = differenceInMilliseconds(quoteDate, previousDate);
31
- // if (msDiff >= 1000) {
32
- // newData.lastUpdated = formatDuration(
33
- // intervalToDuration(interval(quoteDate, previousDate)),
34
- // );
35
- // } else {
36
- // newData.lastUpdated = `${msDiff}ms ago`;
37
- // }
38
- // }
39
- return newData;
40
- });
41
- });
42
- return () => {
43
- subscription.unsubscribe();
44
- };
45
- }, [dataService]);
46
- const styleSheet = (0, react_1.useMemo)(() => common_1.RWStyleSheet.create({
47
- pricesWrapper: {
48
- alignSelf: "center",
49
- flexDirection: "row",
50
- gap: { column: 5 },
51
- },
52
- price: {
53
- width: 100,
54
- height: "auto",
55
- // borderColor: "#000",
56
- // borderThickness: 1,
57
- alignItems: "center",
58
- },
59
- ask: {
60
- colors: {
61
- [common_1.ImGuiCol.Text]: themes_1.theme2Colors.red,
62
- },
63
- },
64
- bid: {
65
- colors: {
66
- [common_1.ImGuiCol.Text]: themes_1.theme2Colors.green,
67
- },
68
- },
69
- }), []);
70
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.pricesWrapper, children: [(0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.price, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { text: "ASK", style: styleSheet.ask }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { text: typeof data?.quote?.AskPrice === "number"
71
- ? data?.quote?.AskPrice.toFixed(6)
72
- : "n/a", style: styleSheet.ask })] }), (0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.price, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { text: "BID", style: styleSheet.bid }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { text: typeof data?.quote?.BidPrice === "number"
73
- ? data?.quote?.BidPrice.toFixed(6)
74
- : "n/a", style: styleSheet.bid })] })] }) }));
75
- };
76
- exports.CryptoQuotePrice = CryptoQuotePrice;
@@ -1,5 +0,0 @@
1
- type Props = {
2
- symbol: string;
3
- };
4
- export declare const CryptoSymbolBlock: ({ symbol }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoSymbolBlock = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const common_1 = require("@xframes/common");
7
- const CryptoSymbolPair_1 = require("../CryptoSymbolPairs/CryptoSymbolPair");
8
- const XFrames_1 = require("src/lib/XFrames");
9
- const CryptoSymbolBlock = ({ symbol }) => {
10
- const price = "40,730.00";
11
- const currency = "USD";
12
- const trend = "(+2.50%)";
13
- const styleSheet = (0, react_1.useMemo)(() => common_1.RWStyleSheet.create({
14
- block: {
15
- flexDirection: "row",
16
- padding: {
17
- // horizontal: 2,
18
- vertical: 8,
19
- },
20
- gap: { column: 5 },
21
- // borderColor: "#fff",
22
- // borderThickness: 1,
23
- },
24
- symbolLogos: {
25
- width: 60,
26
- height: 40,
27
- alignItems: "center",
28
- justifyContent: "center",
29
- },
30
- info: {
31
- gap: { row: 5 },
32
- },
33
- priceRow: {
34
- flexDirection: "row",
35
- gap: { column: 2 },
36
- },
37
- symbol: {
38
- font: { name: "roboto-bold", size: 16 },
39
- colors: { [common_1.ImGuiCol.Text]: "#A9B5C0" },
40
- },
41
- price: {
42
- font: { name: "roboto-bold", size: 20 },
43
- colors: { [common_1.ImGuiCol.Text]: "#D9D9D9" },
44
- },
45
- currency: {
46
- font: { name: "roboto-bold", size: 20 },
47
- colors: { [common_1.ImGuiCol.Text]: "#A9B5C0" },
48
- },
49
- trend: {
50
- font: { name: "roboto-bold", size: 20 },
51
- colors: { [common_1.ImGuiCol.Text]: "#239465" },
52
- },
53
- }), []);
54
- return ((0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.block, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.symbolLogos, children: (0, jsx_runtime_1.jsx)(CryptoSymbolPair_1.CryptoSymbolPair, { symbol: symbol }) }), (0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.info, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { style: styleSheet.symbol, text: symbol }), (0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.priceRow, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { style: styleSheet.price, text: price }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { style: styleSheet.currency, text: currency }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { style: styleSheet.trend, text: trend })] })] })] }));
55
- };
56
- exports.CryptoSymbolBlock = CryptoSymbolBlock;
@@ -1,5 +0,0 @@
1
- type Props = {
2
- symbol: string;
3
- };
4
- export declare const CryptoSymbolPair: ({ symbol }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoSymbolPair = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const common_1 = require("@xframes/common");
7
- const XFrames_1 = require("src/lib/XFrames");
8
- const CryptoSymbolPair = ({ symbol }) => {
9
- const styleSheet = (0, react_1.useMemo)(() => common_1.RWStyleSheet.create({
10
- symbolLogoPair: {
11
- flexDirection: "row",
12
- },
13
- symbolLogoLeft: {
14
- width: 24,
15
- height: 24,
16
- },
17
- symbolLogoRight: {
18
- width: 24,
19
- height: 24,
20
- position: { left: -5 }, // todo: doesn't this need absolute positioning?
21
- },
22
- }), []);
23
- return ((0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.symbolLogoPair, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Image, { url: "bitcoin-btc-logo_gqud0f.png", style: styleSheet.symbolLogoLeft }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Image, { url: "77-771550_dollar-currency-money-finance-usd-us-dollar-dollar_apzzg2.png", style: styleSheet.symbolLogoRight })] }));
24
- };
25
- exports.CryptoSymbolPair = CryptoSymbolPair;
@@ -1 +0,0 @@
1
- export declare const Sidebar: () => import("react/jsx-runtime").JSX.Element;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Sidebar = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const common_1 = require("@xframes/common");
7
- const XFrames_1 = require("src/lib/XFrames");
8
- const Sidebar = () => {
9
- const styleSheet = (0, react_1.useMemo)(() => common_1.RWStyleSheet.create({
10
- sidebarNode: {
11
- flexBasis: 60,
12
- height: "100%",
13
- border: {
14
- color: "#1B1D20",
15
- thickness: 1,
16
- },
17
- },
18
- sideBarItem: {
19
- width: 58,
20
- height: 58,
21
- justifyContent: "center",
22
- alignItems: "center",
23
- },
24
- logo: {
25
- font: { name: "roboto-regular", size: 36 },
26
- },
27
- icon: {
28
- width: 48,
29
- height: 48,
30
- font: { name: "roboto-regular", size: 36 },
31
- colors: {
32
- [common_1.ImGuiCol.ButtonHovered]: "#001033",
33
- [common_1.ImGuiCol.ButtonActive]: "#001033",
34
- },
35
- vars: { [common_1.ImGuiStyleVar.FrameRounding]: 24 },
36
- },
37
- iconActive: {
38
- width: 48,
39
- height: 48,
40
- font: { name: "roboto-regular", size: 36 },
41
- vars: { [common_1.ImGuiStyleVar.FrameRounding]: 24 },
42
- colors: {
43
- [common_1.ImGuiCol.Text]: "#588AF5",
44
- [common_1.ImGuiCol.Button]: "#001033",
45
- [common_1.ImGuiCol.ButtonHovered]: "#001033",
46
- [common_1.ImGuiCol.ButtonActive]: "#001033",
47
- },
48
- },
49
- }), []);
50
- return ((0, jsx_runtime_1.jsxs)(XFrames_1.XFrames.Node, { style: styleSheet.sidebarNode, children: [(0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.sideBarItem, children: (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { text: common_1.faIconMap.otter, style: styleSheet.logo }) }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.sideBarItem, children: (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Button, { label: common_1.faIconMap["arrow-trend-up"], style: styleSheet.iconActive, hoverStyle: styleSheet.iconActive }) }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.sideBarItem, children: (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Button, { label: common_1.faIconMap["wallet"], style: styleSheet.icon, hoverStyle: styleSheet.iconActive }) }), (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.sideBarItem, children: (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Button, { label: common_1.faIconMap["chart-pie"], style: styleSheet.icon, hoverStyle: styleSheet.iconActive }) })] }));
51
- };
52
- exports.Sidebar = Sidebar;
@@ -1,7 +0,0 @@
1
- type Props = {
2
- tabs: string[];
3
- selectedTabIndex: number;
4
- onSelectedTabChange: (index: number) => void;
5
- };
6
- export declare const Tabs: ({ tabs, selectedTabIndex, onSelectedTabChange, }: Props) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tabs = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const common_1 = require("@xframes/common");
7
- const XFrames_1 = require("src/lib/XFrames");
8
- const themes_1 = require("src/themes");
9
- // todo: fix 1px vertical shift on hover
10
- const Tabs = ({ tabs, selectedTabIndex, onSelectedTabChange, }) => {
11
- // const [selectedItemIds, setSelectedItemIds] = useState("cryptoAssetPanels");
12
- const styleSheet = (0, react_1.useMemo)(() => common_1.RWStyleSheet.create({
13
- tabs: {
14
- flexDirection: "row",
15
- borderLeft: {
16
- color: "#1C1E22",
17
- thickness: 1,
18
- },
19
- borderBottom: {
20
- color: "#1C1E22",
21
- thickness: 1,
22
- },
23
- },
24
- tab: {
25
- padding: { vertical: 10, horizontal: 20 },
26
- borderTop: {
27
- color: "#1C1E22",
28
- thickness: 1,
29
- },
30
- borderRight: {
31
- color: "#1C1E22",
32
- thickness: 1,
33
- },
34
- },
35
- hoveredTab: {
36
- padding: { vertical: 10, horizontal: 20 },
37
- borderTop: {
38
- // todo: not currently working for hover/active/disabled states
39
- color: "#fff",
40
- thickness: 1,
41
- },
42
- borderRight: {
43
- color: "#1C1E22",
44
- thickness: 1,
45
- },
46
- position: {
47
- top: 1, // todo: hack
48
- },
49
- },
50
- activeTab: {
51
- padding: { vertical: 10, horizontal: 20 },
52
- borderTop: {
53
- // todo: not currently working for hover/active/disabled states
54
- color: "#fff",
55
- thickness: 1,
56
- },
57
- borderRight: {
58
- color: "#1C1E22",
59
- thickness: 1,
60
- },
61
- position: {
62
- top: 1, // todo: hack
63
- },
64
- },
65
- selectedTab: {
66
- padding: { vertical: 10, horizontal: 20 },
67
- borderTop: {
68
- color: "#fff",
69
- thickness: 1,
70
- },
71
- borderBottom: {
72
- color: themes_1.theme2Colors.black,
73
- thickness: 1,
74
- },
75
- borderRight: {
76
- color: "#1C1E22",
77
- thickness: 1,
78
- },
79
- position: {
80
- top: 1, // todo: hack
81
- },
82
- },
83
- tabText: {
84
- font: { name: "roboto-bold", size: 18 },
85
- },
86
- }), []);
87
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: styleSheet.tabs, children: tabs.map((tab, index) => {
88
- const isSelected = selectedTabIndex === index;
89
- return ((0, jsx_runtime_1.jsx)(XFrames_1.XFrames.Node, { style: isSelected ? styleSheet.selectedTab : styleSheet.tab, hoverStyle: isSelected ? styleSheet.selectedTab : styleSheet.hoveredTab, activeStyle: isSelected ? styleSheet.selectedTab : styleSheet.activeTab, onClick: () => {
90
- // console.log("clicked");
91
- onSelectedTabChange(index);
92
- }, trackMouseClickEvents: true, children: (0, jsx_runtime_1.jsx)(XFrames_1.XFrames.UnformattedText, { text: tab, style: styleSheet.tabText }) }, tab));
93
- }) }));
94
- };
95
- exports.Tabs = Tabs;
@@ -1 +0,0 @@
1
- export declare const TradingGuiDemo: () => import("react/jsx-runtime").JSX.Element;