@backtest-kit/ui 3.0.5 → 3.0.6
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/build/modules/frontend/build/assets/{index-BqGq0tpQ.js → index-D0JjIz0o.js} +4 -4
- package/build/modules/frontend/build/assets/{index-C07BrKk-.js → index-D4LUZK00.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-BZQ5v7T_.js → markdownit-DXkBqI9D.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,_ as t,r as a,a as n,f as i,b as s,d as o,u as r,e as l,g as d,h as c,i as p,s as u,j as h,k as m,Z as b,q as g,I as x,l as y,B as v,J as f,m as k,n as w,X as S,R as W,L as R,o as L,p as C,T as G,v as M,t as $,w as N,x as T,y as F,z as P,A as j,C as A,D as z,E as B,F as E,S as I,G as O,H as D}from"./index-
|
|
1
|
+
import{c as e,_ as t,r as a,a as n,f as i,b as s,d as o,u as r,e as l,g as d,h as c,i as p,s as u,j as h,k as m,Z as b,q as g,I as x,l as y,B as v,J as f,m as k,n as w,X as S,R as W,L as R,o as L,p as C,T as G,v as M,t as $,w as N,x as T,y as F,z as P,A as j,C as A,D as z,E as B,F as E,S as I,G as O,H as D}from"./index-D0JjIz0o.js";const H=e(),V=["className","component","disableGutters","fixed","maxWidth","classes"],X=d(),q=H("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),J=e=>r({props:e,name:"MuiContainer",defaultTheme:X});const Y=function(e={}){const{createStyledComponent:r=q,useThemeProps:d=J,componentName:p="MuiContainer"}=e,u=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const n=a,i=e.breakpoints.values[n];return 0!==i&&(t[e.breakpoints.up(n)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=d(e),{className:h,component:m="div",disableGutters:b=!1,fixed:g=!1,maxWidth:x="lg"}=r,y=n(r,V),v=t({},r,{component:m,disableGutters:b,fixed:g,maxWidth:x}),f=((e,t)=>{const{classes:a,fixed:n,disableGutters:i,maxWidth:s}=e,r={root:["root",s&&`maxWidth${o(String(s))}`,n&&"fixed",i&&"disableGutters"]};return l(r,e=>c(t,e),a)})(v,p);return i(u,t({as:m,ownerState:v,className:s(f.root,h),ref:a},y))})}({createStyledComponent:u("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})}),Z=h(i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh"),_=new m,K=[{type:b.Link,action:"back-action",label:"Main"},{type:b.Link,action:"back-action",label:"Dashboard"}],Q=[{action:"update-now",label:"Refresh",icon:()=>i(x,{icon:Z,color:"#4caf50"})}],U=()=>i(g,{items:K,actions:Q,onAction:_.next}),ee=({className:e,symbol:t,style:a,sx:n})=>i(f,{children:async()=>{try{const s=(await y.symbolGlobalService.getSymbolMap())[t],o=null==s?void 0:s.icon,r=(null==s?void 0:s.color)||"#ccc";return i(v,{className:e,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:o?"transparent":r,...n},style:a,children:o?i("img",{loading:"lazy",crossOrigin:"anonymous",src:o,alt:t,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,a=t.parentElement;a&&(a.style.background=r,t.style.display="none")}}):i(v,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return i(v,{className:e,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:a,children:i(v,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});const te=({data:{type:e},setLoading:t})=>{const{elementRef:a,size:n}=k({closest:".MuiContainer-root",compute:e=>(e.height-=150,e)}),[s,{loading:o,execute:r}]=w(async()=>"live"===e?await y.storageViewService.listSignalLive():await y.storageViewService.listSignalBacktest(),{onLoadStart:()=>t(!0),onLoadEnd:()=>t(!1),deps:[e]});S(()=>_.subscribe(e=>{"update-now"===e&&r()}));const l=W.useMemo(()=>s?s.reduce((e,t)=>(e[t.symbol]||(e[t.symbol]=[]),e[t.symbol].push(t),e),{}):{},[s]),d=e=>{const t=l[e]||[];return t.length?i(E,{children:t.map((t,a)=>{return i(P,{sx:{background:e=>a%2==1?A(e.palette.getContrastText(e.palette.background.paper),.02):void 0},onClick:()=>y.layoutService.pickSignal(t.id),children:[i(L,{primary:i(v,{sx:{display:"flex",gap:2,flexWrap:"wrap",alignItems:"center"},children:[i(G,{variant:"body2",component:"span",sx:{fontWeight:"bold",px:1,py:.5,borderRadius:1,background:"long"===t.position?"#1976D2":"#F57C00",color:"white"},children:"long"===t.position?"LONG":"SHORT"}),i(G,{variant:"body2",component:"span",sx:{fontWeight:"medium"},children:[i(v,{component:"span",sx:{color:"text.secondary",mr:.5},children:"Entry:"}),j(t.priceOpen),"$"]}),i(G,{variant:"body2",component:"span",sx:{fontWeight:"medium",color:"success.main"},children:[i(v,{component:"span",sx:{color:"text.secondary",mr:.5},children:"TP:"}),j(t.priceTakeProfit),"$"]}),i(G,{variant:"body2",component:"span",sx:{fontWeight:"medium",color:"error.main"},children:[i(v,{component:"span",sx:{color:"text.secondary",mr:.5},children:"SL:"}),j(t.priceStopLoss),"$"]}),"pnl"in t&&i(G,{variant:"body2",component:"span",sx:{fontWeight:"bold",px:1,py:.5,borderRadius:1,background:t.pnl.pnlPercentage>=0?A("#4caf50",.15):A("#f44336",.15),color:t.pnl.pnlPercentage>=0?"#2e7d32":"#c62828"},children:["PNL: ",t.pnl.pnlPercentage>=0?"+":"",t.pnl.pnlPercentage.toFixed(2),"%"]}),i(G,{variant:"caption",component:"span",sx:{px:1,py:.25,borderRadius:.5,background:"opened"===t.status?A("#4caf50",.2):"scheduled"===t.status?A("#ff9800",.2):"closed"===t.status?A("#9e9e9e",.2):A("#f44336",.2),color:"opened"===t.status?"#2e7d32":"scheduled"===t.status?"#e65100":"closed"===t.status?"#616161":"#c62828"},children:t.status})]}),secondary:i(G,{pt:.5,variant:"subtitle2",sx:{opacity:.5},children:(n=t.createdAt||t.pendingAt,new Date(n).toLocaleString([],{year:"numeric",month:"numeric",day:"numeric",hourCycle:"h24",hour:"2-digit",minute:"2-digit",second:"2-digit"}))})}),i(z,{disableRipple:!0,children:i(B,{})})]},`item-${e}-${t.id}`);var n})}):i(R,{children:i(L,{sx:{"& .MuiTypography-body2":{maxWidth:"435px"}},primary:"Нет сигналов",secondary:"Сигналы будут отображены здесь после появления"})})};return o?null:i(T,{ref:a,sx:{width:"100%",maxHeight:n.height,overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",bgcolor:"background.paper",position:"relative","& ul":{padding:0}},subheader:i("li",{}),children:i(f,{deps:[l],children:async()=>{const t=Object.keys(l),a=await y.symbolGlobalService.getSymbolMap();return t.length?t.map(e=>{var t,n,s;const o=null==(t=a[e])?void 0:t.color,r=(null==(n=l[e])?void 0:n.length)||0;return i("li",{children:i("ul",{children:[i(C,{sx:{background:(c=o,F(c,"#000000")>F(c,"#FFFFFF")?$(o,.1):N(o,.1)),color:"white !important",zIndex:9,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i(v,{sx:{position:"relative",paddingRight:"8px"},children:i(ee,{symbol:e})}),(null==(s=a[e])?void 0:s.displayName)||e,i(v,{flex:1}),i(G,{variant:"body2",sx:{fontWeight:"medium"},children:M(r,{one:"Signal",two:"Signals",many:"Signals"})})]}),i(v,{sx:{marginTop:"16px",marginBottom:"16px"},children:d(e)})]})},`section-${e}`);var c}):i(R,{children:i(L,{primary:"No signals yet",secondary:"live"===e?"Live signals will be displayed here":"Backtest signals will be displayed here"})})}})})},ae=()=>i(I,{children:"\n body {\n background-color: #ddd !important;\n }\n "}),ne=D(),ie=(e,t)=>e.some(e=>e.includes(t)),se=[{id:"backtest",element:te,isActive:e=>ie(["/backtest"],e)},{id:"live",element:te,isActive:e=>ie(["/live"],e)}],oe=[{id:"backtest",label:"Backtest"},{id:"live",label:"Live"}],re=({symbol:e})=>{S(()=>ne.replace("/backtest"));return i(Y,{children:[i(O,{withScroll:!0,sx:{height:"calc(100vh - 105px)"},BeforePaper:U,onLoadStart:()=>y.layoutService.setAppbarLoader(!0),onLoadEnd:()=>y.layoutService.setAppbarLoader(!1),routes:se,tabs:oe,history:ne,initialData:()=>({backtest:{type:"backtest"},live:{type:"live"}}),payload:()=>({symbol:e}),onTabChange:(e,t)=>{"backtest"===e&&t.replace("/backtest"),"live"===e&&t.replace("/live")}}),i(ae,{})]})};export{re as MainPage,re as default};
|
package/build/modules/frontend/build/assets/{markdownit-BZQ5v7T_.js → markdownit-DXkBqI9D.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as e,M as t}from"./index-
|
|
1
|
+
import{K as e,M as t}from"./index-D0JjIz0o.js";function r(e,t){for(var r=0;r<t.length;r++){const o=t[r];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(o,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=t();const n=r({__proto__:null,default:e(o)},[o]);export{n as m};
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
|
|
141
141
|
rel="stylesheet"
|
|
142
142
|
/>
|
|
143
|
-
<script type="module" crossorigin src="/assets/index-
|
|
143
|
+
<script type="module" crossorigin src="/assets/index-D0JjIz0o.js"></script>
|
|
144
144
|
<link rel="stylesheet" crossorigin href="/assets/index-DrRm3Jka.css">
|
|
145
145
|
</head>
|
|
146
146
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backtest-kit/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. React dashboard with candlestick charts, signal tracking, and risk analysis.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"worker-testbed": "1.0.12"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"backtest-kit": "^3.0.
|
|
97
|
+
"backtest-kit": "^3.0.10",
|
|
98
98
|
"ccxt": "^4.5.24",
|
|
99
99
|
"typescript": "^5.0.0"
|
|
100
100
|
},
|