@buoy-gg/jotai 7.0.21 → 7.0.23
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.
|
@@ -23,7 +23,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
* - Events tab: Live atom change monitoring with diffs
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
const FREE_TIER_CHANGE_LIMIT = 25;
|
|
27
26
|
function EventsEmptyState({
|
|
28
27
|
isEnabled
|
|
29
28
|
}) {
|
|
@@ -55,6 +54,7 @@ function JotaiModal({
|
|
|
55
54
|
onAtomExpand
|
|
56
55
|
}) {
|
|
57
56
|
const isPro = (0, _license.useIsPro)();
|
|
57
|
+
const changeLimit = (0, _sharedUi.useLimit)("jotai.changes");
|
|
58
58
|
const [showProModal, setShowProModal] = (0, _react.useState)(false);
|
|
59
59
|
const [activeTab, setActiveTab] = (0, _react.useState)(initialTab ?? "atoms");
|
|
60
60
|
const [selectedHistoryAtom, setSelectedHistoryAtom] = (0, _react.useState)(null);
|
|
@@ -82,15 +82,10 @@ function JotaiModal({
|
|
|
82
82
|
return atoms.filter(a => !Array.from(ignoredPatterns).some(p => a.label.toLowerCase().includes(p.toLowerCase())));
|
|
83
83
|
}, [atoms, ignoredPatterns]);
|
|
84
84
|
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, [displayedChanges, isPro]);
|
|
90
|
-
const lockedChangeCount = (0, _react.useMemo)(() => {
|
|
91
|
-
if (isPro) return 0;
|
|
92
|
-
return Math.max(0, displayedChanges.length - FREE_TIER_CHANGE_LIMIT);
|
|
93
|
-
}, [displayedChanges.length, isPro]);
|
|
85
|
+
// Pro is Infinity here, so slice() returns everything and the locked count
|
|
86
|
+
// floors at 0 — no tier branching needed at the call site.
|
|
87
|
+
const visibleChanges = (0, _react.useMemo)(() => displayedChanges.slice(0, changeLimit), [displayedChanges, changeLimit]);
|
|
88
|
+
const lockedChangeCount = (0, _react.useMemo)(() => Math.max(0, displayedChanges.length - changeLimit), [displayedChanges.length, changeLimit]);
|
|
94
89
|
const hasLockedChanges = lockedChangeCount > 0;
|
|
95
90
|
|
|
96
91
|
// When viewing a single atom's history, scope the list
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { useState, useMemo, useRef, useCallback, useEffect } from "react";
|
|
12
12
|
import { View, Text, StyleSheet, FlatList, TextInput, TouchableOpacity } from "react-native";
|
|
13
|
-
import { JsModal, ModalHeader, TabSelector, macOSColors, buoyColors, Search, Filter, Power, X, Box, devToolsStorageKeys, ProUpgradeModal, PowerToggleButton, ToolbarCopyButton, ToolbarClearButton, truncatePayload, TickProvider } from "@buoy-gg/shared-ui";
|
|
13
|
+
import { JsModal, ModalHeader, TabSelector, macOSColors, buoyColors, Search, Filter, Power, X, Box, devToolsStorageKeys, ProUpgradeModal, PowerToggleButton, ToolbarCopyButton, ToolbarClearButton, truncatePayload, TickProvider, useLimit } from "@buoy-gg/shared-ui";
|
|
14
14
|
import { useIsPro } from "@buoy-gg/license";
|
|
15
15
|
import { useJotaiAtomChanges } from "../hooks/useJotaiAtomChanges";
|
|
16
16
|
import { JotaiAtomChangeItem } from "./JotaiAtomChangeItem";
|
|
@@ -18,7 +18,6 @@ import { JotaiAtomDetailContent, JotaiAtomDetailFooter } from "./JotaiAtomDetail
|
|
|
18
18
|
import { JotaiAtomBrowser } from "./JotaiAtomBrowser";
|
|
19
19
|
import { JotaiEventFilterView } from "./JotaiEventFilterView";
|
|
20
20
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
|
-
const FREE_TIER_CHANGE_LIMIT = 25;
|
|
22
21
|
function EventsEmptyState({
|
|
23
22
|
isEnabled
|
|
24
23
|
}) {
|
|
@@ -50,6 +49,7 @@ export function JotaiModal({
|
|
|
50
49
|
onAtomExpand
|
|
51
50
|
}) {
|
|
52
51
|
const isPro = useIsPro();
|
|
52
|
+
const changeLimit = useLimit("jotai.changes");
|
|
53
53
|
const [showProModal, setShowProModal] = useState(false);
|
|
54
54
|
const [activeTab, setActiveTab] = useState(initialTab ?? "atoms");
|
|
55
55
|
const [selectedHistoryAtom, setSelectedHistoryAtom] = useState(null);
|
|
@@ -77,15 +77,10 @@ export function JotaiModal({
|
|
|
77
77
|
return atoms.filter(a => !Array.from(ignoredPatterns).some(p => a.label.toLowerCase().includes(p.toLowerCase())));
|
|
78
78
|
}, [atoms, ignoredPatterns]);
|
|
79
79
|
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, [displayedChanges, isPro]);
|
|
85
|
-
const lockedChangeCount = useMemo(() => {
|
|
86
|
-
if (isPro) return 0;
|
|
87
|
-
return Math.max(0, displayedChanges.length - FREE_TIER_CHANGE_LIMIT);
|
|
88
|
-
}, [displayedChanges.length, isPro]);
|
|
80
|
+
// Pro is Infinity here, so slice() returns everything and the locked count
|
|
81
|
+
// floors at 0 — no tier branching needed at the call site.
|
|
82
|
+
const visibleChanges = useMemo(() => displayedChanges.slice(0, changeLimit), [displayedChanges, changeLimit]);
|
|
83
|
+
const lockedChangeCount = useMemo(() => Math.max(0, displayedChanges.length - changeLimit), [displayedChanges.length, changeLimit]);
|
|
89
84
|
const hasLockedChanges = lockedChangeCount > 0;
|
|
90
85
|
|
|
91
86
|
// When viewing a single atom's history, scope the list
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JotaiModal.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiModal.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"JotaiModal.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiModal.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyCH,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,UAAU,CAAC;AAkBjE,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,MAAc,EACd,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,YAAY,GACb,EAAE,eAAe,sCAyiBjB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,GAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAGpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/jotai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.23",
|
|
4
4
|
"description": "Jotai devtools inside your React Native app — every atom write shows prev → next, with per-atom history & live values. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"**/snapshotProvider.ts"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@buoy-gg/
|
|
33
|
-
"@buoy-gg/
|
|
32
|
+
"@buoy-gg/license": "^7.0.23",
|
|
33
|
+
"@buoy-gg/shared-ui": "^7.0.23"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"jotai": ">=2.0.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"bugs": {
|
|
76
76
|
"url": "https://github.com/LovesWorking/react-native-buoy/issues"
|
|
77
77
|
},
|
|
78
|
-
"homepage": "https://buoy.gg/tools/jotai",
|
|
78
|
+
"homepage": "https://buoy.gg/buoy/latest/docs/tools/jotai",
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public",
|
|
81
81
|
"tag": "latest"
|