@garagem-ai/site-sdk 0.13.6 → 0.14.0
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 +18 -4
- package/dist/index.d.ts +18 -4
- package/dist/index.js +46 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -5
- 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-CokmqLjn.d.mts} +13 -0
- package/dist/{types-photo-search-CVPyF9zC.d.ts → types-photo-search-CokmqLjn.d.ts} +13 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/listing-card-model.ts +28 -3
- package/src/studio-contract.ts +31 -2
- package/src/types.ts +8 -0
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-
|
|
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-CokmqLjn.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-
|
|
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-CokmqLjn.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:
|
|
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
|
|