@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
|
@@ -864,6 +864,7 @@ declare function searchSortOptions(sorts: Array<{
|
|
|
864
864
|
}>;
|
|
865
865
|
/** Toolbar: price + bedrooms first and required when the schema has them. */
|
|
866
866
|
declare const TOOLBAR_PRIMARY_FILTER_IDS: readonly ["price", "property_bedrooms"];
|
|
867
|
+
/** Listing detail: `…/id-<código>` at any depth, or the short CRM link `/imoveis/<código>`. */
|
|
867
868
|
declare function isListingDetailPath(pathname: string): boolean;
|
|
868
869
|
declare function readPublicSearch(pathname: string, search: string, dictionary?: SearchUiDictionary): {
|
|
869
870
|
pathFilters: SearchPathFilters;
|
|
@@ -864,6 +864,7 @@ declare function searchSortOptions(sorts: Array<{
|
|
|
864
864
|
}>;
|
|
865
865
|
/** Toolbar: price + bedrooms first and required when the schema has them. */
|
|
866
866
|
declare const TOOLBAR_PRIMARY_FILTER_IDS: readonly ["price", "property_bedrooms"];
|
|
867
|
+
/** Listing detail: `…/id-<código>` at any depth, or the short CRM link `/imoveis/<código>`. */
|
|
867
868
|
declare function isListingDetailPath(pathname: string): boolean;
|
|
868
869
|
declare function readPublicSearch(pathname: string, search: string, dictionary?: SearchUiDictionary): {
|
|
869
870
|
pathFilters: SearchPathFilters;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@garagem-ai/site-sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Typed, runtime-agnostic SDK for building custom real estate sites against the Garagem platform. Drop into any Next.js (or other JS) project to fetch listings, sites and CMS data.",
|
|
6
6
|
"main": "./dist/index.js",
|
package/src/search-engine.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isShortListingPath } from "@garagem/search-url";
|
|
1
2
|
import {
|
|
2
3
|
composeSearchPublicHref,
|
|
3
4
|
parseAppliedSearchQuery,
|
|
@@ -77,10 +78,11 @@ function pathnameOnly(pathname: string): string {
|
|
|
77
78
|
return String(pathname || "").split(/[?#]/)[0] || "/";
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
/** Listing detail: `…/id-<código>` at any depth, or the short CRM link `/imoveis/<código>`. */
|
|
80
82
|
export function isListingDetailPath(pathname: string): boolean {
|
|
81
|
-
const
|
|
82
|
-
const last =
|
|
83
|
-
return last.toLowerCase().startsWith("id-");
|
|
83
|
+
const path = pathnameOnly(pathname);
|
|
84
|
+
const last = path.split("/").filter(Boolean).pop() || "";
|
|
85
|
+
return last.toLowerCase().startsWith("id-") || isShortListingPath(path);
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
export function readPublicSearch(
|