@loafmarkets/ui 0.1.422 → 0.1.424
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 +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +112 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -379,6 +379,9 @@ interface PropertyNewsUpdatesProps extends React$1.HTMLAttributes<HTMLDivElement
|
|
|
379
379
|
showAssetBadges?: boolean;
|
|
380
380
|
}
|
|
381
381
|
declare const __resetDismissedBreaking: () => void;
|
|
382
|
+
/** Test hook: drop the in-memory cache so the next read comes from storage,
|
|
383
|
+
* the way a fresh page load would. */
|
|
384
|
+
declare const __reloadBreakingMemory: () => void;
|
|
382
385
|
declare function formatAge(publishedAt: string, now: number): string;
|
|
383
386
|
declare function rowAgeLabel(publishedAt: string | undefined, now: number): {
|
|
384
387
|
label: string;
|
|
@@ -743,6 +746,12 @@ type LoginPopupProps = {
|
|
|
743
746
|
* gate advances straight to sign-in.
|
|
744
747
|
*/
|
|
745
748
|
initialCode?: string;
|
|
749
|
+
/**
|
|
750
|
+
* Seeds the "Claim your handle" input (e.g. from a linked X username). Fills
|
|
751
|
+
* only an untouched field — never clobbers typed text. Caller sanitizes;
|
|
752
|
+
* this component seeds verbatim.
|
|
753
|
+
*/
|
|
754
|
+
defaultHandle?: string | null;
|
|
746
755
|
/** Wallet address used for the receive funds view (bypasses Privy modal). */
|
|
747
756
|
walletAddress?: string | null;
|
|
748
757
|
/** Called when the user submits a referral code during onboarding. */
|
|
@@ -1541,4 +1550,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
|
|
|
1541
1550
|
}>, maxPoints?: number): number[];
|
|
1542
1551
|
declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
|
|
1543
1552
|
|
|
1544
|
-
export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, HlsVideo, type HlsVideoProps, type HlsVideoSource, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, type LoafLiquidityDotState, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type NewsBadgeAsset, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SentimentBar, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, __resetDismissedBreaking, badgeVariants, buttonVariants, extractSparkline, formatAge, hasPendingActivity, matchesTab, rowAgeLabel, useAdaptivePolling, useToast };
|
|
1553
|
+
export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, HlsVideo, type HlsVideoProps, type HlsVideoSource, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, type LoafLiquidityDotState, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type NewsBadgeAsset, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SentimentBar, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, __reloadBreakingMemory, __resetDismissedBreaking, badgeVariants, buttonVariants, extractSparkline, formatAge, hasPendingActivity, matchesTab, rowAgeLabel, useAdaptivePolling, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -379,6 +379,9 @@ interface PropertyNewsUpdatesProps extends React$1.HTMLAttributes<HTMLDivElement
|
|
|
379
379
|
showAssetBadges?: boolean;
|
|
380
380
|
}
|
|
381
381
|
declare const __resetDismissedBreaking: () => void;
|
|
382
|
+
/** Test hook: drop the in-memory cache so the next read comes from storage,
|
|
383
|
+
* the way a fresh page load would. */
|
|
384
|
+
declare const __reloadBreakingMemory: () => void;
|
|
382
385
|
declare function formatAge(publishedAt: string, now: number): string;
|
|
383
386
|
declare function rowAgeLabel(publishedAt: string | undefined, now: number): {
|
|
384
387
|
label: string;
|
|
@@ -743,6 +746,12 @@ type LoginPopupProps = {
|
|
|
743
746
|
* gate advances straight to sign-in.
|
|
744
747
|
*/
|
|
745
748
|
initialCode?: string;
|
|
749
|
+
/**
|
|
750
|
+
* Seeds the "Claim your handle" input (e.g. from a linked X username). Fills
|
|
751
|
+
* only an untouched field — never clobbers typed text. Caller sanitizes;
|
|
752
|
+
* this component seeds verbatim.
|
|
753
|
+
*/
|
|
754
|
+
defaultHandle?: string | null;
|
|
746
755
|
/** Wallet address used for the receive funds view (bypasses Privy modal). */
|
|
747
756
|
walletAddress?: string | null;
|
|
748
757
|
/** Called when the user submits a referral code during onboarding. */
|
|
@@ -1541,4 +1550,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
|
|
|
1541
1550
|
}>, maxPoints?: number): number[];
|
|
1542
1551
|
declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
|
|
1543
1552
|
|
|
1544
|
-
export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, HlsVideo, type HlsVideoProps, type HlsVideoSource, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, type LoafLiquidityDotState, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type NewsBadgeAsset, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SentimentBar, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, __resetDismissedBreaking, badgeVariants, buttonVariants, extractSparkline, formatAge, hasPendingActivity, matchesTab, rowAgeLabel, useAdaptivePolling, useToast };
|
|
1553
|
+
export { type ActivityTabId, AssetSelectorBar, type AssetSelectorBarProps, type AssetSelectorMetric, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, ContactPopup, type ContactPopupProps, type FinancialItem, type FundWalletParams, type FundWalletResult, Header, type HeaderNavItem, type HeaderPortfolioData, type HeaderProps, HlsVideo, type HlsVideoProps, type HlsVideoSource, type HousePositionOrderbook, type HousePositionPendingOrder, HousePositionSlider, HousePositionSliderMobile, type HousePositionSliderMobileOrderPayload, type HousePositionSliderMobileOrderbook, type HousePositionSliderMobileProps, type HousePositionSliderOrderPayload, type HousePositionSliderProps, type InspectionSlot, LoafLiquidityBadge, type LoafLiquidityDotState, LoafLiquidityLogo, type LoafLiquidityLogoProps, LoginPopup, type LoginPopupProps, MobileTradeNav, type MobileTradeNavItem, type MobileTradeNavProps, type NewsBadgeAsset, type OfferStatus, OfferingProgressCard, type OfferingProgressCardProps, OnboardingGuide, type OnboardingGuideProps, Orderbook, type OrderbookLevel, type OrderbookProps, type OrderbookSide, type OrderbookTrade, type OverviewImage, type OverviewResponse, OwnerBooking, type OwnerBookingProps, PaymentPopup, type PaymentPopupProps, PortfolioActivityPanel, type PortfolioActivityPanelProps, type PortfolioPosition, PortfolioSummary, type PortfolioSummaryProps, PriceChart, type PriceChartCandle, type PriceChartProps, type PriceChartRange, type PropertyAddressOption, PropertyBuy, PropertyCompareBar, type PropertyCompareBarProps, PropertyDocuments, type PropertyGalleryHotspot, type PropertyGalleryImage, PropertyHeroHeader, type PropertyHeroHeaderProps, PropertyHistory, type PropertyInfoItem, PropertyInspectionTimes, PropertyMediaRow, type PropertyMediaRowProps, type PropertyNewsItem, type PropertyNewsType, PropertyNewsUpdates, type PropertyNewsUpdatesProps, type PropertyOffer, PropertyOffers, type PropertyOffersProps, PropertyOverview, type PropertyOverviewProps, PropertyPhotoGallery, type PropertyPriceSummary, PropertySubheader, type PropertySubheaderAction, type PropertySubheaderProps, type PropertySubheaderTab, PropertyTour, type PropertyTourProps, PropertyValuation, type PropertyValuationProps, type PropertyValueSummary, type PurchaseFeedItem, type SelectorItem, SentimentBar, SiteFooter, Skeleton, type SkeletonProps, SlideDigit, SparklineChart, type SparklineChartProps, type ToastData, ToastProvider, type ToastVariant, TradeConfirmationModal, type TradeConfirmationModalDetails, type TradeConfirmationModalProps, TradingSlider, type TradingSliderProps, type YourOrder, type YourOrderSide, YourOrders, type YourOrdersProps, __reloadBreakingMemory, __resetDismissedBreaking, badgeVariants, buttonVariants, extractSparkline, formatAge, hasPendingActivity, matchesTab, rowAgeLabel, useAdaptivePolling, useToast };
|
package/dist/index.js
CHANGED
|
@@ -3041,6 +3041,74 @@ var PropertyTour = React9__namespace.forwardRef(
|
|
|
3041
3041
|
);
|
|
3042
3042
|
PropertyTour.displayName = "PropertyTour";
|
|
3043
3043
|
|
|
3044
|
+
// src/lib/breaking-dismissals.ts
|
|
3045
|
+
var BREAKING_WINDOW_HOURS = 6;
|
|
3046
|
+
var BREAKING_MEMORY_CAP = 50;
|
|
3047
|
+
var BREAKING_MEMORY_STORAGE_KEY = "loaf:dismissed-breaking";
|
|
3048
|
+
var emptyBreakingMemory = () => ({ dismissed: {}, pinned: {}, watermark: null });
|
|
3049
|
+
var isTimestampMap = (v) => typeof v === "object" && v !== null && !Array.isArray(v) && Object.values(v).every((t) => typeof t === "number" && Number.isFinite(t));
|
|
3050
|
+
var pruneMap = (map, cutoff) => {
|
|
3051
|
+
const fresh = Object.entries(map).filter(([, t]) => t >= cutoff);
|
|
3052
|
+
fresh.sort((a, b) => b[1] - a[1]);
|
|
3053
|
+
return Object.fromEntries(fresh.slice(0, BREAKING_MEMORY_CAP));
|
|
3054
|
+
};
|
|
3055
|
+
var prune = (mem, now) => {
|
|
3056
|
+
const cutoff = now - BREAKING_WINDOW_HOURS * 36e5;
|
|
3057
|
+
return {
|
|
3058
|
+
dismissed: pruneMap(mem.dismissed, cutoff),
|
|
3059
|
+
pinned: pruneMap(mem.pinned, cutoff),
|
|
3060
|
+
// An expired watermark can't block anything (every in-window story is newer).
|
|
3061
|
+
watermark: mem.watermark !== null && mem.watermark >= cutoff ? mem.watermark : null
|
|
3062
|
+
};
|
|
3063
|
+
};
|
|
3064
|
+
function parseBreakingMemory(raw, now) {
|
|
3065
|
+
if (!raw) return emptyBreakingMemory();
|
|
3066
|
+
try {
|
|
3067
|
+
const v = JSON.parse(raw);
|
|
3068
|
+
if (typeof v !== "object" || v === null || Array.isArray(v) || !isTimestampMap(v.dismissed) || !isTimestampMap(v.pinned) || !(v.watermark === null || typeof v.watermark === "number" && Number.isFinite(v.watermark))) {
|
|
3069
|
+
return emptyBreakingMemory();
|
|
3070
|
+
}
|
|
3071
|
+
return prune({ dismissed: v.dismissed, pinned: v.pinned, watermark: v.watermark ?? null }, now);
|
|
3072
|
+
} catch {
|
|
3073
|
+
return emptyBreakingMemory();
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
var serializeBreakingMemory = (mem) => JSON.stringify(mem);
|
|
3077
|
+
function recordBreakingDismissal(mem, key, publishedAtMs, now) {
|
|
3078
|
+
return prune(
|
|
3079
|
+
{
|
|
3080
|
+
dismissed: { ...mem.dismissed, [key]: publishedAtMs },
|
|
3081
|
+
pinned: mem.pinned,
|
|
3082
|
+
watermark: Math.max(mem.watermark ?? -Infinity, publishedAtMs)
|
|
3083
|
+
},
|
|
3084
|
+
now
|
|
3085
|
+
);
|
|
3086
|
+
}
|
|
3087
|
+
function recordBreakingPins(mem, pins, now) {
|
|
3088
|
+
if (pins.every((p) => mem.pinned[p.key] !== void 0)) return mem;
|
|
3089
|
+
const pinned = { ...mem.pinned };
|
|
3090
|
+
for (const p of pins) pinned[p.key] = p.publishedAtMs;
|
|
3091
|
+
return prune({ dismissed: mem.dismissed, pinned, watermark: mem.watermark }, now);
|
|
3092
|
+
}
|
|
3093
|
+
function mayPinBreaking(mem, key, publishedAtMs) {
|
|
3094
|
+
if (mem.dismissed[key] !== void 0) return false;
|
|
3095
|
+
if (mem.watermark === null) return true;
|
|
3096
|
+
return publishedAtMs > mem.watermark || mem.pinned[key] !== void 0;
|
|
3097
|
+
}
|
|
3098
|
+
function loadBreakingMemory(now) {
|
|
3099
|
+
try {
|
|
3100
|
+
return parseBreakingMemory(window.localStorage.getItem(BREAKING_MEMORY_STORAGE_KEY), now);
|
|
3101
|
+
} catch {
|
|
3102
|
+
return emptyBreakingMemory();
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
function saveBreakingMemory(mem) {
|
|
3106
|
+
try {
|
|
3107
|
+
window.localStorage.setItem(BREAKING_MEMORY_STORAGE_KEY, serializeBreakingMemory(mem));
|
|
3108
|
+
} catch {
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3044
3112
|
// src/lib/isSafeUrl.ts
|
|
3045
3113
|
var CONTROL_CHARS = /[\u0000-\u001F\u007F]/g;
|
|
3046
3114
|
function isSafeUrl(url) {
|
|
@@ -3061,13 +3129,27 @@ function matchesTab(item, tab) {
|
|
|
3061
3129
|
if (item.types && item.types.length > 0) return item.types.includes(tab);
|
|
3062
3130
|
return item.type === tab;
|
|
3063
3131
|
}
|
|
3064
|
-
var BREAKING_WINDOW_HOURS = 6;
|
|
3065
3132
|
var MAX_PINNED_BREAKING = 2;
|
|
3066
3133
|
var BREAKING_IMPACT_FLOOR = 8;
|
|
3067
3134
|
var breakingImpact = (it) => typeof it.impactScore === "number" && Number.isFinite(it.impactScore) ? it.impactScore : BREAKING_IMPACT_FLOOR;
|
|
3068
|
-
var
|
|
3069
|
-
var
|
|
3135
|
+
var breakingMemory = null;
|
|
3136
|
+
var getBreakingMemory = () => breakingMemory ??= loadBreakingMemory(Date.now());
|
|
3137
|
+
var commitBreakingMemory = (mem) => {
|
|
3138
|
+
breakingMemory = mem;
|
|
3139
|
+
saveBreakingMemory(mem);
|
|
3140
|
+
};
|
|
3141
|
+
var __resetDismissedBreaking = () => {
|
|
3142
|
+
breakingMemory = null;
|
|
3143
|
+
try {
|
|
3144
|
+
window.localStorage.removeItem(BREAKING_MEMORY_STORAGE_KEY);
|
|
3145
|
+
} catch {
|
|
3146
|
+
}
|
|
3147
|
+
};
|
|
3148
|
+
var __reloadBreakingMemory = () => {
|
|
3149
|
+
breakingMemory = null;
|
|
3150
|
+
};
|
|
3070
3151
|
var breakingKey = (it) => String(it.id ?? it.title);
|
|
3152
|
+
var breakingPublishedMs = (it) => new Date(it.publishedAt).getTime();
|
|
3071
3153
|
var BREAKING_SWIPE_MIN_PX = 80;
|
|
3072
3154
|
var ITEMS_PER_PAGE = 5;
|
|
3073
3155
|
var ITEMS_PER_PAGE_MOBILE = 5;
|
|
@@ -3595,8 +3677,19 @@ var PropertyNewsUpdates = React9__namespace.forwardRef(
|
|
|
3595
3677
|
});
|
|
3596
3678
|
};
|
|
3597
3679
|
const pinnedBreaking = React9__namespace.useMemo(() => {
|
|
3598
|
-
|
|
3680
|
+
const mem = getBreakingMemory();
|
|
3681
|
+
return breakingEligible.filter((it) => mayPinBreaking(mem, breakingKey(it), breakingPublishedMs(it))).sort((a, b) => breakingImpact(b) - breakingImpact(a)).slice(0, MAX_PINNED_BREAKING);
|
|
3599
3682
|
}, [breakingEligible, dismissedVersion]);
|
|
3683
|
+
React9__namespace.useEffect(() => {
|
|
3684
|
+
if (pinnedBreaking.length === 0) return;
|
|
3685
|
+
const mem = getBreakingMemory();
|
|
3686
|
+
const next = recordBreakingPins(
|
|
3687
|
+
mem,
|
|
3688
|
+
pinnedBreaking.map((it) => ({ key: breakingKey(it), publishedAtMs: breakingPublishedMs(it) })),
|
|
3689
|
+
Date.now()
|
|
3690
|
+
);
|
|
3691
|
+
if (next !== mem) commitBreakingMemory(next);
|
|
3692
|
+
}, [pinnedBreaking]);
|
|
3600
3693
|
const breakingRowKeys = React9__namespace.useMemo(
|
|
3601
3694
|
() => new Set(breakingEligible.map(breakingKey)),
|
|
3602
3695
|
[breakingEligible]
|
|
@@ -3701,8 +3794,13 @@ var PropertyNewsUpdates = React9__namespace.forwardRef(
|
|
|
3701
3794
|
const sentiment = getSentimentInfo(item.sentimentScore);
|
|
3702
3795
|
const k = breakingKey(item);
|
|
3703
3796
|
const dx = breakingSwipe?.key === k ? breakingSwipe.dx : 0;
|
|
3797
|
+
const persistDismissal = () => {
|
|
3798
|
+
commitBreakingMemory(
|
|
3799
|
+
recordBreakingDismissal(getBreakingMemory(), k, breakingPublishedMs(item), Date.now())
|
|
3800
|
+
);
|
|
3801
|
+
};
|
|
3704
3802
|
const finishDismiss = () => {
|
|
3705
|
-
|
|
3803
|
+
persistDismissal();
|
|
3706
3804
|
setDismissingBreakingKey(null);
|
|
3707
3805
|
setDismissedVersion((v) => v + 1);
|
|
3708
3806
|
};
|
|
@@ -3750,7 +3848,7 @@ var PropertyNewsUpdates = React9__namespace.forwardRef(
|
|
|
3750
3848
|
const drag = Math.max(0, e.clientX - breakingSwipeStartXRef.current);
|
|
3751
3849
|
const width = e.currentTarget.offsetWidth || 0;
|
|
3752
3850
|
if (drag >= Math.max(BREAKING_SWIPE_MIN_PX, width * 0.3)) {
|
|
3753
|
-
|
|
3851
|
+
persistDismissal();
|
|
3754
3852
|
setDismissedVersion((v) => v + 1);
|
|
3755
3853
|
}
|
|
3756
3854
|
},
|
|
@@ -7669,6 +7767,7 @@ var LoginPopup = ({
|
|
|
7669
7767
|
onFundWallet,
|
|
7670
7768
|
initialView,
|
|
7671
7769
|
initialCode,
|
|
7770
|
+
defaultHandle,
|
|
7672
7771
|
kycStatus: kycStatusProp,
|
|
7673
7772
|
walletAddress,
|
|
7674
7773
|
onSubmitReferralCode,
|
|
@@ -7679,6 +7778,12 @@ var LoginPopup = ({
|
|
|
7679
7778
|
const [view, setView] = React9.useState(() => initialView ?? "main");
|
|
7680
7779
|
const [email, setEmail] = React9.useState("");
|
|
7681
7780
|
const [handle, setHandle] = React9.useState("");
|
|
7781
|
+
const seededDefaultHandleRef = React9__namespace.default.useRef(null);
|
|
7782
|
+
React9.useEffect(() => {
|
|
7783
|
+
if (!defaultHandle || seededDefaultHandleRef.current === defaultHandle) return;
|
|
7784
|
+
seededDefaultHandleRef.current = defaultHandle;
|
|
7785
|
+
setHandle((current) => current ? current : defaultHandle);
|
|
7786
|
+
}, [defaultHandle]);
|
|
7682
7787
|
const [otp, setOtp] = React9.useState(Array(OTP_INPUT_LENGTH).fill(""));
|
|
7683
7788
|
const [error, setError] = React9.useState("");
|
|
7684
7789
|
const [copied, setCopied] = React9.useState(false);
|
|
@@ -22014,6 +22119,7 @@ exports.ToastProvider = ToastProvider;
|
|
|
22014
22119
|
exports.TradeConfirmationModal = TradeConfirmationModal;
|
|
22015
22120
|
exports.TradingSlider = TradingSlider;
|
|
22016
22121
|
exports.YourOrders = YourOrders;
|
|
22122
|
+
exports.__reloadBreakingMemory = __reloadBreakingMemory;
|
|
22017
22123
|
exports.__resetDismissedBreaking = __resetDismissedBreaking;
|
|
22018
22124
|
exports.badgeVariants = badgeVariants;
|
|
22019
22125
|
exports.buttonVariants = buttonVariants;
|