@garagem-ai/site-sdk 0.4.11 → 0.4.13
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 +9 -129
- package/dist/index.d.ts +9 -129
- package/dist/index.js +44 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -15
- 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 -5
- 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 +9 -10
package/src/studio-contract.ts
CHANGED
|
@@ -13,13 +13,12 @@ export const STUDIO_SDK_PACKAGE = "@garagem-ai/site-sdk" as const;
|
|
|
13
13
|
export const STUDIO_SDK_CONTRACT = {
|
|
14
14
|
package: STUDIO_SDK_PACKAGE,
|
|
15
15
|
/**
|
|
16
|
-
* Exact pin for generated Studio sites. Must
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* listingAmenityGroups so listing detail never prints amenity ids.
|
|
16
|
+
* Exact pin for generated Studio sites. Must match a tarball already on
|
|
17
|
+
* npm — v0 installs this version. After the 0.4.13 changeset publishes,
|
|
18
|
+
* bump this and move that release's names from `optionalReactExports`
|
|
19
|
+
* into `reactExports`.
|
|
21
20
|
*/
|
|
22
|
-
minNpmVersion: "0.4.
|
|
21
|
+
minNpmVersion: "0.4.12",
|
|
23
22
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
24
23
|
selfInjectSince: "0.4.2",
|
|
25
24
|
chromeStrategy: "self-inject" as const,
|
|
@@ -39,6 +38,7 @@ export const STUDIO_SDK_CONTRACT = {
|
|
|
39
38
|
optionalReactExports: {
|
|
40
39
|
SearchPageFallback: "0.4.1",
|
|
41
40
|
SearchChromeStyles: "0.4.1",
|
|
41
|
+
ListingDetailFields: "0.4.13",
|
|
42
42
|
} as const,
|
|
43
43
|
forbiddenImports: ["@garagem-ai/site-sdk/react/search.css"] as const,
|
|
44
44
|
leadStrategy: "visit-default" as const,
|
|
@@ -94,7 +94,7 @@ Every page section is two layers: (1) surface — \`section\` / header / footer
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export function studioSearchLandmarkInstruction(): string {
|
|
97
|
-
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>\` — 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.`;
|
|
97
|
+
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">\` — 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>\` — 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.`;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
const REACT_SDK_NAMED_IMPORT_RE =
|
|
@@ -175,12 +175,11 @@ export function studioLeadInstruction(): string {
|
|
|
175
175
|
|
|
176
176
|
export function studioListingDetailInstruction(): string {
|
|
177
177
|
const names = STUDIO_SDK_CONTRACT.listingDetailExports.join(", ");
|
|
178
|
-
return `Listing detail
|
|
178
|
+
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 — 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.`;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
export function studioAmenityInstruction(): string {
|
|
182
|
-
|
|
183
|
-
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ínio\`). Labels are already alphabetical (pt-BR) — keep that order. Omit empty groups. Never print amenity ids, never invent a local label map, and never title a section "Comodidades da unidade".`;
|
|
182
|
+
return `Listing amenities: Portuguese labels from \`listingAmenityGroups(listing)\` (optional dictionary from \`getSearchUi()\`). Titles: \`Comodidades\` / \`Comodidades do condomínio\`. Never print amenity ids, never invent a local label map, and never title a section "Comodidades da unidade".`;
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
export function studioChromeInstruction(): string {
|