@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.
@@ -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 be ≥ `selfInjectSince` so
17
- * prompts that skip the layout chrome tag match the tarball v0 installs.
18
- * 0.4.9 adds listingDetailModel (values, facts, location, breadcrumb,
19
- * description clamp, video/tour), getSimilarListings, and
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.9",
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 blocks: import ${names} from \`${STUDIO_SDK_PACKAGE}\` and \`ListingCard\` from \`${STUDIO_SDK_PACKAGE}/react\`. Render \`listingDetailModel(listing)\` for breadcrumb (hrefs are search prefixes of \`listing.path\`, never invented paths), values (price / sob consulta, condo, IPTU), facts (omit empty zeros; bedrooms ≠ salas), location plus a discreet Google Maps \`<a target="_blank" rel="noopener noreferrer">\`, and description with the helper clamp + toggle (keep the full text; do not drop the remainder). 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 the list is empty. Do not invent a local recommendation loop.`;
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
- const names = STUDIO_SDK_CONTRACT.amenityExports.join(", ");
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 {