@garagem-ai/site-sdk 0.13.3 → 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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +46 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -6
- 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-BPLxl65M.d.mts → types-photo-search-CVPyF9zC.d.mts} +13 -1
- package/dist/{types-photo-search-BPLxl65M.d.ts → types-photo-search-CVPyF9zC.d.ts} +13 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/search-engine.ts +47 -3
- package/src/studio-contract.ts +3 -0
package/dist/react.mjs
CHANGED
|
@@ -71,6 +71,19 @@ var LISTING_TYPE_ALIASES = {
|
|
|
71
71
|
rental: ["alugar"]
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
// ../search-url/listing-identity.ts
|
|
75
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
76
|
+
var LISTING_CODE_RE = /^(?:[A-Za-z0-9]+|[A-Z0-9]+(?:-[A-Z0-9]+)+)$/;
|
|
77
|
+
var LETTER_CODE_RE = /^[A-Z]{5}$/;
|
|
78
|
+
function isShortListingIdentity(segment) {
|
|
79
|
+
if (UUID_RE.test(segment) || LETTER_CODE_RE.test(segment)) return true;
|
|
80
|
+
return /\d/.test(segment) && LISTING_CODE_RE.test(segment);
|
|
81
|
+
}
|
|
82
|
+
function isShortListingPath(pathname) {
|
|
83
|
+
const parts = (pathname.split(/[?#]/)[0] ?? "").split("/").filter(Boolean);
|
|
84
|
+
return parts.length === 2 && parts[0] === SEARCH_BASE_ROUTE && isShortListingIdentity(parts[1] ?? "");
|
|
85
|
+
}
|
|
86
|
+
|
|
74
87
|
// ../search-url/path.ts
|
|
75
88
|
function toArray(value) {
|
|
76
89
|
if (value === void 0) return [];
|
|
@@ -167,6 +180,7 @@ function parseSearchPublicPath(pathname, dictionary = emptySearchUrlDictionary()
|
|
|
167
180
|
if (segments.some((segment) => segment.toLowerCase().startsWith("id-"))) {
|
|
168
181
|
return null;
|
|
169
182
|
}
|
|
183
|
+
if (isShortListingPath(raw)) return null;
|
|
170
184
|
const filters = {};
|
|
171
185
|
const locationParts = [];
|
|
172
186
|
const propertyTypes = [];
|
|
@@ -499,9 +513,9 @@ function pathnameOnly(pathname) {
|
|
|
499
513
|
return String(pathname || "").split(/[?#]/)[0] || "/";
|
|
500
514
|
}
|
|
501
515
|
function isListingDetailPath(pathname) {
|
|
502
|
-
const
|
|
503
|
-
const last =
|
|
504
|
-
return last.toLowerCase().startsWith("id-");
|
|
516
|
+
const path = pathnameOnly(pathname);
|
|
517
|
+
const last = path.split("/").filter(Boolean).pop() || "";
|
|
518
|
+
return last.toLowerCase().startsWith("id-") || isShortListingPath(path);
|
|
505
519
|
}
|
|
506
520
|
function readPublicSearch(pathname, search, dictionary) {
|
|
507
521
|
const pathFilters = parseSearchPublicPath2(pathnameOnly(pathname), dictionary) || {};
|