@garagem-ai/site-sdk 0.13.6 → 0.14.1

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/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { k as SearchUi, a as Listing, ai as LocationNameTables, S as SearchPathFilters, A as AppliedSearchQuery, bq as MapSearchSubscription, an as MapBounds, as as MapPolygon, au as MapSearchResult, ar as MapPinCluster, O as PhotoSearchItem, U as ListingWithMatchedPhoto, F as FetchLike } from './types-photo-search-CVPyF9zC.mjs';
1
+ import { k as SearchUi, a as Listing, ai as LocationNameTables, S as SearchPathFilters, A as AppliedSearchQuery, bq as MapSearchSubscription, an as MapBounds, as as MapPolygon, au as MapSearchResult, ar as MapPinCluster, O as PhotoSearchItem, U as ListingWithMatchedPhoto, F as FetchLike } from './types-photo-search--3fBk3Cs.mjs';
2
2
 
3
3
  type SiteIdInput = string | Promise<string> | (() => string | Promise<string>);
4
4
  type PublicSearchSnapshot = {
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { k as SearchUi, a as Listing, ai as LocationNameTables, S as SearchPathFilters, A as AppliedSearchQuery, bq as MapSearchSubscription, an as MapBounds, as as MapPolygon, au as MapSearchResult, ar as MapPinCluster, O as PhotoSearchItem, U as ListingWithMatchedPhoto, F as FetchLike } from './types-photo-search-CVPyF9zC.js';
1
+ import { k as SearchUi, a as Listing, ai as LocationNameTables, S as SearchPathFilters, A as AppliedSearchQuery, bq as MapSearchSubscription, an as MapBounds, as as MapPolygon, au as MapSearchResult, ar as MapPinCluster, O as PhotoSearchItem, U as ListingWithMatchedPhoto, F as FetchLike } from './types-photo-search--3fBk3Cs.js';
2
2
 
3
3
  type SiteIdInput = string | Promise<string> | (() => string | Promise<string>);
4
4
  type PublicSearchSnapshot = {
package/dist/react.js CHANGED
@@ -1472,9 +1472,21 @@ var import_react2 = require("react");
1472
1472
  function listingLocationLabel(location) {
1473
1473
  return [location.neighborhood, location.city, location.state].map((part) => part ? String(part).trim() : "").filter(Boolean).join(", ");
1474
1474
  }
1475
+ function cardPriceLabel(isPrivate, collapsed, price, formattedPrice) {
1476
+ if (isPrivate) return "Sob consulta";
1477
+ if (collapsed && price != null) return `A partir de ${formattedPrice}`;
1478
+ return formattedPrice;
1479
+ }
1475
1480
  function toListingCardModel(listing) {
1476
1481
  const isPrivate = listing.priceVisibility === "private";
1477
1482
  const area = listing.property?.usableArea ?? listing.property?.totalArea;
1483
+ const unitCount = listing.development?.unitCount;
1484
+ const collapsed = typeof unitCount === "number" && unitCount > 1;
1485
+ const formattedPrice = formatListingPrice(
1486
+ listing.price,
1487
+ "pt-BR",
1488
+ listing.currency ?? "BRL"
1489
+ );
1478
1490
  return {
1479
1491
  href: listingPublicPath(listing),
1480
1492
  title: listing.title,
@@ -1482,7 +1494,12 @@ function toListingCardModel(listing) {
1482
1494
  businessLabel: listingBusinessLabel(listing.businessType),
1483
1495
  priceVisibility: listing.priceVisibility,
1484
1496
  price: listing.price,
1485
- priceLabel: isPrivate ? "Sob consulta" : formatListingPrice(listing.price, "pt-BR", listing.currency ?? "BRL"),
1497
+ priceLabel: cardPriceLabel(
1498
+ isPrivate,
1499
+ collapsed,
1500
+ listing.price,
1501
+ formattedPrice
1502
+ ),
1486
1503
  pricePeriod: listing.businessType === "rental" && !isPrivate && listing.price != null ? "/m\xEAs" : null,
1487
1504
  locationLabel: listingLocationLabel(listing.location || {}),
1488
1505
  propertyType: listing.property?.type ?? null,
@@ -1491,7 +1508,8 @@ function toListingCardModel(listing) {
1491
1508
  bedrooms: listing.property?.bedrooms ?? null,
1492
1509
  bathrooms: listing.property?.bathrooms ?? null,
1493
1510
  parkingSpaces: listing.property?.parkingSpaces ?? null,
1494
- areaM2: area ?? null
1511
+ areaM2: area ?? null,
1512
+ unitCount: collapsed && typeof unitCount === "number" ? unitCount : null
1495
1513
  };
1496
1514
  }
1497
1515