@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/index.d.mts +46 -24
- package/dist/index.d.ts +46 -24
- package/dist/index.js +72 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -28
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +20 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +20 -2
- package/dist/react.mjs.map +1 -1
- package/dist/{types-photo-search-CVPyF9zC.d.mts → types-photo-search--3fBk3Cs.d.mts} +15 -3
- package/dist/{types-photo-search-CVPyF9zC.d.ts → types-photo-search--3fBk3Cs.d.ts} +15 -3
- package/package.json +1 -1
- package/src/analytics-document.ts +3 -3
- package/src/index.ts +2 -0
- package/src/listing-card-model.ts +28 -3
- package/src/search-engine.ts +2 -3
- package/src/studio-contract.ts +55 -23
- package/src/types.ts +8 -0
package/dist/react.mjs
CHANGED
|
@@ -1444,9 +1444,21 @@ import { useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useSta
|
|
|
1444
1444
|
function listingLocationLabel(location) {
|
|
1445
1445
|
return [location.neighborhood, location.city, location.state].map((part) => part ? String(part).trim() : "").filter(Boolean).join(", ");
|
|
1446
1446
|
}
|
|
1447
|
+
function cardPriceLabel(isPrivate, collapsed, price, formattedPrice) {
|
|
1448
|
+
if (isPrivate) return "Sob consulta";
|
|
1449
|
+
if (collapsed && price != null) return `A partir de ${formattedPrice}`;
|
|
1450
|
+
return formattedPrice;
|
|
1451
|
+
}
|
|
1447
1452
|
function toListingCardModel(listing) {
|
|
1448
1453
|
const isPrivate = listing.priceVisibility === "private";
|
|
1449
1454
|
const area = listing.property?.usableArea ?? listing.property?.totalArea;
|
|
1455
|
+
const unitCount = listing.development?.unitCount;
|
|
1456
|
+
const collapsed = typeof unitCount === "number" && unitCount > 1;
|
|
1457
|
+
const formattedPrice = formatListingPrice(
|
|
1458
|
+
listing.price,
|
|
1459
|
+
"pt-BR",
|
|
1460
|
+
listing.currency ?? "BRL"
|
|
1461
|
+
);
|
|
1450
1462
|
return {
|
|
1451
1463
|
href: listingPublicPath(listing),
|
|
1452
1464
|
title: listing.title,
|
|
@@ -1454,7 +1466,12 @@ function toListingCardModel(listing) {
|
|
|
1454
1466
|
businessLabel: listingBusinessLabel(listing.businessType),
|
|
1455
1467
|
priceVisibility: listing.priceVisibility,
|
|
1456
1468
|
price: listing.price,
|
|
1457
|
-
priceLabel:
|
|
1469
|
+
priceLabel: cardPriceLabel(
|
|
1470
|
+
isPrivate,
|
|
1471
|
+
collapsed,
|
|
1472
|
+
listing.price,
|
|
1473
|
+
formattedPrice
|
|
1474
|
+
),
|
|
1458
1475
|
pricePeriod: listing.businessType === "rental" && !isPrivate && listing.price != null ? "/m\xEAs" : null,
|
|
1459
1476
|
locationLabel: listingLocationLabel(listing.location || {}),
|
|
1460
1477
|
propertyType: listing.property?.type ?? null,
|
|
@@ -1463,7 +1480,8 @@ function toListingCardModel(listing) {
|
|
|
1463
1480
|
bedrooms: listing.property?.bedrooms ?? null,
|
|
1464
1481
|
bathrooms: listing.property?.bathrooms ?? null,
|
|
1465
1482
|
parkingSpaces: listing.property?.parkingSpaces ?? null,
|
|
1466
|
-
areaM2: area ?? null
|
|
1483
|
+
areaM2: area ?? null,
|
|
1484
|
+
unitCount: collapsed && typeof unitCount === "number" ? unitCount : null
|
|
1467
1485
|
};
|
|
1468
1486
|
}
|
|
1469
1487
|
|