@garagem-ai/site-sdk 0.6.0 → 0.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@garagem-ai/site-sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "private": false,
5
5
  "description": "Typed, runtime-agnostic SDK for building custom real estate sites against the Garagem platform. Drop into any Next.js (or other JS) project to fetch listings, sites and CMS data.",
6
6
  "main": "./dist/index.js",
@@ -18,11 +18,13 @@ export const STUDIO_SDK_CONTRACT = {
18
18
  * Exact pin for generated Studio sites. Must match a tarball already on
19
19
  * npm — v0 installs this version. After a later changeset publishes, bump
20
20
  * this and move that release's names from `optionalReactExports` /
21
- * `unpublishedSearchExports` into the prompt-safe lists. Do not bump here
22
- * until that tarball is on npm. Headless SearchPage already shipped in
23
- * 0.4.12 (`visibleSearchFilters` / `toolbarFilterIds` are on that pin).
21
+ * `unpublishedSearchExports` / `unpublishedPhoneExports` into the
22
+ * prompt-safe lists. Do not bump here until that tarball is on npm.
23
+ * Phone mask helpers shipped in 0.6.0. Search filter helpers
24
+ * (`visibleSearchFilters` / `toolbarFilterIds`) shipped in 0.4.12 and
25
+ * remain on this pin.
24
26
  */
25
- minNpmVersion: "0.4.12",
27
+ minNpmVersion: "0.6.0",
26
28
  /** Historical: older tarballs inject card CSS when those components mount. */
27
29
  selfInjectSince: "0.4.2",
28
30
  chromeStrategy: "app-owned" as const,
@@ -75,18 +77,9 @@ export const STUDIO_SDK_CONTRACT = {
75
77
  "formatListingPrice",
76
78
  ] as const,
77
79
  /**
78
- * Prompt-safe phone helpers on `minNpmVersion`. Empty until a published
79
- * tarball exports them and this pin bumps — then move names here from
80
- * `unpublishedPhoneExports`.
80
+ * Prompt-safe phone helpers on `minNpmVersion` (published in 0.6.0).
81
81
  */
82
- phoneExports: [] as const,
83
- /**
84
- * Headless phone mask helpers in git / newer tarballs but not on
85
- * `minNpmVersion` (0.4.12). Prompts, completeness, and repair text must
86
- * not mention these until the pin bumps — v0 installs the pin and the
87
- * ESM loader throws on missing named exports.
88
- */
89
- unpublishedPhoneExports: [
82
+ phoneExports: [
90
83
  "PHONE_COUNTRIES",
91
84
  "formatPhoneNational",
92
85
  "toE164",
@@ -96,12 +89,19 @@ export const STUDIO_SDK_CONTRACT = {
96
89
  "findPhoneCountry",
97
90
  "remaskPhoneForCountry",
98
91
  ] as const,
92
+ /**
93
+ * Headless phone helpers in git but not on `minNpmVersion`. Prompts,
94
+ * completeness, and repair text must not mention these until the pin
95
+ * bumps — v0 installs the pin and the ESM loader throws on missing
96
+ * named exports.
97
+ */
98
+ unpublishedPhoneExports: [] as const,
99
99
  amenityExports: ["listingAmenityGroups"] as const,
100
100
  /**
101
- * Names already on the pinned npm tarball (`minNpmVersion` / 0.4.12) —
102
- * safe for Studio prompts and completeness. Includes
103
- * `visibleSearchFilters` + `toolbarFilterIds` (shipped in 0.4.12). Do not
104
- * confuse with `unpublishedSearchExports` (`searchChromeModel`, …).
101
+ * Names already on the pinned npm tarball (`minNpmVersion`) — safe for
102
+ * Studio prompts and completeness. Includes `visibleSearchFilters` +
103
+ * `toolbarFilterIds` (shipped in 0.4.12). Do not confuse with
104
+ * `unpublishedSearchExports` (`searchChromeModel`, …).
105
105
  */
106
106
  searchExports: [
107
107
  "searchResultsHeading",
@@ -237,7 +237,8 @@ export function studioSdkPinInstruction(): string {
237
237
 
238
238
  export function studioLeadInstruction(): string {
239
239
  const names = STUDIO_SDK_CONTRACT.leadExports.join(", ");
240
- return `Listing-detail visit/contact leads: import ${names} from \`${STUDIO_SDK_PACKAGE}\` (the main package, not \`/react\`). Call \`submitVisitLead\` / \`submitContactLead\` — never concatenate a leads webhook URL and never POST the Showcase demo leads route. Phone fields use a national mask with a country picker and submit E.164 — do not invent a second mask and do not import \`@garagem/ui\` PhoneInput.`;
240
+ const phone = STUDIO_SDK_CONTRACT.phoneExports.join(", ");
241
+ return `Listing-detail visit/contact leads: import ${names} from \`${STUDIO_SDK_PACKAGE}\` (the main package, not \`/react\`). Call \`submitVisitLead\` / \`submitContactLead\` — never concatenate a leads webhook URL and never POST the Showcase demo leads route. Phone fields: import ${phone} from the same package. Display draft is \`formatPhoneNational\` (default country \`BR\`); changing country calls \`remaskPhoneForCountry\`; submit \`toE164\` and require \`isValidPhone\`. Do not invent a second mask and do not import \`@garagem/ui\` PhoneInput.`;
241
242
  }
242
243
 
243
244
  export function studioListingCardInstruction(): string {