@garagem-ai/site-sdk 0.13.2 → 0.13.4
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 +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +32 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -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.map +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/{types-photo-search-BPLxl65M.d.mts → types-photo-search-BROgleJq.d.mts} +12 -1
- package/dist/{types-photo-search-BPLxl65M.d.ts → types-photo-search-BROgleJq.d.ts} +12 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/search-engine.ts +42 -0
- package/src/studio-contract.ts +8 -4
package/dist/index.mjs
CHANGED
|
@@ -1029,6 +1029,27 @@ function lookupDisplay(table, slug) {
|
|
|
1029
1029
|
if (!slug || !table) return slug;
|
|
1030
1030
|
return table[slug] || table[String(slug).toLowerCase()] || slug;
|
|
1031
1031
|
}
|
|
1032
|
+
var LOCATION_FIELDS = ["state", "city", "neighborhood", "street"];
|
|
1033
|
+
var LOCATION_TABLE_KEY = {
|
|
1034
|
+
state: "states",
|
|
1035
|
+
city: "cities",
|
|
1036
|
+
neighborhood: "neighborhoods",
|
|
1037
|
+
street: "streets"
|
|
1038
|
+
};
|
|
1039
|
+
function locationTableHasSlug(table, slug) {
|
|
1040
|
+
if (!table) return false;
|
|
1041
|
+
if (Object.hasOwn(table, slug)) return true;
|
|
1042
|
+
const lower = slug.toLowerCase();
|
|
1043
|
+
return lower !== slug && Object.hasOwn(table, lower);
|
|
1044
|
+
}
|
|
1045
|
+
function unknownSearchLocation(location, tables) {
|
|
1046
|
+
if (!location) return false;
|
|
1047
|
+
const present = LOCATION_FIELDS.filter((key) => location[key]);
|
|
1048
|
+
if (present.length === 0 || !tables) return false;
|
|
1049
|
+
return present.some(
|
|
1050
|
+
(key) => !locationTableHasSlug(tables[LOCATION_TABLE_KEY[key]], location[key])
|
|
1051
|
+
);
|
|
1052
|
+
}
|
|
1032
1053
|
function displayPathLocation(location, values) {
|
|
1033
1054
|
if (!location) return null;
|
|
1034
1055
|
const table = values || {};
|
|
@@ -3122,11 +3143,12 @@ var STUDIO_SDK_CONTRACT = {
|
|
|
3122
3143
|
* Weighted map buckets (`map.buckets`, clustered by the hook) shipped
|
|
3123
3144
|
* in 0.11.0. Share links (`getShareLink`, `/p/[token]`) shipped in
|
|
3124
3145
|
* 0.12.0. Analytics catalog events (`trackListingView` plus the search
|
|
3125
|
-
* and lead emitters) shipped in 0.13.0.
|
|
3126
|
-
*
|
|
3127
|
-
*
|
|
3146
|
+
* and lead emitters) shipped in 0.13.0. `property_search` sends a city
|
|
3147
|
+
* or neighborhood only when the site's location table knows it, as of
|
|
3148
|
+
* 0.13.2. Search filter helpers (`visibleSearchFilters` /
|
|
3149
|
+
* `toolbarFilterIds`) shipped in 0.4.12 and remain on this pin.
|
|
3128
3150
|
*/
|
|
3129
|
-
minNpmVersion: "0.13.
|
|
3151
|
+
minNpmVersion: "0.13.2",
|
|
3130
3152
|
/** Historical: older tarballs inject card CSS when those components mount. */
|
|
3131
3153
|
selfInjectSince: "0.4.2",
|
|
3132
3154
|
chromeStrategy: "app-owned",
|
|
@@ -3249,7 +3271,10 @@ var STUDIO_SDK_CONTRACT = {
|
|
|
3249
3271
|
*/
|
|
3250
3272
|
unpublishedSearchExports: [
|
|
3251
3273
|
"searchChromeModel",
|
|
3252
|
-
"rangeDraftFromPath"
|
|
3274
|
+
"rangeDraftFromPath",
|
|
3275
|
+
// `unknownSearchLocation` is in git. Prompts inline the same check with
|
|
3276
|
+
// `parseSearchPublicPath` + `locationsPath` until this name is on the pin.
|
|
3277
|
+
"unknownSearchLocation"
|
|
3253
3278
|
],
|
|
3254
3279
|
/**
|
|
3255
3280
|
* maps.fndn.ai helpers (static map, street view, boundaries, travel
|
|
@@ -5158,6 +5183,7 @@ export {
|
|
|
5158
5183
|
travelTimesFromListing,
|
|
5159
5184
|
truncateNationalPhoneDigits,
|
|
5160
5185
|
unavailableReactImports,
|
|
5186
|
+
unknownSearchLocation,
|
|
5161
5187
|
uploadSellerLeadPhoto,
|
|
5162
5188
|
visibleSearchFilters
|
|
5163
5189
|
};
|