@loafmarkets/ui 0.1.425 → 0.1.427

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 CHANGED
@@ -1288,8 +1288,10 @@ type AssetSelectorBarProps = {
1288
1288
  * ("YONG") and hovering it pops an instant tooltip with the full name. Falls back to the
1289
1289
  * full name when no ticker is known. Ignored when `tickerPrimary` is set. */
1290
1290
  compactName?: boolean;
1291
+ /** Fires on every open/close of the asset list (not on mount) — hosts defer per-row market data until the first open. */
1292
+ onOpenChange?: (open: boolean) => void;
1291
1293
  };
1292
- declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, afterName, imageUrl, badgeLabel, tickerPrimary, compactName, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
1294
+ declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, afterName, imageUrl, badgeLabel, tickerPrimary, compactName, onOpenChange, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
1293
1295
 
1294
1296
  type ToastVariant = 'success' | 'error' | 'info' | 'pending' | 'sell';
1295
1297
  type ToastData = {
package/dist/index.d.ts CHANGED
@@ -1288,8 +1288,10 @@ type AssetSelectorBarProps = {
1288
1288
  * ("YONG") and hovering it pops an instant tooltip with the full name. Falls back to the
1289
1289
  * full name when no ticker is known. Ignored when `tickerPrimary` is set. */
1290
1290
  compactName?: boolean;
1291
+ /** Fires on every open/close of the asset list (not on mount) — hosts defer per-row market data until the first open. */
1292
+ onOpenChange?: (open: boolean) => void;
1291
1293
  };
1292
- declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, afterName, imageUrl, badgeLabel, tickerPrimary, compactName, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
1294
+ declare function AssetSelectorBar({ propertyName, tokenPrice, offeringValuation, metrics: metricsProp, currentTokenName, selectorItems, onSelect, trailing, afterName, imageUrl, badgeLabel, tickerPrimary, compactName, onOpenChange, }: AssetSelectorBarProps): react_jsx_runtime.JSX.Element;
1293
1295
 
1294
1296
  type ToastVariant = 'success' | 'error' | 'info' | 'pending' | 'sell';
1295
1297
  type ToastData = {
package/dist/index.js CHANGED
@@ -10822,6 +10822,7 @@ function GalleryMapSection({
10822
10822
  const [showVideo, setShowVideo] = React9.useState(false);
10823
10823
  const [autoPlaying, setAutoPlaying] = React9.useState(autoPlay);
10824
10824
  const [showFullMap, setShowFullMap] = React9.useState(false);
10825
+ const [fullMapMountedFor, setFullMapMountedFor] = React9.useState(null);
10825
10826
  const [showFullVideo, setShowFullVideo] = React9.useState(false);
10826
10827
  const isMobile = useMaxWidth(768);
10827
10828
  const resolvedMapUrl = mapUrl ?? (tokenName ? `/map/${tokenName}?embed=true&zoom=14&hideOthers=true` : "about:blank");
@@ -10939,7 +10940,10 @@ function GalleryMapSection({
10939
10940
  ] }),
10940
10941
  /* @__PURE__ */ jsxRuntime.jsxs(MapHeaderRight, { children: [
10941
10942
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: propertyLocation }),
10942
- /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => setShowFullMap(true), children: [
10943
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => {
10944
+ setFullMapMountedFor(resolvedMapUrl);
10945
+ setShowFullMap(true);
10946
+ }, children: [
10943
10947
  /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", style: { width: 14, height: 14 }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3" }) }),
10944
10948
  "Full Screen"
10945
10949
  ] })
@@ -10988,7 +10992,7 @@ function GalleryMapSection({
10988
10992
  ] }),
10989
10993
  /* @__PURE__ */ jsxRuntime.jsx(SuburbDesc, { children: "One of Sydney's most prestigious harbourside suburbs, consistently ranked among Australia's highest-value residential markets. Strong capital growth driven by limited supply, heritage conservation overlays, and international buyer demand." })
10990
10994
  ] }),
