@refraction-ui/react 0.9.1 → 0.9.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/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/analytics/index.d.cts +11 -1
- package/dist/internal/analytics/index.d.ts +11 -1
- package/dist/internal/react-analytics/index.d.cts +4 -1
- package/dist/internal/react-analytics/index.d.ts +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -45403,6 +45403,10 @@ async function startSessionReplay(options) {
|
|
|
45403
45403
|
|
|
45404
45404
|
// ../react-analytics/dist/index.js
|
|
45405
45405
|
var AnalyticsContext = React11__namespace.createContext(null);
|
|
45406
|
+
var noopAnalytics = null;
|
|
45407
|
+
function getNoopAnalytics() {
|
|
45408
|
+
return noopAnalytics ??= createNoopAnalytics();
|
|
45409
|
+
}
|
|
45406
45410
|
function AnalyticsProvider({ children, value }) {
|
|
45407
45411
|
const analyticsRef = React11__namespace.useRef(null);
|
|
45408
45412
|
if (!analyticsRef.current) {
|
|
@@ -45416,17 +45420,18 @@ function AnalyticsProvider({ children, value }) {
|
|
|
45416
45420
|
}
|
|
45417
45421
|
function useAnalytics(options) {
|
|
45418
45422
|
const ctx = React11__namespace.useContext(AnalyticsContext);
|
|
45419
|
-
|
|
45423
|
+
let base = ctx;
|
|
45424
|
+
if (!base) {
|
|
45420
45425
|
devWarn(
|
|
45421
45426
|
"react-analytics/use-analytics-outside-provider",
|
|
45422
|
-
"useAnalytics() was called outside an <AnalyticsProvider>.
|
|
45427
|
+
"useAnalytics() (or useTrackEvent()) was called outside an <AnalyticsProvider>. Analytics is a no-op here; wrap your app (or the consuming subtree) in <AnalyticsProvider> to enable it."
|
|
45423
45428
|
);
|
|
45424
|
-
|
|
45429
|
+
base = getNoopAnalytics();
|
|
45425
45430
|
}
|
|
45426
45431
|
const scope = options?.scope;
|
|
45427
45432
|
return React11__namespace.useMemo(
|
|
45428
|
-
() => scope ?
|
|
45429
|
-
[
|
|
45433
|
+
() => scope ? base.with(scope) : base,
|
|
45434
|
+
[base, scope]
|
|
45430
45435
|
);
|
|
45431
45436
|
}
|
|
45432
45437
|
function useTrackEvent(options) {
|