@buoy-gg/react-query 7.0.41 → 7.0.43
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/README.md +11 -73
- package/lib/commonjs/checkPeer.js +1 -8
- package/lib/commonjs/checkPeer.web.js +1 -3
- package/lib/commonjs/index.js +1 -657
- package/lib/commonjs/preset.js +1 -243
- package/lib/commonjs/react-query/components/DataEditorMode.js +1 -317
- package/lib/commonjs/react-query/components/FilterStatusBadge.js +1 -55
- package/lib/commonjs/react-query/components/MutationBrowserMode.js +1 -52
- package/lib/commonjs/react-query/components/MutationEditorMode.js +1 -276
- package/lib/commonjs/react-query/components/QueryBrowserMode.js +1 -99
- package/lib/commonjs/react-query/components/QueryDebugInfo.js +1 -107
- package/lib/commonjs/react-query/components/QueryFilterViewV3.js +1 -224
- package/lib/commonjs/react-query/components/QuerySelector.js +1 -209
- package/lib/commonjs/react-query/components/ReactQueryDevToolsModal.js +1 -91
- package/lib/commonjs/react-query/components/ReactQuerySection.js +1 -47
- package/lib/commonjs/react-query/components/ReactQueryTracker.js +1 -38
- package/lib/commonjs/react-query/components/WifiToggle.js +1 -51
- package/lib/commonjs/react-query/components/modals/DataEditorModal.js +1 -103
- package/lib/commonjs/react-query/components/modals/MutationBrowserFooter.js +1 -61
- package/lib/commonjs/react-query/components/modals/MutationBrowserModal.js +1 -164
- package/lib/commonjs/react-query/components/modals/MutationEditorModal.js +1 -106
- package/lib/commonjs/react-query/components/modals/QueryBrowserFooter.js +1 -56
- package/lib/commonjs/react-query/components/modals/QueryBrowserModal.js +1 -254
- package/lib/commonjs/react-query/components/modals/ReactQueryModal.js +1 -83
- package/lib/commonjs/react-query/components/modals/ReactQueryModalHeader.js +1 -194
- package/lib/commonjs/react-query/components/modals/SwipeIndicator.js +1 -204
- package/lib/commonjs/react-query/components/query-browser/ActionButton.js +1 -100
- package/lib/commonjs/react-query/components/query-browser/ClearCacheButton.js +1 -53
- package/lib/commonjs/react-query/components/query-browser/Explorer.js +1 -75
- package/lib/commonjs/react-query/components/query-browser/MutationButton.js +1 -190
- package/lib/commonjs/react-query/components/query-browser/MutationDetails.js +1 -124
- package/lib/commonjs/react-query/components/query-browser/MutationDetailsChips.js +1 -68
- package/lib/commonjs/react-query/components/query-browser/MutationInformation.js +1 -118
- package/lib/commonjs/react-query/components/query-browser/MutationStatusCount.js +1 -84
- package/lib/commonjs/react-query/components/query-browser/MutationsList.js +1 -220
- package/lib/commonjs/react-query/components/query-browser/NetworkToggleButton.js +1 -54
- package/lib/commonjs/react-query/components/query-browser/QueryActions.js +1 -124
- package/lib/commonjs/react-query/components/query-browser/QueryBrowser.js +1 -181
- package/lib/commonjs/react-query/components/query-browser/QueryDetails.js +1 -141
- package/lib/commonjs/react-query/components/query-browser/QueryDetailsChip.js +1 -78
- package/lib/commonjs/react-query/components/query-browser/QueryInformation.js +1 -95
- package/lib/commonjs/react-query/components/query-browser/QueryRow.js +1 -96
- package/lib/commonjs/react-query/components/query-browser/QueryStatus.js +1 -167
- package/lib/commonjs/react-query/components/query-browser/QueryStatusCount.js +1 -100
- package/lib/commonjs/react-query/components/query-browser/StorageStatusCount.js +1 -61
- package/lib/commonjs/react-query/components/query-browser/index.js +1 -170
- package/lib/commonjs/react-query/components/query-browser/svgs.js +1 -72
- package/lib/commonjs/react-query/hooks/useActionButtons.js +1 -51
- package/lib/commonjs/react-query/hooks/useAllMutations.js +1 -85
- package/lib/commonjs/react-query/hooks/useAllQueries.js +1 -117
- package/lib/commonjs/react-query/hooks/useModalManager.js +1 -178
- package/lib/commonjs/react-query/hooks/useModalPersistence.js +1 -71
- package/lib/commonjs/react-query/hooks/useMutationActionButtons.js +1 -21
- package/lib/commonjs/react-query/hooks/useQueryStatusCounts.js +1 -114
- package/lib/commonjs/react-query/hooks/useReactQueryState.js +1 -24
- package/lib/commonjs/react-query/hooks/useSelectedMutation.js +1 -30
- package/lib/commonjs/react-query/hooks/useSelectedQuery.js +1 -96
- package/lib/commonjs/react-query/hooks/useStorageQueryCounts.js +1 -28
- package/lib/commonjs/react-query/hooks/useWifiState.js +1 -67
- package/lib/commonjs/react-query/stores/reactQueryEventStore.js +1 -302
- package/lib/commonjs/react-query/sync/dehydrate.js +1 -166
- package/lib/commonjs/react-query/sync/reactQuerySyncAdapter.js +1 -593
- package/lib/commonjs/react-query/sync/snapshotProvider.js +1 -289
- package/lib/commonjs/react-query/sync/useReactQuerySyncAdapter.js +1 -34
- package/lib/commonjs/react-query/types/types.js +1 -14
- package/lib/commonjs/react-query/utils/actions/deleteItem.js +1 -23
- package/lib/commonjs/react-query/utils/actions/emitDevToolsEvent.js +1 -40
- package/lib/commonjs/react-query/utils/actions/invalidate.js +1 -15
- package/lib/commonjs/react-query/utils/actions/refetch.js +1 -17
- package/lib/commonjs/react-query/utils/actions/remove.js +1 -15
- package/lib/commonjs/react-query/utils/actions/reset.js +1 -17
- package/lib/commonjs/react-query/utils/actions/triggerError.js +1 -33
- package/lib/commonjs/react-query/utils/actions/triggerLoading.js +1 -54
- package/lib/commonjs/react-query/utils/deleteNestedDataByPath.js +1 -56
- package/lib/commonjs/react-query/utils/getQueryStatusColor.js +1 -16
- package/lib/commonjs/react-query/utils/getQueryStatusLabel.js +1 -23
- package/lib/commonjs/react-query/utils/getStorageQueryCounts.js +1 -35
- package/lib/commonjs/react-query/utils/modalStorageOperations.js +1 -127
- package/lib/commonjs/react-query/utils/storageQueryUtils.js +1 -149
- package/lib/commonjs/react-query/utils/testIDs.js +1 -61
- package/lib/commonjs/react-query/utils/updateNestedDataByPath.js +1 -61
- package/lib/module/checkPeer.js +1 -8
- package/lib/module/checkPeer.web.js +1 -3
- package/lib/module/index.js +1 -130
- package/lib/module/preset.js +1 -239
- package/lib/module/react-query/components/DataEditorMode.js +1 -311
- package/lib/module/react-query/components/FilterStatusBadge.js +1 -51
- package/lib/module/react-query/components/MutationBrowserMode.js +1 -47
- package/lib/module/react-query/components/MutationEditorMode.js +1 -270
- package/lib/module/react-query/components/QueryBrowserMode.js +1 -94
- package/lib/module/react-query/components/QueryDebugInfo.js +1 -104
- package/lib/module/react-query/components/QueryFilterViewV3.js +1 -221
- package/lib/module/react-query/components/QuerySelector.js +1 -205
- package/lib/module/react-query/components/ReactQueryDevToolsModal.js +1 -87
- package/lib/module/react-query/components/ReactQuerySection.js +1 -43
- package/lib/module/react-query/components/ReactQueryTracker.js +1 -35
- package/lib/module/react-query/components/WifiToggle.js +1 -48
- package/lib/module/react-query/components/modals/DataEditorModal.js +1 -99
- package/lib/module/react-query/components/modals/MutationBrowserFooter.js +1 -56
- package/lib/module/react-query/components/modals/MutationBrowserModal.js +1 -161
- package/lib/module/react-query/components/modals/MutationEditorModal.js +1 -102
- package/lib/module/react-query/components/modals/QueryBrowserFooter.js +1 -51
- package/lib/module/react-query/components/modals/QueryBrowserModal.js +1 -250
- package/lib/module/react-query/components/modals/ReactQueryModal.js +1 -79
- package/lib/module/react-query/components/modals/ReactQueryModalHeader.js +1 -190
- package/lib/module/react-query/components/modals/SwipeIndicator.js +1 -201
- package/lib/module/react-query/components/query-browser/ActionButton.js +1 -96
- package/lib/module/react-query/components/query-browser/ClearCacheButton.js +1 -49
- package/lib/module/react-query/components/query-browser/Explorer.js +1 -70
- package/lib/module/react-query/components/query-browser/MutationButton.js +1 -186
- package/lib/module/react-query/components/query-browser/MutationDetails.js +1 -119
- package/lib/module/react-query/components/query-browser/MutationDetailsChips.js +1 -64
- package/lib/module/react-query/components/query-browser/MutationInformation.js +1 -113
- package/lib/module/react-query/components/query-browser/MutationStatusCount.js +1 -79
- package/lib/module/react-query/components/query-browser/MutationsList.js +1 -215
- package/lib/module/react-query/components/query-browser/NetworkToggleButton.js +1 -50
- package/lib/module/react-query/components/query-browser/QueryActions.js +1 -119
- package/lib/module/react-query/components/query-browser/QueryBrowser.js +1 -176
- package/lib/module/react-query/components/query-browser/QueryDetails.js +1 -136
- package/lib/module/react-query/components/query-browser/QueryDetailsChip.js +1 -74
- package/lib/module/react-query/components/query-browser/QueryInformation.js +1 -90
- package/lib/module/react-query/components/query-browser/QueryRow.js +1 -92
- package/lib/module/react-query/components/query-browser/QueryStatus.js +1 -163
- package/lib/module/react-query/components/query-browser/QueryStatusCount.js +1 -95
- package/lib/module/react-query/components/query-browser/StorageStatusCount.js +1 -56
- package/lib/module/react-query/components/query-browser/index.js +1 -22
- package/lib/module/react-query/components/query-browser/svgs.js +1 -64
- package/lib/module/react-query/hooks/useActionButtons.js +1 -46
- package/lib/module/react-query/hooks/useAllMutations.js +1 -82
- package/lib/module/react-query/hooks/useAllQueries.js +1 -114
- package/lib/module/react-query/hooks/useModalManager.js +1 -175
- package/lib/module/react-query/hooks/useModalPersistence.js +1 -67
- package/lib/module/react-query/hooks/useMutationActionButtons.js +1 -17
- package/lib/module/react-query/hooks/useQueryStatusCounts.js +1 -112
- package/lib/module/react-query/hooks/useReactQueryState.js +1 -20
- package/lib/module/react-query/hooks/useSelectedMutation.js +1 -27
- package/lib/module/react-query/hooks/useSelectedQuery.js +1 -92
- package/lib/module/react-query/hooks/useStorageQueryCounts.js +1 -25
- package/lib/module/react-query/hooks/useWifiState.js +1 -64
- package/lib/module/react-query/stores/reactQueryEventStore.js +1 -293
- package/lib/module/react-query/sync/dehydrate.js +1 -156
- package/lib/module/react-query/sync/reactQuerySyncAdapter.js +1 -589
- package/lib/module/react-query/sync/snapshotProvider.js +1 -284
- package/lib/module/react-query/sync/useReactQuerySyncAdapter.js +1 -31
- package/lib/module/react-query/types/types.js +1 -10
- package/lib/module/react-query/utils/actions/deleteItem.js +1 -19
- package/lib/module/react-query/utils/actions/emitDevToolsEvent.js +1 -36
- package/lib/module/react-query/utils/actions/invalidate.js +1 -11
- package/lib/module/react-query/utils/actions/refetch.js +1 -13
- package/lib/module/react-query/utils/actions/remove.js +1 -11
- package/lib/module/react-query/utils/actions/reset.js +1 -13
- package/lib/module/react-query/utils/actions/triggerError.js +1 -29
- package/lib/module/react-query/utils/actions/triggerLoading.js +1 -50
- package/lib/module/react-query/utils/deleteNestedDataByPath.js +1 -51
- package/lib/module/react-query/utils/getQueryStatusColor.js +1 -12
- package/lib/module/react-query/utils/getQueryStatusLabel.js +1 -19
- package/lib/module/react-query/utils/getStorageQueryCounts.js +1 -31
- package/lib/module/react-query/utils/modalStorageOperations.js +1 -117
- package/lib/module/react-query/utils/storageQueryUtils.js +1 -140
- package/lib/module/react-query/utils/testIDs.js +1 -54
- package/lib/module/react-query/utils/updateNestedDataByPath.js +1 -56
- package/lib/web/index.mjs +3 -4
- package/package.json +4 -7
- package/lib/typescript/checkPeer.d.ts.map +0 -1
- package/lib/typescript/checkPeer.web.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/react-query/components/DataEditorMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/FilterStatusBadge.d.ts.map +0 -1
- package/lib/typescript/react-query/components/MutationBrowserMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/MutationEditorMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QueryBrowserMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QueryDebugInfo.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QueryFilterViewV3.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QuerySelector.d.ts.map +0 -1
- package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/ReactQuerySection.d.ts.map +0 -1
- package/lib/typescript/react-query/components/ReactQueryTracker.d.ts.map +0 -1
- package/lib/typescript/react-query/components/WifiToggle.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/DataEditorModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/MutationEditorModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/ReactQueryModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/SwipeIndicator.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/ActionButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/ClearCacheButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/Explorer.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationDetails.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationDetailsChips.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationInformation.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/NetworkToggleButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryActions.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryDetails.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryDetailsChip.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryInformation.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryRow.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryStatus.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/index.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/svgs.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useActionButtons.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useAllMutations.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useAllQueries.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useModalManager.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useModalPersistence.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useMutationActionButtons.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useQueryStatusCounts.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useReactQueryState.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useSelectedMutation.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useSelectedQuery.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useStorageQueryCounts.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useWifiState.d.ts.map +0 -1
- package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/dehydrate.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/reactQuerySyncAdapter.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/snapshotProvider.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/useReactQuerySyncAdapter.d.ts.map +0 -1
- package/lib/typescript/react-query/types/types.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/deleteItem.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/emitDevToolsEvent.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/invalidate.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/refetch.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/remove.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/reset.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/triggerError.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/triggerLoading.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/deleteNestedDataByPath.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/getQueryStatusColor.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/getQueryStatusLabel.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/getStorageQueryCounts.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/modalStorageOperations.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/storageQueryUtils.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/testIDs.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/updateNestedDataByPath.d.ts.map +0 -1
|
@@ -1,54 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
/**
|
|
11
|
-
* Small toggle used in the query browser to mock offline/online behavior.
|
|
12
|
-
*/
|
|
13
|
-
const NetworkToggleButton = ({
|
|
14
|
-
isOffline,
|
|
15
|
-
onToggle
|
|
16
|
-
}) => {
|
|
17
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
18
|
-
"sentry-label": "ignore devtools network toggle button",
|
|
19
|
-
style: [styles.button, isOffline && styles.offlineButton],
|
|
20
|
-
onPress: onToggle,
|
|
21
|
-
activeOpacity: 0.7,
|
|
22
|
-
accessibilityLabel: isOffline ? "Unset offline mocking behavior" : "Mock offline behavior",
|
|
23
|
-
accessibilityRole: "button",
|
|
24
|
-
accessibilityState: {
|
|
25
|
-
selected: isOffline
|
|
26
|
-
},
|
|
27
|
-
children: isOffline ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Wifi, {
|
|
28
|
-
size: 16,
|
|
29
|
-
color: _sharedUi.buoyColors.error,
|
|
30
|
-
strokeWidth: 2
|
|
31
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Wifi, {
|
|
32
|
-
size: 16,
|
|
33
|
-
color: _sharedUi.buoyColors.success,
|
|
34
|
-
strokeWidth: 2
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
const styles = _reactNative.StyleSheet.create({
|
|
39
|
-
button: {
|
|
40
|
-
width: 32,
|
|
41
|
-
height: 32,
|
|
42
|
-
borderRadius: 6,
|
|
43
|
-
backgroundColor: "rgba(16, 185, 129, 0.1)",
|
|
44
|
-
justifyContent: "center",
|
|
45
|
-
alignItems: "center",
|
|
46
|
-
borderWidth: 1,
|
|
47
|
-
borderColor: "rgba(16, 185, 129, 0.2)"
|
|
48
|
-
},
|
|
49
|
-
offlineButton: {
|
|
50
|
-
backgroundColor: "rgba(239, 68, 68, 0.1)",
|
|
51
|
-
borderColor: "rgba(239, 68, 68, 0.2)"
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var _default = exports.default = NetworkToggleButton;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");const NetworkToggleButton=({isOffline:e,onToggle:t})=>{return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{"sentry-label":"ignore devtools network toggle button",style:[styles.button,e&&styles.offlineButton],onPress:t,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?(0,_jsxRuntime.jsx)(_sharedUi.Wifi,{size:16,color:_sharedUi.buoyColors.error,strokeWidth:2}):(0,_jsxRuntime.jsx)(_sharedUi.Wifi,{size:16,color:_sharedUi.buoyColors.success,strokeWidth:2})})};const styles=_reactNative.StyleSheet.create({button:{width:32,height:32,borderRadius:6,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"rgba(16, 185, 129, 0.2)"},offlineButton:{backgroundColor:"rgba(239, 68, 68, 0.1)",borderColor:"rgba(239, 68, 68, 0.2)"}});var _default=exports.default=NetworkToggleButton;
|
|
@@ -1,124 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = QueryActions;
|
|
7
|
-
var _reactQuery = require("@tanstack/react-query");
|
|
8
|
-
var _ActionButton = _interopRequireDefault(require("./ActionButton"));
|
|
9
|
-
var _getQueryStatusLabel = require("../../utils/getQueryStatusLabel");
|
|
10
|
-
var _triggerLoading = _interopRequireDefault(require("../../utils/actions/triggerLoading"));
|
|
11
|
-
var _refetch = _interopRequireDefault(require("../../utils/actions/refetch"));
|
|
12
|
-
var _reset = _interopRequireDefault(require("../../utils/actions/reset"));
|
|
13
|
-
var _remove = _interopRequireDefault(require("../../utils/actions/remove"));
|
|
14
|
-
var _invalidate = _interopRequireDefault(require("../../utils/actions/invalidate"));
|
|
15
|
-
var _triggerError = _interopRequireDefault(require("../../utils/actions/triggerError"));
|
|
16
|
-
var _reactNative = require("react-native");
|
|
17
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
-
/**
|
|
21
|
-
* Action panel rendered in query detail views providing mutation simulation and removal controls.
|
|
22
|
-
*/
|
|
23
|
-
function QueryActions({
|
|
24
|
-
query,
|
|
25
|
-
setSelectedQuery
|
|
26
|
-
}) {
|
|
27
|
-
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
28
|
-
if (query === undefined) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const queryStatus = query.state.status;
|
|
32
|
-
const isFetching = (0, _getQueryStatusLabel.getQueryStatusLabel)(query) === "fetching";
|
|
33
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
34
|
-
style: styles.container,
|
|
35
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
36
|
-
style: styles.section,
|
|
37
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
38
|
-
style: styles.sectionLabel,
|
|
39
|
-
children: "Actions"
|
|
40
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
41
|
-
style: styles.buttonsRow,
|
|
42
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
43
|
-
disabled: isFetching,
|
|
44
|
-
onClick: () => (0, _refetch.default)({
|
|
45
|
-
query
|
|
46
|
-
}),
|
|
47
|
-
variant: "refetch",
|
|
48
|
-
text: "Refetch"
|
|
49
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
50
|
-
disabled: queryStatus === "pending",
|
|
51
|
-
onClick: () => (0, _invalidate.default)({
|
|
52
|
-
query,
|
|
53
|
-
queryClient
|
|
54
|
-
}),
|
|
55
|
-
variant: "invalidate",
|
|
56
|
-
text: "Invalidate"
|
|
57
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
58
|
-
disabled: queryStatus === "pending",
|
|
59
|
-
onClick: () => (0, _reset.default)({
|
|
60
|
-
queryClient,
|
|
61
|
-
query
|
|
62
|
-
}),
|
|
63
|
-
variant: "reset",
|
|
64
|
-
text: "Reset"
|
|
65
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
66
|
-
disabled: isFetching,
|
|
67
|
-
onClick: () => {
|
|
68
|
-
(0, _remove.default)({
|
|
69
|
-
queryClient,
|
|
70
|
-
query
|
|
71
|
-
});
|
|
72
|
-
setSelectedQuery(undefined);
|
|
73
|
-
},
|
|
74
|
-
variant: "remove",
|
|
75
|
-
text: "Remove"
|
|
76
|
-
})]
|
|
77
|
-
})]
|
|
78
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
79
|
-
style: styles.section,
|
|
80
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
81
|
-
style: styles.sectionLabel,
|
|
82
|
-
children: "Triggers"
|
|
83
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
84
|
-
style: styles.buttonsRow,
|
|
85
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
86
|
-
disabled: false,
|
|
87
|
-
onClick: () => (0, _triggerLoading.default)({
|
|
88
|
-
query
|
|
89
|
-
}),
|
|
90
|
-
variant: "triggerLoading",
|
|
91
|
-
text: query.state.fetchStatus === "fetching" ? "Restore Loading" : "Trigger Loading"
|
|
92
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
93
|
-
disabled: queryStatus === "pending",
|
|
94
|
-
onClick: () => (0, _triggerError.default)({
|
|
95
|
-
query,
|
|
96
|
-
queryClient
|
|
97
|
-
}),
|
|
98
|
-
variant: "triggerError",
|
|
99
|
-
text: queryStatus === "error" ? "Restore Error" : "Trigger Error"
|
|
100
|
-
})]
|
|
101
|
-
})]
|
|
102
|
-
})]
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
const styles = _reactNative.StyleSheet.create({
|
|
106
|
-
container: {
|
|
107
|
-
gap: 16
|
|
108
|
-
},
|
|
109
|
-
section: {
|
|
110
|
-
gap: 8
|
|
111
|
-
},
|
|
112
|
-
sectionLabel: {
|
|
113
|
-
fontSize: 11,
|
|
114
|
-
fontWeight: "600",
|
|
115
|
-
color: _sharedUi.night.color.textTertiary,
|
|
116
|
-
textTransform: "uppercase",
|
|
117
|
-
letterSpacing: 0.5
|
|
118
|
-
},
|
|
119
|
-
buttonsRow: {
|
|
120
|
-
flexDirection: "row",
|
|
121
|
-
flexWrap: "wrap",
|
|
122
|
-
gap: 8
|
|
123
|
-
}
|
|
124
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryActions;var _reactQuery=require("@tanstack/react-query");var _ActionButton=_interopRequireDefault(require("./ActionButton"));var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _triggerLoading=_interopRequireDefault(require("../../utils/actions/triggerLoading"));var _refetch=_interopRequireDefault(require("../../utils/actions/refetch"));var _reset=_interopRequireDefault(require("../../utils/actions/reset"));var _remove=_interopRequireDefault(require("../../utils/actions/remove"));var _invalidate=_interopRequireDefault(require("../../utils/actions/invalidate"));var _triggerError=_interopRequireDefault(require("../../utils/actions/triggerError"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function QueryActions({query:e,setSelectedQuery:a}){const t=(0,_reactQuery.useQueryClient)();if(e===void 0){return null}const r=e.state.status;const i=(0,_getQueryStatusLabel.getQueryStatusLabel)(e)==="fetching";return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionLabel,children:"Actions"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.buttonsRow,children:[(0,_jsxRuntime.jsx)(_ActionButton.default,{disabled:i,onClick:()=>(0,_refetch.default)({query:e}),variant:"refetch",text:"Refetch"}),(0,_jsxRuntime.jsx)(_ActionButton.default,{disabled:r==="pending",onClick:()=>(0,_invalidate.default)({query:e,queryClient:t}),variant:"invalidate",text:"Invalidate"}),(0,_jsxRuntime.jsx)(_ActionButton.default,{disabled:r==="pending",onClick:()=>(0,_reset.default)({queryClient:t,query:e}),variant:"reset",text:"Reset"}),(0,_jsxRuntime.jsx)(_ActionButton.default,{disabled:i,onClick:()=>{(0,_remove.default)({queryClient:t,query:e});a(void 0)},variant:"remove",text:"Remove"})]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionLabel,children:"Triggers"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.buttonsRow,children:[(0,_jsxRuntime.jsx)(_ActionButton.default,{disabled:false,onClick:()=>(0,_triggerLoading.default)({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),(0,_jsxRuntime.jsx)(_ActionButton.default,{disabled:r==="pending",onClick:()=>(0,_triggerError.default)({query:e,queryClient:t}),variant:"triggerError",text:r==="error"?"Restore Error":"Trigger Error"})]})]})]})}const styles=_reactNative.StyleSheet.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});
|
|
@@ -1,181 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = QueryBrowser;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _QueryRow = _interopRequireDefault(require("./QueryRow"));
|
|
10
|
-
var _useAllQueries = _interopRequireDefault(require("../../hooks/useAllQueries"));
|
|
11
|
-
var _getQueryStatusLabel = require("../../utils/getQueryStatusLabel");
|
|
12
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
/**
|
|
16
|
-
* Scrollable list view of cached queries with filtering support and selection handling.
|
|
17
|
-
*/
|
|
18
|
-
function QueryBrowser({
|
|
19
|
-
selectedQuery,
|
|
20
|
-
onQuerySelect,
|
|
21
|
-
activeFilter,
|
|
22
|
-
emptyStateMessage,
|
|
23
|
-
emptyState,
|
|
24
|
-
contentContainerStyle,
|
|
25
|
-
queries: externalQueries,
|
|
26
|
-
searchText = "",
|
|
27
|
-
ignoredPatterns = new Set(),
|
|
28
|
-
includedPatterns = new Set()
|
|
29
|
-
}) {
|
|
30
|
-
// Holds all queries using the working hook, or use external queries if provided
|
|
31
|
-
const internalQueries = (0, _useAllQueries.default)();
|
|
32
|
-
const allQueries = externalQueries ?? internalQueries;
|
|
33
|
-
|
|
34
|
-
// Filter queries based on active filter, search text, and ignored patterns
|
|
35
|
-
const filteredQueries = (0, _react.useMemo)(() => {
|
|
36
|
-
let filtered = allQueries;
|
|
37
|
-
|
|
38
|
-
// Apply status filter
|
|
39
|
-
if (activeFilter) {
|
|
40
|
-
filtered = filtered.filter(query => {
|
|
41
|
-
const status = (0, _getQueryStatusLabel.getQueryStatusLabel)(query);
|
|
42
|
-
return status === activeFilter;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Apply search filter on query keys
|
|
47
|
-
if (searchText) {
|
|
48
|
-
const searchLower = searchText.toLowerCase();
|
|
49
|
-
filtered = filtered.filter(query => {
|
|
50
|
-
if (!query?.queryKey) return false;
|
|
51
|
-
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
52
|
-
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
53
|
-
return keyString.includes(searchLower);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Apply included patterns filter (show ONLY queries matching any pattern)
|
|
58
|
-
// This acts as a whitelist - if any include patterns exist, query must match at least one
|
|
59
|
-
if (includedPatterns.size > 0) {
|
|
60
|
-
filtered = filtered.filter(query => {
|
|
61
|
-
if (!query?.queryKey) return false;
|
|
62
|
-
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
63
|
-
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
64
|
-
|
|
65
|
-
// Return true if query matches ANY included pattern
|
|
66
|
-
return Array.from(includedPatterns).some(pattern => keyString.includes(pattern.toLowerCase()));
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Apply ignored patterns filter (hide queries matching any pattern)
|
|
71
|
-
if (ignoredPatterns.size > 0) {
|
|
72
|
-
filtered = filtered.filter(query => {
|
|
73
|
-
if (!query?.queryKey) return true;
|
|
74
|
-
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
75
|
-
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
76
|
-
|
|
77
|
-
// Return true if NO patterns match (i.e., keep the query)
|
|
78
|
-
return !Array.from(ignoredPatterns).some(pattern => keyString.includes(pattern.toLowerCase()));
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Sort by most recently updated (dataUpdatedAt descending)
|
|
83
|
-
filtered.sort((a, b) => {
|
|
84
|
-
const aTime = a.state.dataUpdatedAt || 0;
|
|
85
|
-
const bTime = b.state.dataUpdatedAt || 0;
|
|
86
|
-
return bTime - aTime; // Most recent first
|
|
87
|
-
});
|
|
88
|
-
return filtered;
|
|
89
|
-
}, [allQueries, activeFilter, searchText, includedPatterns, ignoredPatterns]);
|
|
90
|
-
|
|
91
|
-
// Function to handle query selection with stable comparison
|
|
92
|
-
const handleQuerySelect = (0, _react.useCallback)(query => {
|
|
93
|
-
// Compare queries by their queryKey and queryHash for stable selection
|
|
94
|
-
const isCurrentlySelected = selectedQuery?.queryHash === query.queryHash;
|
|
95
|
-
if (isCurrentlySelected) {
|
|
96
|
-
onQuerySelect(undefined); // Deselect
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
onQuerySelect(query);
|
|
100
|
-
}, [selectedQuery?.queryHash, onQuerySelect]);
|
|
101
|
-
if (filteredQueries.length === 0) {
|
|
102
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
|
|
103
|
-
testID: "buoy-rq-empty",
|
|
104
|
-
...(emptyState ?? {
|
|
105
|
-
otto: "empty",
|
|
106
|
-
title: "No queries found",
|
|
107
|
-
message: emptyStateMessage || (activeFilter ? `No ${activeFilter} queries found` : "No queries found")
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return (
|
|
112
|
-
/*#__PURE__*/
|
|
113
|
-
// Virtualized list with STABLE keys (queryHash). The previous
|
|
114
|
-
// ScrollView + map mounted every row, and its key included
|
|
115
|
-
// dataUpdatedAt/fetchStatus so rows REMOUNTED on each update — at 300
|
|
116
|
-
// seeded queries that measured 168% CPU with 546 row renders during a
|
|
117
|
-
// 5s idle dwell (tool-bench 2026-07-06). TanStack Query objects are
|
|
118
|
-
// mutable with stable identity, so `stateSig` carries the changing
|
|
119
|
-
// fields for the row's memo comparison.
|
|
120
|
-
(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
|
121
|
-
testID: "buoy-rq-query-list",
|
|
122
|
-
style: styles.listWrapper,
|
|
123
|
-
contentContainerStyle: contentContainerStyle || styles.listContent,
|
|
124
|
-
data: filteredQueries,
|
|
125
|
-
keyExtractor: queryKeyExtractor,
|
|
126
|
-
renderItem: ({
|
|
127
|
-
item: query
|
|
128
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryRow.default, {
|
|
129
|
-
query: query,
|
|
130
|
-
stateSig: computeQueryStateSig(query),
|
|
131
|
-
isSelected: selectedQuery?.queryHash === query.queryHash,
|
|
132
|
-
onSelect: handleQuerySelect
|
|
133
|
-
}),
|
|
134
|
-
showsVerticalScrollIndicator: true,
|
|
135
|
-
..._sharedUi.EVENT_LIST_PRESET
|
|
136
|
-
})
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
const queryKeyExtractor = q => q.queryHash;
|
|
140
|
-
|
|
141
|
-
/** The row-visible slice of a query's mutable state, as a comparable
|
|
142
|
-
* string — drives QueryRow's memo (see comment above). */
|
|
143
|
-
function computeQueryStateSig(q) {
|
|
144
|
-
let observers = 0;
|
|
145
|
-
let stale = false;
|
|
146
|
-
try {
|
|
147
|
-
observers = q.getObserversCount();
|
|
148
|
-
stale = q.isStale();
|
|
149
|
-
} catch {
|
|
150
|
-
// defensive: state reads on a disposed query must not break the list
|
|
151
|
-
}
|
|
152
|
-
return `${q.state.dataUpdatedAt}|${q.state.fetchStatus}|${q.state.status}|${observers}|${stale}`;
|
|
153
|
-
}
|
|
154
|
-
const styles = _reactNative.StyleSheet.create({
|
|
155
|
-
listWrapper: {
|
|
156
|
-
flexGrow: 1
|
|
157
|
-
},
|
|
158
|
-
listContent: {
|
|
159
|
-
paddingBottom: 16,
|
|
160
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
161
|
-
backgroundColor: "transparent"
|
|
162
|
-
},
|
|
163
|
-
emptyContainer: {
|
|
164
|
-
flex: 1,
|
|
165
|
-
justifyContent: "center",
|
|
166
|
-
alignItems: "center",
|
|
167
|
-
padding: 32,
|
|
168
|
-
backgroundColor: _sharedUi.night.color.surface,
|
|
169
|
-
margin: 16,
|
|
170
|
-
borderRadius: 8,
|
|
171
|
-
borderWidth: 1,
|
|
172
|
-
borderColor: _sharedUi.night.color.border
|
|
173
|
-
},
|
|
174
|
-
emptyText: {
|
|
175
|
-
color: _sharedUi.night.color.textTertiary,
|
|
176
|
-
fontSize: 14,
|
|
177
|
-
textAlign: "center",
|
|
178
|
-
fontFamily: _sharedUi.monoFont,
|
|
179
|
-
letterSpacing: 0.5
|
|
180
|
-
}
|
|
181
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryBrowser;var _react=require("react");var _reactNative=require("react-native");var _QueryRow=_interopRequireDefault(require("./QueryRow"));var _useAllQueries=_interopRequireDefault(require("../../hooks/useAllQueries"));var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function QueryBrowser({selectedQuery:r,onQuerySelect:u,activeFilter:a,emptyStateMessage:S,emptyState:m,contentContainerStyle:g,queries:p,searchText:i="",ignoredPatterns:l=new Set,includedPatterns:y=new Set}){const q=(0,_useAllQueries.default)();const f=p??q;const d=(0,_react.useMemo)(()=>{let e=f;if(a){e=e.filter(t=>{const o=(0,_getQueryStatusLabel.getQueryStatusLabel)(t);return o===a})}if(i){const t=i.toLowerCase();e=e.filter(o=>{if(!o?.queryKey)return false;const n=Array.isArray(o.queryKey)?o.queryKey:[o.queryKey];const s=n.filter(c=>c!=null).map(c=>String(c)).join(" ").toLowerCase();return s.includes(t)})}if(y.size>0){e=e.filter(t=>{if(!t?.queryKey)return false;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const n=o.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return Array.from(y).some(s=>n.includes(s.toLowerCase()))})}if(l.size>0){e=e.filter(t=>{if(!t?.queryKey)return true;const o=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const n=o.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return!Array.from(l).some(s=>n.includes(s.toLowerCase()))})}e.sort((t,o)=>{const n=t.state.dataUpdatedAt||0;const s=o.state.dataUpdatedAt||0;return s-n});return e},[f,a,i,y,l]);const h=(0,_react.useCallback)(e=>{const t=r?.queryHash===e.queryHash;if(t){u(void 0);return}u(e)},[r?.queryHash,u]);if(d.length===0){return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-rq-empty",...m??{otto:"empty",title:"No queries found",message:S||(a?`No ${a} queries found`:"No queries found")}})}return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{testID:"buoy-rq-query-list",style:styles.listWrapper,contentContainerStyle:g||styles.listContent,data:d,keyExtractor:queryKeyExtractor,renderItem:({item:e})=>(0,_jsxRuntime.jsx)(_QueryRow.default,{query:e,stateSig:computeQueryStateSig(e),isSelected:r?.queryHash===e.queryHash,onSelect:h}),showsVerticalScrollIndicator:true,..._sharedUi.EVENT_LIST_PRESET})}const queryKeyExtractor=r=>r.queryHash;function computeQueryStateSig(r){let u=0;let a=false;try{u=r.getObserversCount();a=r.isStale()}catch{}return`${r.state.dataUpdatedAt}|${r.state.fetchStatus}|${r.state.status}|${u}|${a}`}const styles=_reactNative.StyleSheet.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:_sharedUi.night.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},emptyText:{color:_sharedUi.night.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:_sharedUi.monoFont,letterSpacing:.5}});
|
|
@@ -1,141 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = QueryDetails;
|
|
7
|
-
var _QueryDetailsChip = _interopRequireDefault(require("./QueryDetailsChip"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/**
|
|
13
|
-
* Renders the primary metadata summary for a selected query, including fetch status and timings.
|
|
14
|
-
*/
|
|
15
|
-
function QueryDetails({
|
|
16
|
-
query
|
|
17
|
-
}) {
|
|
18
|
-
if (query === undefined) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
// Convert the timestamp to a Date object and format it
|
|
22
|
-
const lastUpdated = new Date(query.state.dataUpdatedAt).toLocaleTimeString("en-US", {
|
|
23
|
-
hour: "2-digit",
|
|
24
|
-
minute: "2-digit",
|
|
25
|
-
second: "2-digit",
|
|
26
|
-
hour12: true
|
|
27
|
-
});
|
|
28
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
29
|
-
style: styles.minWidth,
|
|
30
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
31
|
-
style: styles.headerText,
|
|
32
|
-
children: "Query Details"
|
|
33
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
34
|
-
style: styles.row,
|
|
35
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
36
|
-
"sentry-label": "ignore devtools query details scroll",
|
|
37
|
-
horizontal: true,
|
|
38
|
-
style: styles.flexOne,
|
|
39
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
40
|
-
testID: "buoy-rq-detail-key",
|
|
41
|
-
style: styles.queryKeyText,
|
|
42
|
-
children: (0, _sharedUi.displayValue)(query.queryKey, true)
|
|
43
|
-
})
|
|
44
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryDetailsChip.default, {
|
|
45
|
-
query: query,
|
|
46
|
-
testID: "buoy-rq-detail-status"
|
|
47
|
-
})]
|
|
48
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
49
|
-
style: styles.row,
|
|
50
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
51
|
-
style: styles.labelText,
|
|
52
|
-
children: "Observers:"
|
|
53
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
54
|
-
testID: "buoy-rq-detail-observers",
|
|
55
|
-
style: styles.valueText,
|
|
56
|
-
children: `${query.getObserversCount()}`
|
|
57
|
-
})]
|
|
58
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
59
|
-
style: styles.row,
|
|
60
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
61
|
-
style: styles.labelText,
|
|
62
|
-
children: "Last Updated:"
|
|
63
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
64
|
-
testID: "buoy-rq-detail-updated",
|
|
65
|
-
style: styles.valueText,
|
|
66
|
-
children: `${lastUpdated}`
|
|
67
|
-
})]
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
const styles = _reactNative.StyleSheet.create({
|
|
72
|
-
minWidth: {
|
|
73
|
-
minWidth: 200,
|
|
74
|
-
backgroundColor: _sharedUi.night.color.surface,
|
|
75
|
-
borderRadius: 6,
|
|
76
|
-
borderWidth: 1,
|
|
77
|
-
borderColor: _sharedUi.night.color.accent + "4D",
|
|
78
|
-
overflow: "hidden",
|
|
79
|
-
shadowColor: _sharedUi.night.color.accent,
|
|
80
|
-
shadowOffset: {
|
|
81
|
-
width: 0,
|
|
82
|
-
height: 0
|
|
83
|
-
},
|
|
84
|
-
shadowOpacity: 0.1,
|
|
85
|
-
shadowRadius: 6
|
|
86
|
-
},
|
|
87
|
-
headerText: {
|
|
88
|
-
backgroundColor: _sharedUi.night.color.accent + "15",
|
|
89
|
-
paddingHorizontal: 12,
|
|
90
|
-
paddingVertical: 10,
|
|
91
|
-
fontWeight: "600",
|
|
92
|
-
fontSize: 12,
|
|
93
|
-
color: _sharedUi.night.color.accent,
|
|
94
|
-
borderBottomWidth: 1,
|
|
95
|
-
borderBottomColor: _sharedUi.night.color.accent + "33",
|
|
96
|
-
letterSpacing: 0.5,
|
|
97
|
-
textTransform: "uppercase",
|
|
98
|
-
fontFamily: _sharedUi.monoFont
|
|
99
|
-
},
|
|
100
|
-
row: {
|
|
101
|
-
flexDirection: "row",
|
|
102
|
-
justifyContent: "space-between",
|
|
103
|
-
alignItems: "center",
|
|
104
|
-
paddingHorizontal: 12,
|
|
105
|
-
paddingVertical: 10,
|
|
106
|
-
borderBottomWidth: 1,
|
|
107
|
-
borderBottomColor: _sharedUi.night.color.separator
|
|
108
|
-
},
|
|
109
|
-
flexOne: {
|
|
110
|
-
flex: 1,
|
|
111
|
-
marginRight: 8
|
|
112
|
-
},
|
|
113
|
-
queryKeyText: {
|
|
114
|
-
fontSize: 12,
|
|
115
|
-
color: _sharedUi.night.color.text,
|
|
116
|
-
fontFamily: _sharedUi.monoFont,
|
|
117
|
-
lineHeight: 18,
|
|
118
|
-
flexShrink: 1,
|
|
119
|
-
backgroundColor: _sharedUi.night.color.accent + "15",
|
|
120
|
-
paddingHorizontal: 8,
|
|
121
|
-
paddingVertical: 4,
|
|
122
|
-
borderRadius: 4,
|
|
123
|
-
borderWidth: 1,
|
|
124
|
-
borderColor: _sharedUi.night.color.accent + "4D"
|
|
125
|
-
},
|
|
126
|
-
labelText: {
|
|
127
|
-
fontSize: 10,
|
|
128
|
-
color: _sharedUi.night.color.textSecondary,
|
|
129
|
-
fontWeight: "600",
|
|
130
|
-
letterSpacing: 0.5,
|
|
131
|
-
textTransform: "uppercase",
|
|
132
|
-
fontFamily: _sharedUi.monoFont
|
|
133
|
-
},
|
|
134
|
-
valueText: {
|
|
135
|
-
fontSize: 12,
|
|
136
|
-
color: _sharedUi.night.color.text,
|
|
137
|
-
fontWeight: "500",
|
|
138
|
-
fontVariant: ["tabular-nums"],
|
|
139
|
-
fontFamily: _sharedUi.monoFont
|
|
140
|
-
}
|
|
141
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryDetails;var _QueryDetailsChip=_interopRequireDefault(require("./QueryDetailsChip"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function QueryDetails({query:e}){if(e===void 0){return null}const t=new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.minWidth,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerText,children:"Query Details"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:styles.flexOne,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-key",style:styles.queryKeyText,children:(0,_sharedUi.displayValue)(e.queryKey,true)})}),(0,_jsxRuntime.jsx)(_QueryDetailsChip.default,{query:e,testID:"buoy-rq-detail-status"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Observers:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-observers",style:styles.valueText,children:`${e.getObserversCount()}`})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Last Updated:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-updated",style:styles.valueText,children:`${t}`})]})]})}const styles=_reactNative.StyleSheet.create({minWidth:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:_sharedUi.night.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18,flexShrink:1,backgroundColor:_sharedUi.night.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D"},labelText:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:_sharedUi.monoFont}});
|
|
@@ -1,78 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = QueryDetailsChip;
|
|
7
|
-
var _getQueryStatusLabel = require("../../utils/getQueryStatusLabel");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
const backgroundColors = {
|
|
12
|
-
fresh: _sharedUi.buoyColors.success + "15",
|
|
13
|
-
stale: _sharedUi.buoyColors.warning + "15",
|
|
14
|
-
fetching: _sharedUi.buoyColors.primary + "15",
|
|
15
|
-
paused: _sharedUi.buoyColors.textMuted + "1A",
|
|
16
|
-
noObserver: _sharedUi.buoyColors.textMuted + "1A",
|
|
17
|
-
error: _sharedUi.buoyColors.error + "15",
|
|
18
|
-
inactive: _sharedUi.buoyColors.textMuted + "1A"
|
|
19
|
-
};
|
|
20
|
-
const borderColors = {
|
|
21
|
-
fresh: _sharedUi.buoyColors.success + "33",
|
|
22
|
-
stale: _sharedUi.buoyColors.warning + "33",
|
|
23
|
-
fetching: _sharedUi.buoyColors.primary + "33",
|
|
24
|
-
paused: _sharedUi.buoyColors.textMuted + "33",
|
|
25
|
-
noObserver: _sharedUi.buoyColors.textMuted + "33",
|
|
26
|
-
error: _sharedUi.buoyColors.error + "33",
|
|
27
|
-
inactive: _sharedUi.buoyColors.textMuted + "33"
|
|
28
|
-
};
|
|
29
|
-
const textColors = {
|
|
30
|
-
fresh: _sharedUi.buoyColors.success,
|
|
31
|
-
stale: _sharedUi.buoyColors.warning,
|
|
32
|
-
fetching: _sharedUi.buoyColors.primary,
|
|
33
|
-
paused: _sharedUi.buoyColors.textMuted,
|
|
34
|
-
noObserver: _sharedUi.buoyColors.textMuted,
|
|
35
|
-
error: _sharedUi.buoyColors.error,
|
|
36
|
-
inactive: _sharedUi.buoyColors.textMuted
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Chip component used to display small query metadata values (status, observers, etc.).
|
|
40
|
-
*/
|
|
41
|
-
function QueryDetailsChip({
|
|
42
|
-
query,
|
|
43
|
-
testID
|
|
44
|
-
}) {
|
|
45
|
-
const status = (0, _getQueryStatusLabel.getQueryStatusLabel)(query);
|
|
46
|
-
const backgroundColor = backgroundColors[status];
|
|
47
|
-
const borderColor = borderColors[status];
|
|
48
|
-
const textColor = textColors[status];
|
|
49
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
50
|
-
style: [styles.container, {
|
|
51
|
-
backgroundColor,
|
|
52
|
-
borderColor
|
|
53
|
-
}],
|
|
54
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
55
|
-
testID: testID,
|
|
56
|
-
style: [styles.text, {
|
|
57
|
-
color: textColor
|
|
58
|
-
}],
|
|
59
|
-
children: status
|
|
60
|
-
})
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
const styles = _reactNative.StyleSheet.create({
|
|
64
|
-
container: {
|
|
65
|
-
paddingHorizontal: 8,
|
|
66
|
-
paddingVertical: 4,
|
|
67
|
-
borderWidth: 1,
|
|
68
|
-
borderRadius: 6,
|
|
69
|
-
alignSelf: "flex-start"
|
|
70
|
-
},
|
|
71
|
-
text: {
|
|
72
|
-
fontSize: 11,
|
|
73
|
-
fontWeight: "600",
|
|
74
|
-
textTransform: "uppercase",
|
|
75
|
-
letterSpacing: 0.5,
|
|
76
|
-
fontFamily: _sharedUi.monoFont
|
|
77
|
-
}
|
|
78
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=QueryDetailsChip;var _getQueryStatusLabel=require("../../utils/getQueryStatusLabel");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");const backgroundColors={fresh:_sharedUi.buoyColors.success+"15",stale:_sharedUi.buoyColors.warning+"15",fetching:_sharedUi.buoyColors.primary+"15",paused:_sharedUi.buoyColors.textMuted+"1A",noObserver:_sharedUi.buoyColors.textMuted+"1A",error:_sharedUi.buoyColors.error+"15",inactive:_sharedUi.buoyColors.textMuted+"1A"};const borderColors={fresh:_sharedUi.buoyColors.success+"33",stale:_sharedUi.buoyColors.warning+"33",fetching:_sharedUi.buoyColors.primary+"33",paused:_sharedUi.buoyColors.textMuted+"33",noObserver:_sharedUi.buoyColors.textMuted+"33",error:_sharedUi.buoyColors.error+"33",inactive:_sharedUi.buoyColors.textMuted+"33"};const textColors={fresh:_sharedUi.buoyColors.success,stale:_sharedUi.buoyColors.warning,fetching:_sharedUi.buoyColors.primary,paused:_sharedUi.buoyColors.textMuted,noObserver:_sharedUi.buoyColors.textMuted,error:_sharedUi.buoyColors.error,inactive:_sharedUi.buoyColors.textMuted};function QueryDetailsChip({query:o,testID:r}){const e=(0,_getQueryStatusLabel.getQueryStatusLabel)(o);const t=backgroundColors[e];const s=borderColors[e];const u=textColors[e];return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.container,{backgroundColor:t,borderColor:s}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:r,style:[styles.text,{color:u}],children:e})})}const styles=_reactNative.StyleSheet.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:_sharedUi.monoFont}});
|