@garagem-ai/site-sdk 0.13.4 → 0.13.5
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -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 +17 -3
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +17 -3
- package/dist/react.mjs.map +1 -1
- package/dist/{types-photo-search-BROgleJq.d.mts → types-photo-search-CVPyF9zC.d.mts} +1 -0
- package/dist/{types-photo-search-BROgleJq.d.ts → types-photo-search-CVPyF9zC.d.ts} +1 -0
- package/package.json +1 -1
- package/src/search-engine.ts +5 -3
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-CVPyF9zC.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-CVPyF9zC.js';
|
|
2
2
|
|
|
3
3
|
type SiteIdInput = string | Promise<string> | (() => string | Promise<string>);
|
|
4
4
|
type PublicSearchSnapshot = {
|
package/dist/react.js
CHANGED
|
@@ -99,6 +99,19 @@ var LISTING_TYPE_ALIASES = {
|
|
|
99
99
|
rental: ["alugar"]
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
// ../search-url/listing-identity.ts
|
|
103
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
104
|
+
var LISTING_CODE_RE = /^(?:[A-Za-z0-9]+|[A-Z0-9]+(?:-[A-Z0-9]+)+)$/;
|
|
105
|
+
var LETTER_CODE_RE = /^[A-Z]{5}$/;
|
|
106
|
+
function isShortListingIdentity(segment) {
|
|
107
|
+
if (UUID_RE.test(segment) || LETTER_CODE_RE.test(segment)) return true;
|
|
108
|
+
return /\d/.test(segment) && LISTING_CODE_RE.test(segment);
|
|
109
|
+
}
|
|
110
|
+
function isShortListingPath(pathname) {
|
|
111
|
+
const parts = (pathname.split(/[?#]/)[0] ?? "").split("/").filter(Boolean);
|
|
112
|
+
return parts.length === 2 && parts[0] === SEARCH_BASE_ROUTE && isShortListingIdentity(parts[1] ?? "");
|
|
113
|
+
}
|
|
114
|
+
|
|
102
115
|
// ../search-url/path.ts
|
|
103
116
|
function toArray(value) {
|
|
104
117
|
if (value === void 0) return [];
|
|
@@ -195,6 +208,7 @@ function parseSearchPublicPath(pathname, dictionary = emptySearchUrlDictionary()
|
|
|
195
208
|
if (segments.some((segment) => segment.toLowerCase().startsWith("id-"))) {
|
|
196
209
|
return null;
|
|
197
210
|
}
|
|
211
|
+
if (isShortListingPath(raw)) return null;
|
|
198
212
|
const filters = {};
|
|
199
213
|
const locationParts = [];
|
|
200
214
|
const propertyTypes = [];
|
|
@@ -527,9 +541,9 @@ function pathnameOnly(pathname) {
|
|
|
527
541
|
return String(pathname || "").split(/[?#]/)[0] || "/";
|
|
528
542
|
}
|
|
529
543
|
function isListingDetailPath(pathname) {
|
|
530
|
-
const
|
|
531
|
-
const last =
|
|
532
|
-
return last.toLowerCase().startsWith("id-");
|
|
544
|
+
const path = pathnameOnly(pathname);
|
|
545
|
+
const last = path.split("/").filter(Boolean).pop() || "";
|
|
546
|
+
return last.toLowerCase().startsWith("id-") || isShortListingPath(path);
|
|
533
547
|
}
|
|
534
548
|
function readPublicSearch(pathname, search, dictionary) {
|
|
535
549
|
const pathFilters = parseSearchPublicPath2(pathnameOnly(pathname), dictionary) || {};
|