@loafmarkets/ui 0.1.268 → 0.1.270
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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +32 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -886,6 +886,7 @@ type ActivityTabId = 'positions' | 'subscriptions' | 'open-orders' | 'orders' |
|
|
|
886
886
|
type PortfolioActivityPanelProps = {
|
|
887
887
|
positions?: readonly PortfolioPosition[];
|
|
888
888
|
showPositionsTab?: boolean;
|
|
889
|
+
showSubscriptionsTab?: boolean;
|
|
889
890
|
onPositionClick?: (tokenName: string, isIpo: boolean) => void;
|
|
890
891
|
onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
|
|
891
892
|
offeringOrders?: readonly OfferingOrder[];
|
|
@@ -907,7 +908,7 @@ type PortfolioActivityPanelProps = {
|
|
|
907
908
|
className?: string;
|
|
908
909
|
style?: React.CSSProperties;
|
|
909
910
|
};
|
|
910
|
-
declare function PortfolioActivityPanel({ positions, showPositionsTab, onPositionClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, onAmendOrder, cancellingOrderId, compactPositions, defaultTab, pageSize, blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
|
|
911
|
+
declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, onAmendOrder, cancellingOrderId, compactPositions, defaultTab, pageSize, blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
|
|
911
912
|
|
|
912
913
|
type SelectorItem = {
|
|
913
914
|
readonly tokenName: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -886,6 +886,7 @@ type ActivityTabId = 'positions' | 'subscriptions' | 'open-orders' | 'orders' |
|
|
|
886
886
|
type PortfolioActivityPanelProps = {
|
|
887
887
|
positions?: readonly PortfolioPosition[];
|
|
888
888
|
showPositionsTab?: boolean;
|
|
889
|
+
showSubscriptionsTab?: boolean;
|
|
889
890
|
onPositionClick?: (tokenName: string, isIpo: boolean) => void;
|
|
890
891
|
onClosePosition?: (tokenName: string, type: 'market' | 'limit', quantity: number, marketPrice: number) => void;
|
|
891
892
|
offeringOrders?: readonly OfferingOrder[];
|
|
@@ -907,7 +908,7 @@ type PortfolioActivityPanelProps = {
|
|
|
907
908
|
className?: string;
|
|
908
909
|
style?: React.CSSProperties;
|
|
909
910
|
};
|
|
910
|
-
declare function PortfolioActivityPanel({ positions, showPositionsTab, onPositionClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, onAmendOrder, cancellingOrderId, compactPositions, defaultTab, pageSize, blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
|
|
911
|
+
declare function PortfolioActivityPanel({ positions, showPositionsTab, showSubscriptionsTab, onPositionClick, onClosePosition, offeringOrders, openOrders, orderHistory, tradeHistory, transfers, onCancelOrder, onCancelAllOrders, onAmendOrder, cancellingOrderId, compactPositions, defaultTab, pageSize, blockExplorerBaseUrl, className, style, }: PortfolioActivityPanelProps): react_jsx_runtime.JSX.Element;
|
|
911
912
|
|
|
912
913
|
type SelectorItem = {
|
|
913
914
|
readonly tokenName: string;
|
package/dist/index.js
CHANGED
|
@@ -13628,6 +13628,7 @@ function EditableField({ value, onCommit, format }) {
|
|
|
13628
13628
|
function PortfolioActivityPanel({
|
|
13629
13629
|
positions = [],
|
|
13630
13630
|
showPositionsTab = false,
|
|
13631
|
+
showSubscriptionsTab = true,
|
|
13631
13632
|
onPositionClick,
|
|
13632
13633
|
onClosePosition,
|
|
13633
13634
|
offeringOrders = [],
|
|
@@ -13646,7 +13647,7 @@ function PortfolioActivityPanel({
|
|
|
13646
13647
|
className,
|
|
13647
13648
|
style
|
|
13648
13649
|
}) {
|
|
13649
|
-
const resolvedDefaultTab = defaultTab ?? (showPositionsTab ? "positions" : "subscriptions");
|
|
13650
|
+
const resolvedDefaultTab = defaultTab ?? (showPositionsTab ? "positions" : showSubscriptionsTab ? "subscriptions" : "orders");
|
|
13650
13651
|
const [activeTab, setActiveTab] = React5.useState(resolvedDefaultTab);
|
|
13651
13652
|
const [activityPage, setActivityPage] = React5.useState(0);
|
|
13652
13653
|
const [pendingCancelOrderId, setPendingCancelOrderId] = React5.useState(null);
|
|
@@ -13729,6 +13730,27 @@ function PortfolioActivityPanel({
|
|
|
13729
13730
|
setAllExpanded(true);
|
|
13730
13731
|
}
|
|
13731
13732
|
};
|
|
13733
|
+
const mergedOrderHistory = React5.useMemo(() => {
|
|
13734
|
+
if (showSubscriptionsTab || offeringOrders.length === 0) return orderHistory;
|
|
13735
|
+
const mapped = offeringOrders.map((o, i) => ({
|
|
13736
|
+
id: o.ipoOrderId ?? -(i + 1),
|
|
13737
|
+
propertyId: 0,
|
|
13738
|
+
tokenName: o.tokenName,
|
|
13739
|
+
side: "BUY",
|
|
13740
|
+
type: "MARKET",
|
|
13741
|
+
timeInForce: "GTC",
|
|
13742
|
+
quantity: o.quantity,
|
|
13743
|
+
price: o.price,
|
|
13744
|
+
status: o.status.toUpperCase() === "ALLOCATED" ? "FILLED" : o.status.toUpperCase(),
|
|
13745
|
+
filledQuantity: o.status.toUpperCase() === "ALLOCATED" || o.status.toUpperCase() === "FILLED" || o.status.toUpperCase() === "CONFIRMED" ? o.quantity : 0,
|
|
13746
|
+
rejectionReason: null,
|
|
13747
|
+
deadline: 0,
|
|
13748
|
+
filledAt: o.status.toUpperCase() === "ALLOCATED" || o.status.toUpperCase() === "FILLED" || o.status.toUpperCase() === "CONFIRMED" ? o.createdAt : null,
|
|
13749
|
+
cancelledAt: null,
|
|
13750
|
+
createdAt: o.createdAt
|
|
13751
|
+
}));
|
|
13752
|
+
return [...orderHistory, ...mapped].sort((a, b) => b.createdAt - a.createdAt);
|
|
13753
|
+
}, [showSubscriptionsTab, offeringOrders, orderHistory]);
|
|
13732
13754
|
const activeTabTotal = React5.useMemo(() => {
|
|
13733
13755
|
switch (activeTab) {
|
|
13734
13756
|
case "positions":
|
|
@@ -13738,7 +13760,7 @@ function PortfolioActivityPanel({
|
|
|
13738
13760
|
case "open-orders":
|
|
13739
13761
|
return openOrders.length;
|
|
13740
13762
|
case "orders":
|
|
13741
|
-
return
|
|
13763
|
+
return mergedOrderHistory.length;
|
|
13742
13764
|
case "trades":
|
|
13743
13765
|
return tradeHistory.length;
|
|
13744
13766
|
case "transfers":
|
|
@@ -13746,15 +13768,15 @@ function PortfolioActivityPanel({
|
|
|
13746
13768
|
default:
|
|
13747
13769
|
return 0;
|
|
13748
13770
|
}
|
|
13749
|
-
}, [activeTab, positions.length, offeringOrders.length, openOrders.length,
|
|
13771
|
+
}, [activeTab, positions.length, offeringOrders.length, openOrders.length, mergedOrderHistory.length, tradeHistory.length, transfers.length]);
|
|
13750
13772
|
const positionsCount = positions.length;
|
|
13751
13773
|
const openOrdersCount = React5.useMemo(
|
|
13752
13774
|
() => openOrders.filter((o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED").length,
|
|
13753
13775
|
[openOrders]
|
|
13754
13776
|
);
|
|
13755
13777
|
const pendingHistoryCount = React5.useMemo(
|
|
13756
|
-
() =>
|
|
13757
|
-
[
|
|
13778
|
+
() => mergedOrderHistory.filter((o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED").length,
|
|
13779
|
+
[mergedOrderHistory]
|
|
13758
13780
|
);
|
|
13759
13781
|
const pendingOfferingsCount = React5.useMemo(
|
|
13760
13782
|
() => offeringOrders.filter((o) => {
|
|
@@ -13780,7 +13802,7 @@ function PortfolioActivityPanel({
|
|
|
13780
13802
|
")"
|
|
13781
13803
|
] })
|
|
13782
13804
|
] }),
|
|
13783
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Tab, { $active: activeTab === "subscriptions", onClick: () => handleTabChange("subscriptions"), children: [
|
|
13805
|
+
showSubscriptionsTab && /* @__PURE__ */ jsxRuntime.jsxs(Tab, { $active: activeTab === "subscriptions", onClick: () => handleTabChange("subscriptions"), children: [
|
|
13784
13806
|
"Initial Offerings",
|
|
13785
13807
|
pendingOfferingsCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(TabCount, { children: [
|
|
13786
13808
|
" (",
|
|
@@ -14058,8 +14080,8 @@ function PortfolioActivityPanel({
|
|
|
14058
14080
|
] })
|
|
14059
14081
|
] }),
|
|
14060
14082
|
activeTab === "orders" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14061
|
-
|
|
14062
|
-
|
|
14083
|
+
mergedOrderHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: "No orders yet. Place a trade to see it appear here." }),
|
|
14084
|
+
mergedOrderHistory.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14063
14085
|
/* @__PURE__ */ jsxRuntime.jsxs(GridHeader, { $columns: "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
|
|
14064
14086
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Asset" }),
|
|
14065
14087
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Side" }),
|
|
@@ -14070,7 +14092,7 @@ function PortfolioActivityPanel({
|
|
|
14070
14092
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Status" }),
|
|
14071
14093
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Date" })
|
|
14072
14094
|
] }),
|
|
14073
|
-
pageSlice(
|
|
14095
|
+
pageSlice(mergedOrderHistory).map((order) => {
|
|
14074
14096
|
const meta = getOrderStatusMeta(order.status);
|
|
14075
14097
|
const isMarket = order.type === "MARKET";
|
|
14076
14098
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14227,6 +14249,7 @@ var ContentScroll = styled9__default.default.div`
|
|
|
14227
14249
|
flex: 1;
|
|
14228
14250
|
overflow-y: auto;
|
|
14229
14251
|
min-height: 0;
|
|
14252
|
+
padding-bottom: 1rem;
|
|
14230
14253
|
scrollbar-width: thin;
|
|
14231
14254
|
scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
|
|
14232
14255
|
&::-webkit-scrollbar { width: 4px; }
|