10991
- showFullMap && !hideMap && /* @__PURE__ */ jsxRuntime.jsx(FullMapPopup, { onClose: () => setShowFullMap(false), mapUrl: resolvedMapUrl }),
10995
+ fullMapMountedFor === resolvedMapUrl && !hideMap && /* @__PURE__ */ jsxRuntime.jsx(FullMapPopup, { hidden: !showFullMap, onClose: () => setShowFullMap(false), mapUrl: resolvedMapUrl }),
10992
10996
  showFullVideo && videoUrl && /* @__PURE__ */ jsxRuntime.jsxs(FullVideoOverlay, { onClick: () => setShowFullVideo(false), children: [
10993
10997
  /* @__PURE__ */ jsxRuntime.jsx(FullVideoClose, { onClick: () => setShowFullVideo(false), "aria-label": "Close video", children: "\u2715" }),
10994
10998
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11118,21 +11122,23 @@ function StackedGallery({ images, onPhotoClick }) {
11118
11122
  }) })
11119
11123
  ] });
11120
11124
  }
11121
- function FullMapPopup({ onClose, mapUrl }) {
11125
+ function FullMapPopup({ onClose, mapUrl, hidden = false }) {
11122
11126
  React9.useEffect(() => {
11127
+ if (hidden) return;
11123
11128
  const handleEsc = (e) => {
11124
11129
  if (e.key === "Escape") onClose();
11125
11130
  };
11126
11131
  window.addEventListener("keydown", handleEsc);
11127
11132
  return () => window.removeEventListener("keydown", handleEsc);
11128
- }, [onClose]);
11133
+ }, [onClose, hidden]);
11129
11134
  React9.useEffect(() => {
11135
+ if (hidden) return;
11130
11136
  const handleMessage = (e) => {
11131
11137
  if (e.data === "loaf:close-embed") onClose();
11132
11138
  };
11133
11139
  window.addEventListener("message", handleMessage);
11134
11140
  return () => window.removeEventListener("message", handleMessage);
11135
- }, [onClose]);
11141
+ }, [onClose, hidden]);
11136
11142
  const iframeRef = React9.useCallback((node) => {
11137
11143
  if (!node) return;
11138
11144
  const handleLoad = () => {
@@ -11148,7 +11154,7 @@ function FullMapPopup({ onClose, mapUrl }) {
11148
11154
  };
11149
11155
  node.addEventListener("load", handleLoad);
11150
11156
  }, [onClose]);
11151
- return /* @__PURE__ */ jsxRuntime.jsx(FullMapOverlay, { onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(FullMapPanel, { onClick: (e) => e.stopPropagation(), children: [
11157
+ return /* @__PURE__ */ jsxRuntime.jsx(FullMapOverlay, { onClick: onClose, hidden, children: /* @__PURE__ */ jsxRuntime.jsxs(FullMapPanel, { onClick: (e) => e.stopPropagation(), children: [
11152
11158
  /* @__PURE__ */ jsxRuntime.jsxs(FullMapHeader, { children: [
11153
11159
  /* @__PURE__ */ jsxRuntime.jsxs(FullMapTitle, { children: [
11154
11160
  /* @__PURE__ */ jsxRuntime.jsx(bi.BiMap, {}),
@@ -11444,6 +11450,12 @@ var FullMapOverlay = styled10__default.default.div`
11444
11450
  align-items: center;
11445
11451
  justify-content: center;
11446
11452
  backdrop-filter: blur(4px);
11453
+
11454
+ /* Kept mounted between opens (see fullMapMountedFor); \`display: flex\` above would
11455
+ otherwise beat the UA's [hidden] rule. */
11456
+ &[hidden] {
11457
+ display: none;
11458
+ }
11447
11459
  `;
11448
11460
  var FullVideoOverlay = styled10__default.default.div`
11449
11461
  position: fixed;
@@ -13871,9 +13883,20 @@ function AssetSelectorBar({
13871
13883
  imageUrl,
13872
13884
  badgeLabel,
13873
13885
  tickerPrimary,
13874
- compactName
13886
+ compactName,
13887
+ onOpenChange
13875
13888
  }) {
13876
13889
  const [isDropdownOpen, setIsDropdownOpen] = React9.useState(false);
13890
+ const openChangeRef = React9.useRef(onOpenChange);
13891
+ openChangeRef.current = onOpenChange;
13892
+ const openSeenRef = React9.useRef(false);
13893
+ React9.useEffect(() => {
13894
+ if (!openSeenRef.current) {
13895
+ openSeenRef.current = true;
13896
+ return;
13897
+ }
13898
+ openChangeRef.current?.(isDropdownOpen);
13899
+ }, [isDropdownOpen]);
13877
13900
  const [nameTip, setNameTip] = React9.useState(null);
13878
13901
  const anchorRef = React9.useRef(null);
13879
13902
  const [dropdownPos, setDropdownPos] = React9.useState(null);