@garagem-ai/site-sdk 0.5.2 → 0.6.0
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/README.md +16 -25
- package/dist/index.d.mts +296 -28
- package/dist/index.d.ts +296 -28
- package/dist/index.js +469 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +458 -51
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +18 -60
- package/dist/react.d.ts +18 -60
- package/dist/react.js +265 -874
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +246 -841
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-4ocM0UPk.d.mts → search-engine-CtnLzmwW.d.mts} +13 -181
- package/dist/{search-engine-4ocM0UPk.d.ts → search-engine-CtnLzmwW.d.ts} +13 -181
- package/package.json +11 -13
- package/src/amenity-labels.ts +9 -2
- package/src/fetchers.ts +2 -1
- package/src/index.ts +20 -2
- package/src/internal/url.ts +1 -0
- package/src/leads.ts +45 -6
- package/src/listing-card-model.ts +4 -1
- package/src/listing-detail.ts +8 -2
- package/src/phone-countries.ts +97 -0
- package/src/phone.ts +431 -0
- package/src/presentation.ts +1 -24
- package/src/react/index.ts +1 -11
- package/src/react/public-search-snapshot.ts +165 -0
- package/src/react/staged-filters-mirror.ts +38 -0
- package/src/react/types.ts +17 -30
- package/src/react/use-public-search.ts +121 -42
- package/src/search-engine.ts +3 -0
- package/src/studio-contract.ts +63 -21
- package/src/types.ts +12 -0
- package/src/react/cn.ts +0 -3
- package/src/react/listing-card.tsx +0 -98
- package/src/react/listing-detail-fields.tsx +0 -119
- package/src/react/search-chrome.tsx +0 -29
- package/src/react/search.css +0 -214
- package/src/react/styles/index.ts +0 -1
- package/src/react/styles/search-chrome-css.generated.ts +0 -5
- package/src/react/styles/search-chrome-styles.tsx +0 -31
package/dist/react.d.mts
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { w as Listing, E as ListingCardModel, e as SearchUi, j as SearchPathFilters, A as AppliedSearchQuery, W as LocationNameTables, I as ListingDetailFieldsSource, o as AmenityLabelDictionary } from './search-engine-4ocM0UPk.mjs';
|
|
1
|
+
import { e as SearchUi, n as Listing, x as LocationNameTables, o as SearchPathFilters, A as AppliedSearchQuery } from './search-engine-CtnLzmwW.mjs';
|
|
3
2
|
|
|
4
|
-
type ListingCardClassNames = {
|
|
5
|
-
root?: string;
|
|
6
|
-
media?: string;
|
|
7
|
-
badge?: string;
|
|
8
|
-
body?: string;
|
|
9
|
-
price?: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
location?: string;
|
|
12
|
-
features?: string;
|
|
13
|
-
cta?: string;
|
|
14
|
-
};
|
|
15
|
-
type ListingCardSlots = {
|
|
16
|
-
media?: ReactNode;
|
|
17
|
-
badge?: ReactNode;
|
|
18
|
-
cta?: ReactNode;
|
|
19
|
-
};
|
|
20
|
-
type ListingCardProps = {
|
|
21
|
-
listing: Listing | ListingCardModel;
|
|
22
|
-
href?: string;
|
|
23
|
-
className?: string;
|
|
24
|
-
classNames?: ListingCardClassNames;
|
|
25
|
-
slots?: ListingCardSlots;
|
|
26
|
-
style?: CSSProperties;
|
|
27
|
-
};
|
|
28
3
|
type SiteIdInput = string | Promise<string> | (() => string | Promise<string>);
|
|
4
|
+
type PublicSearchSnapshot = {
|
|
5
|
+
schema?: SearchUi | null;
|
|
6
|
+
listings?: Listing[];
|
|
7
|
+
page?: number;
|
|
8
|
+
total?: number;
|
|
9
|
+
totalPages?: number;
|
|
10
|
+
locationNames?: LocationNameTables | null;
|
|
11
|
+
catalogId?: string | null;
|
|
12
|
+
};
|
|
29
13
|
type UsePublicSearchOptions = {
|
|
30
14
|
siteId: SiteIdInput;
|
|
31
15
|
baseUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Query string without `?`, from the server page's `searchParams`.
|
|
18
|
+
* The hook must not call Next's search-params hook: that suspends the
|
|
19
|
+
* tree, and Next leaves the resolved HTML in a hidden node until JS runs.
|
|
20
|
+
*/
|
|
21
|
+
search?: string;
|
|
22
|
+
initial?: PublicSearchSnapshot;
|
|
32
23
|
};
|
|
33
24
|
type PublicSearchState = {
|
|
34
25
|
schema: SearchUi | null;
|
|
@@ -58,39 +49,6 @@ type PublicSearchState = {
|
|
|
58
49
|
locationNames: LocationNameTables | null;
|
|
59
50
|
};
|
|
60
51
|
|
|
61
|
-
declare function ListingCard({ listing, href, className, classNames, slots, style, }: ListingCardProps): ReactElement;
|
|
62
|
-
|
|
63
|
-
type ListingDetailFieldsClassNames = {
|
|
64
|
-
root?: string;
|
|
65
|
-
facts?: string;
|
|
66
|
-
fact?: string;
|
|
67
|
-
values?: string;
|
|
68
|
-
value?: string;
|
|
69
|
-
amenityGroup?: string;
|
|
70
|
-
amenityTitle?: string;
|
|
71
|
-
amenityList?: string;
|
|
72
|
-
amenityLabel?: string;
|
|
73
|
-
};
|
|
74
|
-
type ListingDetailFieldsProps = {
|
|
75
|
-
listing: ListingDetailFieldsSource;
|
|
76
|
-
dictionary?: AmenityLabelDictionary | null;
|
|
77
|
-
className?: string;
|
|
78
|
-
classNames?: ListingDetailFieldsClassNames;
|
|
79
|
-
style?: CSSProperties;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Renders listing facts, values, and amenities. Omits empty rows so JSX
|
|
83
|
-
* never prints `undefined`. Theme via `data-slot` / classNames — do not
|
|
84
|
-
* reimplement these blocks in generated pages.
|
|
85
|
-
*/
|
|
86
|
-
declare function ListingDetailFields({ listing, dictionary, className, classNames, style, }: ListingDetailFieldsProps): ReactElement | null;
|
|
87
|
-
|
|
88
|
-
declare function SearchChromeStyles(): ReactElement | null;
|
|
89
|
-
|
|
90
|
-
declare function ResultsSkeleton({ className, }: {
|
|
91
|
-
className?: string;
|
|
92
|
-
}): ReactElement;
|
|
93
|
-
|
|
94
52
|
declare function usePublicSearch(options: UsePublicSearchOptions): PublicSearchState;
|
|
95
53
|
|
|
96
|
-
export {
|
|
54
|
+
export { type PublicSearchSnapshot, type PublicSearchState, type SiteIdInput, type UsePublicSearchOptions, usePublicSearch };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { w as Listing, E as ListingCardModel, e as SearchUi, j as SearchPathFilters, A as AppliedSearchQuery, W as LocationNameTables, I as ListingDetailFieldsSource, o as AmenityLabelDictionary } from './search-engine-4ocM0UPk.js';
|
|
1
|
+
import { e as SearchUi, n as Listing, x as LocationNameTables, o as SearchPathFilters, A as AppliedSearchQuery } from './search-engine-CtnLzmwW.js';
|
|
3
2
|
|
|
4
|
-
type ListingCardClassNames = {
|
|
5
|
-
root?: string;
|
|
6
|
-
media?: string;
|
|
7
|
-
badge?: string;
|
|
8
|
-
body?: string;
|
|
9
|
-
price?: string;
|
|
10
|
-
title?: string;
|
|
11
|
-
location?: string;
|
|
12
|
-
features?: string;
|
|
13
|
-
cta?: string;
|
|
14
|
-
};
|
|
15
|
-
type ListingCardSlots = {
|
|
16
|
-
media?: ReactNode;
|
|
17
|
-
badge?: ReactNode;
|
|
18
|
-
cta?: ReactNode;
|
|
19
|
-
};
|
|
20
|
-
type ListingCardProps = {
|
|
21
|
-
listing: Listing | ListingCardModel;
|
|
22
|
-
href?: string;
|
|
23
|
-
className?: string;
|
|
24
|
-
classNames?: ListingCardClassNames;
|
|
25
|
-
slots?: ListingCardSlots;
|
|
26
|
-
style?: CSSProperties;
|
|
27
|
-
};
|
|
28
3
|
type SiteIdInput = string | Promise<string> | (() => string | Promise<string>);
|
|
4
|
+
type PublicSearchSnapshot = {
|
|
5
|
+
schema?: SearchUi | null;
|
|
6
|
+
listings?: Listing[];
|
|
7
|
+
page?: number;
|
|
8
|
+
total?: number;
|
|
9
|
+
totalPages?: number;
|
|
10
|
+
locationNames?: LocationNameTables | null;
|
|
11
|
+
catalogId?: string | null;
|
|
12
|
+
};
|
|
29
13
|
type UsePublicSearchOptions = {
|
|
30
14
|
siteId: SiteIdInput;
|
|
31
15
|
baseUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Query string without `?`, from the server page's `searchParams`.
|
|
18
|
+
* The hook must not call Next's search-params hook: that suspends the
|
|
19
|
+
* tree, and Next leaves the resolved HTML in a hidden node until JS runs.
|
|
20
|
+
*/
|
|
21
|
+
search?: string;
|
|
22
|
+
initial?: PublicSearchSnapshot;
|
|
32
23
|
};
|
|
33
24
|
type PublicSearchState = {
|
|
34
25
|
schema: SearchUi | null;
|
|
@@ -58,39 +49,6 @@ type PublicSearchState = {
|
|
|
58
49
|
locationNames: LocationNameTables | null;
|
|
59
50
|
};
|
|
60
51
|
|
|
61
|
-
declare function ListingCard({ listing, href, className, classNames, slots, style, }: ListingCardProps): ReactElement;
|
|
62
|
-
|
|
63
|
-
type ListingDetailFieldsClassNames = {
|
|
64
|
-
root?: string;
|
|
65
|
-
facts?: string;
|
|
66
|
-
fact?: string;
|
|
67
|
-
values?: string;
|
|
68
|
-
value?: string;
|
|
69
|
-
amenityGroup?: string;
|
|
70
|
-
amenityTitle?: string;
|
|
71
|
-
amenityList?: string;
|
|
72
|
-
amenityLabel?: string;
|
|
73
|
-
};
|
|
74
|
-
type ListingDetailFieldsProps = {
|
|
75
|
-
listing: ListingDetailFieldsSource;
|
|
76
|
-
dictionary?: AmenityLabelDictionary | null;
|
|
77
|
-
className?: string;
|
|
78
|
-
classNames?: ListingDetailFieldsClassNames;
|
|
79
|
-
style?: CSSProperties;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Renders listing facts, values, and amenities. Omits empty rows so JSX
|
|
83
|
-
* never prints `undefined`. Theme via `data-slot` / classNames — do not
|
|
84
|
-
* reimplement these blocks in generated pages.
|
|
85
|
-
*/
|
|
86
|
-
declare function ListingDetailFields({ listing, dictionary, className, classNames, style, }: ListingDetailFieldsProps): ReactElement | null;
|
|
87
|
-
|
|
88
|
-
declare function SearchChromeStyles(): ReactElement | null;
|
|
89
|
-
|
|
90
|
-
declare function ResultsSkeleton({ className, }: {
|
|
91
|
-
className?: string;
|
|
92
|
-
}): ReactElement;
|
|
93
|
-
|
|
94
52
|
declare function usePublicSearch(options: UsePublicSearchOptions): PublicSearchState;
|
|
95
53
|
|
|
96
|
-
export {
|
|
54
|
+
export { type PublicSearchSnapshot, type PublicSearchState, type SiteIdInput, type UsePublicSearchOptions, usePublicSearch };
|