@buyingbuddy/react 0.0.1 → 0.0.2

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 ADDED
@@ -0,0 +1,236 @@
1
+ # @buyingbuddy/react
2
+
3
+ React components for embedding [BuyingBuddy](https://www.buyingbuddy.com) real-estate (IDX) widgets — featured galleries, search forms, interactive maps, property details, and more.
4
+
5
+ BuyingBuddy widgets ship as a `<bb-widget>` custom element loaded from the BuyingBuddy plugin script. This package wraps that element in idiomatic React components so you can add IDX search and listings to your site without writing script tags or touching the custom element directly.
6
+
7
+ Works with **React**, **Next.js**, and **Framer**.
8
+
9
+ > **Is this the right package for you?** This is a React component library — you use it inside a build-tooled project (Vite, Next.js, Framer) that compiles JSX/TypeScript. If you just want to drop a widget into a plain HTML page with a `<script>` tag, you don't need this package — use the standard widget install from your BuyingBuddy dashboard (**Widgets → Plugin Installation and Setup**) instead.
10
+
11
+ ## Install
12
+
13
+ Inside an existing React project:
14
+
15
+ ```bash
16
+ npm install @buyingbuddy/react
17
+ ```
18
+
19
+ React 18 or 19 is required as a peer dependency, so make sure your project has them:
20
+
21
+ ```bash
22
+ npm install react react-dom
23
+ ```
24
+
25
+ ### Starting from scratch
26
+
27
+ No React project yet? This gets you from nothing to a running page:
28
+
29
+ ```bash
30
+ npm create vite@latest my-site -- --template react
31
+ cd my-site
32
+ npm install
33
+ npm install @buyingbuddy/react
34
+ npm run dev # opens a dev server, usually http://localhost:5173
35
+ ```
36
+
37
+ Then paste one of the examples below into `src/App.jsx` and save — the page reloads automatically.
38
+
39
+ ## Prerequisites
40
+
41
+ Before anything will render, you need both of these:
42
+
43
+ 1. **A BuyingBuddy account ID (`acid`).** Find it in your dashboard under **Widgets → Plugin Installation and Setup**. There is no anonymous or "try it" mode — the widgets will not load without a valid account ID.
44
+ 2. **Your domain authorized on that account.** An `acid` only works on domains registered to its account. Running on an unauthorized domain produces an "invalid account / unauthorized domain" error.
45
+
46
+ ## Quick start
47
+
48
+ ```jsx
49
+ import { BuyingBuddyProvider, BuyingBuddyWidget } from "@buyingbuddy/react";
50
+
51
+ export default function App() {
52
+ return (
53
+ <BuyingBuddyProvider accountId="your-account-id">
54
+ <BuyingBuddyWidget type="FeaturedGallery" limit={12} />
55
+ </BuyingBuddyProvider>
56
+ );
57
+ }
58
+ ```
59
+
60
+ Replace `your-account-id` with your `acid`. The provider loads the BuyingBuddy script for that account once, waits for it to initialize, then renders your widgets. While it loads it renders the `fallback` (nothing, by default).
61
+
62
+ ## Examples
63
+
64
+ **A search form above a results list:**
65
+
66
+ ```jsx
67
+ <BuyingBuddyProvider accountId="your-account-id">
68
+ <BuyingBuddyWidget type="SearchForm" />
69
+ <BuyingBuddyWidget type="SearchResults" limit={24} order="price_desc" />
70
+ </BuyingBuddyProvider>
71
+ ```
72
+
73
+ **FeaturedGallery / FeaturedList show the account's own (featured) listings**, with `limit` capping how many:
74
+
75
+ ```jsx
76
+ <BuyingBuddyWidget type="FeaturedGallery" limit={12} />
77
+ ```
78
+
79
+ > If the account has no listings of its own — e.g. a brand-new or demo account — this renders empty ("0 Found"). To show listings from the broader MLS instead, give it a `filter` (below).
80
+
81
+ **Driving a gallery by search criteria.** Pass a `filter` to query the MLS rather than the account's own listings. Criteria, sort, and count are `+`-joined tokens inside the string; use `FIELD()` for a field that accepts several values:
82
+
83
+ ```jsx
84
+ {/* 6 listings over $300k, priced high-to-low */}
85
+ <BuyingBuddyWidget
86
+ type="FeaturedGallery"
87
+ filter="price_min:300000+orderby:price desc+limit:6"
88
+ />
89
+
90
+ {/* combine criteria with + ; FIELD() for multi-value fields */}
91
+ <BuyingBuddyWidget
92
+ type="FeaturedGallery"
93
+ filter="city:Denver+FIELD(property_beds:3,4,5)+orderby:price desc+limit:9"
94
+ />
95
+ ```
96
+
97
+ **A map-bound results list** (results widgets are driven by the search/cookie state, and `SearchResults` is bound to the map viewport):
98
+
99
+ ```jsx
100
+ <BuyingBuddyWidget
101
+ type="SearchResults"
102
+ filter="city:Denver+price_min:300000"
103
+ order="price_desc"
104
+ />
105
+ ```
106
+
107
+ **An interactive map with a fixed height:**
108
+
109
+ ```jsx
110
+ <BuyingBuddyWidget type="InteractiveMap" style={{ height: "600px" }} />
111
+ ```
112
+
113
+ **Run a callback when a widget finishes loading** (memoize the handler — see [Caveats](#caveats--limitations)):
114
+
115
+ ```jsx
116
+ import { useCallback } from "react";
117
+
118
+ const handleLoaded = useCallback(() => console.log("gallery ready"), []);
119
+
120
+ <BuyingBuddyWidget type="FeaturedGallery" onWidgetLoaded={handleLoaded} />
121
+ ```
122
+
123
+ ### Next.js
124
+
125
+ The provider runs entirely in the browser (it loads a script and reads `window`), so the file that renders it must be a **client component**. In the App Router, add the `"use client"` directive at the top of the file — it tells Next.js to run this component in the browser rather than only on the server.
126
+
127
+ In `app/page.tsx`:
128
+
129
+ ```tsx
130
+ "use client";
131
+
132
+ import { BuyingBuddyProvider, BuyingBuddyWidget } from "@buyingbuddy/react";
133
+
134
+ export default function Page() {
135
+ return (
136
+ <BuyingBuddyProvider accountId="your-account-id" fallback={<p>Loading…</p>}>
137
+ <BuyingBuddyWidget type="SearchForm" />
138
+ <BuyingBuddyWidget type="SearchResults" limit={24} />
139
+ </BuyingBuddyProvider>
140
+ );
141
+ }
142
+ ```
143
+
144
+ Because the widgets are client-only, their listing content is **not server-rendered** — keep that in mind if SEO of the listings themselves matters to you.
145
+
146
+ ### Framer
147
+
148
+ A standalone, single-file widget for the [Framer](https://www.framer.com) website builder is included at [`framer/BuyingBuddyWidget.tsx`](framer/BuyingBuddyWidget.tsx). It bundles the script loading and adds Framer property controls (Account ID, widget type, filter, limit, sort order, featured-only), so you configure everything from Framer's design panel — no React code required.
149
+
150
+ 1. Open the [`framer/BuyingBuddyWidget.tsx`](framer/BuyingBuddyWidget.tsx) file and copy its entire contents.
151
+ 2. In Framer, go to **Assets → Code → +** and paste it in.
152
+ 3. Drag the component onto your canvas and set your **Account ID** in the property panel.
153
+
154
+ ## API
155
+
156
+ ### `<BuyingBuddyProvider>`
157
+
158
+ Loads the BuyingBuddy runtime for an account and makes it available to the widgets inside it. Use **one** provider, near the top of your tree.
159
+
160
+ | Prop | Type | Default | Description |
161
+ |------|------|---------|-------------|
162
+ | `accountId` | `string` | — | **Required.** Your BuyingBuddy account ID (`acid`). |
163
+ | `domain` | `string` | `"www.mbb2.com"` | API domain. Only change if directed by BuyingBuddy support. |
164
+ | `children` | `ReactNode` | — | Rendered once the script loads. |
165
+ | `fallback` | `ReactNode` | `null` | Shown while the script is loading (not shown on error — see Caveats). |
166
+
167
+ ### `<BuyingBuddyWidget>`
168
+
169
+ Renders a single widget. Must be a descendant of `<BuyingBuddyProvider>`.
170
+
171
+ | Prop | Type | Description |
172
+ |------|------|-------------|
173
+ | `type` | `BuyingBuddyWidgetType` | **Required.** Widget to render — e.g. `"FeaturedGallery"`, `"SearchForm"`, `"SearchResults"`, `"InteractiveMap"`, `"SearchDetails"`. |
174
+ | `filter` | `string` | Property filter in `FIELD()` or `key:value` syntax, e.g. `"FIELD(property_beds:3,4,5)"`. |
175
+ | `limit` | `number \| string` | Maximum number of results to display. |
176
+ | `order` | `string` | Sort order, e.g. `"price_asc"`, `"price_desc"`, `"date_listed_desc"`. |
177
+ | `demo` | `boolean \| string` | Sets the `demo` attribute on the widget element. |
178
+ | `featured` | `boolean \| string` | Show only featured listings. |
179
+ | `style` | `React.CSSProperties` | Inline styles for the **wrapper `<div>`** (not forwarded to the widget element). |
180
+ | `className` | `string` | CSS class(es) for the wrapper `<div>`. |
181
+ | `id` | `string` | HTML `id` attribute set on the widget element. |
182
+ | `onWidgetLoaded` | `() => void` | Fires once when the widget finishes loading. Memoize it (see Caveats). |
183
+
184
+ Common `type` values include `FeaturedGallery`, `FeaturedList`, `SearchForm`, `SearchResults`, `SearchDetails`, `QuickSearch`, `InteractiveMap`, `Communities`, `LcForm` (lead capture), `LoginPanel`, `Calculator`, `MarketReport`, `MarketStats`, `Brokers`, `OfficeRoster`, and `Disclaimer`. The `type` prop accepts any string, so newer widget types work even before they're added to the typings.
185
+
186
+ ### `useBuyingBuddy()`
187
+
188
+ Hook for reading the provider's load state. Throws if called outside a `<BuyingBuddyProvider>`.
189
+
190
+ ```jsx
191
+ import { useBuyingBuddy } from "@buyingbuddy/react";
192
+
193
+ function Status() {
194
+ const { isLoaded, error, accountId } = useBuyingBuddy();
195
+ if (error) return <p>Failed to load: {error.message}</p>;
196
+ return <p>{isLoaded ? `Ready (${accountId})` : "Loading…"}</p>;
197
+ }
198
+ ```
199
+
200
+ Returns `{ isLoaded: boolean, error: Error | null, accountId: string }`. Note that when `error` is set, the provider also renders its own built-in error message in place of `children`.
201
+
202
+ ### TypeScript
203
+
204
+ The package is written in TypeScript and ships its own types. These are exported for your own typing needs:
205
+
206
+ ```ts
207
+ import type {
208
+ BuyingBuddyWidgetType,
209
+ BuyingBuddyWidgetProps,
210
+ BuyingBuddyProviderProps,
211
+ BuyingBuddyContextValue,
212
+ } from "@buyingbuddy/react";
213
+ ```
214
+
215
+ ## Caveats & limitations
216
+
217
+ - **One account per page.** The BuyingBuddy script installs a single global, so a page is expected to use one `accountId`. Rendering two providers with different account IDs on the same page is not supported.
218
+ - **Client-side only.** Widgets render in the browser after the script loads — nothing is server-rendered. There's no SSR/streaming output, so the listing content isn't in the initial HTML (relevant for SEO).
219
+ - **Changing a prop rebuilds the widget.** Changing `type`, `filter`, `limit`, `order`, `demo`, `featured`, `id`, or `onWidgetLoaded` tears down and recreates the underlying `<bb-widget>`, losing in-widget state (map position, scroll, form input). In particular, pass a **stable** `onWidgetLoaded` (wrap it in `useCallback`) — an inline arrow function changes identity on every render and forces a rebuild each time.
220
+ - **The script persists after unmount.** Unmounting the provider does not remove the script or reset the global — remounting reuses the already-loaded runtime. This is intentional.
221
+ - **Error UI is built in.** On load failure the provider renders its own inline error message in place of `children` (and `fallback` is not shown). You can read `error` from `useBuyingBuddy()`, but you can't currently replace the default error UI.
222
+ - **ESM-only.** This package ships as ES modules only (no CommonJS build). Use it in a project with ESM/bundler support.
223
+ - **Pre-release.** This package is `0.0.1` — the API may change.
224
+
225
+ ## Development
226
+
227
+ ```bash
228
+ npm install
229
+ npm run build # compile src/ to dist/ (JS + .d.ts)
230
+ npm run dev # rebuild on change (tsc --watch)
231
+ npm test # run the unit tests (vitest)
232
+ ```
233
+
234
+ ## License
235
+
236
+ Proprietary — `UNLICENSED`. © Blue Fire Group / BuyingBuddy.
@@ -1 +1 @@
1
- {"version":3,"file":"BuyingBuddyProvider.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIjF;;;GAGG;AACH,wBAAgB,cAAc,IAAI,uBAAuB,CAQxD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,GAAG,CAAC,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC7B,UAAU,EAAE,MAAM,CAAC;YACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH;CACF;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,MAAuB,EACvB,QAAQ,EACR,QAAe,GAChB,EAAE,wBAAwB,2CAkF1B"}
1
+ {"version":3,"file":"BuyingBuddyProvider.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIjF;;;GAGG;AACH,wBAAgB,cAAc,IAAI,uBAAuB,CAQxD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,GAAG,CAAC,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC7B,UAAU,EAAE,MAAM,CAAC;YACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;SACxB,CAAC;KACH;CACF;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,MAAuB,EACvB,QAAQ,EACR,QAAe,GAChB,EAAE,wBAAwB,2CAiG1B"}
@@ -59,6 +59,20 @@ export function BuyingBuddyProvider({ accountId, domain = "www.mbb2.com", childr
59
59
  useEffect(() => {
60
60
  if (typeof window === "undefined")
61
61
  return;
62
+ // Inject the widget theme stylesheet. The official plugin embed loads
63
+ // this separately from the runtime script; without it the widgets render
64
+ // unthemed and the map logs "Missing acid or theme data". Uses the same
65
+ // `domain` as the API so the theme follows the environment (production vs
66
+ // preview) — if a given environment serves bad CSS, that's the
67
+ // environment's problem, not this package's.
68
+ const themeId = `mbb-theme-${accountId}`;
69
+ if (!document.getElementById(themeId)) {
70
+ const theme = document.createElement("script");
71
+ theme.id = themeId;
72
+ theme.src = `https://${domain}/version3/css/theme/acid/${accountId}`;
73
+ theme.async = true;
74
+ document.head.appendChild(theme);
75
+ }
62
76
  // Already loaded for this account
63
77
  if (window.MBB && LOADED_ACCOUNTS.has(accountId)) {
64
78
  setIsLoaded(true);
@@ -1 +1 @@
1
- {"version":3,"file":"BuyingBuddyProvider.js","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpF,MAAM,kBAAkB,GAAG,aAAa,CAAiC,IAAI,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC3C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAA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AAmB,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,aACtL,kDAAmC,OAAE,KAAK,CAAC,OAAO,IAC9C,CACP,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GACN,CAC/B,CAAC;AACJ,CAAC"}
package/dist/types.d.ts CHANGED
@@ -26,7 +26,10 @@ export interface BuyingBuddyWidgetProps {
26
26
  * Example: "price_asc", "price_desc", "date_listed_desc"
27
27
  */
28
28
  order?: string;
29
- /** Enable demo mode (shows sample data without an account). */
29
+ /**
30
+ * Sets the `demo` attribute on the widget element. Note: a valid
31
+ * account ID is still required — there is no account-less preview mode.
32
+ */
30
33
  demo?: boolean | string;
31
34
  /** Show only featured listings. */
32
35
  featured?: boolean | string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,iBAAiB,GACjB,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,cAAc,GACd,YAAY,GACZ,cAAc,GACd,aAAa,GACb,YAAY,GACZ,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,uCAAuC;IACvC,IAAI,EAAE,qBAAqB,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,+D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AM,WAAW,sBAAsB;IACrC,uCAAuC;IACvC,IAAI,EAAE,qBAAqB,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE5B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yBAAyB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,oDAAoD;IACpD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAElB,0CAA0C;IAC1C,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAEpB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buyingbuddy/react",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "React wrapper for BuyingBuddy Web Component widgets",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",