@buyingbuddy/react 0.3.1 → 0.3.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/CHANGELOG.md +62 -1
- package/README.md +11 -4
- package/dist/BuyingBuddyProvider.d.ts +1 -1
- package/dist/BuyingBuddyProvider.d.ts.map +1 -1
- package/dist/BuyingBuddyProvider.js +40 -4
- package/dist/BuyingBuddyProvider.js.map +1 -1
- package/dist/BuyingBuddyWidget.d.ts.map +1 -1
- package/dist/BuyingBuddyWidget.js +3 -0
- package/dist/BuyingBuddyWidget.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +25 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,68 @@ major version is `0`, a breaking change bumps the **minor** version.
|
|
|
8
8
|
Entries before 0.3.0 were reconstructed from the repository history when this file was
|
|
9
9
|
added, so they summarize each release rather than record it at the time.
|
|
10
10
|
|
|
11
|
-
## [0.3.
|
|
11
|
+
## [0.3.2] — 2026-08-22
|
|
12
|
+
|
|
13
|
+
Two changes, released together. Neither has shipped before: 0.3.2 was version-bumped and
|
|
14
|
+
merged on 2026-08-21 but never published, so every install to date has received 0.3.1.
|
|
15
|
+
|
|
16
|
+
### The package now works in React Server Components frameworks, including the Next.js App Router
|
|
17
|
+
|
|
18
|
+
`BuyingBuddyProvider` and `BuyingBuddyWidget`, and the package entry point, now carry a
|
|
19
|
+
`"use client"` directive.
|
|
20
|
+
|
|
21
|
+
Previously, importing the package the way this README shows it failed an App Router build
|
|
22
|
+
outright with `createContext is not a function`, and `next dev` returned HTTP 500 on every
|
|
23
|
+
route. The documented workaround — a local file re-exporting the package behind your own
|
|
24
|
+
`"use client"` — is no longer necessary. It remains harmless if you already have one.
|
|
25
|
+
|
|
26
|
+
`"use client"` is a React Server Components directive rather than a Next.js one, so bundlers
|
|
27
|
+
that do not understand it ignore it: this is inert for Vite, Create React App and Framer
|
|
28
|
+
consumers, and no change is required on their side.
|
|
29
|
+
|
|
30
|
+
### Fixed — a failed script load no longer takes your website down with it
|
|
31
|
+
|
|
32
|
+
`<BuyingBuddyProvider>` renders `children` immediately and in every state. Previously it
|
|
33
|
+
withheld them until the runtime script finished loading, and replaced them entirely with its
|
|
34
|
+
own red error box if the script failed.
|
|
35
|
+
|
|
36
|
+
Because every documented install path wraps the whole application in the provider, that
|
|
37
|
+
second behaviour meant a single blocked request to our CDN — an ad blocker, a CSP rule, a
|
|
38
|
+
corporate proxy, an offline client, a CloudFront blip — replaced the customer's entire
|
|
39
|
+
website with an error message. A load failure is now reported rather than rendered: it is
|
|
40
|
+
logged to the console once, and remains readable as `error` from `useBuyingBuddy()` for any
|
|
41
|
+
application that wants to surface it. Widgets already render nothing until the runtime is
|
|
42
|
+
ready, which is the correct degraded state and is unchanged.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
const { error } = useBuyingBuddy();
|
|
46
|
+
if (error) return <p>Property search is temporarily unavailable.</p>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Deprecated — `fallback`
|
|
50
|
+
|
|
51
|
+
Nothing is required of you on upgrade, but `fallback` is now accepted and ignored, and will be
|
|
52
|
+
removed in a future release. Delete it when convenient. It is kept in the type meanwhile so
|
|
53
|
+
existing call sites continue to compile.
|
|
54
|
+
|
|
55
|
+
The prop only ever existed to soften the behaviour above: it filled the gap while the provider
|
|
56
|
+
was withholding your page. With the page no longer withheld there is no gap left to fill, and
|
|
57
|
+
the widgets inside it handle their own loading.
|
|
58
|
+
|
|
59
|
+
- The instruction our install guides gave — `fallback={children}` — rendered `children`
|
|
60
|
+
anyway, so removing it changes nothing you can see.
|
|
61
|
+
- If you passed a real loading indicator, it stops appearing. Your page is no longer withheld,
|
|
62
|
+
so there is no longer a moment for it to cover. **TypeScript users see a deprecation marker;
|
|
63
|
+
JavaScript users get no signal**, so check your call sites rather than waiting for a build
|
|
64
|
+
error that will not come.
|
|
65
|
+
|
|
66
|
+
## [0.3.1] — 2026-08-20
|
|
67
|
+
|
|
68
|
+
- No functional change. Added a data-hosting note to the README, and brought the internal
|
|
69
|
+
version constant back into step with the package version so the `data-bb-react` stamp and
|
|
70
|
+
`window.MBB.reactPackageVersion` report the version that actually built the site.
|
|
71
|
+
|
|
72
|
+
## [0.3.0] — 2026-08-13
|
|
12
73
|
|
|
13
74
|
### Removed — breaking
|
|
14
75
|
|
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ export default function App() {
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
Replace `account-activation-key` with your `activationKey`. The provider loads the Buying Buddy script for that account once
|
|
66
|
+
Replace `account-activation-key` with your `activationKey`. The provider loads the Buying Buddy script for that account once and makes it available to the widgets inside it. Your own content renders straight away — the provider never withholds it — and each widget appears once the runtime is ready.
|
|
67
67
|
|
|
68
68
|
## Examples
|
|
69
69
|
|
|
@@ -127,7 +127,7 @@ import { BuyingBuddyProvider, BuyingBuddyWidget } from "@buyingbuddy/react";
|
|
|
127
127
|
|
|
128
128
|
export default function Page() {
|
|
129
129
|
return (
|
|
130
|
-
<BuyingBuddyProvider activationKey="account-activation-key"
|
|
130
|
+
<BuyingBuddyProvider activationKey="account-activation-key">
|
|
131
131
|
<BuyingBuddyWidget type="SearchResults" />
|
|
132
132
|
</BuyingBuddyProvider>
|
|
133
133
|
);
|
|
@@ -155,7 +155,7 @@ Loads the Buying Buddy runtime for an account and makes it available to the widg
|
|
|
155
155
|
| Prop | Type | Default | Description |
|
|
156
156
|
|------|------|---------|-------------|
|
|
157
157
|
| `activationKey` | `string` | — | **Required.** Your Buying Buddy account activation key. |
|
|
158
|
-
| `fallback` | `ReactNode` |
|
|
158
|
+
| `fallback` | `ReactNode` | — | **Deprecated, no-op since 0.3.2.** Accepted and ignored; safe to delete. The provider no longer withholds `children`, so there is no loading state for it to render in. |
|
|
159
159
|
|
|
160
160
|
### `<BuyingBuddyWidget>`
|
|
161
161
|
|
|
@@ -188,7 +188,14 @@ import type {
|
|
|
188
188
|
- **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).
|
|
189
189
|
- **Changing a prop rebuilds the widget.** Changing `type` or `filter` tears down and recreates the underlying `<bb-widget>`, losing in-widget state (map position, scroll, form input).
|
|
190
190
|
- **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.
|
|
191
|
-
- **
|
|
191
|
+
- **A script load failure degrades quietly.** If the runtime script fails to load — CDN outage, ad blocker, CSP rule, corporate proxy, offline — your application renders exactly as it otherwise would and the Buying Buddy widgets are simply absent. The provider renders nothing of its own over your page. The failure is logged to the console once, and is readable as `error` from `useBuyingBuddy()` if you want to say something about it yourself:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
const { error } = useBuyingBuddy();
|
|
195
|
+
if (error) return <p>Property search is temporarily unavailable.</p>;
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Note this covers script load failure only — an unauthorized domain loads fine but renders empty widgets (see Prerequisites).
|
|
192
199
|
- **ESM-only.** This package ships as ES modules only (no CommonJS build). Use it in a project with ESM/bundler support.
|
|
193
200
|
- **Pre-release.** This package is `0.x` — the API may change.
|
|
194
201
|
|
|
@@ -27,5 +27,5 @@ declare global {
|
|
|
27
27
|
* </BuyingBuddyProvider>
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
export declare function BuyingBuddyProvider({ activationKey, domain, apiBaseUrl, children,
|
|
30
|
+
export declare function BuyingBuddyProvider({ activationKey, domain, apiBaseUrl, children, }: BuyingBuddyProviderProps): import("react").JSX.Element;
|
|
31
31
|
//# sourceMappingURL=BuyingBuddyProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyingBuddyProvider.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuyingBuddyProvider.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAKjF;;;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;AAqBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,aAAa,EACb,MAAuB,EACvB,UAAU,EACV,QAAQ,GAKT,EAAE,wBAAwB,+BA2H1B"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
// Required: createContext() runs at module scope below, and in the Next.js App
|
|
4
|
+
// Router every module is a Server Component by default - without this the build
|
|
5
|
+
// fails with "createContext is not a function" and next dev 500s on every route.
|
|
2
6
|
import { createContext, useContext, useEffect, useState } from "react";
|
|
3
7
|
import { PKG_VERSION } from "./version";
|
|
4
8
|
const BuyingBuddyContext = createContext(null);
|
|
@@ -14,6 +18,12 @@ export function useBuyingBuddy() {
|
|
|
14
18
|
return ctx;
|
|
15
19
|
}
|
|
16
20
|
const LOADED_ACCOUNTS = new Set();
|
|
21
|
+
// Accounts whose runtime bundle has already failed and been reported. The
|
|
22
|
+
// provider logs a load failure once per activation key, not once per attempt:
|
|
23
|
+
// a remount, a React StrictMode double-effect, or a second provider for the
|
|
24
|
+
// same account would otherwise repeat an identical message the developer has
|
|
25
|
+
// already seen and can do nothing further about.
|
|
26
|
+
const REPORTED_LOAD_FAILURES = new Set();
|
|
17
27
|
/**
|
|
18
28
|
* The v5 widget runtime, served from the CDN — the exact same bundle every
|
|
19
29
|
* other official integration (WordPress, Joomla, PHP SDK) loads. Loading it
|
|
@@ -36,7 +46,12 @@ const MBB_BUNDLE_URL = "https://d2w6u17ngtanmy.cloudfront.net/scripts/my-buying-
|
|
|
36
46
|
* </BuyingBuddyProvider>
|
|
37
47
|
* ```
|
|
38
48
|
*/
|
|
39
|
-
export function BuyingBuddyProvider({ activationKey, domain = "www.mbb2.com", apiBaseUrl, children,
|
|
49
|
+
export function BuyingBuddyProvider({ activationKey, domain = "www.mbb2.com", apiBaseUrl, children,
|
|
50
|
+
// `fallback` is deliberately absent here. It remains on the props type as a
|
|
51
|
+
// deprecated no-op so existing call sites keep compiling, but the provider no
|
|
52
|
+
// longer has a loading state to render, so there is nothing for it to stand
|
|
53
|
+
// in for. See the deprecation note in ./types.
|
|
54
|
+
}) {
|
|
40
55
|
// Base URL for widget DATA requests. Defaults to the same environment as
|
|
41
56
|
// `domain`, but can be set independently to point data at another
|
|
42
57
|
// environment (e.g. a quick prod/preview flip for testing) without changing
|
|
@@ -113,7 +128,21 @@ export function BuyingBuddyProvider({ activationKey, domain = "www.mbb2.com", ap
|
|
|
113
128
|
script.onerror = () => {
|
|
114
129
|
if (cancelled)
|
|
115
130
|
return;
|
|
116
|
-
|
|
131
|
+
const failure = new Error(`Failed to load BuyingBuddy script for account: ${activationKey}`);
|
|
132
|
+
// Report, do not render. The provider wraps the host application's
|
|
133
|
+
// whole tree, so anything it renders in place of `children` takes the
|
|
134
|
+
// customer's site down with it - and a blocked CloudFront request is
|
|
135
|
+
// an ordinary event (ad blocker, CSP rule, corporate proxy, offline),
|
|
136
|
+
// not an exceptional one. The correct degraded state is the site
|
|
137
|
+
// intact with the widgets absent, which is what BuyingBuddyWidget's
|
|
138
|
+
// own `if (!isLoaded) return null` already produces.
|
|
139
|
+
if (!REPORTED_LOAD_FAILURES.has(activationKey)) {
|
|
140
|
+
REPORTED_LOAD_FAILURES.add(activationKey);
|
|
141
|
+
console.error(`[@buyingbuddy/react] ${failure.message}`);
|
|
142
|
+
}
|
|
143
|
+
// Still surfaced on the context, so a host app that wants to say
|
|
144
|
+
// something about it can read `error` from useBuyingBuddy().
|
|
145
|
+
setError(failure);
|
|
117
146
|
};
|
|
118
147
|
document.head.appendChild(script);
|
|
119
148
|
}
|
|
@@ -124,6 +153,13 @@ export function BuyingBuddyProvider({ activationKey, domain = "www.mbb2.com", ap
|
|
|
124
153
|
};
|
|
125
154
|
}, [activationKey, domain, resolvedApiBaseUrl]);
|
|
126
155
|
const value = { isLoaded, error, activationKey };
|
|
127
|
-
|
|
156
|
+
// `children` renders unconditionally, in every state. The provider is a
|
|
157
|
+
// context boundary, not a gate: it is mounted at the application root by
|
|
158
|
+
// every documented install path, so gating its subtree on a third-party CDN
|
|
159
|
+
// script means one blocked request hides the entire customer site. Widgets
|
|
160
|
+
// gate themselves on `isLoaded` individually, which is the right granularity
|
|
161
|
+
// - and it is why the old `fallback` prop existed only to be handed
|
|
162
|
+
// `children` back, undoing the gate it was introduced to soften.
|
|
163
|
+
return (_jsx(BuyingBuddyContext.Provider, { value: value, children: children }));
|
|
128
164
|
}
|
|
129
165
|
//# sourceMappingURL=BuyingBuddyProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyingBuddyProvider.js","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuyingBuddyProvider.js","sourceRoot":"","sources":["../src/BuyingBuddyProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,+EAA+E;AAC/E,gFAAgF;AAChF,iFAAiF;AAEjF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,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AC,OAAO,CAAC,CAAC;YACpB,CAAC,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,GAAG,EAAE;YACV,0EAA0E;YAC1E,mDAAmD;YACnD,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEhD,MAAM,KAAK,GAA4B,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IAE1E,wEAAwE;IACxE,yEAAyE;IACzE,4EAA4E;IAC5E,2EAA2E;IAC3E,6EAA6E;IAC7E,oEAAoE;IACpE,iEAAiE;IACjE,OAAO,CACL,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACtC,QAAQ,GACmB,CAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuyingBuddyWidget.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyWidget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuyingBuddyWidget.d.ts","sourceRoot":"","sources":["../src/BuyingBuddyWidget.tsx"],"names":[],"mappings":"AAMA,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"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// Required: this module imports useBuyingBuddy from the provider, so it is a client
|
|
3
|
+
// module for the same reason - see the note in BuyingBuddyProvider.tsx.
|
|
1
4
|
import { createElement, useCallback, useEffect, useRef } from "react";
|
|
2
5
|
import { useBuyingBuddy } from "./BuyingBuddyProvider";
|
|
3
6
|
/**
|
|
@@ -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,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,CAA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GED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// The directive is on the barrel AND on both component modules, deliberately.
|
|
3
|
+
// A "use client" barrel alone is usually enough for Next's RSC plugin, but the
|
|
4
|
+
// configuration proven end to end on the Next.js 16 App Router vetting run had it
|
|
5
|
+
// in all three emitted files, so that is what ships. It is an RSC directive, not a
|
|
6
|
+
// Next one: bundlers that do not understand it ignore it, so this is inert for the
|
|
7
|
+
// Vite / CRA / Framer consumers and fixes every RSC framework at once.
|
|
1
8
|
export { BuyingBuddyProvider, useBuyingBuddy } from "./BuyingBuddyProvider";
|
|
2
9
|
export { BuyingBuddyWidget } from "./BuyingBuddyWidget";
|
|
3
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,8EAA8E;AAC9E,+EAA+E;AAC/E,kFAAkF;AAClF,mFAAmF;AACnF,mFAAmF;AACnF,uEAAuE;AAEvE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -56,11 +56,23 @@ export interface BuyingBuddyProviderProps {
|
|
|
56
56
|
* Example: "https://preview.mbb2.com".
|
|
57
57
|
*/
|
|
58
58
|
apiBaseUrl?: string;
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Your application. Rendered immediately and in every state — the provider
|
|
61
|
+
* never withholds it, including while the runtime script is loading and
|
|
62
|
+
* after a load failure.
|
|
63
|
+
*/
|
|
60
64
|
children: React.ReactNode;
|
|
61
65
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
66
|
+
* @deprecated Since 0.3.2 this is accepted and ignored, and it will be
|
|
67
|
+
* removed in a future release. Safe to delete from your call site.
|
|
68
|
+
*
|
|
69
|
+
* It used to hold the place of `children` while the runtime script loaded,
|
|
70
|
+
* back when the provider withheld them. The provider no longer does, so
|
|
71
|
+
* there is no longer a state for it to render in: individual widgets render
|
|
72
|
+
* nothing until the runtime is ready, and everything else on the page —
|
|
73
|
+
* your header, your copy, your other components — is never withheld in the
|
|
74
|
+
* first place. The prop is kept in the type so existing call sites continue
|
|
75
|
+
* to compile.
|
|
64
76
|
*/
|
|
65
77
|
fallback?: React.ReactNode;
|
|
66
78
|
}
|
|
@@ -70,7 +82,16 @@ export interface BuyingBuddyProviderProps {
|
|
|
70
82
|
export interface BuyingBuddyContextValue {
|
|
71
83
|
/** Whether the MBB script has finished loading. */
|
|
72
84
|
isLoaded: boolean;
|
|
73
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Set if the runtime script failed to load — a CDN outage, an ad blocker, a
|
|
87
|
+
* CSP rule, a corporate proxy, or an offline client.
|
|
88
|
+
*
|
|
89
|
+
* The provider does not render anything of its own in this state: your
|
|
90
|
+
* application renders normally and Buying Buddy widgets are simply absent.
|
|
91
|
+
* Read this if you want to say something about it yourself; ignoring it is a
|
|
92
|
+
* perfectly reasonable choice. The failure is also logged to the console
|
|
93
|
+
* once per activation key.
|
|
94
|
+
*/
|
|
74
95
|
error: Error | null;
|
|
75
96
|
/** The activation key passed to the provider. */
|
|
76
97
|
activationKey: string;
|
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;;;;;;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,MAA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H,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.3.
|
|
17
|
+
export declare const PKG_VERSION = "0.3.2";
|
|
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.3.
|
|
17
|
+
export const PKG_VERSION = "0.3.2";
|
|
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.
|
|
3
|
+
"version": "0.3.2",
|
|
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",
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc",
|
|
21
|
+
"assert:use-client": "node scripts/assert-use-client.mjs",
|
|
21
22
|
"dev": "tsc --watch",
|
|
22
23
|
"test": "vitest run",
|
|
23
|
-
"prepublishOnly": "npm run build"
|
|
24
|
+
"prepublishOnly": "npm run build && npm run assert:use-client"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"react": ">=18",
|