@loafmarkets/ui 0.1.423 → 0.1.425
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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +106 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -9
- 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;
|
|
@@ -1547,4 +1550,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
|
|
|
1547
1550
|
}>, maxPoints?: number): number[];
|
|
1548
1551
|
declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
|
|
1549
1552
|
|
|
1550
|
-
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;
|
|
@@ -1547,4 +1550,4 @@ declare function extractSparkline(candles: ReadonlyArray<{
|
|
|
1547
1550
|
}>, maxPoints?: number): number[];
|
|
1548
1551
|
declare const SparklineChart: React__default.NamedExoticComponent<SparklineChartProps>;
|
|
1549
1552
|
|
|
1550
|
-
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
|
@@ -2875,7 +2875,6 @@ function MobileDepthRow({
|
|
|
2875
2875
|
);
|
|
2876
2876
|
}
|
|
2877
2877
|
var isHlsManifest = (url) => /\.m3u8(\?|$)/i.test(url);
|
|
2878
|
-
var HLS_MIME = "application/vnd.apple.mpegurl";
|
|
2879
2878
|
var MANIFEST_FAILURES = /* @__PURE__ */ new Set(["manifestLoadError", "manifestLoadTimeOut", "manifestParsingError"]);
|
|
2880
2879
|
var HlsVideo = React9__namespace.forwardRef(
|
|
2881
2880
|
({ src, capLevelToPlayerSize = true, onError, ...videoProps }, ref) => {
|
|
@@ -2893,7 +2892,7 @@ var HlsVideo = React9__namespace.forwardRef(
|
|
|
2893
2892
|
React9__namespace.useEffect(() => {
|
|
2894
2893
|
const video = videoRef.current;
|
|
2895
2894
|
if (!video || !activeSrc) return;
|
|
2896
|
-
if (!isHlsManifest(activeSrc)
|
|
2895
|
+
if (!isHlsManifest(activeSrc)) {
|
|
2897
2896
|
video.src = activeSrc;
|
|
2898
2897
|
return;
|
|
2899
2898
|
}
|
|
@@ -3041,6 +3040,74 @@ var PropertyTour = React9__namespace.forwardRef(
|
|
|
3041
3040
|
);
|
|
3042
3041
|
PropertyTour.displayName = "PropertyTour";
|
|
3043
3042
|
|
|
3043
|
+
// src/lib/breaking-dismissals.ts
|
|
3044
|
+
var BREAKING_WINDOW_HOURS = 6;
|
|
3045
|
+
var BREAKING_MEMORY_CAP = 50;
|
|
3046
|
+
var BREAKING_MEMORY_STORAGE_KEY = "loaf:dismissed-breaking";
|
|
3047
|
+
var emptyBreakingMemory = () => ({ dismissed: {}, pinned: {}, watermark: null });
|
|
3048
|
+
var isTimestampMap = (v) => typeof v === "object" && v !== null && !Array.isArray(v) && Object.values(v).every((t) => typeof t === "number" && Number.isFinite(t));
|
|
3049
|
+
var pruneMap = (map, cutoff) => {
|
|
3050
|
+
const fresh = Object.entries(map).filter(([, t]) => t >= cutoff);
|
|
3051
|
+
fresh.sort((a, b) => b[1] - a[1]);
|
|
3052
|
+
return Object.fromEntries(fresh.slice(0, BREAKING_MEMORY_CAP));
|
|
3053
|
+
};
|
|
3054
|
+
var prune = (mem, now) => {
|
|
3055
|
+
const cutoff = now - BREAKING_WINDOW_HOURS * 36e5;
|
|
3056
|
+
return {
|
|
3057
|
+
dismissed: pruneMap(mem.dismissed, cutoff),
|
|
3058
|
+
pinned: pruneMap(mem.pinned, cutoff),
|
|
3059
|
+
// An expired watermark can't block anything (every in-window story is newer).
|
|
3060
|
+
watermark: mem.watermark !== null && mem.watermark >= cutoff ? mem.watermark : null
|
|
3061
|
+
};
|
|
3062
|
+
};
|
|
3063
|
+
function parseBreakingMemory(raw, now) {
|
|
3064
|
+
if (!raw) return emptyBreakingMemory();
|
|
3065
|
+
try {
|
|
3066
|
+
const v = JSON.parse(raw);
|
|
3067
|
+
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))) {
|
|
3068
|
+
return emptyBreakingMemory();
|
|
3069
|
+
}
|
|
3070
|
+
return prune({ dismissed: v.dismissed, pinned: v.pinned, watermark: v.watermark ?? null }, now);
|
|
3071
|
+
} catch {
|
|
3072
|
+
return emptyBreakingMemory();
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
var serializeBreakingMemory = (mem) => JSON.stringify(mem);
|
|
3076
|
+
function recordBreakingDismissal(mem, key, publishedAtMs, now) {
|
|
3077
|
+
return prune(
|
|
3078
|
+
{
|
|
3079
|
+
dismissed: { ...mem.dismissed, [key]: publishedAtMs },
|
|
3080
|
+
pinned: mem.pinned,
|
|
3081
|
+
watermark: Math.max(mem.watermark ?? -Infinity, publishedAtMs)
|
|
3082
|
+
},
|
|
3083
|
+
now
|
|
3084
|
+
);
|
|
3085
|
+
}
|
|
3086
|
+
function recordBreakingPins(mem, pins, now) {
|
|
3087
|
+
if (pins.every((p) => mem.pinned[p.key] !== void 0)) return mem;
|
|
3088
|
+
const pinned = { ...mem.pinned };
|
|
3089
|
+
for (const p of pins) pinned[p.key] = p.publishedAtMs;
|
|
3090
|
+
return prune({ dismissed: mem.dismissed, pinned, watermark: mem.watermark }, now);
|
|
3091
|
+
}
|
|
3092
|
+
function mayPinBreaking(mem, key, publishedAtMs) {
|
|
3093
|
+
if (mem.dismissed[key] !== void 0) return false;
|
|
3094
|
+
if (mem.watermark === null) return true;
|
|
3095
|
+
return publishedAtMs > mem.watermark || mem.pinned[key] !== void 0;
|
|
3096
|
+
}
|
|
3097
|
+
function loadBreakingMemory(now) {
|
|
3098
|
+
try {
|
|
3099
|
+
return parseBreakingMemory(window.localStorage.getItem(BREAKING_MEMORY_STORAGE_KEY), now);
|
|
3100
|
+
} catch {
|
|
3101
|
+
return emptyBreakingMemory();
|
|
3102
|
+
}
|
|
3103
|
+
}
|
|
3104
|
+
function saveBreakingMemory(mem) {
|
|
3105
|
+
try {
|
|
3106
|
+
window.localStorage.setItem(BREAKING_MEMORY_STORAGE_KEY, serializeBreakingMemory(mem));
|
|
3107
|
+
} catch {
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3044
3111
|
// src/lib/isSafeUrl.ts
|
|
3045
3112
|
var CONTROL_CHARS = /[\u0000-\u001F\u007F]/g;
|
|
3046
3113
|
function isSafeUrl(url) {
|
|
@@ -3061,13 +3128,27 @@ function matchesTab(item, tab) {
|
|
|
3061
3128
|
if (item.types && item.types.length > 0) return item.types.includes(tab);
|
|
3062
3129
|
return item.type === tab;
|
|
3063
3130
|
}
|
|
3064
|
-
var BREAKING_WINDOW_HOURS = 6;
|
|
3065
3131
|
var MAX_PINNED_BREAKING = 2;
|
|
3066
3132
|
var BREAKING_IMPACT_FLOOR = 8;
|
|
3067
3133
|
var breakingImpact = (it) => typeof it.impactScore === "number" && Number.isFinite(it.impactScore) ? it.impactScore : BREAKING_IMPACT_FLOOR;
|
|
3068
|
-
var
|
|
3069
|
-
var
|
|
3134
|
+
var breakingMemory = null;
|
|
3135
|
+
var getBreakingMemory = () => breakingMemory ??= loadBreakingMemory(Date.now());
|
|
3136
|
+
var commitBreakingMemory = (mem) => {
|
|
3137
|
+
breakingMemory = mem;
|
|
3138
|
+
saveBreakingMemory(mem);
|
|
3139
|
+
};
|
|
3140
|
+
var __resetDismissedBreaking = () => {
|
|
3141
|
+
breakingMemory = null;
|
|
3142
|
+
try {
|
|
3143
|
+
window.localStorage.removeItem(BREAKING_MEMORY_STORAGE_KEY);
|
|
3144
|
+
} catch {
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
var __reloadBreakingMemory = () => {
|
|
3148
|
+
breakingMemory = null;
|
|
3149
|
+
};
|
|
3070
3150
|
var breakingKey = (it) => String(it.id ?? it.title);
|
|
3151
|
+
var breakingPublishedMs = (it) => new Date(it.publishedAt).getTime();
|
|
3071
3152
|
var BREAKING_SWIPE_MIN_PX = 80;
|
|
3072
3153
|
var ITEMS_PER_PAGE = 5;
|
|
3073
3154
|
var ITEMS_PER_PAGE_MOBILE = 5;
|
|
@@ -3595,8 +3676,19 @@ var PropertyNewsUpdates = React9__namespace.forwardRef(
|
|
|
3595
3676
|
});
|
|
3596
3677
|
};
|
|
3597
3678
|
const pinnedBreaking = React9__namespace.useMemo(() => {
|
|
3598
|
-
|
|
3679
|
+
const mem = getBreakingMemory();
|
|
3680
|
+
return breakingEligible.filter((it) => mayPinBreaking(mem, breakingKey(it), breakingPublishedMs(it))).sort((a, b) => breakingImpact(b) - breakingImpact(a)).slice(0, MAX_PINNED_BREAKING);
|
|
3599
3681
|
}, [breakingEligible, dismissedVersion]);
|
|
3682
|
+
React9__namespace.useEffect(() => {
|
|
3683
|
+
if (pinnedBreaking.length === 0) return;
|
|
3684
|
+
const mem = getBreakingMemory();
|
|
3685
|
+
const next = recordBreakingPins(
|
|
3686
|
+
mem,
|
|
3687
|
+
pinnedBreaking.map((it) => ({ key: breakingKey(it), publishedAtMs: breakingPublishedMs(it) })),
|
|
3688
|
+
Date.now()
|
|
3689
|
+
);
|
|
3690
|
+
if (next !== mem) commitBreakingMemory(next);
|
|
3691
|
+
}, [pinnedBreaking]);
|
|
3600
3692
|
const breakingRowKeys = React9__namespace.useMemo(
|
|
3601
3693
|
() => new Set(breakingEligible.map(breakingKey)),
|
|
3602
3694
|
[breakingEligible]
|
|
@@ -3701,8 +3793,13 @@ var PropertyNewsUpdates = React9__namespace.forwardRef(
|
|
|
3701
3793
|
const sentiment = getSentimentInfo(item.sentimentScore);
|
|
3702
3794
|
const k = breakingKey(item);
|
|
3703
3795
|
const dx = breakingSwipe?.key === k ? breakingSwipe.dx : 0;
|
|
3796
|
+
const persistDismissal = () => {
|
|
3797
|
+
commitBreakingMemory(
|
|
3798
|
+
recordBreakingDismissal(getBreakingMemory(), k, breakingPublishedMs(item), Date.now())
|
|
3799
|
+
);
|
|
3800
|
+
};
|
|
3704
3801
|
const finishDismiss = () => {
|
|
3705
|
-
|
|
3802
|
+
persistDismissal();
|
|
3706
3803
|
setDismissingBreakingKey(null);
|
|
3707
3804
|
setDismissedVersion((v) => v + 1);
|
|
3708
3805
|
};
|
|
@@ -3750,7 +3847,7 @@ var PropertyNewsUpdates = React9__namespace.forwardRef(
|
|
|
3750
3847
|
const drag = Math.max(0, e.clientX - breakingSwipeStartXRef.current);
|
|
3751
3848
|
const width = e.currentTarget.offsetWidth || 0;
|
|
3752
3849
|
if (drag >= Math.max(BREAKING_SWIPE_MIN_PX, width * 0.3)) {
|
|
3753
|
-
|
|
3850
|
+
persistDismissal();
|
|
3754
3851
|
setDismissedVersion((v) => v + 1);
|
|
3755
3852
|
}
|
|
3756
3853
|
},
|
|
@@ -22021,6 +22118,7 @@ exports.ToastProvider = ToastProvider;
|
|
|
22021
22118
|
exports.TradeConfirmationModal = TradeConfirmationModal;
|
|
22022
22119
|
exports.TradingSlider = TradingSlider;
|
|
22023
22120
|
exports.YourOrders = YourOrders;
|
|
22121
|
+
exports.__reloadBreakingMemory = __reloadBreakingMemory;
|
|
22024
22122
|
exports.__resetDismissedBreaking = __resetDismissedBreaking;
|
|
22025
22123
|
exports.badgeVariants = badgeVariants;
|
|
22026
22124
|
exports.buttonVariants = buttonVariants;
|