@garagem-ai/site-sdk 0.4.11 → 0.4.12
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 +1 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -9
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
- package/src/listing-detail.ts +8 -4
- package/src/react/styles/search-chrome-css.generated.ts +1 -1
- package/src/studio-contract.ts +4 -5
package/dist/index.mjs
CHANGED
|
@@ -2161,15 +2161,19 @@ function listingMediaOverlays(listing) {
|
|
|
2161
2161
|
return overlays;
|
|
2162
2162
|
}
|
|
2163
2163
|
function listingDetailModel(listing, options) {
|
|
2164
|
+
const descriptionPreview = listingDescriptionPreview(
|
|
2165
|
+
listing.description,
|
|
2166
|
+
options?.descriptionExpanded === true
|
|
2167
|
+
);
|
|
2164
2168
|
return {
|
|
2165
2169
|
breadcrumb: listingBreadcrumb(listing),
|
|
2166
2170
|
values: listingValues(listing),
|
|
2167
2171
|
facts: listingFacts(listing),
|
|
2168
2172
|
location: listingLocationBlock(listing),
|
|
2169
|
-
description
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
+
/** Clamped (or full) copy — a string so JSX `{model.description}` is safe. */
|
|
2174
|
+
description: descriptionPreview?.text ?? null,
|
|
2175
|
+
descriptionTruncated: descriptionPreview?.truncated === true,
|
|
2176
|
+
descriptionToggleLabel: descriptionPreview?.toggleLabel ?? null,
|
|
2173
2177
|
mediaOverlays: listingMediaOverlays(listing)
|
|
2174
2178
|
};
|
|
2175
2179
|
}
|
|
@@ -2181,11 +2185,10 @@ var STUDIO_SDK_CONTRACT = {
|
|
|
2181
2185
|
/**
|
|
2182
2186
|
* Exact pin for generated Studio sites. Must be ≥ `selfInjectSince` so
|
|
2183
2187
|
* prompts that skip the layout chrome tag match the tarball v0 installs.
|
|
2184
|
-
* 0.4.
|
|
2185
|
-
*
|
|
2186
|
-
* listingAmenityGroups so listing detail never prints amenity ids.
|
|
2188
|
+
* 0.4.12 flattens listingDetailModel.description to a string (plus
|
|
2189
|
+
* descriptionToggleLabel) so JSX cannot render the clamp object.
|
|
2187
2190
|
*/
|
|
2188
|
-
minNpmVersion: "0.4.
|
|
2191
|
+
minNpmVersion: "0.4.12",
|
|
2189
2192
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
2190
2193
|
selfInjectSince: "0.4.2",
|
|
2191
2194
|
chromeStrategy: "self-inject",
|
|
@@ -2315,7 +2318,7 @@ function studioLeadInstruction() {
|
|
|
2315
2318
|
}
|
|
2316
2319
|
function studioListingDetailInstruction() {
|
|
2317
2320
|
const names = STUDIO_SDK_CONTRACT.listingDetailExports.join(", ");
|
|
2318
|
-
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 \u2260 salas), location plus a discreet Google Maps \`<a target="_blank" rel="noopener noreferrer">\`, and description
|
|
2321
|
+
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 \u2260 salas), location plus a discreet Google Maps \`<a target="_blank" rel="noopener noreferrer">\`, and description as the string \`model.description\` plus \`model.descriptionToggleLabel\` (keep the full text; do not drop the remainder). Map facts/values/breadcrumb items to \`.label\` / \`.text\` / \`.href\`; use \`model.location.label\` and \`model.location.mapsHref\`. Never interpolate \`model.location\`, \`model.facts\`, \`model.values\`, \`model.breadcrumb\`, \`model.mediaOverlays\`, or amenity groups 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 the list is empty. Do not invent a local recommendation loop.`;
|
|
2319
2322
|
}
|
|
2320
2323
|
function studioAmenityInstruction() {
|
|
2321
2324
|
const names = STUDIO_SDK_CONTRACT.amenityExports.join(", ");
|