@buoy-gg/react-query 7.0.40 → 7.0.42
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 -69
- package/lib/commonjs/checkPeer.js +1 -0
- package/lib/commonjs/checkPeer.web.js +1 -0
- package/lib/commonjs/index.js +1 -736
- 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 -0
- package/lib/module/checkPeer.web.js +1 -0
- package/lib/module/index.js +1 -135
- 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/typescript/checkPeer.d.ts +1 -0
- package/lib/typescript/checkPeer.web.d.ts +2 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/web/index.mjs +11 -0
- package/package.json +36 -12
- 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
package/lib/commonjs/preset.js
CHANGED
|
@@ -1,243 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createReactQueryTool = createReactQueryTool;
|
|
7
|
-
exports.createWifiToggleTool = createWifiToggleTool;
|
|
8
|
-
exports.wifiTogglePreset = exports.reactQueryToolPreset = void 0;
|
|
9
|
-
var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
|
|
10
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
-
var _ReactQueryDevToolsModal = require("./react-query/components/ReactQueryDevToolsModal");
|
|
12
|
-
var _reactQuery = require("@tanstack/react-query");
|
|
13
|
-
var _react = require("react");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
/**
|
|
16
|
-
* Pre-configured React Query devtools for FloatingDevTools
|
|
17
|
-
*
|
|
18
|
-
* This preset provides a zero-config way to add React Query inspection to your dev tools.
|
|
19
|
-
* Just import and add it to your apps array!
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* import { reactQueryToolPreset } from '@buoy-gg/react-query';
|
|
24
|
-
*
|
|
25
|
-
* const installedApps = [
|
|
26
|
-
* reactQueryToolPreset, // That's it!
|
|
27
|
-
* // ...other tools
|
|
28
|
-
* ];
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
// Empty component for toggle-only mode
|
|
33
|
-
const EmptyComponent = () => null;
|
|
34
|
-
|
|
35
|
-
// Save WiFi state to storage
|
|
36
|
-
const saveWifiState = async enabled => {
|
|
37
|
-
try {
|
|
38
|
-
await _sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.settings.wifiEnabled(), enabled.toString());
|
|
39
|
-
} catch (error) {
|
|
40
|
-
// Failed to save WiFi state
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Restore the persisted WiFi state into onlineManager on app load.
|
|
46
|
-
*
|
|
47
|
-
* The toggle is rendered as a `toggle-only` tool whose state lives in
|
|
48
|
-
* `onlineManager`, not in a mounted React component. The `useWifiState` hook
|
|
49
|
-
* only restores when its component (the modal) mounts, so without this the
|
|
50
|
-
* persisted offline state is lost on reload and defaults back to online.
|
|
51
|
-
* Running this at module load ensures the saved state is applied eagerly.
|
|
52
|
-
*/
|
|
53
|
-
const restoreWifiState = async () => {
|
|
54
|
-
try {
|
|
55
|
-
const savedState = await _sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.settings.wifiEnabled());
|
|
56
|
-
if (savedState !== null) {
|
|
57
|
-
_reactQuery.onlineManager.setOnline(savedState === "true");
|
|
58
|
-
}
|
|
59
|
-
} catch (error) {
|
|
60
|
-
// Failed to restore WiFi state
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Eagerly restore persisted WiFi state on import so offline mode survives reloads.
|
|
65
|
-
restoreWifiState();
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* WiFi icon component - uses hooks to subscribe to onlineManager changes.
|
|
69
|
-
*
|
|
70
|
-
* ⚠️ IMPORTANT - DO NOT MODIFY THIS COMPONENT ⚠️
|
|
71
|
-
* This component MUST use useState and useEffect hooks to subscribe to onlineManager.
|
|
72
|
-
* It is rendered as a JSX component (<IconComponent />) in FloatingMenu and DialIcon,
|
|
73
|
-
* which allows hooks to work properly.
|
|
74
|
-
*
|
|
75
|
-
* If you remove the hooks or change this to read onlineManager.isOnline() directly,
|
|
76
|
-
* the icon color will NOT update when the WiFi toggle is pressed.
|
|
77
|
-
*
|
|
78
|
-
* See: FloatingMenu.tsx (renders as <IconComponent />)
|
|
79
|
-
* See: DialIcon.tsx (renders as <icon.iconComponent />)
|
|
80
|
-
*/
|
|
81
|
-
function WifiIcon({
|
|
82
|
-
size
|
|
83
|
-
}) {
|
|
84
|
-
const [isOnline, setIsOnline] = (0, _react.useState)(() => _reactQuery.onlineManager.isOnline());
|
|
85
|
-
(0, _react.useEffect)(() => {
|
|
86
|
-
const unsubscribe = _reactQuery.onlineManager.subscribe(online => {
|
|
87
|
-
setIsOnline(online);
|
|
88
|
-
});
|
|
89
|
-
return unsubscribe;
|
|
90
|
-
}, []);
|
|
91
|
-
const color = isOnline ? "#10B981" : "#DC2626";
|
|
92
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Wifi, {
|
|
93
|
-
size: size,
|
|
94
|
-
color: color
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Pre-configured React Query devtools for FloatingDevTools.
|
|
100
|
-
* Includes:
|
|
101
|
-
* - Query browser and inspector
|
|
102
|
-
* - Mutation tracking
|
|
103
|
-
* - Cache inspection
|
|
104
|
-
* - Query invalidation
|
|
105
|
-
* - Performance monitoring
|
|
106
|
-
*/
|
|
107
|
-
const reactQueryToolPreset = exports.reactQueryToolPreset = {
|
|
108
|
-
id: "query",
|
|
109
|
-
name: "QUERY",
|
|
110
|
-
description: "React Query inspector",
|
|
111
|
-
slot: "both",
|
|
112
|
-
icon: ({
|
|
113
|
-
size
|
|
114
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.QueryIcon, {
|
|
115
|
-
size: size
|
|
116
|
-
}),
|
|
117
|
-
component: _ReactQueryDevToolsModal.ReactQueryDevToolsModal,
|
|
118
|
-
props: {
|
|
119
|
-
enableSharedModalDimensions: false
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Create a custom React Query devtools configuration.
|
|
125
|
-
* Use this if you want to override default settings.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```tsx
|
|
129
|
-
* import { createReactQueryTool } from '@buoy-gg/react-query';
|
|
130
|
-
*
|
|
131
|
-
* const myQueryTool = createReactQueryTool({
|
|
132
|
-
* name: "TANSTACK",
|
|
133
|
-
* colorPreset: "purple",
|
|
134
|
-
* enableSharedModalDimensions: true,
|
|
135
|
-
* });
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
function createReactQueryTool(options) {
|
|
139
|
-
return {
|
|
140
|
-
id: options?.id || "query",
|
|
141
|
-
name: options?.name || "QUERY",
|
|
142
|
-
description: options?.description || "React Query inspector",
|
|
143
|
-
slot: "both",
|
|
144
|
-
icon: ({
|
|
145
|
-
size
|
|
146
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.QueryIcon, {
|
|
147
|
-
size: size
|
|
148
|
-
}),
|
|
149
|
-
component: _ReactQueryDevToolsModal.ReactQueryDevToolsModal,
|
|
150
|
-
props: {
|
|
151
|
-
enableSharedModalDimensions: options?.enableSharedModalDimensions !== undefined ? options.enableSharedModalDimensions : false
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Pre-configured WiFi toggle tool for FloatingDevTools.
|
|
158
|
-
* Allows toggling React Query's online state to simulate offline scenarios.
|
|
159
|
-
* Simple toggle - no modal needed!
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```tsx
|
|
163
|
-
* import { wifiTogglePreset } from '@buoy-gg/react-query';
|
|
164
|
-
*
|
|
165
|
-
* const installedApps = [
|
|
166
|
-
* wifiTogglePreset, // That's it!
|
|
167
|
-
* // ...other tools
|
|
168
|
-
* ];
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
const wifiTogglePreset = exports.wifiTogglePreset = {
|
|
172
|
-
id: "query-wifi-toggle",
|
|
173
|
-
name: "WIFI",
|
|
174
|
-
description: "Toggle React Query online/offline state",
|
|
175
|
-
slot: "row",
|
|
176
|
-
icon: WifiIcon,
|
|
177
|
-
component: EmptyComponent,
|
|
178
|
-
props: {},
|
|
179
|
-
launchMode: "toggle-only",
|
|
180
|
-
onPress: () => {
|
|
181
|
-
const newState = !_reactQuery.onlineManager.isOnline();
|
|
182
|
-
_reactQuery.onlineManager.setOnline(newState);
|
|
183
|
-
saveWifiState(newState);
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Create a custom WiFi toggle tool configuration.
|
|
189
|
-
* Use this if you want to override default settings.
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```tsx
|
|
193
|
-
* import { createWifiToggleTool } from '@buoy-gg/react-query';
|
|
194
|
-
*
|
|
195
|
-
* const myWifiTool = createWifiToggleTool({
|
|
196
|
-
* name: "OFFLINE",
|
|
197
|
-
* onColor: "#10B981",
|
|
198
|
-
* offColor: "#DC2626",
|
|
199
|
-
* });
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
function createWifiToggleTool(options) {
|
|
203
|
-
const onColor = options?.onColor || "#10B981";
|
|
204
|
-
const offColor = options?.offColor || "#DC2626";
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Custom WiFi icon component with hooks - rendered as JSX component.
|
|
208
|
-
*
|
|
209
|
-
* ⚠️ IMPORTANT - DO NOT MODIFY THIS COMPONENT ⚠️
|
|
210
|
-
* This component MUST use useState and useEffect hooks to subscribe to onlineManager.
|
|
211
|
-
* See the comment on WifiIcon above for full explanation.
|
|
212
|
-
*/
|
|
213
|
-
const CustomWifiIcon = ({
|
|
214
|
-
size
|
|
215
|
-
}) => {
|
|
216
|
-
const [isOnline, setIsOnline] = (0, _react.useState)(() => _reactQuery.onlineManager.isOnline());
|
|
217
|
-
(0, _react.useEffect)(() => {
|
|
218
|
-
const unsubscribe = _reactQuery.onlineManager.subscribe(online => {
|
|
219
|
-
setIsOnline(online);
|
|
220
|
-
});
|
|
221
|
-
return unsubscribe;
|
|
222
|
-
}, []);
|
|
223
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Wifi, {
|
|
224
|
-
size: size,
|
|
225
|
-
color: isOnline ? onColor : offColor
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
return {
|
|
229
|
-
id: options?.id || "query-wifi-toggle",
|
|
230
|
-
name: options?.name || "WIFI",
|
|
231
|
-
description: options?.description || "Toggle React Query online/offline state",
|
|
232
|
-
slot: "row",
|
|
233
|
-
icon: CustomWifiIcon,
|
|
234
|
-
component: EmptyComponent,
|
|
235
|
-
props: {},
|
|
236
|
-
launchMode: "toggle-only",
|
|
237
|
-
onPress: () => {
|
|
238
|
-
const newState = !_reactQuery.onlineManager.isOnline();
|
|
239
|
-
_reactQuery.onlineManager.setOnline(newState);
|
|
240
|
-
saveWifiState(newState);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createReactQueryTool=createReactQueryTool;exports.createWifiToggleTool=createWifiToggleTool;exports.wifiTogglePreset=exports.reactQueryToolPreset=void 0;var _floatingToolsCore=require("@buoy-gg/floating-tools-core");var _sharedUi=require("@buoy-gg/shared-ui");var _ReactQueryDevToolsModal=require("./react-query/components/ReactQueryDevToolsModal");var _reactQuery=require("@tanstack/react-query");var _react=require("react");var _jsxRuntime=require("react/jsx-runtime");const EmptyComponent=()=>null;const saveWifiState=async e=>{try{await _sharedUi.persistentStorage.setItem(_sharedUi.devToolsStorageKeys.settings.wifiEnabled(),e.toString())}catch(o){}};const restoreWifiState=async()=>{try{const e=await _sharedUi.persistentStorage.getItem(_sharedUi.devToolsStorageKeys.settings.wifiEnabled());if(e!==null){_reactQuery.onlineManager.setOnline(e==="true")}}catch(e){}};restoreWifiState();function WifiIcon({size:e}){const[o,r]=(0,_react.useState)(()=>_reactQuery.onlineManager.isOnline());(0,_react.useEffect)(()=>{const n=_reactQuery.onlineManager.subscribe(s=>{r(s)});return n},[]);const t=o?"#10B981":"#DC2626";return(0,_jsxRuntime.jsx)(_sharedUi.Wifi,{size:e,color:t})}const reactQueryToolPreset=exports.reactQueryToolPreset={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>(0,_jsxRuntime.jsx)(_floatingToolsCore.QueryIcon,{size:e}),component:_ReactQueryDevToolsModal.ReactQueryDevToolsModal,props:{enableSharedModalDimensions:false}};function createReactQueryTool(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:o})=>(0,_jsxRuntime.jsx)(_floatingToolsCore.QueryIcon,{size:o}),component:_ReactQueryDevToolsModal.ReactQueryDevToolsModal,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:false}}}const wifiTogglePreset=exports.wifiTogglePreset={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:WifiIcon,component:EmptyComponent,props:{},launchMode:"toggle-only",onPress:()=>{const e=!_reactQuery.onlineManager.isOnline();_reactQuery.onlineManager.setOnline(e);saveWifiState(e)}};function createWifiToggleTool(e){const o=e?.onColor||"#10B981";const r=e?.offColor||"#DC2626";const t=({size:n})=>{const[s,i]=(0,_react.useState)(()=>_reactQuery.onlineManager.isOnline());(0,_react.useEffect)(()=>{const a=_reactQuery.onlineManager.subscribe(l=>{i(l)});return a},[]);return(0,_jsxRuntime.jsx)(_sharedUi.Wifi,{size:n,color:s?o:r})};return{id:e?.id||"query-wifi-toggle",name:e?.name||"WIFI",description:e?.description||"Toggle React Query online/offline state",slot:"row",icon:t,component:EmptyComponent,props:{},launchMode:"toggle-only",onPress:()=>{const n=!_reactQuery.onlineManager.isOnline();_reactQuery.onlineManager.setOnline(n);saveWifiState(n)}}}
|
|
@@ -1,317 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DataEditorActionsFooter = DataEditorActionsFooter;
|
|
7
|
-
exports.DataEditorMode = DataEditorMode;
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _reactQuery = require("@tanstack/react-query");
|
|
10
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
-
var _Explorer = _interopRequireDefault(require("./query-browser/Explorer"));
|
|
12
|
-
var _QueryDetails = _interopRequireDefault(require("./query-browser/QueryDetails"));
|
|
13
|
-
var _ActionButton = _interopRequireDefault(require("./query-browser/ActionButton"));
|
|
14
|
-
var _getQueryStatusLabel = require("../utils/getQueryStatusLabel");
|
|
15
|
-
var _useActionButtons = require("../hooks/useActionButtons");
|
|
16
|
-
var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
/**
|
|
20
|
-
* Primary data editing surface displayed inside the React Query modal. Couples the editable
|
|
21
|
-
* explorer, read-only insight panels, and action footer for the selected query.
|
|
22
|
-
*/
|
|
23
|
-
function DataEditorMode({
|
|
24
|
-
selectedQuery,
|
|
25
|
-
isFloatingMode,
|
|
26
|
-
disableInternalFooter = false,
|
|
27
|
-
queryVersion
|
|
28
|
-
}) {
|
|
29
|
-
const insets = (0, _sharedUi.useSafeAreaInsets)({
|
|
30
|
-
minBottom: 16
|
|
31
|
-
});
|
|
32
|
-
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
33
|
-
const actionButtons = (0, _useActionButtons.useActionButtons)(selectedQuery, queryClient, queryVersion);
|
|
34
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
35
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
36
|
-
testID: "buoy-rq-detail-scroll",
|
|
37
|
-
accessibilityLabel: "Data editor mode",
|
|
38
|
-
accessibilityHint: "View data editor mode",
|
|
39
|
-
"sentry-label": "ignore data editor mode",
|
|
40
|
-
style: styles.explorerScrollContainer,
|
|
41
|
-
contentContainerStyle: [styles.explorerScrollContent, !disableInternalFooter && {
|
|
42
|
-
paddingBottom: 72
|
|
43
|
-
}],
|
|
44
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
45
|
-
style: styles.section,
|
|
46
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(DataExplorer, {
|
|
47
|
-
visible: !!selectedQuery.state.data,
|
|
48
|
-
selectedQuery: selectedQuery,
|
|
49
|
-
queryVersion: queryVersion
|
|
50
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(DataEmptyState, {
|
|
51
|
-
visible: !selectedQuery.state.data,
|
|
52
|
-
selectedQuery: selectedQuery
|
|
53
|
-
})]
|
|
54
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
55
|
-
style: styles.section,
|
|
56
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryDetails.default, {
|
|
57
|
-
query: selectedQuery
|
|
58
|
-
})
|
|
59
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
60
|
-
style: styles.section,
|
|
61
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
62
|
-
style: styles.queryExplorerContainer,
|
|
63
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
64
|
-
testID: "buoy-rq-query-explorer-header",
|
|
65
|
-
style: styles.queryExplorerHeader,
|
|
66
|
-
children: "Query Explorer"
|
|
67
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
68
|
-
style: styles.queryExplorerContent,
|
|
69
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
|
|
70
|
-
title: "",
|
|
71
|
-
data: selectedQuery,
|
|
72
|
-
maxDepth: 10,
|
|
73
|
-
rawMode: true,
|
|
74
|
-
showTypeFilter: true,
|
|
75
|
-
initialExpanded: false
|
|
76
|
-
})
|
|
77
|
-
})]
|
|
78
|
-
})
|
|
79
|
-
})]
|
|
80
|
-
}), !disableInternalFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
81
|
-
style: [styles.actionFooter, {
|
|
82
|
-
paddingBottom: isFloatingMode ? 0 : insets.bottom + 8
|
|
83
|
-
}],
|
|
84
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
85
|
-
style: styles.actionsRow,
|
|
86
|
-
children: actionButtons.map((action, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
87
|
-
testID: `buoy-rq-action-${action.variant}`,
|
|
88
|
-
onClick: action.onPress,
|
|
89
|
-
text: action.label,
|
|
90
|
-
variant: action.variant,
|
|
91
|
-
disabled: action.disabled
|
|
92
|
-
}, index))
|
|
93
|
-
})
|
|
94
|
-
})]
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// External footer component for sticky modal footer usage
|
|
99
|
-
/**
|
|
100
|
-
* Standalone footer variant that can be composed into sticky modal layouts while reusing the
|
|
101
|
-
* standard action button arrangement.
|
|
102
|
-
*/
|
|
103
|
-
function DataEditorActionsFooter({
|
|
104
|
-
selectedQuery,
|
|
105
|
-
isFloatingMode,
|
|
106
|
-
queryVersion
|
|
107
|
-
}) {
|
|
108
|
-
const insets = (0, _sharedUi.useSafeAreaInsets)({
|
|
109
|
-
minBottom: 16
|
|
110
|
-
});
|
|
111
|
-
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
112
|
-
const actionButtons = (0, _useActionButtons.useActionButtons)(selectedQuery, queryClient, queryVersion);
|
|
113
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
114
|
-
style: [styles.actionFooter, {
|
|
115
|
-
paddingBottom: isFloatingMode ? 0 : insets.bottom + 8
|
|
116
|
-
}],
|
|
117
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
118
|
-
style: styles.actionsRow,
|
|
119
|
-
children: actionButtons.map((action, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ActionButton.default, {
|
|
120
|
-
testID: `buoy-rq-action-${action.variant}`,
|
|
121
|
-
onClick: action.onPress,
|
|
122
|
-
text: action.label,
|
|
123
|
-
variant: action.variant,
|
|
124
|
-
disabled: action.disabled
|
|
125
|
-
}, index))
|
|
126
|
-
})
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function DataExplorer({
|
|
130
|
-
visible,
|
|
131
|
-
selectedQuery,
|
|
132
|
-
queryVersion = 0
|
|
133
|
-
}) {
|
|
134
|
-
if (!visible) return null;
|
|
135
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
136
|
-
style: styles.dataContainer,
|
|
137
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
138
|
-
testID: "buoy-rq-data-header",
|
|
139
|
-
style: styles.dataHeader,
|
|
140
|
-
children: "Data Editor"
|
|
141
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
142
|
-
style: styles.dataContent,
|
|
143
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Explorer.default, {
|
|
144
|
-
editable: true,
|
|
145
|
-
label: "Data",
|
|
146
|
-
value: selectedQuery.state.data,
|
|
147
|
-
defaultExpanded: ["Data"],
|
|
148
|
-
activeQuery: selectedQuery,
|
|
149
|
-
dataVersion: queryVersion
|
|
150
|
-
})
|
|
151
|
-
})]
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
function DataEmptyState({
|
|
155
|
-
visible,
|
|
156
|
-
selectedQuery
|
|
157
|
-
}) {
|
|
158
|
-
if (!visible) return null;
|
|
159
|
-
const getEmptyStateContent = () => {
|
|
160
|
-
// Check if query is disabled first
|
|
161
|
-
if (selectedQuery.isDisabled()) {
|
|
162
|
-
return {
|
|
163
|
-
title: "Query Disabled",
|
|
164
|
-
description: "This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
if (selectedQuery.state.status === "pending" || (0, _getQueryStatusLabel.getQueryStatusLabel)(selectedQuery) === "fetching") {
|
|
168
|
-
return {
|
|
169
|
-
title: selectedQuery.state.status === "pending" ? "Loading..." : "Refetching...",
|
|
170
|
-
description: "Please wait while the query is being executed."
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
if (selectedQuery.state.status === "error") {
|
|
174
|
-
return {
|
|
175
|
-
title: "Query Error",
|
|
176
|
-
description: selectedQuery.state.error?.message || "An error occurred while fetching data."
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
title: "No Data Available",
|
|
181
|
-
description: "This query has no data to edit. Try refetching the query first."
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
const {
|
|
185
|
-
title,
|
|
186
|
-
description
|
|
187
|
-
} = getEmptyStateContent();
|
|
188
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
189
|
-
style: styles.emptyState,
|
|
190
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
191
|
-
testID: "buoy-rq-detail-empty-title",
|
|
192
|
-
style: styles.emptyTitle,
|
|
193
|
-
children: title
|
|
194
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
195
|
-
testID: "buoy-rq-detail-empty-description",
|
|
196
|
-
style: styles.emptyDescription,
|
|
197
|
-
children: description
|
|
198
|
-
})]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
const styles = _reactNative.StyleSheet.create({
|
|
202
|
-
// Explorer section
|
|
203
|
-
explorerScrollContainer: {
|
|
204
|
-
flex: 1
|
|
205
|
-
},
|
|
206
|
-
explorerScrollContent: {
|
|
207
|
-
paddingBottom: 16,
|
|
208
|
-
paddingHorizontal: 8,
|
|
209
|
-
flexGrow: 1
|
|
210
|
-
},
|
|
211
|
-
// Section layout matching QueryInformation
|
|
212
|
-
section: {
|
|
213
|
-
marginBottom: 16
|
|
214
|
-
},
|
|
215
|
-
// Empty states matching main dev tools
|
|
216
|
-
emptyState: {
|
|
217
|
-
flex: 1,
|
|
218
|
-
justifyContent: "center",
|
|
219
|
-
alignItems: "center",
|
|
220
|
-
padding: 32
|
|
221
|
-
},
|
|
222
|
-
emptyTitle: {
|
|
223
|
-
color: _sharedUi.night.color.text,
|
|
224
|
-
fontSize: 18,
|
|
225
|
-
fontWeight: "600",
|
|
226
|
-
marginBottom: 8,
|
|
227
|
-
textAlign: "center"
|
|
228
|
-
},
|
|
229
|
-
emptyDescription: {
|
|
230
|
-
color: _sharedUi.night.color.textSecondary,
|
|
231
|
-
fontSize: 14,
|
|
232
|
-
textAlign: "center",
|
|
233
|
-
lineHeight: 20,
|
|
234
|
-
maxWidth: 280
|
|
235
|
-
},
|
|
236
|
-
// Action footer - compact single row layout
|
|
237
|
-
actionFooter: {
|
|
238
|
-
borderTopWidth: 1,
|
|
239
|
-
borderTopColor: _sharedUi.night.color.border,
|
|
240
|
-
paddingTop: 8,
|
|
241
|
-
paddingHorizontal: 12,
|
|
242
|
-
// Transparent so the night sheet's star field shows through.
|
|
243
|
-
backgroundColor: "transparent",
|
|
244
|
-
borderBottomLeftRadius: 14,
|
|
245
|
-
borderBottomRightRadius: 14
|
|
246
|
-
},
|
|
247
|
-
actionsRow: {
|
|
248
|
-
flexDirection: "row",
|
|
249
|
-
alignItems: "center",
|
|
250
|
-
gap: 8
|
|
251
|
-
},
|
|
252
|
-
// Query Explorer styled container matching QueryDetails
|
|
253
|
-
queryExplorerContainer: {
|
|
254
|
-
minWidth: 200,
|
|
255
|
-
backgroundColor: _sharedUi.night.color.surface,
|
|
256
|
-
borderRadius: 6,
|
|
257
|
-
borderWidth: 1,
|
|
258
|
-
borderColor: _sharedUi.night.color.accent + "4D",
|
|
259
|
-
overflow: "hidden",
|
|
260
|
-
shadowColor: _sharedUi.night.color.accent,
|
|
261
|
-
shadowOffset: {
|
|
262
|
-
width: 0,
|
|
263
|
-
height: 0
|
|
264
|
-
},
|
|
265
|
-
shadowOpacity: 0.1,
|
|
266
|
-
shadowRadius: 6
|
|
267
|
-
},
|
|
268
|
-
queryExplorerHeader: {
|
|
269
|
-
backgroundColor: _sharedUi.night.color.accent + "1A",
|
|
270
|
-
paddingHorizontal: 12,
|
|
271
|
-
paddingVertical: 10,
|
|
272
|
-
fontWeight: "600",
|
|
273
|
-
fontSize: 12,
|
|
274
|
-
color: _sharedUi.night.color.accent,
|
|
275
|
-
borderBottomWidth: 1,
|
|
276
|
-
borderBottomColor: _sharedUi.night.color.accent + "33",
|
|
277
|
-
letterSpacing: 0.5,
|
|
278
|
-
textTransform: "uppercase",
|
|
279
|
-
fontFamily: _sharedUi.monoFont
|
|
280
|
-
},
|
|
281
|
-
queryExplorerContent: {
|
|
282
|
-
padding: 8
|
|
283
|
-
},
|
|
284
|
-
// Data section with teal accent - editable/success theme
|
|
285
|
-
dataContainer: {
|
|
286
|
-
minWidth: 200,
|
|
287
|
-
backgroundColor: _sharedUi.night.color.surface,
|
|
288
|
-
borderRadius: 6,
|
|
289
|
-
borderWidth: 1,
|
|
290
|
-
borderColor: _sharedUi.night.color.accent + "4D",
|
|
291
|
-
overflow: "hidden",
|
|
292
|
-
shadowColor: _sharedUi.night.color.accent,
|
|
293
|
-
shadowOffset: {
|
|
294
|
-
width: 0,
|
|
295
|
-
height: 0
|
|
296
|
-
},
|
|
297
|
-
shadowOpacity: 0.1,
|
|
298
|
-
shadowRadius: 6,
|
|
299
|
-
marginTop: 8
|
|
300
|
-
},
|
|
301
|
-
dataHeader: {
|
|
302
|
-
backgroundColor: _sharedUi.night.color.accent + "1A",
|
|
303
|
-
paddingHorizontal: 12,
|
|
304
|
-
paddingVertical: 10,
|
|
305
|
-
fontWeight: "600",
|
|
306
|
-
fontSize: 12,
|
|
307
|
-
color: _sharedUi.night.color.accent,
|
|
308
|
-
borderBottomWidth: 1,
|
|
309
|
-
borderBottomColor: _sharedUi.night.color.accent + "33",
|
|
310
|
-
letterSpacing: 0.5,
|
|
311
|
-
textTransform: "uppercase",
|
|
312
|
-
fontFamily: _sharedUi.monoFont
|
|
313
|
-
},
|
|
314
|
-
dataContent: {
|
|
315
|
-
padding: 8
|
|
316
|
-
}
|
|
317
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DataEditorActionsFooter=DataEditorActionsFooter;exports.DataEditorMode=DataEditorMode;var _reactNative=require("react-native");var _reactQuery=require("@tanstack/react-query");var _sharedUi=require("@buoy-gg/shared-ui");var _Explorer=_interopRequireDefault(require("./query-browser/Explorer"));var _QueryDetails=_interopRequireDefault(require("./query-browser/QueryDetails"));var _ActionButton=_interopRequireDefault(require("./query-browser/ActionButton"));var _getQueryStatusLabel=require("../utils/getQueryStatusLabel");var _useActionButtons=require("../hooks/useActionButtons");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function DataEditorMode({selectedQuery:t,isFloatingMode:e,disableInternalFooter:r=false,queryVersion:a}){const n=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const s=(0,_reactQuery.useQueryClient)();const o=(0,_useActionButtons.useActionButtons)(t,s,a);return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:styles.explorerScrollContainer,contentContainerStyle:[styles.explorerScrollContent,!r&&{paddingBottom:72}],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(DataExplorer,{visible:!!t.state.data,selectedQuery:t,queryVersion:a}),(0,_jsxRuntime.jsx)(DataEmptyState,{visible:!t.state.data,selectedQuery:t})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsx)(_QueryDetails.default,{query:t})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.queryExplorerContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-query-explorer-header",style:styles.queryExplorerHeader,children:"Query Explorer"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.queryExplorerContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:n.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:o.map((i,l)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${i.variant}`,onClick:i.onPress,text:i.label,variant:i.variant,disabled:i.disabled},l))})})]})}function DataEditorActionsFooter({selectedQuery:t,isFloatingMode:e,queryVersion:r}){const a=(0,_sharedUi.useSafeAreaInsets)({minBottom:16});const n=(0,_reactQuery.useQueryClient)();const s=(0,_useActionButtons.useActionButtons)(t,n,r);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionFooter,{paddingBottom:e?0:a.bottom+8}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:s.map((o,i)=>(0,_jsxRuntime.jsx)(_ActionButton.default,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},i))})})}function DataExplorer({visible:t,selectedQuery:e,queryVersion:r=0}){if(!t)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-data-header",style:styles.dataHeader,children:"Data Editor"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"Data",value:e.state.data,defaultExpanded:["Data"],activeQuery:e,dataVersion:r})})]})}function DataEmptyState({visible:t,selectedQuery:e}){if(!t)return null;const r=()=>{if(e.isDisabled()){return{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}}if(e.state.status==="pending"||(0,_getQueryStatusLabel.getQueryStatusLabel)(e)==="fetching"){return{title:e.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}}if(e.state.status==="error"){return{title:"Query Error",description:e.state.error?.message||"An error occurred while fetching data."}}return{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."}};const{title:a,description:n}=r();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.emptyState,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-empty-title",style:styles.emptyTitle,children:a}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-rq-detail-empty-description",style:styles.emptyDescription,children:n})]})}const styles=_reactNative.StyleSheet.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:_sharedUi.night.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:_sharedUi.night.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{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},queryExplorerHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",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},queryExplorerContent:{padding:8},dataContainer:{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,marginTop:8},dataHeader:{backgroundColor:_sharedUi.night.color.accent+"1A",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},dataContent:{padding:8}});
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FilterStatusBadge = FilterStatusBadge;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
/**
|
|
11
|
-
* Compact badge showing filter status (e.g., "Showing 5 of 12")
|
|
12
|
-
* Displayed below the header when filters are active
|
|
13
|
-
*/
|
|
14
|
-
function FilterStatusBadge({
|
|
15
|
-
totalCount,
|
|
16
|
-
filteredCount,
|
|
17
|
-
onPress
|
|
18
|
-
}) {
|
|
19
|
-
// Don't show if no filtering is happening
|
|
20
|
-
if (filteredCount === totalCount) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
24
|
-
style: styles.container,
|
|
25
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
26
|
-
testID: "buoy-rq-filter-badge",
|
|
27
|
-
style: styles.text,
|
|
28
|
-
children: ["Showing ", filteredCount, " of ", totalCount]
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
if (onPress) {
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
33
|
-
testID: "buoy-rq-filter-badge-button",
|
|
34
|
-
accessibilityRole: "button",
|
|
35
|
-
accessibilityLabel: `Showing ${filteredCount} of ${totalCount}, open filters`,
|
|
36
|
-
onPress: onPress,
|
|
37
|
-
activeOpacity: 0.7,
|
|
38
|
-
children: content
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return content;
|
|
42
|
-
}
|
|
43
|
-
const styles = _reactNative.StyleSheet.create({
|
|
44
|
-
container: {
|
|
45
|
-
flexDirection: "row",
|
|
46
|
-
alignItems: "center",
|
|
47
|
-
justifyContent: "center",
|
|
48
|
-
paddingVertical: 2
|
|
49
|
-
},
|
|
50
|
-
text: {
|
|
51
|
-
fontSize: 9,
|
|
52
|
-
color: _sharedUi.night.color.textTertiary,
|
|
53
|
-
fontFamily: _sharedUi.monoFont
|
|
54
|
-
}
|
|
55
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FilterStatusBadge=FilterStatusBadge;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function FilterStatusBadge({totalCount:e,filteredCount:t,onPress:r}){if(t===e){return null}const i=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{testID:"buoy-rq-filter-badge",style:styles.text,children:["Showing ",t," of ",e]})});if(r){return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${t} of ${e}, open filters`,onPress:r,activeOpacity:.7,children:i})}return i}const styles=_reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont}});
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MutationBrowserMode = MutationBrowserMode;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _MutationsList = _interopRequireDefault(require("./query-browser/MutationsList"));
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
/**
|
|
12
|
-
* Layout wrapper that renders the mutation list alongside selection handling glue logic used by
|
|
13
|
-
* the React Query modal.
|
|
14
|
-
*/
|
|
15
|
-
function MutationBrowserMode({
|
|
16
|
-
selectedMutation,
|
|
17
|
-
onMutationSelect,
|
|
18
|
-
activeFilter,
|
|
19
|
-
searchText = ""
|
|
20
|
-
}) {
|
|
21
|
-
// Convert function to Dispatch compatible format
|
|
22
|
-
const handleMutationSelect = action => {
|
|
23
|
-
if (typeof action === "function") {
|
|
24
|
-
onMutationSelect(action(selectedMutation));
|
|
25
|
-
} else {
|
|
26
|
-
onMutationSelect(action);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
30
|
-
style: styles.mutationListContainer,
|
|
31
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MutationsList.default, {
|
|
32
|
-
selectedMutation: selectedMutation,
|
|
33
|
-
setSelectedMutation: handleMutationSelect,
|
|
34
|
-
activeFilter: activeFilter,
|
|
35
|
-
searchText: searchText,
|
|
36
|
-
hideInfoPanel: true,
|
|
37
|
-
contentContainerStyle: styles.mutationListContent
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
const styles = _reactNative.StyleSheet.create({
|
|
42
|
-
mutationListContainer: {
|
|
43
|
-
flex: 1,
|
|
44
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
45
|
-
backgroundColor: "transparent"
|
|
46
|
-
},
|
|
47
|
-
mutationListContent: {
|
|
48
|
-
padding: 8,
|
|
49
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
50
|
-
backgroundColor: "transparent"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.MutationBrowserMode=MutationBrowserMode;var _reactNative=require("react-native");var _MutationsList=_interopRequireDefault(require("./query-browser/MutationsList"));var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function MutationBrowserMode({selectedMutation:t,onMutationSelect:r,activeFilter:n,searchText:i=""}){const o=e=>{if(typeof e==="function"){r(e(t))}else{r(e)}};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.mutationListContainer,children:(0,_jsxRuntime.jsx)(_MutationsList.default,{selectedMutation:t,setSelectedMutation:o,activeFilter:n,searchText:i,hideInfoPanel:true,contentContainerStyle:styles.mutationListContent})})}const styles=_reactNative.StyleSheet.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});
|