@garagem-ai/site-sdk 0.4.14 → 0.5.1

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.
@@ -623,5 +623,20 @@ declare function searchResultsHeading(pathFilters: SearchPathFilters, dictionary
623
623
  */
624
624
  declare function hrefWithExplicitPage(href: string, page: number): string;
625
625
  declare function paginationPages(currentPage: number, totalPages: number, padding: number): number[];
626
+ declare const SEARCH_EMPTY_COPY = "Nenhum im\u00F3vel encontrado. Ajuste a busca ou os filtros.";
627
+ declare function rangeDraftFromPath(pathFilters: SearchPathFilters): Record<string, {
628
+ min: string;
629
+ max: string;
630
+ }>;
631
+ type SearchChromeModel = {
632
+ headingTitle: string;
633
+ toolbarFilters: SearchUiFilter[];
634
+ extraFilters: SearchUiFilter[];
635
+ sortOptions: Array<{
636
+ id: string;
637
+ label: string;
638
+ }>;
639
+ };
640
+ declare function searchChromeModel(schema: SearchUi | null, pathFilters: SearchPathFilters, locationNames?: LocationNameTables | null): SearchChromeModel;
626
641
 
627
- export { type SearchUiOption as $, type AppliedSearchQuery as A, type ListingBreadcrumbCrumb as B, type CmsCollection as C, type ListingBusinessType as D, type ListingCardModel as E, FORBIDDEN_SEARCH_QUERY_KEYS as F, type ListingDescriptionPreview as G, type ListingDetailFieldsModel as H, type ListingDetailFieldsSource as I, type ListingDetailModel as J, type ListingFact as K, type ListingFilters as L, type ListingLocation as M, type ListingLocationBlock as N, type ListingMedia as O, type ListingMediaOverlay as P, type QueryListingsParams as Q, type RequestNextOptions as R, type SearchListingsParams as S, type ListingPriceVisibility as T, type ListingPropertySummary as U, type ListingValue as V, type LocationNameTables as W, type QueryListingsLocation as X, SEARCH_SORT_RELEVANCE as Y, type SearchPathLocation as Z, type SearchUiFilter as _, type CmsEntriesResult as a, TOOLBAR_PRIMARY_FILTER_IDS as a0, applyPathFilter as a1, buildQueryListingsParams as a2, canonicalizeSearchHref as a3, clearStagedPathFilters as a4, countFacetChoices as a5, countOptionLabel as a6, displayPathLocation as a7, hrefForAppliedChange as a8, hrefForPathFilters as a9, hrefWithExplicitPage as aa, isListingDetailPath as ab, labelAmenities as ac, listingAmenityGroups as ad, listingBreadcrumb as ae, listingDescriptionPreview as af, listingDetailFieldsModel as ag, listingDetailModel as ah, listingFacts as ai, listingLocationBlock as aj, listingLocationLabel as ak, listingMapsHref as al, listingMediaOverlays as am, listingValues as an, paginationPages as ao, pathFilterHasOption as ap, pathFilterValue as aq, publicSearchHref as ar, readPublicSearch as as, searchHrefUsesLegacyFilterQuery as at, searchResultsHeading as au, searchSortOptions as av, toListingCardModel as aw, toolbarFilterIds as ax, visibleSearchFilters as ay, type CmsEntry as b, type ListingDetail as c, type ListingsResult as d, type SearchUi as e, type SimilarListingsResult as f, type Site as g, type QueryListingsResult as h, type SearchListingsResult as i, type SearchPathFilters as j, type SearchUiDictionary as k, type QueryListingsFilters as l, type AppliedSearchChange as m, AMENITY_FALLBACK_LABELS as n, type AmenityLabelDictionary as o, type AmenityLabelOption as p, type CmsEntryStatus as q, type CmsFieldDefinition as r, type CmsFieldType as s, type CmsSeoData as t, LISTING_AMENITY_TITLES as u, LISTING_DESCRIPTION_CLAMP as v, type Listing as w, type ListingAmenityGroup as x, type ListingAmenityGroupKey as y, type ListingAmenitySource as z };
642
+ export { type SearchPathLocation as $, type AppliedSearchQuery as A, type ListingBreadcrumbCrumb as B, type CmsCollection as C, type ListingBusinessType as D, type ListingCardModel as E, FORBIDDEN_SEARCH_QUERY_KEYS as F, type ListingDescriptionPreview as G, type ListingDetailFieldsModel as H, type ListingDetailFieldsSource as I, type ListingDetailModel as J, type ListingFact as K, type ListingFilters as L, type ListingLocation as M, type ListingLocationBlock as N, type ListingMedia as O, type ListingMediaOverlay as P, type QueryListingsParams as Q, type RequestNextOptions as R, type SearchListingsParams as S, type ListingPriceVisibility as T, type ListingPropertySummary as U, type ListingValue as V, type LocationNameTables as W, type QueryListingsLocation as X, SEARCH_EMPTY_COPY as Y, SEARCH_SORT_RELEVANCE as Z, type SearchChromeModel as _, type CmsEntriesResult as a, type SearchUiFilter as a0, type SearchUiOption as a1, TOOLBAR_PRIMARY_FILTER_IDS as a2, applyPathFilter as a3, buildQueryListingsParams as a4, canonicalizeSearchHref as a5, clearStagedPathFilters as a6, countFacetChoices as a7, countOptionLabel as a8, displayPathLocation as a9, toListingCardModel as aA, toolbarFilterIds as aB, visibleSearchFilters as aC, hrefForAppliedChange as aa, hrefForPathFilters as ab, hrefWithExplicitPage as ac, isListingDetailPath as ad, labelAmenities as ae, listingAmenityGroups as af, listingBreadcrumb as ag, listingDescriptionPreview as ah, listingDetailFieldsModel as ai, listingDetailModel as aj, listingFacts as ak, listingLocationBlock as al, listingLocationLabel as am, listingMapsHref as an, listingMediaOverlays as ao, listingValues as ap, paginationPages as aq, pathFilterHasOption as ar, pathFilterValue as as, publicSearchHref as at, rangeDraftFromPath as au, readPublicSearch as av, searchChromeModel as aw, searchHrefUsesLegacyFilterQuery as ax, searchResultsHeading as ay, searchSortOptions as az, type CmsEntry as b, type ListingDetail as c, type ListingsResult as d, type SearchUi as e, type SimilarListingsResult as f, type Site as g, type QueryListingsResult as h, type SearchListingsResult as i, type SearchPathFilters as j, type SearchUiDictionary as k, type QueryListingsFilters as l, type AppliedSearchChange as m, AMENITY_FALLBACK_LABELS as n, type AmenityLabelDictionary as o, type AmenityLabelOption as p, type CmsEntryStatus as q, type CmsFieldDefinition as r, type CmsFieldType as s, type CmsSeoData as t, LISTING_AMENITY_TITLES as u, LISTING_DESCRIPTION_CLAMP as v, type Listing as w, type ListingAmenityGroup as x, type ListingAmenityGroupKey as y, type ListingAmenitySource as z };
@@ -623,5 +623,20 @@ declare function searchResultsHeading(pathFilters: SearchPathFilters, dictionary
623
623
  */
624
624
  declare function hrefWithExplicitPage(href: string, page: number): string;
625
625
  declare function paginationPages(currentPage: number, totalPages: number, padding: number): number[];
626
+ declare const SEARCH_EMPTY_COPY = "Nenhum im\u00F3vel encontrado. Ajuste a busca ou os filtros.";
627
+ declare function rangeDraftFromPath(pathFilters: SearchPathFilters): Record<string, {
628
+ min: string;
629
+ max: string;
630
+ }>;
631
+ type SearchChromeModel = {
632
+ headingTitle: string;
633
+ toolbarFilters: SearchUiFilter[];
634
+ extraFilters: SearchUiFilter[];
635
+ sortOptions: Array<{
636
+ id: string;
637
+ label: string;
638
+ }>;
639
+ };
640
+ declare function searchChromeModel(schema: SearchUi | null, pathFilters: SearchPathFilters, locationNames?: LocationNameTables | null): SearchChromeModel;
626
641
 
627
- export { type SearchUiOption as $, type AppliedSearchQuery as A, type ListingBreadcrumbCrumb as B, type CmsCollection as C, type ListingBusinessType as D, type ListingCardModel as E, FORBIDDEN_SEARCH_QUERY_KEYS as F, type ListingDescriptionPreview as G, type ListingDetailFieldsModel as H, type ListingDetailFieldsSource as I, type ListingDetailModel as J, type ListingFact as K, type ListingFilters as L, type ListingLocation as M, type ListingLocationBlock as N, type ListingMedia as O, type ListingMediaOverlay as P, type QueryListingsParams as Q, type RequestNextOptions as R, type SearchListingsParams as S, type ListingPriceVisibility as T, type ListingPropertySummary as U, type ListingValue as V, type LocationNameTables as W, type QueryListingsLocation as X, SEARCH_SORT_RELEVANCE as Y, type SearchPathLocation as Z, type SearchUiFilter as _, type CmsEntriesResult as a, TOOLBAR_PRIMARY_FILTER_IDS as a0, applyPathFilter as a1, buildQueryListingsParams as a2, canonicalizeSearchHref as a3, clearStagedPathFilters as a4, countFacetChoices as a5, countOptionLabel as a6, displayPathLocation as a7, hrefForAppliedChange as a8, hrefForPathFilters as a9, hrefWithExplicitPage as aa, isListingDetailPath as ab, labelAmenities as ac, listingAmenityGroups as ad, listingBreadcrumb as ae, listingDescriptionPreview as af, listingDetailFieldsModel as ag, listingDetailModel as ah, listingFacts as ai, listingLocationBlock as aj, listingLocationLabel as ak, listingMapsHref as al, listingMediaOverlays as am, listingValues as an, paginationPages as ao, pathFilterHasOption as ap, pathFilterValue as aq, publicSearchHref as ar, readPublicSearch as as, searchHrefUsesLegacyFilterQuery as at, searchResultsHeading as au, searchSortOptions as av, toListingCardModel as aw, toolbarFilterIds as ax, visibleSearchFilters as ay, type CmsEntry as b, type ListingDetail as c, type ListingsResult as d, type SearchUi as e, type SimilarListingsResult as f, type Site as g, type QueryListingsResult as h, type SearchListingsResult as i, type SearchPathFilters as j, type SearchUiDictionary as k, type QueryListingsFilters as l, type AppliedSearchChange as m, AMENITY_FALLBACK_LABELS as n, type AmenityLabelDictionary as o, type AmenityLabelOption as p, type CmsEntryStatus as q, type CmsFieldDefinition as r, type CmsFieldType as s, type CmsSeoData as t, LISTING_AMENITY_TITLES as u, LISTING_DESCRIPTION_CLAMP as v, type Listing as w, type ListingAmenityGroup as x, type ListingAmenityGroupKey as y, type ListingAmenitySource as z };
642
+ export { type SearchPathLocation as $, type AppliedSearchQuery as A, type ListingBreadcrumbCrumb as B, type CmsCollection as C, type ListingBusinessType as D, type ListingCardModel as E, FORBIDDEN_SEARCH_QUERY_KEYS as F, type ListingDescriptionPreview as G, type ListingDetailFieldsModel as H, type ListingDetailFieldsSource as I, type ListingDetailModel as J, type ListingFact as K, type ListingFilters as L, type ListingLocation as M, type ListingLocationBlock as N, type ListingMedia as O, type ListingMediaOverlay as P, type QueryListingsParams as Q, type RequestNextOptions as R, type SearchListingsParams as S, type ListingPriceVisibility as T, type ListingPropertySummary as U, type ListingValue as V, type LocationNameTables as W, type QueryListingsLocation as X, SEARCH_EMPTY_COPY as Y, SEARCH_SORT_RELEVANCE as Z, type SearchChromeModel as _, type CmsEntriesResult as a, type SearchUiFilter as a0, type SearchUiOption as a1, TOOLBAR_PRIMARY_FILTER_IDS as a2, applyPathFilter as a3, buildQueryListingsParams as a4, canonicalizeSearchHref as a5, clearStagedPathFilters as a6, countFacetChoices as a7, countOptionLabel as a8, displayPathLocation as a9, toListingCardModel as aA, toolbarFilterIds as aB, visibleSearchFilters as aC, hrefForAppliedChange as aa, hrefForPathFilters as ab, hrefWithExplicitPage as ac, isListingDetailPath as ad, labelAmenities as ae, listingAmenityGroups as af, listingBreadcrumb as ag, listingDescriptionPreview as ah, listingDetailFieldsModel as ai, listingDetailModel as aj, listingFacts as ak, listingLocationBlock as al, listingLocationLabel as am, listingMapsHref as an, listingMediaOverlays as ao, listingValues as ap, paginationPages as aq, pathFilterHasOption as ar, pathFilterValue as as, publicSearchHref as at, rangeDraftFromPath as au, readPublicSearch as av, searchChromeModel as aw, searchHrefUsesLegacyFilterQuery as ax, searchResultsHeading as ay, searchSortOptions as az, type CmsEntry as b, type ListingDetail as c, type ListingsResult as d, type SearchUi as e, type SimilarListingsResult as f, type Site as g, type QueryListingsResult as h, type SearchListingsResult as i, type SearchPathFilters as j, type SearchUiDictionary as k, type QueryListingsFilters as l, type AppliedSearchChange as m, AMENITY_FALLBACK_LABELS as n, type AmenityLabelDictionary as o, type AmenityLabelOption as p, type CmsEntryStatus as q, type CmsFieldDefinition as r, type CmsFieldType as s, type CmsSeoData as t, LISTING_AMENITY_TITLES as u, LISTING_DESCRIPTION_CLAMP as v, type Listing as w, type ListingAmenityGroup as x, type ListingAmenityGroupKey as y, type ListingAmenitySource as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@garagem-ai/site-sdk",
3
- "version": "0.4.14",
3
+ "version": "0.5.1",
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",
@@ -58,7 +58,7 @@
58
58
  "@garagem/search-url": "workspace:*",
59
59
  "@types/node": "^20.10.8",
60
60
  "@types/react": "19.1.4",
61
- "next": "16.3.0",
61
+ "next": "16.4.0-canary.15",
62
62
  "react": "19.2.1",
63
63
  "react-dom": "19.2.1",
64
64
  "tsup": "^8.0.1",
package/src/index.ts CHANGED
@@ -188,13 +188,17 @@ export {
188
188
  pathFilterHasOption,
189
189
  pathFilterValue,
190
190
  publicSearchHref,
191
+ rangeDraftFromPath,
191
192
  readPublicSearch,
193
+ SEARCH_EMPTY_COPY,
194
+ searchChromeModel,
192
195
  searchHrefUsesLegacyFilterQuery,
193
196
  searchSortOptions,
194
197
  toolbarFilterIds,
195
198
  visibleSearchFilters,
196
199
  searchResultsHeading,
197
200
  type LocationNameTables,
201
+ type SearchChromeModel,
198
202
  } from "./search-engine";
199
203
 
200
204
  export {
@@ -235,6 +239,7 @@ export {
235
239
  studioAmenityInstruction,
236
240
  studioLeadInstruction,
237
241
  studioListingDetailInstruction,
242
+ studioSearchInstruction,
238
243
  studioSearchLandmarkInstruction,
239
244
  studioSdkPinInstruction,
240
245
  studioSiteWidthCss,
@@ -6,26 +6,14 @@ export type {
6
6
  ListingDetailFieldsClassNames,
7
7
  ListingDetailFieldsProps,
8
8
  } from "./listing-detail-fields";
9
- export { SearchPage } from "./search-page";
10
9
  export { SearchChromeStyles } from "./styles";
11
- export { SearchPagination } from "./search-pagination";
12
- export { SearchQueryForm } from "./search-query-form";
13
- export { FilterPanel, rangeDraftFromPath } from "./filter-panel";
14
- export {
15
- ResultsSkeleton,
16
- SearchPageFallback,
17
- SearchSortSelect,
18
- } from "./search-chrome";
10
+ export { ResultsSkeleton } from "./search-chrome";
19
11
  export { usePublicSearch } from "./use-public-search";
20
12
  export type {
21
13
  ListingCardClassNames,
22
14
  ListingCardProps,
23
15
  ListingCardSlots,
24
16
  PublicSearchState,
25
- SearchPageClassNames,
26
- SearchPageIcons,
27
- SearchPageVariant,
28
17
  SiteIdInput,
29
18
  UsePublicSearchOptions,
30
19
  } from "./types";
31
- export type { SearchPageProps } from "./search-page";
@@ -2,42 +2,8 @@
2
2
 
3
3
  import type { ReactElement } from "react";
4
4
 
5
- import { searchSortOptions } from "../search-engine";
6
5
  import { SearchChromeStyles } from "./styles";
7
6
 
8
- export type SearchSortSelectProps = {
9
- value: string;
10
- onChange: (sort: string | null) => void;
11
- sorts?: Array<{ id: string; label: string }>;
12
- className?: string;
13
- };
14
-
15
- export function SearchSortSelect({
16
- value,
17
- onChange,
18
- sorts,
19
- className,
20
- }: SearchSortSelectProps): ReactElement {
21
- const options = searchSortOptions(sorts);
22
- return (
23
- <label data-slot="search-sort" className={className}>
24
- <span data-slot="search-label">Ordenar</span>
25
- <select
26
- id="garagem-search-sort"
27
- data-slot="search-sort-trigger"
28
- value={value}
29
- onChange={(event) => onChange(event.target.value || null)}
30
- >
31
- {options.map((sort) => (
32
- <option key={sort.id || "relevance"} value={sort.id}>
33
- {sort.label}
34
- </option>
35
- ))}
36
- </select>
37
- </label>
38
- );
39
- }
40
-
41
7
  export function ResultsSkeleton({
42
8
  className,
43
9
  }: {
@@ -61,17 +27,3 @@ export function ResultsSkeleton({
61
27
  </>
62
28
  );
63
29
  }
64
-
65
- export function SearchPageFallback({
66
- className,
67
- as: Root = "main",
68
- }: {
69
- className?: string;
70
- as?: "main" | "div";
71
- }): ReactElement {
72
- return (
73
- <Root data-slot="search-page">
74
- <ResultsSkeleton className={className} />
75
- </Root>
76
- );
77
- }