@garagem-ai/site-sdk 0.4.12 → 0.4.14
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 +29 -25
- package/dist/index.d.mts +8 -130
- package/dist/index.d.ts +8 -130
- package/dist/index.js +43 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -17
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +28 -2
- package/dist/react.d.ts +28 -2
- package/dist/react.js +645 -109
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +649 -114
- package/dist/react.mjs.map +1 -1
- package/dist/{search-engine-B83s_fVd.d.mts → search-engine-1O4sKtKb.d.mts} +141 -1
- package/dist/{search-engine-B83s_fVd.d.ts → search-engine-1O4sKtKb.d.ts} +141 -1
- package/package.json +1 -1
- package/src/index.ts +7 -0
- package/src/listing-detail-fields.ts +59 -0
- package/src/listing-detail.ts +27 -9
- package/src/react/index.ts +5 -0
- package/src/react/listing-detail-fields.tsx +119 -0
- package/src/react/search-page.tsx +7 -0
- package/src/react/styles/search-chrome-css.generated.ts +1 -1
- package/src/react/types.ts +1 -0
- package/src/studio-contract.ts +8 -8
package/README.md
CHANGED
|
@@ -54,24 +54,25 @@ raw escape hatch when you need full control.
|
|
|
54
54
|
|
|
55
55
|
### Friendly layer (recommended for most use cases)
|
|
56
56
|
|
|
57
|
-
| API | Description
|
|
58
|
-
| ------------------------------------------------------------- |
|
|
59
|
-
| `getListings({ siteId, filters?, next? })` | Paginated listings for a site, with simple `filters` (`city`, `businessType`, `propertyType`, `neighborhood`, `minPrice`, `maxPrice`, `limit`, `offset`)
|
|
60
|
-
| `getListing({ siteId, listingId, next? })` | Full detail of a single listing
|
|
61
|
-
| `getSimilarListings({ siteId, listingId, limit?, next? })` | Similar listings carousel (same card shape as `getListings`)
|
|
62
|
-
| `getSite({ siteId? \| domain?, next? })` | Public site profile (returns `null` if unknown)
|
|
63
|
-
| `getCmsCollections({ siteId })` | List CMS collections
|
|
64
|
-
| `getCmsCollection({ siteId, slug })` | One CMS collection schema
|
|
65
|
-
| `getCmsEntries({ siteId, collection, limit?, offset? })` | Published CMS entries only
|
|
66
|
-
| `getCmsEntry({ siteId, collection, slug })` | One published CMS entry
|
|
67
|
-
| `getSearchUi({ siteId, next? })` | Tenant search schema (filters, slugs)
|
|
68
|
-
| `getLeadUi({ siteId, next? })` | Visit-default lead dialog schema (weekday hours, Sat/Sun flags)
|
|
69
|
-
| `submitVisitLead({ siteId, listingId, … })` | POST a visit lead (`listing.id` UUID; civil `visitDate` or `Date`/ISO instant normalized in the schedule timezone)
|
|
70
|
-
| `submitContactLead({ siteId, listingId, … })` | POST a contact lead (no date/time)
|
|
71
|
-
| `slotsForDate` / `normalizeVisitDate` / `expandVisitSchedule` | Pure schedule helpers (`America/Sao_Paulo`, default Mon–Fri 06:00–22:00)
|
|
72
|
-
| `listingDetailModel(listing)` | Listing-detail blocks: breadcrumb,
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
57
|
+
| API | Description |
|
|
58
|
+
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `getListings({ siteId, filters?, next? })` | Paginated listings for a site, with simple `filters` (`city`, `businessType`, `propertyType`, `neighborhood`, `minPrice`, `maxPrice`, `limit`, `offset`) |
|
|
60
|
+
| `getListing({ siteId, listingId, next? })` | Full detail of a single listing |
|
|
61
|
+
| `getSimilarListings({ siteId, listingId, limit?, next? })` | Similar listings carousel (same card shape as `getListings`) |
|
|
62
|
+
| `getSite({ siteId? \| domain?, next? })` | Public site profile (returns `null` if unknown) |
|
|
63
|
+
| `getCmsCollections({ siteId })` | List CMS collections |
|
|
64
|
+
| `getCmsCollection({ siteId, slug })` | One CMS collection schema |
|
|
65
|
+
| `getCmsEntries({ siteId, collection, limit?, offset? })` | Published CMS entries only |
|
|
66
|
+
| `getCmsEntry({ siteId, collection, slug })` | One published CMS entry |
|
|
67
|
+
| `getSearchUi({ siteId, next? })` | Tenant search schema (filters, slugs) |
|
|
68
|
+
| `getLeadUi({ siteId, next? })` | Visit-default lead dialog schema (weekday hours, Sat/Sun flags) |
|
|
69
|
+
| `submitVisitLead({ siteId, listingId, … })` | POST a visit lead (`listing.id` UUID; civil `visitDate` or `Date`/ISO instant normalized in the schedule timezone) |
|
|
70
|
+
| `submitContactLead({ siteId, listingId, … })` | POST a contact lead (no date/time) |
|
|
71
|
+
| `slotsForDate` / `normalizeVisitDate` / `expandVisitSchedule` | Pure schedule helpers (`America/Sao_Paulo`, default Mon–Fri 06:00–22:00) |
|
|
72
|
+
| `listingDetailModel(listing)` | Listing-detail blocks: breadcrumb, location + Maps href, `description` string + toggle label, video/tour overlays. Studio pages map `facts` / `values` via `.label` / `.text` leaves. |
|
|
73
|
+
| `listingDetailFieldsModel(listing, dictionary?)` | Facts, values, and amenity groups that are safe to render: every row has a real label + text; missing condo/IPTU/empty groups are omitted. Used by `ListingDetailFields` (0.4.13+). |
|
|
74
|
+
| `listingAmenityGroups(listing, dictionary?)` | Unit / building amenity labels (`Comodidades`, `Comodidades do condomínio`). Reads `propertyFeatures` + `buildingAmenities` (works when `building` is null). Tenant `getSearchUi().dictionary` first, then the SDK fallback. Studio pages call this helper directly. |
|
|
75
|
+
| `resolvePublicSiteId({ host?, fallback? })` | Preview uses `fallback` (`GARAGEM_SITE_ID`); live hosts resolve via `getSite({ domain })` |
|
|
75
76
|
|
|
76
77
|
### Advanced layer (when the friendly one isn't enough)
|
|
77
78
|
|
|
@@ -256,10 +257,11 @@ separate subpath — peer `react` + `next`.
|
|
|
256
257
|
|
|
257
258
|
Studio codegen follows `STUDIO_SDK_CONTRACT`: pin
|
|
258
259
|
`@garagem-ai/site-sdk` to `minNpmVersion` and import only
|
|
259
|
-
`reactExports` (`SearchPage`, `ListingCard`,
|
|
260
|
-
`ResultsSkeleton` on the Studio pin). Preview,
|
|
261
|
-
published `next build` all resolve that tarball.
|
|
262
|
-
CSS (`@garagem-ai/site-sdk/react/search.css`) in
|
|
260
|
+
`reactExports` (`SearchPage`, `ListingCard`,
|
|
261
|
+
`usePublicSearch`, `ResultsSkeleton` on the Studio pin). Preview,
|
|
262
|
+
open-in-new-tab, and published `next build` all resolve that tarball.
|
|
263
|
+
Do **not** import npm CSS (`@garagem-ai/site-sdk/react/search.css`) in
|
|
264
|
+
Studio.
|
|
263
265
|
|
|
264
266
|
`SearchPage`, `ListingCard`, and `ResultsSkeleton` inject the chrome
|
|
265
267
|
stylesheet (JS `<style>` tag). Layout tags are optional.
|
|
@@ -292,9 +294,11 @@ SearchPage fills its parent. Constrain width with `.max-w-site` and
|
|
|
292
294
|
`variant` is `toolbar` (default), `dialog`, or `sidebar`. Customize with
|
|
293
295
|
CSS variables (`SEARCH_CSS_VARS` / `SEARCH_CSS_RECIPE` in `globals.css`),
|
|
294
296
|
`classNames`, `icons`, and `data-slot`. Home and search should share
|
|
295
|
-
`ListingCard`.
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
`ListingCard`. Listing detail maps `listingDetailModel` leaves and
|
|
298
|
+
`listingAmenityGroups`. The search H1 is SEO
|
|
299
|
+
stable: hit count is a sibling `<span>`, not inside `<h1>`. Presentation
|
|
300
|
+
tokens stay framework-free on the main entry so other adapters can reuse
|
|
301
|
+
them.
|
|
298
302
|
|
|
299
303
|
Hand-written Next apps that prefer a layout tag or a padded search
|
|
300
304
|
fallback can import those after they ship on npm; until then they are
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as
|
|
2
|
-
export { p as
|
|
1
|
+
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as SearchPathFilters, k as SearchUiDictionary, l as QueryListingsFilters, A as AppliedSearchQuery, m as AppliedSearchChange } from './search-engine-1O4sKtKb.mjs';
|
|
2
|
+
export { n as AMENITY_FALLBACK_LABELS, o as AmenityLabelDictionary, p as AmenityLabelOption, q as CmsEntryStatus, r as CmsFieldDefinition, s as CmsFieldType, t as CmsSeoData, F as FORBIDDEN_SEARCH_QUERY_KEYS, u as LISTING_AMENITY_TITLES, v as LISTING_DESCRIPTION_CLAMP, w as Listing, x as ListingAmenityGroup, y as ListingAmenityGroupKey, z as ListingAmenitySource, B as ListingBreadcrumbCrumb, D as ListingBusinessType, E as ListingCardModel, G as ListingDescriptionPreview, H as ListingDetailFieldsModel, I as ListingDetailFieldsSource, J as ListingDetailModel, K as ListingFact, M as ListingLocation, N as ListingLocationBlock, O as ListingMedia, P as ListingMediaOverlay, T as ListingPriceVisibility, U as ListingPropertySummary, V as ListingValue, W as LocationNameTables, X as QueryListingsLocation, Y as SEARCH_SORT_RELEVANCE, Z as SearchPathLocation, _ as SearchUiFilter, $ as SearchUiOption, a0 as TOOLBAR_PRIMARY_FILTER_IDS, a1 as applyPathFilter, a2 as buildQueryListingsParams, a3 as canonicalizeSearchHref, a4 as clearStagedPathFilters, a5 as countFacetChoices, a6 as countOptionLabel, a7 as displayPathLocation, a8 as hrefForAppliedChange, a9 as hrefForPathFilters, aa as hrefWithExplicitPage, ab as isListingDetailPath, ac as labelAmenities, ad as listingAmenityGroups, ae as listingBreadcrumb, af as listingDescriptionPreview, ag as listingDetailFieldsModel, ah as listingDetailModel, ai as listingFacts, aj as listingLocationBlock, ak as listingLocationLabel, al as listingMapsHref, am as listingMediaOverlays, an as listingValues, ao as paginationPages, ap as pathFilterHasOption, aq as pathFilterValue, ar as publicSearchHref, as as readPublicSearch, at as searchHrefUsesLegacyFilterQuery, au as searchResultsHeading, av as searchSortOptions, aw as toListingCardModel, ax as toolbarFilterIds, ay as visibleSearchFilters } from './search-engine-1O4sKtKb.mjs';
|
|
3
3
|
|
|
4
4
|
/** Custom fetch implementation. Defaults to the global `fetch`. */
|
|
5
5
|
type FetchLike = typeof fetch;
|
|
@@ -258,48 +258,6 @@ declare function getLeadUi(options: GetLeadUiOptions): Promise<LeadUi>;
|
|
|
258
258
|
declare function submitVisitLead(input: VisitLeadInput): Promise<LeadSubmitResult>;
|
|
259
259
|
declare function submitContactLead(input: ContactLeadInput): Promise<LeadSubmitResult>;
|
|
260
260
|
|
|
261
|
-
/**
|
|
262
|
-
* Portuguese labels for listing amenity ids. Tenant search-ui dictionary
|
|
263
|
-
* wins; this map is the default-catalog fallback so generated Studio pages
|
|
264
|
-
* never print camelCase keys.
|
|
265
|
-
*/
|
|
266
|
-
declare const LISTING_AMENITY_TITLES: {
|
|
267
|
-
readonly unit: "Comodidades";
|
|
268
|
-
readonly building: "Comodidades do condomínio";
|
|
269
|
-
};
|
|
270
|
-
type AmenityLabelOption = {
|
|
271
|
-
id: string;
|
|
272
|
-
label: string;
|
|
273
|
-
};
|
|
274
|
-
type AmenityLabelDictionary = {
|
|
275
|
-
propertyFeatures?: AmenityLabelOption[];
|
|
276
|
-
buildingAmenities?: AmenityLabelOption[];
|
|
277
|
-
};
|
|
278
|
-
type ListingAmenityGroupKey = keyof typeof LISTING_AMENITY_TITLES;
|
|
279
|
-
type ListingAmenityGroup = {
|
|
280
|
-
key: ListingAmenityGroupKey;
|
|
281
|
-
title: string;
|
|
282
|
-
labels: string[];
|
|
283
|
-
};
|
|
284
|
-
type ListingAmenitySource = {
|
|
285
|
-
amenities?: string[] | null;
|
|
286
|
-
propertyFeatures?: string[] | null;
|
|
287
|
-
/** Condo amenity ids, even when `building` is null (no buildingId). */
|
|
288
|
-
buildingAmenities?: string[] | null;
|
|
289
|
-
building?: {
|
|
290
|
-
amenities?: string[] | null;
|
|
291
|
-
} | null;
|
|
292
|
-
};
|
|
293
|
-
/**
|
|
294
|
-
* Default tenant ids + canonical `has*` / `is*` keys seen on public listings.
|
|
295
|
-
* Aligned with DEFAULT_PROPERTY_FEATURES and DEFAULT_BUILDING_FEATURES from
|
|
296
|
-
* Foundation's field-definitions.ts so generated Studio pages never need a
|
|
297
|
-
* dictionary for standard amenities.
|
|
298
|
-
*/
|
|
299
|
-
declare const AMENITY_FALLBACK_LABELS: Record<string, string>;
|
|
300
|
-
declare function labelAmenities(ids: readonly string[] | null | undefined, dictionary?: AmenityLabelOption[]): string[];
|
|
301
|
-
declare function listingAmenityGroups(listing: ListingAmenitySource, dictionary?: AmenityLabelDictionary): ListingAmenityGroup[];
|
|
302
|
-
|
|
303
261
|
/** Public listing URLs. Prefer `listing.path` from the API; fallback is `/imoveis/id-{listingCode}`. */
|
|
304
262
|
declare function listingLookupKey(raw: string): string;
|
|
305
263
|
declare function listingPublicPath(listing: {
|
|
@@ -308,87 +266,6 @@ declare function listingPublicPath(listing: {
|
|
|
308
266
|
id?: string | null;
|
|
309
267
|
}): string;
|
|
310
268
|
|
|
311
|
-
declare const LISTING_DESCRIPTION_CLAMP = 280;
|
|
312
|
-
type ListingFact = {
|
|
313
|
-
key: string;
|
|
314
|
-
label: string;
|
|
315
|
-
text: string;
|
|
316
|
-
};
|
|
317
|
-
type ListingValue = {
|
|
318
|
-
key: string;
|
|
319
|
-
label: string;
|
|
320
|
-
text: string;
|
|
321
|
-
};
|
|
322
|
-
type ListingBreadcrumbCrumb = {
|
|
323
|
-
label: string;
|
|
324
|
-
href: string;
|
|
325
|
-
};
|
|
326
|
-
type ListingLocationBlock = {
|
|
327
|
-
label: string;
|
|
328
|
-
mapsHref: string | null;
|
|
329
|
-
};
|
|
330
|
-
type ListingDescriptionPreview = {
|
|
331
|
-
text: string;
|
|
332
|
-
truncated: boolean;
|
|
333
|
-
toggleLabel: string | null;
|
|
334
|
-
};
|
|
335
|
-
type ListingMediaOverlay = {
|
|
336
|
-
key: "video" | "tour";
|
|
337
|
-
hash: "video" | "tour";
|
|
338
|
-
title: string;
|
|
339
|
-
href: string;
|
|
340
|
-
embedSrc: string;
|
|
341
|
-
};
|
|
342
|
-
declare function listingValues(listing: {
|
|
343
|
-
price?: number | null;
|
|
344
|
-
priceVisibility?: string | null;
|
|
345
|
-
property?: {
|
|
346
|
-
condoFee?: number | null;
|
|
347
|
-
propertyTax?: number | null;
|
|
348
|
-
} | null;
|
|
349
|
-
}): ListingValue[];
|
|
350
|
-
declare function listingFacts(listing: {
|
|
351
|
-
property?: {
|
|
352
|
-
totalArea?: number | null;
|
|
353
|
-
usableArea?: number | null;
|
|
354
|
-
bedrooms?: number | null;
|
|
355
|
-
suites?: number | null;
|
|
356
|
-
parkingSpaces?: number | null;
|
|
357
|
-
rooms?: number | null;
|
|
358
|
-
floor?: number | string | null;
|
|
359
|
-
} | null;
|
|
360
|
-
}): ListingFact[];
|
|
361
|
-
declare function listingMapsHref(location: ListingLocation | null | undefined): string | null;
|
|
362
|
-
declare function listingLocationBlock(listing: {
|
|
363
|
-
location?: ListingLocation | null;
|
|
364
|
-
} | null | undefined): ListingLocationBlock | null;
|
|
365
|
-
declare function listingBreadcrumb(listing: {
|
|
366
|
-
path?: string | null;
|
|
367
|
-
listingCode?: string | null;
|
|
368
|
-
id?: string | null;
|
|
369
|
-
}): ListingBreadcrumbCrumb[];
|
|
370
|
-
declare function listingDescriptionPreview(description: string | null | undefined, expanded?: boolean): ListingDescriptionPreview | null;
|
|
371
|
-
declare function listingMediaOverlays(listing: {
|
|
372
|
-
media?: ListingMedia[] | null;
|
|
373
|
-
}): ListingMediaOverlay[];
|
|
374
|
-
declare function listingDetailModel(listing: Pick<ListingDetail, "id" | "listingCode" | "path" | "price" | "priceVisibility" | "description"> & {
|
|
375
|
-
property?: ListingDetail["property"] | null;
|
|
376
|
-
location?: ListingLocation | null;
|
|
377
|
-
media?: ListingMedia[] | null;
|
|
378
|
-
}, options?: {
|
|
379
|
-
descriptionExpanded?: boolean;
|
|
380
|
-
}): {
|
|
381
|
-
breadcrumb: ListingBreadcrumbCrumb[];
|
|
382
|
-
values: ListingValue[];
|
|
383
|
-
facts: ListingFact[];
|
|
384
|
-
location: ListingLocationBlock | null;
|
|
385
|
-
/** Clamped (or full) copy — a string so JSX `{model.description}` is safe. */
|
|
386
|
-
description: string | null;
|
|
387
|
-
descriptionTruncated: boolean;
|
|
388
|
-
descriptionToggleLabel: string | null;
|
|
389
|
-
mediaOverlays: ListingMediaOverlay[];
|
|
390
|
-
};
|
|
391
|
-
|
|
392
269
|
/**
|
|
393
270
|
* Presentation helpers with no UI framework.
|
|
394
271
|
* React / React Native / Flutter adapters consume these formatters and
|
|
@@ -480,10 +357,10 @@ declare const STUDIO_SDK_PACKAGE: "@garagem-ai/site-sdk";
|
|
|
480
357
|
declare const STUDIO_SDK_CONTRACT: {
|
|
481
358
|
readonly package: "@garagem-ai/site-sdk";
|
|
482
359
|
/**
|
|
483
|
-
* Exact pin for generated Studio sites. Must
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
360
|
+
* Exact pin for generated Studio sites. Must match a tarball already on
|
|
361
|
+
* npm — v0 installs this version. After the 0.4.13 changeset publishes,
|
|
362
|
+
* bump this and move that release's names from `optionalReactExports`
|
|
363
|
+
* into `reactExports`.
|
|
487
364
|
*/
|
|
488
365
|
readonly minNpmVersion: "0.4.12";
|
|
489
366
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
@@ -500,6 +377,7 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
500
377
|
readonly optionalReactExports: {
|
|
501
378
|
readonly SearchPageFallback: "0.4.1";
|
|
502
379
|
readonly SearchChromeStyles: "0.4.1";
|
|
380
|
+
readonly ListingDetailFields: "0.4.13";
|
|
503
381
|
};
|
|
504
382
|
readonly forbiddenImports: readonly ["@garagem-ai/site-sdk/react/search.css"];
|
|
505
383
|
readonly leadStrategy: "visit-default";
|
|
@@ -651,4 +529,4 @@ interface GaragemClient {
|
|
|
651
529
|
*/
|
|
652
530
|
declare function createGaragemClient(options?: CreateGaragemClientOptions): GaragemClient;
|
|
653
531
|
|
|
654
|
-
export {
|
|
532
|
+
export { AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetLeadUiOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, type HHmm, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, ListingDetail, ListingFilters, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, expandVisitSchedule, expandVisitTimeSlots, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getLeadUi, getListing, getListings, getSearchUi, getSimilarListings, getSite, hasShowcaseLeadsPostUrl, isStudioPreviewHost, isVisitSlotAllowed, listingBusinessLabel, listingLookupKey, listingPublicPath, mergeAppliedSearchQueryIntoSearch, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingDetailInstruction, studioSdkPinInstruction, studioSearchLandmarkInstruction, studioSiteWidthCss, submitContactLead, submitVisitLead, unavailableReactImports };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as
|
|
2
|
-
export { p as
|
|
1
|
+
import { R as RequestNextOptions, L as ListingFilters, Q as QueryListingsParams, S as SearchListingsParams, C as CmsCollection, a as CmsEntriesResult, b as CmsEntry, c as ListingDetail, d as ListingsResult, e as SearchUi, f as SimilarListingsResult, g as Site, h as QueryListingsResult, i as SearchListingsResult, j as SearchPathFilters, k as SearchUiDictionary, l as QueryListingsFilters, A as AppliedSearchQuery, m as AppliedSearchChange } from './search-engine-1O4sKtKb.js';
|
|
2
|
+
export { n as AMENITY_FALLBACK_LABELS, o as AmenityLabelDictionary, p as AmenityLabelOption, q as CmsEntryStatus, r as CmsFieldDefinition, s as CmsFieldType, t as CmsSeoData, F as FORBIDDEN_SEARCH_QUERY_KEYS, u as LISTING_AMENITY_TITLES, v as LISTING_DESCRIPTION_CLAMP, w as Listing, x as ListingAmenityGroup, y as ListingAmenityGroupKey, z as ListingAmenitySource, B as ListingBreadcrumbCrumb, D as ListingBusinessType, E as ListingCardModel, G as ListingDescriptionPreview, H as ListingDetailFieldsModel, I as ListingDetailFieldsSource, J as ListingDetailModel, K as ListingFact, M as ListingLocation, N as ListingLocationBlock, O as ListingMedia, P as ListingMediaOverlay, T as ListingPriceVisibility, U as ListingPropertySummary, V as ListingValue, W as LocationNameTables, X as QueryListingsLocation, Y as SEARCH_SORT_RELEVANCE, Z as SearchPathLocation, _ as SearchUiFilter, $ as SearchUiOption, a0 as TOOLBAR_PRIMARY_FILTER_IDS, a1 as applyPathFilter, a2 as buildQueryListingsParams, a3 as canonicalizeSearchHref, a4 as clearStagedPathFilters, a5 as countFacetChoices, a6 as countOptionLabel, a7 as displayPathLocation, a8 as hrefForAppliedChange, a9 as hrefForPathFilters, aa as hrefWithExplicitPage, ab as isListingDetailPath, ac as labelAmenities, ad as listingAmenityGroups, ae as listingBreadcrumb, af as listingDescriptionPreview, ag as listingDetailFieldsModel, ah as listingDetailModel, ai as listingFacts, aj as listingLocationBlock, ak as listingLocationLabel, al as listingMapsHref, am as listingMediaOverlays, an as listingValues, ao as paginationPages, ap as pathFilterHasOption, aq as pathFilterValue, ar as publicSearchHref, as as readPublicSearch, at as searchHrefUsesLegacyFilterQuery, au as searchResultsHeading, av as searchSortOptions, aw as toListingCardModel, ax as toolbarFilterIds, ay as visibleSearchFilters } from './search-engine-1O4sKtKb.js';
|
|
3
3
|
|
|
4
4
|
/** Custom fetch implementation. Defaults to the global `fetch`. */
|
|
5
5
|
type FetchLike = typeof fetch;
|
|
@@ -258,48 +258,6 @@ declare function getLeadUi(options: GetLeadUiOptions): Promise<LeadUi>;
|
|
|
258
258
|
declare function submitVisitLead(input: VisitLeadInput): Promise<LeadSubmitResult>;
|
|
259
259
|
declare function submitContactLead(input: ContactLeadInput): Promise<LeadSubmitResult>;
|
|
260
260
|
|
|
261
|
-
/**
|
|
262
|
-
* Portuguese labels for listing amenity ids. Tenant search-ui dictionary
|
|
263
|
-
* wins; this map is the default-catalog fallback so generated Studio pages
|
|
264
|
-
* never print camelCase keys.
|
|
265
|
-
*/
|
|
266
|
-
declare const LISTING_AMENITY_TITLES: {
|
|
267
|
-
readonly unit: "Comodidades";
|
|
268
|
-
readonly building: "Comodidades do condomínio";
|
|
269
|
-
};
|
|
270
|
-
type AmenityLabelOption = {
|
|
271
|
-
id: string;
|
|
272
|
-
label: string;
|
|
273
|
-
};
|
|
274
|
-
type AmenityLabelDictionary = {
|
|
275
|
-
propertyFeatures?: AmenityLabelOption[];
|
|
276
|
-
buildingAmenities?: AmenityLabelOption[];
|
|
277
|
-
};
|
|
278
|
-
type ListingAmenityGroupKey = keyof typeof LISTING_AMENITY_TITLES;
|
|
279
|
-
type ListingAmenityGroup = {
|
|
280
|
-
key: ListingAmenityGroupKey;
|
|
281
|
-
title: string;
|
|
282
|
-
labels: string[];
|
|
283
|
-
};
|
|
284
|
-
type ListingAmenitySource = {
|
|
285
|
-
amenities?: string[] | null;
|
|
286
|
-
propertyFeatures?: string[] | null;
|
|
287
|
-
/** Condo amenity ids, even when `building` is null (no buildingId). */
|
|
288
|
-
buildingAmenities?: string[] | null;
|
|
289
|
-
building?: {
|
|
290
|
-
amenities?: string[] | null;
|
|
291
|
-
} | null;
|
|
292
|
-
};
|
|
293
|
-
/**
|
|
294
|
-
* Default tenant ids + canonical `has*` / `is*` keys seen on public listings.
|
|
295
|
-
* Aligned with DEFAULT_PROPERTY_FEATURES and DEFAULT_BUILDING_FEATURES from
|
|
296
|
-
* Foundation's field-definitions.ts so generated Studio pages never need a
|
|
297
|
-
* dictionary for standard amenities.
|
|
298
|
-
*/
|
|
299
|
-
declare const AMENITY_FALLBACK_LABELS: Record<string, string>;
|
|
300
|
-
declare function labelAmenities(ids: readonly string[] | null | undefined, dictionary?: AmenityLabelOption[]): string[];
|
|
301
|
-
declare function listingAmenityGroups(listing: ListingAmenitySource, dictionary?: AmenityLabelDictionary): ListingAmenityGroup[];
|
|
302
|
-
|
|
303
261
|
/** Public listing URLs. Prefer `listing.path` from the API; fallback is `/imoveis/id-{listingCode}`. */
|
|
304
262
|
declare function listingLookupKey(raw: string): string;
|
|
305
263
|
declare function listingPublicPath(listing: {
|
|
@@ -308,87 +266,6 @@ declare function listingPublicPath(listing: {
|
|
|
308
266
|
id?: string | null;
|
|
309
267
|
}): string;
|
|
310
268
|
|
|
311
|
-
declare const LISTING_DESCRIPTION_CLAMP = 280;
|
|
312
|
-
type ListingFact = {
|
|
313
|
-
key: string;
|
|
314
|
-
label: string;
|
|
315
|
-
text: string;
|
|
316
|
-
};
|
|
317
|
-
type ListingValue = {
|
|
318
|
-
key: string;
|
|
319
|
-
label: string;
|
|
320
|
-
text: string;
|
|
321
|
-
};
|
|
322
|
-
type ListingBreadcrumbCrumb = {
|
|
323
|
-
label: string;
|
|
324
|
-
href: string;
|
|
325
|
-
};
|
|
326
|
-
type ListingLocationBlock = {
|
|
327
|
-
label: string;
|
|
328
|
-
mapsHref: string | null;
|
|
329
|
-
};
|
|
330
|
-
type ListingDescriptionPreview = {
|
|
331
|
-
text: string;
|
|
332
|
-
truncated: boolean;
|
|
333
|
-
toggleLabel: string | null;
|
|
334
|
-
};
|
|
335
|
-
type ListingMediaOverlay = {
|
|
336
|
-
key: "video" | "tour";
|
|
337
|
-
hash: "video" | "tour";
|
|
338
|
-
title: string;
|
|
339
|
-
href: string;
|
|
340
|
-
embedSrc: string;
|
|
341
|
-
};
|
|
342
|
-
declare function listingValues(listing: {
|
|
343
|
-
price?: number | null;
|
|
344
|
-
priceVisibility?: string | null;
|
|
345
|
-
property?: {
|
|
346
|
-
condoFee?: number | null;
|
|
347
|
-
propertyTax?: number | null;
|
|
348
|
-
} | null;
|
|
349
|
-
}): ListingValue[];
|
|
350
|
-
declare function listingFacts(listing: {
|
|
351
|
-
property?: {
|
|
352
|
-
totalArea?: number | null;
|
|
353
|
-
usableArea?: number | null;
|
|
354
|
-
bedrooms?: number | null;
|
|
355
|
-
suites?: number | null;
|
|
356
|
-
parkingSpaces?: number | null;
|
|
357
|
-
rooms?: number | null;
|
|
358
|
-
floor?: number | string | null;
|
|
359
|
-
} | null;
|
|
360
|
-
}): ListingFact[];
|
|
361
|
-
declare function listingMapsHref(location: ListingLocation | null | undefined): string | null;
|
|
362
|
-
declare function listingLocationBlock(listing: {
|
|
363
|
-
location?: ListingLocation | null;
|
|
364
|
-
} | null | undefined): ListingLocationBlock | null;
|
|
365
|
-
declare function listingBreadcrumb(listing: {
|
|
366
|
-
path?: string | null;
|
|
367
|
-
listingCode?: string | null;
|
|
368
|
-
id?: string | null;
|
|
369
|
-
}): ListingBreadcrumbCrumb[];
|
|
370
|
-
declare function listingDescriptionPreview(description: string | null | undefined, expanded?: boolean): ListingDescriptionPreview | null;
|
|
371
|
-
declare function listingMediaOverlays(listing: {
|
|
372
|
-
media?: ListingMedia[] | null;
|
|
373
|
-
}): ListingMediaOverlay[];
|
|
374
|
-
declare function listingDetailModel(listing: Pick<ListingDetail, "id" | "listingCode" | "path" | "price" | "priceVisibility" | "description"> & {
|
|
375
|
-
property?: ListingDetail["property"] | null;
|
|
376
|
-
location?: ListingLocation | null;
|
|
377
|
-
media?: ListingMedia[] | null;
|
|
378
|
-
}, options?: {
|
|
379
|
-
descriptionExpanded?: boolean;
|
|
380
|
-
}): {
|
|
381
|
-
breadcrumb: ListingBreadcrumbCrumb[];
|
|
382
|
-
values: ListingValue[];
|
|
383
|
-
facts: ListingFact[];
|
|
384
|
-
location: ListingLocationBlock | null;
|
|
385
|
-
/** Clamped (or full) copy — a string so JSX `{model.description}` is safe. */
|
|
386
|
-
description: string | null;
|
|
387
|
-
descriptionTruncated: boolean;
|
|
388
|
-
descriptionToggleLabel: string | null;
|
|
389
|
-
mediaOverlays: ListingMediaOverlay[];
|
|
390
|
-
};
|
|
391
|
-
|
|
392
269
|
/**
|
|
393
270
|
* Presentation helpers with no UI framework.
|
|
394
271
|
* React / React Native / Flutter adapters consume these formatters and
|
|
@@ -480,10 +357,10 @@ declare const STUDIO_SDK_PACKAGE: "@garagem-ai/site-sdk";
|
|
|
480
357
|
declare const STUDIO_SDK_CONTRACT: {
|
|
481
358
|
readonly package: "@garagem-ai/site-sdk";
|
|
482
359
|
/**
|
|
483
|
-
* Exact pin for generated Studio sites. Must
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
360
|
+
* Exact pin for generated Studio sites. Must match a tarball already on
|
|
361
|
+
* npm — v0 installs this version. After the 0.4.13 changeset publishes,
|
|
362
|
+
* bump this and move that release's names from `optionalReactExports`
|
|
363
|
+
* into `reactExports`.
|
|
487
364
|
*/
|
|
488
365
|
readonly minNpmVersion: "0.4.12";
|
|
489
366
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
@@ -500,6 +377,7 @@ declare const STUDIO_SDK_CONTRACT: {
|
|
|
500
377
|
readonly optionalReactExports: {
|
|
501
378
|
readonly SearchPageFallback: "0.4.1";
|
|
502
379
|
readonly SearchChromeStyles: "0.4.1";
|
|
380
|
+
readonly ListingDetailFields: "0.4.13";
|
|
503
381
|
};
|
|
504
382
|
readonly forbiddenImports: readonly ["@garagem-ai/site-sdk/react/search.css"];
|
|
505
383
|
readonly leadStrategy: "visit-default";
|
|
@@ -651,4 +529,4 @@ interface GaragemClient {
|
|
|
651
529
|
*/
|
|
652
530
|
declare function createGaragemClient(options?: CreateGaragemClientOptions): GaragemClient;
|
|
653
531
|
|
|
654
|
-
export {
|
|
532
|
+
export { AppliedSearchChange, AppliedSearchQuery, CmsCollection, CmsEntriesResult, CmsEntry, type ContactLeadInput, type CreateGaragemClientOptions, type FetchLike, type GaragemClient, GaragemSdkError, type GetCmsCollectionOptions, type GetCmsCollectionsOptions, type GetCmsEntriesOptions, type GetCmsEntryOptions, type GetLeadUiOptions, type GetListingOptions, type GetListingsOptions, type GetSearchUiOptions, type GetSimilarListingsOptions, type GetSiteOptions, type HHmm, type LeadContact, type LeadField, type LeadFieldId, LeadSubmitError, type LeadSubmitErrorCode, type LeadSubmitResult, type LeadUi, ListingDetail, ListingFilters, ListingsResult, type LocationFilterInput, QueryListingsFilters, type QueryListingsOptions, QueryListingsParams, QueryListingsResult, RequestNextOptions, type ResolvePublicSiteIdOptions, SEARCH_CSS_RECIPE, SEARCH_CSS_VARS, STUDIO_DEFAULT_VISIT_SCHEDULE, STUDIO_SDK_CONTRACT, STUDIO_SDK_PACKAGE, STUDIO_SITE_LAYOUT, type SearchListingsOptions, SearchListingsParams, SearchListingsResult, SearchPathFilters, SearchUi, SearchUiDictionary, SimilarListingsResult, Site, type StudioSdkContract, VISIT_TIME_ZONE, type VisitHours, type VisitLeadInput, type VisitSchedule, type VisitScheduleConfig, coerceNpmVersion, compareSemver, composeSearchPublicHref, composeSearchPublicPath, createGaragemClient, expandVisitSchedule, expandVisitTimeSlots, formatAreaM2, formatGroupedInteger, formatListingPrice, getCmsCollection, getCmsCollections, getCmsEntries, getCmsEntry, getLeadUi, getListing, getListings, getSearchUi, getSimilarListings, getSite, hasShowcaseLeadsPostUrl, isStudioPreviewHost, isVisitSlotAllowed, listingBusinessLabel, listingLookupKey, listingPublicPath, mergeAppliedSearchQueryIntoSearch, normalizeVisitDate, normalizeVisitTime, parseAppliedSearchQuery, parseGroupedInteger, parseReactSdkNamedImports, parseSearchPublicPath, pathFiltersToQueryFilters, pathLocationToFilterInput, queryListings, reduceAppliedSearchQuery, resolvePublicSiteId, searchListings, serializeAppliedSearchQuery, slotsForDate, studioAmenityInstruction, studioChromeInstruction, studioCodegenContractViolations, studioDefaultLeadUi, studioLayoutInstruction, studioLeadInstruction, studioListingDetailInstruction, studioSdkPinInstruction, studioSearchLandmarkInstruction, studioSiteWidthCss, submitContactLead, submitVisitLead, unavailableReactImports };
|
package/dist/index.js
CHANGED
|
@@ -74,6 +74,7 @@ __export(src_exports, {
|
|
|
74
74
|
listingBreadcrumb: () => listingBreadcrumb,
|
|
75
75
|
listingBusinessLabel: () => listingBusinessLabel,
|
|
76
76
|
listingDescriptionPreview: () => listingDescriptionPreview,
|
|
77
|
+
listingDetailFieldsModel: () => listingDetailFieldsModel,
|
|
77
78
|
listingDetailModel: () => listingDetailModel,
|
|
78
79
|
listingFacts: () => listingFacts,
|
|
79
80
|
listingLocationBlock: () => listingLocationBlock,
|
|
@@ -2288,32 +2289,56 @@ function listingMediaOverlays(listing) {
|
|
|
2288
2289
|
return overlays;
|
|
2289
2290
|
}
|
|
2290
2291
|
function listingDetailModel(listing, options) {
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2292
|
+
const text = listing.description?.trim() ?? "";
|
|
2293
|
+
const description = text || null;
|
|
2294
|
+
const truncated = description != null && description.length > LISTING_DESCRIPTION_CLAMP;
|
|
2295
|
+
const expanded = options?.descriptionExpanded === true;
|
|
2295
2296
|
return {
|
|
2296
2297
|
breadcrumb: listingBreadcrumb(listing),
|
|
2297
2298
|
values: listingValues(listing),
|
|
2298
2299
|
facts: listingFacts(listing),
|
|
2299
2300
|
location: listingLocationBlock(listing),
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
descriptionToggleLabel: descriptionPreview?.toggleLabel ?? null,
|
|
2301
|
+
description,
|
|
2302
|
+
descriptionTruncated: truncated,
|
|
2303
|
+
descriptionToggleLabel: truncated ? expanded ? "Ler menos" : "Ler mais" : null,
|
|
2304
2304
|
mediaOverlays: listingMediaOverlays(listing)
|
|
2305
2305
|
};
|
|
2306
2306
|
}
|
|
2307
2307
|
|
|
2308
|
+
// src/listing-detail-fields.ts
|
|
2309
|
+
function visibleText(value) {
|
|
2310
|
+
if (typeof value !== "string") return null;
|
|
2311
|
+
const trimmed = value.trim();
|
|
2312
|
+
if (!trimmed || trimmed === "undefined" || trimmed === "null") return null;
|
|
2313
|
+
return trimmed;
|
|
2314
|
+
}
|
|
2315
|
+
function visibleRows(rows) {
|
|
2316
|
+
return rows.filter((row) => {
|
|
2317
|
+
const label = visibleText(row.label);
|
|
2318
|
+
const text = visibleText(row.text);
|
|
2319
|
+
return label != null && text != null;
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
function listingDetailFieldsModel(listing, dictionary) {
|
|
2323
|
+
return {
|
|
2324
|
+
facts: visibleRows(listingFacts(listing)),
|
|
2325
|
+
values: visibleRows(listingValues(listing)),
|
|
2326
|
+
amenityGroups: listingAmenityGroups(listing, dictionary).map((group) => ({
|
|
2327
|
+
...group,
|
|
2328
|
+
labels: group.labels.map((label) => visibleText(label)).filter((label) => label != null)
|
|
2329
|
+
})).filter((group) => group.labels.length > 0)
|
|
2330
|
+
};
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2308
2333
|
// src/studio-contract.ts
|
|
2309
2334
|
var STUDIO_SDK_PACKAGE = "@garagem-ai/site-sdk";
|
|
2310
2335
|
var STUDIO_SDK_CONTRACT = {
|
|
2311
2336
|
package: STUDIO_SDK_PACKAGE,
|
|
2312
2337
|
/**
|
|
2313
|
-
* Exact pin for generated Studio sites. Must
|
|
2314
|
-
*
|
|
2315
|
-
*
|
|
2316
|
-
*
|
|
2338
|
+
* Exact pin for generated Studio sites. Must match a tarball already on
|
|
2339
|
+
* npm — v0 installs this version. After the 0.4.13 changeset publishes,
|
|
2340
|
+
* bump this and move that release's names from `optionalReactExports`
|
|
2341
|
+
* into `reactExports`.
|
|
2317
2342
|
*/
|
|
2318
2343
|
minNpmVersion: "0.4.12",
|
|
2319
2344
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
@@ -2334,7 +2359,8 @@ var STUDIO_SDK_CONTRACT = {
|
|
|
2334
2359
|
*/
|
|
2335
2360
|
optionalReactExports: {
|
|
2336
2361
|
SearchPageFallback: "0.4.1",
|
|
2337
|
-
SearchChromeStyles: "0.4.1"
|
|
2362
|
+
SearchChromeStyles: "0.4.1",
|
|
2363
|
+
ListingDetailFields: "0.4.13"
|
|
2338
2364
|
},
|
|
2339
2365
|
forbiddenImports: ["@garagem-ai/site-sdk/react/search.css"],
|
|
2340
2366
|
leadStrategy: "visit-default",
|
|
@@ -2378,7 +2404,7 @@ ${studioSiteWidthCss()}
|
|
|
2378
2404
|
Every page section is two layers: (1) surface \u2014 \`section\` / header / footer \`${STUDIO_SITE_LAYOUT.surfaceClassName}\`, background to the viewport edges, no max-width class and no horizontal padding; (2) wrapper \u2014 one child \`${STUDIO_SITE_LAYOUT.wrapperClassName}\`. Header and footer use that same inner wrapper. Components fill the wrapper (\`w-full\`). Never nest a second max-width container with extra horizontal padding. ${studioSearchLandmarkInstruction()} Do not use \`ml-auto\` on the content wrapper. To make the site narrower or wider, change ONLY \`--site-max-width\` in \`app/globals.css\` (allowed: ${scale}; default ${STUDIO_SITE_LAYOUT.maxWidthRem}). Do not edit wrapper class names or horizontal padding. Full-bleed image surfaces (home hero, listing gallery) stay flush with the header \u2014 do not add vertical padding there.`;
|
|
2379
2405
|
}
|
|
2380
2406
|
function studioSearchLandmarkInstruction() {
|
|
2381
|
-
return `Search at \`/imoveis\` (hard rule). The page landmark is \`<main className="${STUDIO_SITE_LAYOUT.searchMainClassName}">\` with one child \`${STUDIO_SITE_LAYOUT.wrapperClassName}\`. Pass \`as="div"\` to \`SearchPage\` so it is not a second main. Do not wrap \`SearchPage\` in \`<section>\`. Do not put vertical padding on SearchPage. \`pt-4 pb-12\` is the default on that search \`<main>\` \u2014 change those values if the design needs it. Flush search (glued to the header) is allowed only with \`${STUDIO_SITE_LAYOUT.searchFlushMarker}\` on that \`<main>\`. Never add that vertical padding to home heroes or listing galleries.`;
|
|
2407
|
+
return `Search at \`/imoveis\` (hard rule). The page landmark is \`<main className="${STUDIO_SITE_LAYOUT.searchMainClassName}">\` with one child \`${STUDIO_SITE_LAYOUT.wrapperClassName}\`. Pass \`as="div"\` to \`SearchPage\` so it is not a second main. Mount as one line: \`<SearchPage as="div" siteId={() => resolveSiteId(window.location.host)} baseUrl={GARAGEM_API_BASE} variant="toolbar" />\`. Do not wrap \`SearchPage\` in \`<section>\` or add another \`<h1>\`. SearchPage owns the SEO heading: count in \`data-slot="search-heading-count"\` (sibling \`<span>\`), title in \`<h1 data-slot="search-heading-title">\` \u2014 never put the count inside the H1. Do not put vertical padding on SearchPage. \`pt-4 pb-12\` is the default on that search \`<main>\` \u2014 change those values if the design needs it. Flush search (glued to the header) is allowed only with \`${STUDIO_SITE_LAYOUT.searchFlushMarker}\` on that \`<main>\`. Never add that vertical padding to home heroes or listing galleries.`;
|
|
2382
2408
|
}
|
|
2383
2409
|
var REACT_SDK_NAMED_IMPORT_RE = /(?:^|[\n;])\s*import\s+(?!type\b)(?:type\s+)?\{([^}]+)\}\s+from\s+['"]@garagem-ai\/site-sdk\/react['"]/g;
|
|
2384
2410
|
var SHOWCASE_LEADS_POST_URL_RE = /\/api\/sites\/[^\s"']*\/leads(?!\/ui)/;
|
|
@@ -2445,11 +2471,10 @@ function studioLeadInstruction() {
|
|
|
2445
2471
|
}
|
|
2446
2472
|
function studioListingDetailInstruction() {
|
|
2447
2473
|
const names = STUDIO_SDK_CONTRACT.listingDetailExports.join(", ");
|
|
2448
|
-
return `Listing detail
|
|
2474
|
+
return `Listing detail: import ${names} from \`${STUDIO_SDK_PACKAGE}\` and \`ListingCard\` from \`${STUDIO_SDK_PACKAGE}/react\`. Render \`listingDetailModel\` leaves: \`model.facts[].label\` / \`.text\`, \`model.values[].label\` / \`.text\`, \`model.location.label\` / \`model.location.mapsHref\`, breadcrumb \`.href\` (search prefixes of \`listing.path\`). \`model.description\` is the complete string \u2014 do not slice. Never interpolate \`model.location\`, \`model.facts\`, \`model.values\`, \`model.breadcrumb\`, or \`model.mediaOverlays\` as a React child. Video/tour: \`model.mediaOverlays\` as hash links (\`#video\` / \`#tour\`) and a fullscreen overlay that closes with browser back; omit when empty. Similar listings: \`getSimilarListings({ siteId, listingId, baseUrl })\` + \`ListingCard\`; hide the section when empty. Do not invent a local recommendation loop.`;
|
|
2449
2475
|
}
|
|
2450
2476
|
function studioAmenityInstruction() {
|
|
2451
|
-
|
|
2452
|
-
return `Listing amenities: import ${names} from \`${STUDIO_SDK_PACKAGE}\`. Render \`listingAmenityGroups(listing)\` (optional second arg: \`getSearchUi().dictionary\`). Use the helper titles (\`Comodidades\` / \`Comodidades do condom\xEDnio\`). Labels are already alphabetical (pt-BR) \u2014 keep that order. Omit empty groups. Never print amenity ids, never invent a local label map, and never title a section "Comodidades da unidade".`;
|
|
2477
|
+
return `Listing amenities: Portuguese labels from \`listingAmenityGroups(listing)\` (optional dictionary from \`getSearchUi()\`). Each group is \`{ title, labels: string[] }\` \u2014 render \`group.labels.map((label) => \u2026)\` and hide a group when \`group.labels.length === 0\`. Titles: \`Comodidades\` / \`Comodidades do condom\xEDnio\`. Never print amenity ids, never invent a local label map, and never title a section "Comodidades da unidade".`;
|
|
2453
2478
|
}
|
|
2454
2479
|
function studioChromeInstruction() {
|
|
2455
2480
|
const injectors = compareSemver(
|
|
@@ -2690,6 +2715,7 @@ function createGaragemClient(options = {}) {
|
|
|
2690
2715
|
listingBreadcrumb,
|
|
2691
2716
|
listingBusinessLabel,
|
|
2692
2717
|
listingDescriptionPreview,
|
|
2718
|
+
listingDetailFieldsModel,
|
|
2693
2719
|
listingDetailModel,
|
|
2694
2720
|
listingFacts,
|
|
2695
2721
|
listingLocationBlock,
|