@buyingbuddy/react 0.2.1 → 0.3.0
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/CHANGELOG.md +107 -0
- package/README.md +8 -6
- package/dist/BuyingBuddyProvider.d.ts +1 -1
- package/dist/BuyingBuddyProvider.js +1 -1
- package/dist/BuyingBuddyWidget.d.ts +1 -3
- package/dist/BuyingBuddyWidget.d.ts.map +1 -1
- package/dist/BuyingBuddyWidget.js +2 -4
- package/dist/BuyingBuddyWidget.js.map +1 -1
- package/dist/types.d.ts +5 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/framer/BuyingBuddyWidget.tsx +0 -258
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@buyingbuddy/react`.
|
|
4
|
+
|
|
5
|
+
This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). While the
|
|
6
|
+
major version is `0`, a breaking change bumps the **minor** version.
|
|
7
|
+
|
|
8
|
+
Entries before 0.3.0 were reconstructed from the repository history when this file was
|
|
9
|
+
added, so they summarize each release rather than record it at the time.
|
|
10
|
+
|
|
11
|
+
## [0.3.0] — unreleased
|
|
12
|
+
|
|
13
|
+
### Removed — breaking
|
|
14
|
+
|
|
15
|
+
- **The `limit` and `order` props are gone from `<BuyingBuddyWidget>`.** Result count and
|
|
16
|
+
sort order now travel only as tokens inside `filter`. The component no longer writes
|
|
17
|
+
`data-limit` or `data-order` onto the `<bb-widget>` element.
|
|
18
|
+
|
|
19
|
+
```diff
|
|
20
|
+
- <BuyingBuddyWidget type="FeaturedGallery" limit={9} order="price desc" />
|
|
21
|
+
+ <BuyingBuddyWidget type="FeaturedGallery" filter="limit:9+order:price desc" />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
TypeScript users get a compile error on upgrade. **JavaScript users get no error at all** —
|
|
25
|
+
the props are simply ignored, and a widget that relied on them silently falls back to the
|
|
26
|
+
server's default page size and sort. If you pass either prop, move it into `filter` before
|
|
27
|
+
upgrading.
|
|
28
|
+
|
|
29
|
+
This is not a cosmetic tidy-up. Declared as standalone attributes, `limit` and `order` are
|
|
30
|
+
honored on a widget's first render but silently dropped on load-more, sort and refine, which
|
|
31
|
+
produces duplicated and skipped listings during paging. The same values expressed as filter
|
|
32
|
+
tokens are honored on every request and take precedence server-side. The filter form was
|
|
33
|
+
already the only one this package's README documented.
|
|
34
|
+
|
|
35
|
+
- **The Framer component is no longer included in the published package.** `files` no longer
|
|
36
|
+
lists `framer`, so `node_modules/@buyingbuddy/react/framer/BuyingBuddyWidget.tsx` no longer
|
|
37
|
+
exists. Nothing imports it — it is a paste-into-Framer file, not a module — but if you were
|
|
38
|
+
reading it out of `node_modules`, take it from the repository or, pre-filled with your own
|
|
39
|
+
activation key, from your Buying Buddy dashboard under **Widgets → Plugin Installation and
|
|
40
|
+
Setup**. The source still lives in the repository at `framer/BuyingBuddyWidget.tsx`.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **README documented a sort token that does nothing.** Four examples used
|
|
45
|
+
`orderby:price desc`. `orderby` is not a recognized filter key and is discarded before it
|
|
46
|
+
reaches the search, so those examples silently produced the default sort. The working token
|
|
47
|
+
is `order:` (or `sort:`, which takes precedence over it). Corrected everywhere.
|
|
48
|
+
|
|
49
|
+
### Changed — Framer component (repository only, not shipped)
|
|
50
|
+
|
|
51
|
+
These affect the copy-paste Framer component. They cannot reach an npm consumer, since the
|
|
52
|
+
file is no longer published.
|
|
53
|
+
|
|
54
|
+
- **`accountId` prop renamed to `activationKey`**, matching its own property-control label
|
|
55
|
+
("Activation Key") and the provider prop of the same name, which was renamed back in 0.1.0.
|
|
56
|
+
The Framer component was not brought along at the time. Existing Framer sites must re-set
|
|
57
|
+
the field after pasting the updated component.
|
|
58
|
+
- **Removed the Limit, Sort Order and Featured Only property controls**, for the same reason
|
|
59
|
+
as the package props above. Express them as `filter` tokens instead. The Sort Order control
|
|
60
|
+
was additionally inert: its values (`price_asc`, `price_desc`, `date_listed_desc`,
|
|
61
|
+
`date_listed_asc`) were never spellings the server accepts, which expect a form like
|
|
62
|
+
`price desc`.
|
|
63
|
+
- **Removed the `OfficeRoster` widget type**, which does not apply to Framer. It remains a
|
|
64
|
+
valid `type` in the package's own `BuyingBuddyWidgetType`.
|
|
65
|
+
- The `style` prop and the `@framerSupportedLayoutWidth` / `@framerSupportedLayoutHeight`
|
|
66
|
+
annotations are unchanged — they are Framer's canvas layout plumbing.
|
|
67
|
+
|
|
68
|
+
## [0.2.1] — 2026-08-08
|
|
69
|
+
|
|
70
|
+
- Distinguished the four separate ways a widget can fail to render, so a blank widget reports
|
|
71
|
+
which one occurred instead of failing identically in every case.
|
|
72
|
+
- Dropped a speculative `PKG_VERSION` export from the public entry point. The version stamp
|
|
73
|
+
remains as a `data-bb-react` attribute on the injected script and on
|
|
74
|
+
`window.MBB.reactPackageVersion`.
|
|
75
|
+
|
|
76
|
+
## [0.2.0] — 2026-06-02
|
|
77
|
+
|
|
78
|
+
- The provider loads the v5 widget runtime directly from the CDN rather than through the
|
|
79
|
+
`mbbv3` bootstrap, matching every other official integration.
|
|
80
|
+
|
|
81
|
+
## [0.1.3] — 2026-06-01
|
|
82
|
+
|
|
83
|
+
- `<bb-widget>` renders directly, without the wrapper `<div>` that previously surrounded it.
|
|
84
|
+
|
|
85
|
+
## [0.1.1] — 2026-05-30
|
|
86
|
+
|
|
87
|
+
- A `height` passed via `style` now reaches the widget element itself rather than stopping at
|
|
88
|
+
a wrapper.
|
|
89
|
+
- Stabilized `onWidgetLoaded` and cancelled its poll on unmount.
|
|
90
|
+
- Removed the `featured` prop and demo handling.
|
|
91
|
+
- The provider injects the theme stylesheet alongside the runtime, so widgets render themed
|
|
92
|
+
rather than unstyled.
|
|
93
|
+
|
|
94
|
+
## [0.1.0] — 2026-05-29
|
|
95
|
+
|
|
96
|
+
### Changed — breaking
|
|
97
|
+
|
|
98
|
+
- The provider prop `accountId` was renamed to `activationKey`.
|
|
99
|
+
|
|
100
|
+
## [0.0.3] — 2026-05-29
|
|
101
|
+
|
|
102
|
+
- Added the `apiBaseUrl` prop to `BuyingBuddyProvider`.
|
|
103
|
+
|
|
104
|
+
## [0.0.1] — 2026-03-06
|
|
105
|
+
|
|
106
|
+
- First release: `BuyingBuddyProvider` and `BuyingBuddyWidget` for React and Next.js, using
|
|
107
|
+
imperative DOM creation for React <19 compatibility.
|
package/README.md
CHANGED
|
@@ -87,13 +87,13 @@ Replace `account-activation-key` with your `activationKey`. The provider loads t
|
|
|
87
87
|
{/* 6 listings over $300k, priced high-to-low */}
|
|
88
88
|
<BuyingBuddyWidget
|
|
89
89
|
type="FeaturedGallery"
|
|
90
|
-
filter="price_min:300000+
|
|
90
|
+
filter="price_min:300000+order:price desc+limit:6"
|
|
91
91
|
/>
|
|
92
92
|
|
|
93
93
|
{/* combine criteria with + ; FIELD() for multi-value fields */}
|
|
94
94
|
<BuyingBuddyWidget
|
|
95
95
|
type="FeaturedGallery"
|
|
96
|
-
filter="city:Denver+FIELD(property_beds:3,4,5)+
|
|
96
|
+
filter="city:Denver+FIELD(property_beds:3,4,5)+order:price desc+limit:9"
|
|
97
97
|
/>
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -102,7 +102,7 @@ Replace `account-activation-key` with your `activationKey`. The provider loads t
|
|
|
102
102
|
```jsx
|
|
103
103
|
<BuyingBuddyWidget
|
|
104
104
|
type="SearchResults"
|
|
105
|
-
filter="city:Denver+price_min:300000+
|
|
105
|
+
filter="city:Denver+price_min:300000+order:price desc"
|
|
106
106
|
/>
|
|
107
107
|
```
|
|
108
108
|
|
|
@@ -136,12 +136,14 @@ Because the widgets are client-only, their listing content is **not server-rende
|
|
|
136
136
|
|
|
137
137
|
### Framer
|
|
138
138
|
|
|
139
|
-
A standalone, single-file widget for the [Framer](https://www.framer.com) website builder
|
|
139
|
+
A standalone, single-file widget for the [Framer](https://www.framer.com) website builder lives at [`framer/BuyingBuddyWidget.tsx`](framer/BuyingBuddyWidget.tsx). It bundles the script loading and adds Framer property controls (activation key, widget type, filter), so you configure everything from Framer's design panel — no React code required.
|
|
140
140
|
|
|
141
|
-
1. Open [`framer/BuyingBuddyWidget.tsx`](framer/BuyingBuddyWidget.tsx) and copy its entire contents.
|
|
141
|
+
1. Open [`framer/BuyingBuddyWidget.tsx`](framer/BuyingBuddyWidget.tsx) and copy its entire contents.
|
|
142
142
|
2. In Framer, go to **Assets → Code → +** and paste it in.
|
|
143
143
|
3. Drag the component onto your canvas and set your **activation key** in the property panel.
|
|
144
144
|
|
|
145
|
+
You can also get it pre-filled with your own activation key from your Buying Buddy account dashboard, under **Widgets → Plugin Installation and Setup**.
|
|
146
|
+
|
|
145
147
|
## API
|
|
146
148
|
|
|
147
149
|
### `<BuyingBuddyProvider>`
|
|
@@ -160,7 +162,7 @@ Renders a single widget. Must be a descendant of `<BuyingBuddyProvider>`.
|
|
|
160
162
|
| Prop | Type | Description |
|
|
161
163
|
|------|------|-------------|
|
|
162
164
|
| `type` | `BuyingBuddyWidgetType` | **Required.** Widget to render — e.g. `"FeaturedGallery"`, `"SearchForm"`, `"SearchResults"`, `"InteractiveMap"`, `"SearchDetails"`. |
|
|
163
|
-
| `filter` | `string` | Property filter as `+`-joined tokens, e.g. `"city:Denver+FIELD(property_beds:3,4,5)+
|
|
165
|
+
| `filter` | `string` | Property filter as `+`-joined tokens, e.g. `"city:Denver+FIELD(property_beds:3,4,5)+order:price desc+limit:9"`. |
|
|
164
166
|
| `style` | `React.CSSProperties` | Inline styles applied directly to the `<bb-widget>` element. A `height` here sizes the widget (e.g. for `InteractiveMap` / `SearchResults`). |
|
|
165
167
|
|
|
166
168
|
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.
|
|
@@ -23,7 +23,7 @@ declare global {
|
|
|
23
23
|
* @example
|
|
24
24
|
* ```tsx
|
|
25
25
|
* <BuyingBuddyProvider activationKey="your-activation-key">
|
|
26
|
-
* <BuyingBuddyWidget type="FeaturedGallery" limit
|
|
26
|
+
* <BuyingBuddyWidget type="FeaturedGallery" filter="limit:12" />
|
|
27
27
|
* </BuyingBuddyProvider>
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
@@ -32,7 +32,7 @@ const MBB_BUNDLE_URL = "https://d2w6u17ngtanmy.cloudfront.net/scripts/my-buying-
|
|
|
32
32
|
* @example
|
|
33
33
|
* ```tsx
|
|
34
34
|
* <BuyingBuddyProvider activationKey="your-activation-key">
|
|
35
|
-
* <BuyingBuddyWidget type="FeaturedGallery" limit
|
|
35
|
+
* <BuyingBuddyWidget type="FeaturedGallery" filter="limit:12" />
|
|
36
36
|
* </BuyingBuddyProvider>
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
@@ -18,7 +18,7 @@ import type { BuyingBuddyWidgetProps } from "./types";
|
|
|
18
18
|
* <BuyingBuddyWidget type="InteractiveMap" style={{ height: "600px" }} />
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare function BuyingBuddyWidget({ type, filter,
|
|
21
|
+
export declare function BuyingBuddyWidget({ type, filter, style, className, id, onWidgetLoaded, }: BuyingBuddyWidgetProps): import("react").ReactElement<{
|
|
22
22
|
key: string;
|
|
23
23
|
ref: (el: HTMLElement | null) => void;
|
|
24
24
|
id: string | undefined;
|
|
@@ -27,7 +27,5 @@ export declare function BuyingBuddyWidget({ type, filter, limit, order, style, c
|
|
|
27
27
|
suppressHydrationWarning: boolean;
|
|
28
28
|
"data-type": import("./types").BuyingBuddyWidgetType;
|
|
29
29
|
"data-filter": string | undefined;
|
|
30
|
-
"data-limit": string | undefined;
|
|
31
|
-
"data-order": string | undefined;
|
|
32
30
|
}, string | import("react").JSXElementConstructor<any>> | null;
|
|
33
31
|
//# sourceMappingURL=BuyingBuddyWidget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyingBuddyWidget.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyWidget.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"BuyingBuddyWidget.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyWidget.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,EAAE,EACF,cAAc,GACf,EAAE,sBAAsB;;cAgBY,WAAW,GAAG,IAAI;;;;;;;+DAgDtD"}
|
|
@@ -18,7 +18,7 @@ import { useBuyingBuddy } from "./BuyingBuddyProvider";
|
|
|
18
18
|
* <BuyingBuddyWidget type="InteractiveMap" style={{ height: "600px" }} />
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export function BuyingBuddyWidget({ type, filter,
|
|
21
|
+
export function BuyingBuddyWidget({ type, filter, style, className, id, onWidgetLoaded, }) {
|
|
22
22
|
const { isLoaded } = useBuyingBuddy();
|
|
23
23
|
// Keep the latest onWidgetLoaded in a ref so changing its identity (e.g. an
|
|
24
24
|
// inline arrow created on every render) doesn't reattach listeners or re-init
|
|
@@ -68,7 +68,7 @@ export function BuyingBuddyWidget({ type, filter, limit, order, style, className
|
|
|
68
68
|
const widgetStyle = { display: "block", width: "100%", ...style };
|
|
69
69
|
// `key` ties the element identity to its config, so changing type/filter/etc.
|
|
70
70
|
// remounts (re-inits) the widget rather than mutating a live one.
|
|
71
|
-
const key = `${type}|${filter ?? ""}|${
|
|
71
|
+
const key = `${type}|${filter ?? ""}|${id ?? ""}`;
|
|
72
72
|
return createElement("bb-widget", {
|
|
73
73
|
key,
|
|
74
74
|
ref: widgetRef,
|
|
@@ -78,8 +78,6 @@ export function BuyingBuddyWidget({ type, filter, limit, order, style, className
|
|
|
78
78
|
suppressHydrationWarning: true,
|
|
79
79
|
"data-type": type,
|
|
80
80
|
"data-filter": filter,
|
|
81
|
-
"data-limit": limit !== undefined ? String(limit) : undefined,
|
|
82
|
-
"data-order": order,
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
83
|
//# sourceMappingURL=BuyingBuddyWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyingBuddyWidget.js","sourceRoot":"","sources":["../src/BuyingBuddyWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"BuyingBuddyWidget.js","sourceRoot":"","sources":["../src/BuyingBuddyWidget.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,EAAE,EACF,cAAc,GACS;IACvB,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAC;IAEtC,4EAA4E;IAC5E,8EAA8E;IAC9E,cAAc;IACd,MAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IACjD,SAAS,CAAC,GAAG,EAAE;QACb,iBAAiB,CAAC,OAAO,GAAG,cAAc,CAAC;IAC7C,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,wEAAwE;IACxE,8EAA8E;IAC9E,8EAA8E;IAC9E,sDAAsD;IACtD,MAAM,UAAU,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,EAAsB,EAAE,EAAE;QACvD,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;QACvB,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,IAAI,KAAK;gBAAE,OAAO;YAClB,KAAK,GAAG,IAAI,CAAC;YACb,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC;QACF,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAE7D,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,IAAI,KAAgD,CAAC;QACrD,MAAM,YAAY,GAAG,GAAG,EAAE;YACxB,IAAI,KAAK;gBAAE,OAAO;YAClB,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC;gBAClB,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1E,CAAC;iBAAM,IAAI,QAAQ,EAAE,GAAG,GAAG,EAAE,CAAC;gBAC5B,KAAK,GAAG,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YACvC,CAAC;QACH,CAAC,CAAC;QACF,YAAY,EAAE,CAAC;QAEf,UAAU,CAAC,OAAO,GAAG,GAAG,EAAE;YACxB,IAAI,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAE3B,MAAM,WAAW,GAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IAEjF,8EAA8E;IAC9E,kEAAkE;IAClE,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,MAAM,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;IAElD,OAAO,aAAa,CAAC,WAAW,EAAE;QAChC,GAAG;QACH,GAAG,EAAE,SAAS;QACd,EAAE;QACF,SAAS;QACT,KAAK,EAAE,WAAW;QAClB,wBAAwB,EAAE,IAAI;QAC9B,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,MAAM;KACtB,CAAC,CAAC;AACL,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -15,17 +15,13 @@ export interface BuyingBuddyWidgetProps {
|
|
|
15
15
|
/** Widget type to render. Required. */
|
|
16
16
|
type: BuyingBuddyWidgetType;
|
|
17
17
|
/**
|
|
18
|
-
* Property filter in FIELD() syntax or key:value format.
|
|
19
|
-
*
|
|
18
|
+
* Property filter as `+`-joined tokens, in FIELD() syntax or key:value format.
|
|
19
|
+
*
|
|
20
|
+
* Everything travels through here — criteria, sort and count alike. There are
|
|
21
|
+
* no separate `limit` / `order` props; use the `limit:` and `order:` tokens.
|
|
22
|
+
* Example: "FIELD(property_beds:3,4,5)+order:price desc+limit:9"
|
|
20
23
|
*/
|
|
21
24
|
filter?: string;
|
|
22
|
-
/** Maximum number of results to display. */
|
|
23
|
-
limit?: number | string;
|
|
24
|
-
/**
|
|
25
|
-
* Sort order for results.
|
|
26
|
-
* Example: "price_asc", "price_desc", "date_listed_desc"
|
|
27
|
-
*/
|
|
28
|
-
order?: string;
|
|
29
25
|
/** Inline styles for the widget. A `height` here reaches the widget element. */
|
|
30
26
|
style?: React.CSSProperties;
|
|
31
27
|
/** Additional CSS class name(s). */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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
|
|
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;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gFAAgF;IAChF,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;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,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,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/version.d.ts
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* there is no bundler `define` to inject it from package.json. `version.test.ts`
|
|
15
15
|
* asserts the two stay in step, so a bump that misses this file fails the suite.
|
|
16
16
|
*/
|
|
17
|
-
export declare const PKG_VERSION = "0.
|
|
17
|
+
export declare const PKG_VERSION = "0.3.0";
|
|
18
18
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* there is no bundler `define` to inject it from package.json. `version.test.ts`
|
|
15
15
|
* asserts the two stay in step, so a bump that misses this file fails the suite.
|
|
16
16
|
*/
|
|
17
|
-
export const PKG_VERSION = "0.
|
|
17
|
+
export const PKG_VERSION = "0.3.0";
|
|
18
18
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buyingbuddy/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "IDX MLS real estate integration for React, Next.js, and Framer — property search, map results, listings, lead capture, and CRM via Buying Buddy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"
|
|
17
|
+
"CHANGELOG.md"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc",
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
// BuyingBuddyWidget.tsx — Framer Code Component
|
|
2
|
-
//
|
|
3
|
-
// Standalone single-file component for Framer website builder.
|
|
4
|
-
// Paste this entire file into Framer's code editor (Assets > Code > +).
|
|
5
|
-
//
|
|
6
|
-
// This is a self-contained version of @buyingbuddy/react that works
|
|
7
|
-
// within Framer's single-file constraint and provides property controls
|
|
8
|
-
// for the Framer design UI.
|
|
9
|
-
|
|
10
|
-
import { useState, useEffect, useRef } from "react"
|
|
11
|
-
import { addPropertyControls, ControlType } from "framer"
|
|
12
|
-
|
|
13
|
-
interface BuyingBuddyWidgetProps {
|
|
14
|
-
accountId: string
|
|
15
|
-
widgetType: string
|
|
16
|
-
filter: string
|
|
17
|
-
limit: number
|
|
18
|
-
order: string
|
|
19
|
-
featured: boolean
|
|
20
|
-
style?: React.CSSProperties
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* BuyingBuddy Widget
|
|
25
|
-
*
|
|
26
|
-
* Embeds any BuyingBuddy real estate widget in your Framer site.
|
|
27
|
-
* Configure your activation key and widget type in the property panel.
|
|
28
|
-
*
|
|
29
|
-
* @framerSupportedLayoutWidth any
|
|
30
|
-
* @framerSupportedLayoutHeight any
|
|
31
|
-
*/
|
|
32
|
-
export default function BuyingBuddyWidget(props: BuyingBuddyWidgetProps) {
|
|
33
|
-
const {
|
|
34
|
-
accountId,
|
|
35
|
-
widgetType,
|
|
36
|
-
filter,
|
|
37
|
-
limit,
|
|
38
|
-
order,
|
|
39
|
-
featured,
|
|
40
|
-
style: externalStyle,
|
|
41
|
-
} = props
|
|
42
|
-
|
|
43
|
-
const containerRef = useRef<HTMLDivElement>(null)
|
|
44
|
-
const [status, setStatus] = useState<"loading" | "ready" | "error">(
|
|
45
|
-
"loading"
|
|
46
|
-
)
|
|
47
|
-
const [errorMsg, setErrorMsg] = useState("")
|
|
48
|
-
|
|
49
|
-
// Load the MBB widget runtime
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (!accountId) {
|
|
52
|
-
setStatus("error")
|
|
53
|
-
setErrorMsg(
|
|
54
|
-
"Activation key is required. Set it in the property panel."
|
|
55
|
-
)
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const scriptId = `mbb-script-${accountId}`
|
|
60
|
-
|
|
61
|
-
// Already requested (this mount, a prior mount, or a script tag in the
|
|
62
|
-
// page) — the runtime is loading or loaded; render the widget.
|
|
63
|
-
if (document.getElementById(scriptId)) {
|
|
64
|
-
setStatus("ready")
|
|
65
|
-
return
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Inject the widget theme stylesheet. The runtime bundle does not load
|
|
69
|
-
// a theme itself, so — like the official WP/Joomla embeds — we load it
|
|
70
|
-
// separately; without it widgets render unthemed and the map logs
|
|
71
|
-
// "Missing acid or theme data".
|
|
72
|
-
const themeId = `mbb-theme-${accountId}`
|
|
73
|
-
if (!document.getElementById(themeId)) {
|
|
74
|
-
const theme = document.createElement("script")
|
|
75
|
-
theme.id = themeId
|
|
76
|
-
theme.src = `https://www.mbb2.com/version3/css/theme/acid/${accountId}`
|
|
77
|
-
theme.async = true
|
|
78
|
-
document.head.appendChild(theme)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Initialise the MBB global the official-embed way (a single `data.acid`)
|
|
82
|
-
// before the bundle runs, so its first data request uses our acid.
|
|
83
|
-
if (!(window as any).MBB) {
|
|
84
|
-
;(window as any).MBB = { seo: "false", data: { acid: accountId } }
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Load the v5 runtime directly from the CDN — the same bundle every
|
|
88
|
-
// other official integration (WordPress, Joomla, PHP SDK) loads.
|
|
89
|
-
const script = document.createElement("script")
|
|
90
|
-
script.id = scriptId
|
|
91
|
-
script.src =
|
|
92
|
-
"https://d2w6u17ngtanmy.cloudfront.net/scripts/my-buying-buddy.5.0.js.gz"
|
|
93
|
-
script.async = true
|
|
94
|
-
script.onload = () => setStatus("ready")
|
|
95
|
-
script.onerror = () => {
|
|
96
|
-
setStatus("error")
|
|
97
|
-
setErrorMsg("Failed to load BuyingBuddy script.")
|
|
98
|
-
}
|
|
99
|
-
document.head.appendChild(script)
|
|
100
|
-
}, [accountId])
|
|
101
|
-
|
|
102
|
-
// Create the <bb-widget> custom element imperatively
|
|
103
|
-
useEffect(() => {
|
|
104
|
-
const container = containerRef.current
|
|
105
|
-
if (!container || status !== "ready") return
|
|
106
|
-
|
|
107
|
-
container.innerHTML = ""
|
|
108
|
-
|
|
109
|
-
const widget = document.createElement("bb-widget")
|
|
110
|
-
widget.setAttribute("data-type", widgetType)
|
|
111
|
-
if (filter) widget.setAttribute("data-filter", filter)
|
|
112
|
-
if (limit) widget.setAttribute("limit", String(limit))
|
|
113
|
-
if (order) widget.setAttribute("order", order)
|
|
114
|
-
if (featured) widget.setAttribute("featured", "true")
|
|
115
|
-
|
|
116
|
-
container.appendChild(widget)
|
|
117
|
-
|
|
118
|
-
return () => {
|
|
119
|
-
container.innerHTML = ""
|
|
120
|
-
}
|
|
121
|
-
}, [status, widgetType, filter, limit, order, featured])
|
|
122
|
-
|
|
123
|
-
if (status === "error") {
|
|
124
|
-
return (
|
|
125
|
-
<div
|
|
126
|
-
style={{
|
|
127
|
-
color: "#b91c1c",
|
|
128
|
-
padding: 12,
|
|
129
|
-
border: "1px solid #fca5a5",
|
|
130
|
-
borderRadius: 6,
|
|
131
|
-
background: "#fef2f2",
|
|
132
|
-
fontFamily: "sans-serif",
|
|
133
|
-
fontSize: 14,
|
|
134
|
-
}}
|
|
135
|
-
>
|
|
136
|
-
<strong>BuyingBuddy Error:</strong> {errorMsg}
|
|
137
|
-
</div>
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (status === "loading") {
|
|
142
|
-
return (
|
|
143
|
-
<div
|
|
144
|
-
style={{
|
|
145
|
-
padding: 20,
|
|
146
|
-
textAlign: "center",
|
|
147
|
-
color: "#888",
|
|
148
|
-
fontFamily: "sans-serif",
|
|
149
|
-
}}
|
|
150
|
-
>
|
|
151
|
-
Loading BuyingBuddy...
|
|
152
|
-
</div>
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<div
|
|
158
|
-
ref={containerRef}
|
|
159
|
-
style={{ width: "100%", minHeight: 200, ...externalStyle }}
|
|
160
|
-
/>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
BuyingBuddyWidget.defaultProps = {
|
|
165
|
-
accountId: "",
|
|
166
|
-
widgetType: "FeaturedGallery",
|
|
167
|
-
filter: "",
|
|
168
|
-
limit: 12,
|
|
169
|
-
order: "",
|
|
170
|
-
featured: false,
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
addPropertyControls(BuyingBuddyWidget, {
|
|
174
|
-
accountId: {
|
|
175
|
-
type: ControlType.String,
|
|
176
|
-
title: "Activation Key",
|
|
177
|
-
description: "Your Buying Buddy activation key (acid value).",
|
|
178
|
-
},
|
|
179
|
-
widgetType: {
|
|
180
|
-
type: ControlType.Enum,
|
|
181
|
-
title: "Widget Type",
|
|
182
|
-
options: [
|
|
183
|
-
"FeaturedGallery",
|
|
184
|
-
"FeaturedList",
|
|
185
|
-
"SearchForm",
|
|
186
|
-
"ListingResults",
|
|
187
|
-
"SearchDetails",
|
|
188
|
-
"QuickSearch",
|
|
189
|
-
"InteractiveMap",
|
|
190
|
-
"Communities",
|
|
191
|
-
"LcForm",
|
|
192
|
-
"LoginPanel",
|
|
193
|
-
"Calculator",
|
|
194
|
-
"MarketReport",
|
|
195
|
-
"MarketStats",
|
|
196
|
-
"Brokers",
|
|
197
|
-
"OfficeRoster",
|
|
198
|
-
"Disclaimer",
|
|
199
|
-
],
|
|
200
|
-
optionTitles: [
|
|
201
|
-
"Featured Gallery",
|
|
202
|
-
"Featured List",
|
|
203
|
-
"Search Form",
|
|
204
|
-
"Search Results",
|
|
205
|
-
"Property Details",
|
|
206
|
-
"Quick Search",
|
|
207
|
-
"Interactive Map",
|
|
208
|
-
"Communities",
|
|
209
|
-
"Lead Capture Form",
|
|
210
|
-
"Login Panel",
|
|
211
|
-
"Mortgage Calculator",
|
|
212
|
-
"Market Report",
|
|
213
|
-
"Market Stats",
|
|
214
|
-
"Brokers",
|
|
215
|
-
"Office Roster",
|
|
216
|
-
"MLS Disclaimer",
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
filter: {
|
|
220
|
-
type: ControlType.String,
|
|
221
|
-
title: "Filter",
|
|
222
|
-
description:
|
|
223
|
-
'Property filter, e.g. "city:denver+price_min:300000" or "formType:simple1"',
|
|
224
|
-
placeholder: "city:denver+price_min:300000",
|
|
225
|
-
},
|
|
226
|
-
limit: {
|
|
227
|
-
type: ControlType.Number,
|
|
228
|
-
title: "Limit",
|
|
229
|
-
description: "Maximum number of results to display.",
|
|
230
|
-
min: 1,
|
|
231
|
-
max: 100,
|
|
232
|
-
step: 1,
|
|
233
|
-
},
|
|
234
|
-
order: {
|
|
235
|
-
type: ControlType.Enum,
|
|
236
|
-
title: "Sort Order",
|
|
237
|
-
options: [
|
|
238
|
-
"",
|
|
239
|
-
"price_asc",
|
|
240
|
-
"price_desc",
|
|
241
|
-
"date_listed_desc",
|
|
242
|
-
"date_listed_asc",
|
|
243
|
-
],
|
|
244
|
-
optionTitles: [
|
|
245
|
-
"Default",
|
|
246
|
-
"Price: Low to High",
|
|
247
|
-
"Price: High to Low",
|
|
248
|
-
"Newest First",
|
|
249
|
-
"Oldest First",
|
|
250
|
-
],
|
|
251
|
-
},
|
|
252
|
-
featured: {
|
|
253
|
-
type: ControlType.Boolean,
|
|
254
|
-
title: "Featured Only",
|
|
255
|
-
enabledTitle: "Yes",
|
|
256
|
-
disabledTitle: "No",
|
|
257
|
-
},
|
|
258
|
-
})
|