@refraction-ui/react 0.9.0 → 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/{chunk-O4453CBF.js → chunk-VZLV27H2.js} +2 -2
- package/dist/{chunk-O4453CBF.js.map → chunk-VZLV27H2.js.map} +1 -1
- package/dist/form.js +1 -1
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -6
- 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/dist/internal/shared/index.d.cts +3 -3
- package/dist/internal/shared/index.d.ts +3 -3
- package/dist/internal/theme/index.d.cts +1 -1
- package/dist/internal/theme/index.d.ts +1 -1
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js +1 -1
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn, devWarn, cva, createKeyboardHandler, Keys, createMachine, generateId } from './chunk-
|
|
1
|
+
import { cn, devWarn, cva, createKeyboardHandler, Keys, createMachine, generateId } from './chunk-VZLV27H2.js';
|
|
2
2
|
export { createFaroSink } from './chunk-XWP763SH.js';
|
|
3
3
|
import * as React11 from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -15476,6 +15476,10 @@ async function startSessionReplay(options) {
|
|
|
15476
15476
|
|
|
15477
15477
|
// ../react-analytics/dist/index.js
|
|
15478
15478
|
var AnalyticsContext = React11.createContext(null);
|
|
15479
|
+
var noopAnalytics = null;
|
|
15480
|
+
function getNoopAnalytics() {
|
|
15481
|
+
return noopAnalytics ??= createNoopAnalytics();
|
|
15482
|
+
}
|
|
15479
15483
|
function AnalyticsProvider({ children, value }) {
|
|
15480
15484
|
const analyticsRef = React11.useRef(null);
|
|
15481
15485
|
if (!analyticsRef.current) {
|
|
@@ -15489,17 +15493,18 @@ function AnalyticsProvider({ children, value }) {
|
|
|
15489
15493
|
}
|
|
15490
15494
|
function useAnalytics(options) {
|
|
15491
15495
|
const ctx = React11.useContext(AnalyticsContext);
|
|
15492
|
-
|
|
15496
|
+
let base = ctx;
|
|
15497
|
+
if (!base) {
|
|
15493
15498
|
devWarn(
|
|
15494
15499
|
"react-analytics/use-analytics-outside-provider",
|
|
15495
|
-
"useAnalytics() was called outside an <AnalyticsProvider>.
|
|
15500
|
+
"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."
|
|
15496
15501
|
);
|
|
15497
|
-
|
|
15502
|
+
base = getNoopAnalytics();
|
|
15498
15503
|
}
|
|
15499
15504
|
const scope = options?.scope;
|
|
15500
15505
|
return React11.useMemo(
|
|
15501
|
-
() => scope ?
|
|
15502
|
-
[
|
|
15506
|
+
() => scope ? base.with(scope) : base,
|
|
15507
|
+
[base, scope]
|
|
15503
15508
|
);
|
|
15504
15509
|
}
|
|
15505
15510
|
function useTrackEvent(options) {
|