@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,99 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { JsModal, devToolsStorageKeys, useSafeAreaInsets } from "@buoy-gg/shared-ui";
|
|
4
|
-
import { useGetQueryByQueryKeyWithVersion } from "../../hooks/useSelectedQuery";
|
|
5
|
-
import { ReactQueryModalHeader } from "./ReactQueryModalHeader";
|
|
6
|
-
import { DataEditorMode, DataEditorActionsFooter } from "../DataEditorMode";
|
|
7
|
-
import { useState, useCallback, useEffect, useRef } from "react";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
/**
|
|
10
|
-
* Specialized modal for data editing following "Decompose by Responsibility"
|
|
11
|
-
* Single purpose: Display data editor when a query is selected
|
|
12
|
-
*/
|
|
13
|
-
export function DataEditorModal({
|
|
14
|
-
visible,
|
|
15
|
-
selectedQueryKey,
|
|
16
|
-
onQuerySelect,
|
|
17
|
-
onClose,
|
|
18
|
-
onMinimize,
|
|
19
|
-
enableSharedModalDimensions = false,
|
|
20
|
-
onTabChange
|
|
21
|
-
}) {
|
|
22
|
-
const {
|
|
23
|
-
query: selectedQuery,
|
|
24
|
-
version: queryVersion
|
|
25
|
-
} = useGetQueryByQueryKeyWithVersion(selectedQueryKey);
|
|
26
|
-
const [modalMode, setModalMode] = useState("bottomSheet");
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Fall back to the list when the selected query leaves the cache — a
|
|
30
|
-
* removal, a cache clear, or garbage collection. Same failure as the
|
|
31
|
-
* mutation editor: the key that selected it is still set, so this modal
|
|
32
|
-
* bails out and the browser stays hidden behind it, leaving an "open" tool
|
|
33
|
-
* with nothing on screen. The ref covers the tick before the subscription
|
|
34
|
-
* has resolved the query, when undefined does not yet mean gone.
|
|
35
|
-
*/
|
|
36
|
-
const currentQueryKey = selectedQueryKey ? JSON.stringify(selectedQueryKey) : undefined;
|
|
37
|
-
const seenQueryKey = useRef(undefined);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (selectedQuery) {
|
|
40
|
-
seenQueryKey.current = currentQueryKey;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
// Keyed to THIS query for the same reason as the mutation editor: the
|
|
44
|
-
// last-seen key outlives the detail view, so an un-keyed check would fire
|
|
45
|
-
// on the next selection before its lookup has resolved.
|
|
46
|
-
if (visible && seenQueryKey.current !== undefined && seenQueryKey.current === currentQueryKey) {
|
|
47
|
-
seenQueryKey.current = undefined;
|
|
48
|
-
onQuerySelect(undefined);
|
|
49
|
-
}
|
|
50
|
-
}, [visible, selectedQuery, currentQueryKey, onQuerySelect]);
|
|
51
|
-
const handleModeChange = useCallback(mode => {
|
|
52
|
-
setModalMode(mode);
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
// JsModal overlays the footer on the content and only reserves `footerHeight`
|
|
56
|
-
// of padding beneath it. DataEditorActionsFooter pads its bottom with
|
|
57
|
-
// `insets.bottom + 8` when docked, so the reserve must grow by the same
|
|
58
|
-
// amount or the editor bottom hides behind the footer.
|
|
59
|
-
const insets = useSafeAreaInsets({
|
|
60
|
-
minBottom: 16
|
|
61
|
-
});
|
|
62
|
-
const footerHeight = modalMode === "floating" ? 72 : 80 + insets.bottom;
|
|
63
|
-
const renderHeaderContent = () => /*#__PURE__*/_jsx(ReactQueryModalHeader, {
|
|
64
|
-
selectedQuery: selectedQuery,
|
|
65
|
-
activeTab: "queries",
|
|
66
|
-
onTabChange: onTabChange,
|
|
67
|
-
onBack: () => onQuerySelect(undefined)
|
|
68
|
-
});
|
|
69
|
-
const storagePrefix = enableSharedModalDimensions ? devToolsStorageKeys.reactQuery.modal() : `${devToolsStorageKeys.reactQuery.modal()}_data_editor`;
|
|
70
|
-
if (!visible || !selectedQuery) return null;
|
|
71
|
-
const footerNode = /*#__PURE__*/_jsx(DataEditorActionsFooter, {
|
|
72
|
-
selectedQuery: selectedQuery,
|
|
73
|
-
isFloatingMode: modalMode === "floating",
|
|
74
|
-
queryVersion: queryVersion
|
|
75
|
-
}, `footer-${queryVersion}`);
|
|
76
|
-
return /*#__PURE__*/_jsx(JsModal, {
|
|
77
|
-
visible: visible,
|
|
78
|
-
onClose: onClose,
|
|
79
|
-
onMinimize: onMinimize,
|
|
80
|
-
persistenceKey: storagePrefix,
|
|
81
|
-
header: {
|
|
82
|
-
customContent: renderHeaderContent(),
|
|
83
|
-
showToggleButton: true
|
|
84
|
-
},
|
|
85
|
-
onModeChange: handleModeChange,
|
|
86
|
-
enablePersistence: true,
|
|
87
|
-
initialMode: "bottomSheet",
|
|
88
|
-
enableGlitchEffects: true,
|
|
89
|
-
styles: {},
|
|
90
|
-
footer: footerNode,
|
|
91
|
-
footerHeight: footerHeight,
|
|
92
|
-
children: /*#__PURE__*/_jsx(DataEditorMode, {
|
|
93
|
-
selectedQuery: selectedQuery,
|
|
94
|
-
isFloatingMode: modalMode === "floating",
|
|
95
|
-
disableInternalFooter: true,
|
|
96
|
-
queryVersion: queryVersion
|
|
97
|
-
})
|
|
98
|
-
});
|
|
99
|
-
}
|
|
1
|
+
"use strict";import{JsModal as q,devToolsStorageKeys as u,useSafeAreaInsets as E}from"@buoy-gg/shared-ui";import{useGetQueryByQueryKeyWithVersion as x}from"../../hooks/useSelectedQuery";import{ReactQueryModalHeader as B}from"./ReactQueryModalHeader";import{DataEditorMode as F,DataEditorActionsFooter as H}from"../DataEditorMode";import{useState as S,useCallback as T,useEffect as V,useRef as D}from"react";import{jsx as r}from"react/jsx-runtime";export function DataEditorModal({visible:t,selectedQueryKey:n,onQuerySelect:s,onClose:f,onMinimize:c,enableSharedModalDimensions:l=false,onTabChange:m}){const{query:e,version:i}=x(n);const[a,y]=S("bottomSheet");const d=n?JSON.stringify(n):void 0;const o=D(void 0);V(()=>{if(e){o.current=d;return}if(t&&o.current!==void 0&&o.current===d){o.current=void 0;s(void 0)}},[t,e,d,s]);const g=T(Q=>{y(Q)},[]);const h=E({minBottom:16});const M=a==="floating"?72:80+h.bottom;const p=()=>r(B,{selectedQuery:e,activeTab:"queries",onTabChange:m,onBack:()=>s(void 0)});const b=l?u.reactQuery.modal():`${u.reactQuery.modal()}_data_editor`;if(!t||!e)return null;const C=r(H,{selectedQuery:e,isFloatingMode:a==="floating",queryVersion:i},`footer-${i}`);return r(q,{visible:t,onClose:f,onMinimize:c,persistenceKey:b,header:{customContent:p(),showToggleButton:true},onModeChange:g,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:C,footerHeight:M,children:r(F,{selectedQuery:e,isFloatingMode:a==="floating",disableInternalFooter:true,queryVersion:i})})}
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { View, StyleSheet } from "react-native";
|
|
4
|
-
import { ToolFooter, useSafeAreaInsets } from "@buoy-gg/shared-ui";
|
|
5
|
-
import MutationStatusCount from "../query-browser/MutationStatusCount";
|
|
6
|
-
import { useMemo } from "react";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
/**
|
|
9
|
-
* Footer component for MutationBrowserModal following composition principles
|
|
10
|
-
*
|
|
11
|
-
* Applied principles:
|
|
12
|
-
* - Decompose by Responsibility: Dedicated footer component for mutation filter controls
|
|
13
|
-
* - Prefer Composition over Configuration: Specialized footer matching DataEditorMode pattern
|
|
14
|
-
* - Extract Reusable Logic: Consistent footer styling across modal types
|
|
15
|
-
*/
|
|
16
|
-
export function MutationBrowserFooter({
|
|
17
|
-
activeFilter,
|
|
18
|
-
onFilterChange,
|
|
19
|
-
modalMode,
|
|
20
|
-
size = "default"
|
|
21
|
-
}) {
|
|
22
|
-
const isFloatingMode = modalMode === "floating";
|
|
23
|
-
const insets = useSafeAreaInsets({
|
|
24
|
-
minBottom: 16
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Use useMemo to ensure paddingBottom is recalculated when isFloatingMode changes
|
|
28
|
-
const paddingBottom = useMemo(() => {
|
|
29
|
-
return !isFloatingMode ? insets.bottom : 0;
|
|
30
|
-
}, [isFloatingMode, insets.bottom]);
|
|
31
|
-
return /*#__PURE__*/_jsx(ToolFooter, {
|
|
32
|
-
// Force re-render with key change
|
|
33
|
-
floating: isFloatingMode,
|
|
34
|
-
safeArea: false,
|
|
35
|
-
paddingBottom: paddingBottom,
|
|
36
|
-
style: styles.filterFooter,
|
|
37
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
38
|
-
style: styles.filterContainer,
|
|
39
|
-
children: /*#__PURE__*/_jsx(MutationStatusCount, {
|
|
40
|
-
activeFilter: activeFilter,
|
|
41
|
-
onFilterChange: onFilterChange,
|
|
42
|
-
size: size
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
}, `footer-${isFloatingMode ? "floating" : "docked"}`);
|
|
46
|
-
}
|
|
47
|
-
const styles = StyleSheet.create({
|
|
48
|
-
filterFooter: {
|
|
49
|
-
paddingTop: 8,
|
|
50
|
-
paddingHorizontal: 0
|
|
51
|
-
},
|
|
52
|
-
filterContainer: {
|
|
53
|
-
minHeight: 32,
|
|
54
|
-
justifyContent: "center"
|
|
55
|
-
}
|
|
56
|
-
});
|
|
1
|
+
"use strict";import{View as f,StyleSheet as m}from"react-native";import{ToolFooter as d,useSafeAreaInsets as c}from"@buoy-gg/shared-ui";import u from"../query-browser/MutationStatusCount";import{useMemo as p}from"react";import{jsx as o}from"react/jsx-runtime";export function MutationBrowserFooter({activeFilter:i,onFilterChange:n,modalMode:s,size:a="default"}){const t=s==="floating";const e=c({minBottom:16});const l=p(()=>{return!t?e.bottom:0},[t,e.bottom]);return o(d,{floating:t,safeArea:false,paddingBottom:l,style:r.filterFooter,children:o(f,{style:r.filterContainer,children:o(u,{activeFilter:i,onFilterChange:n,size:a})})},`footer-${t?"floating":"docked"}`)}const r=m.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});
|
|
@@ -1,161 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
import { useCallback, useState, useRef } from "react";
|
|
5
|
-
import { useGetMutationById } from "../../hooks/useSelectedMutation";
|
|
6
|
-
import { MutationBrowserMode } from "../MutationBrowserMode";
|
|
7
|
-
import { MutationBrowserFooter } from "./MutationBrowserFooter";
|
|
8
|
-
import { JsModal, useSafeAreaInsets } from "@buoy-gg/shared-ui";
|
|
9
|
-
import { ReactQueryModalHeader } from "./ReactQueryModalHeader";
|
|
10
|
-
import { View, Animated, PanResponder } from "react-native";
|
|
11
|
-
import { SwipeIndicator } from "./SwipeIndicator";
|
|
12
|
-
import { devToolsStorageKeys } from "@buoy-gg/shared-ui";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
/**
|
|
15
|
-
* Specialized modal wrapper for browsing mutations. Handles persistence, swipe gestures, and
|
|
16
|
-
* filter coordination before delegating to the underlying list view.
|
|
17
|
-
*/
|
|
18
|
-
export function MutationBrowserModal({
|
|
19
|
-
visible,
|
|
20
|
-
selectedMutationId,
|
|
21
|
-
onMutationSelect,
|
|
22
|
-
onClose,
|
|
23
|
-
onMinimize,
|
|
24
|
-
activeFilter: externalActiveFilter,
|
|
25
|
-
onFilterChange: externalOnFilterChange,
|
|
26
|
-
onTabChange,
|
|
27
|
-
enableSharedModalDimensions = false,
|
|
28
|
-
searchText = "",
|
|
29
|
-
onSearchChange
|
|
30
|
-
}) {
|
|
31
|
-
const queryClient = useQueryClient();
|
|
32
|
-
const selectedMutation = useGetMutationById(selectedMutationId);
|
|
33
|
-
const [internalActiveFilter, setInternalActiveFilter] = useState(null);
|
|
34
|
-
const activeFilter = externalActiveFilter ?? internalActiveFilter;
|
|
35
|
-
const setActiveFilter = externalOnFilterChange ?? setInternalActiveFilter;
|
|
36
|
-
|
|
37
|
-
// Clear mutation cache handler
|
|
38
|
-
const handleClearCache = useCallback(() => {
|
|
39
|
-
queryClient.getMutationCache().clear();
|
|
40
|
-
onMutationSelect(undefined);
|
|
41
|
-
}, [queryClient, onMutationSelect]);
|
|
42
|
-
|
|
43
|
-
// Track modal mode for conditional styling
|
|
44
|
-
// Initialize with bottomSheet but it will be updated from persisted state if available
|
|
45
|
-
const [modalMode, setModalMode] = useState("bottomSheet");
|
|
46
|
-
const storagePrefix = enableSharedModalDimensions ? devToolsStorageKeys.reactQuery.modal() : devToolsStorageKeys.reactQuery.mutationModal();
|
|
47
|
-
|
|
48
|
-
// Animated value for gesture tracking [[memory:4875251]]
|
|
49
|
-
const translationX = useRef(new Animated.Value(0)).current;
|
|
50
|
-
const handleSwipeNavigation = useCallback(direction => {
|
|
51
|
-
if (direction === "right") {
|
|
52
|
-
onTabChange("queries");
|
|
53
|
-
}
|
|
54
|
-
}, [onTabChange]);
|
|
55
|
-
const handleModeChange = useCallback(mode => {
|
|
56
|
-
setModalMode(mode);
|
|
57
|
-
}, []);
|
|
58
|
-
|
|
59
|
-
// JsModal overlays the footer on the content and only reserves `footerHeight`
|
|
60
|
-
// of padding beneath it. MutationBrowserFooter grows by the safe-area inset
|
|
61
|
-
// when docked, so the reserve must track that or the list bottom hides
|
|
62
|
-
// behind the footer.
|
|
63
|
-
const insets = useSafeAreaInsets({
|
|
64
|
-
minBottom: 16
|
|
65
|
-
});
|
|
66
|
-
const footerHeight = modalMode === "floating" ? 56 : 48 + insets.bottom;
|
|
67
|
-
|
|
68
|
-
// Create PanResponder for swipe navigation
|
|
69
|
-
const panResponder = useRef(PanResponder.create({
|
|
70
|
-
onStartShouldSetPanResponder: () => false,
|
|
71
|
-
onMoveShouldSetPanResponder: (evt, gestureState) => {
|
|
72
|
-
// Only capture horizontal swipes
|
|
73
|
-
return Math.abs(gestureState.dx) > 5 && Math.abs(gestureState.dy) < 10;
|
|
74
|
-
},
|
|
75
|
-
onPanResponderMove: (evt, gestureState) => {
|
|
76
|
-
// Update translation for visual feedback
|
|
77
|
-
translationX.setValue(gestureState.dx);
|
|
78
|
-
},
|
|
79
|
-
onPanResponderRelease: (evt, gestureState) => {
|
|
80
|
-
const {
|
|
81
|
-
dx,
|
|
82
|
-
vx
|
|
83
|
-
} = gestureState;
|
|
84
|
-
const swipeThreshold = 80; // Match EDGE_THRESHOLD from SwipeIndicator
|
|
85
|
-
const velocityThreshold = 0.5;
|
|
86
|
-
|
|
87
|
-
// Reset visual feedback with spring animation
|
|
88
|
-
Animated.spring(translationX, {
|
|
89
|
-
toValue: 0,
|
|
90
|
-
useNativeDriver: true
|
|
91
|
-
}).start();
|
|
92
|
-
if (Math.abs(dx) > swipeThreshold || Math.abs(vx) > velocityThreshold) {
|
|
93
|
-
if (dx > 0 || vx > 0) {
|
|
94
|
-
handleSwipeNavigation("right");
|
|
95
|
-
} else {
|
|
96
|
-
handleSwipeNavigation("left");
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
onPanResponderTerminate: () => {
|
|
101
|
-
// Reset on termination
|
|
102
|
-
Animated.spring(translationX, {
|
|
103
|
-
toValue: 0,
|
|
104
|
-
useNativeDriver: true
|
|
105
|
-
}).start();
|
|
106
|
-
}
|
|
107
|
-
})).current;
|
|
108
|
-
if (!visible) return null;
|
|
109
|
-
const renderHeaderContent = () => /*#__PURE__*/_jsx(ReactQueryModalHeader, {
|
|
110
|
-
selectedMutation: selectedMutation,
|
|
111
|
-
activeTab: "mutations",
|
|
112
|
-
onTabChange: onTabChange,
|
|
113
|
-
onBack: () => onMutationSelect(undefined),
|
|
114
|
-
searchText: searchText,
|
|
115
|
-
onSearchChange: onSearchChange,
|
|
116
|
-
onClearCache: handleClearCache
|
|
117
|
-
});
|
|
118
|
-
const footerNode = /*#__PURE__*/_jsx(MutationBrowserFooter, {
|
|
119
|
-
activeFilter: activeFilter,
|
|
120
|
-
onFilterChange: setActiveFilter,
|
|
121
|
-
modalMode: modalMode
|
|
122
|
-
});
|
|
123
|
-
return /*#__PURE__*/_jsx(JsModal, {
|
|
124
|
-
visible: visible,
|
|
125
|
-
onClose: onClose,
|
|
126
|
-
onMinimize: onMinimize,
|
|
127
|
-
persistenceKey: storagePrefix,
|
|
128
|
-
header: {
|
|
129
|
-
customContent: renderHeaderContent(),
|
|
130
|
-
showToggleButton: true
|
|
131
|
-
},
|
|
132
|
-
onModeChange: handleModeChange,
|
|
133
|
-
enablePersistence: true,
|
|
134
|
-
initialMode: "bottomSheet",
|
|
135
|
-
enableGlitchEffects: true,
|
|
136
|
-
styles: {},
|
|
137
|
-
footer: footerNode,
|
|
138
|
-
footerHeight: footerHeight,
|
|
139
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
140
|
-
style: {
|
|
141
|
-
flex: 1
|
|
142
|
-
},
|
|
143
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
144
|
-
...panResponder.panHandlers,
|
|
145
|
-
style: {
|
|
146
|
-
flex: 1
|
|
147
|
-
},
|
|
148
|
-
children: [/*#__PURE__*/_jsx(SwipeIndicator, {
|
|
149
|
-
translationX: translationX,
|
|
150
|
-
canSwipeLeft: false,
|
|
151
|
-
canSwipeRight: true
|
|
152
|
-
}), /*#__PURE__*/_jsx(MutationBrowserMode, {
|
|
153
|
-
selectedMutation: selectedMutation,
|
|
154
|
-
onMutationSelect: onMutationSelect,
|
|
155
|
-
activeFilter: activeFilter,
|
|
156
|
-
searchText: searchText
|
|
157
|
-
})]
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
}
|
|
1
|
+
"use strict";import{useQueryClient as X}from"@tanstack/react-query";import{useCallback as s,useState as v,useRef as g}from"react";import{useGetMutationById as _}from"../../hooks/useSelectedMutation";import{MutationBrowserMode as z}from"../MutationBrowserMode";import{MutationBrowserFooter as E}from"./MutationBrowserFooter";import{JsModal as J,useSafeAreaInsets as L}from"@buoy-gg/shared-ui";import{ReactQueryModalHeader as O}from"./ReactQueryModalHeader";import{View as C,Animated as i,PanResponder as U}from"react-native";import{SwipeIndicator as W}from"./SwipeIndicator";import{devToolsStorageKeys as x}from"@buoy-gg/shared-ui";import{jsx as o,jsxs as Y}from"react/jsx-runtime";export function MutationBrowserModal({visible:l,selectedMutationId:y,onMutationSelect:r,onClose:S,onMinimize:w,activeFilter:R,onFilterChange:b,onTabChange:a,enableSharedModalDimensions:F=false,searchText:c="",onSearchChange:P}){const d=X();const u=_(y);const[B,T]=v(null);const m=R??B;const A=b??T;const H=s(()=>{d.getMutationCache().clear();r(void 0)},[d,r]);const[f,V]=v("bottomSheet");const j=F?x.reactQuery.modal():x.reactQuery.mutationModal();const n=g(new i.Value(0)).current;const h=s(e=>{if(e==="right"){a("queries")}},[a]);const I=s(e=>{V(e)},[]);const N=L({minBottom:16});const Q=f==="floating"?56:48+N.bottom;const k=g(U.create({onStartShouldSetPanResponder:()=>false,onMoveShouldSetPanResponder:(e,t)=>{return Math.abs(t.dx)>5&&Math.abs(t.dy)<10},onPanResponderMove:(e,t)=>{n.setValue(t.dx)},onPanResponderRelease:(e,t)=>{const{dx:p,vx:M}=t;const G=80;const K=.5;i.spring(n,{toValue:0,useNativeDriver:true}).start();if(Math.abs(p)>G||Math.abs(M)>K){if(p>0||M>0){h("right")}else{h("left")}}},onPanResponderTerminate:()=>{i.spring(n,{toValue:0,useNativeDriver:true}).start()}})).current;if(!l)return null;const q=()=>o(O,{selectedMutation:u,activeTab:"mutations",onTabChange:a,onBack:()=>r(void 0),searchText:c,onSearchChange:P,onClearCache:H});const D=o(E,{activeFilter:m,onFilterChange:A,modalMode:f});return o(J,{visible:l,onClose:S,onMinimize:w,persistenceKey:j,header:{customContent:q(),showToggleButton:true},onModeChange:I,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:D,footerHeight:Q,children:o(C,{style:{flex:1},children:Y(C,{...k.panHandlers,style:{flex:1},children:[o(W,{translationX:n,canSwipeLeft:false,canSwipeRight:true}),o(z,{selectedMutation:u,onMutationSelect:r,activeFilter:m,searchText:c})]})})})}
|
|
@@ -1,102 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { JsModal, useSafeAreaInsets, devToolsStorageKeys } from "@buoy-gg/shared-ui";
|
|
4
|
-
import { useGetMutationById } from "../../hooks/useSelectedMutation";
|
|
5
|
-
import { ReactQueryModalHeader } from "./ReactQueryModalHeader";
|
|
6
|
-
import { MutationEditorMode, MutationEditorActionsFooter } from "../MutationEditorMode";
|
|
7
|
-
import { useState, useCallback, useEffect, useRef } from "react";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
/**
|
|
10
|
-
* Modal variant dedicated to editing a single mutation entry. Restores persisted positioning and
|
|
11
|
-
* mirrors the behavior of the query editor.
|
|
12
|
-
*/
|
|
13
|
-
export function MutationEditorModal({
|
|
14
|
-
visible,
|
|
15
|
-
selectedMutationId,
|
|
16
|
-
onMutationSelect,
|
|
17
|
-
onClose,
|
|
18
|
-
onMinimize,
|
|
19
|
-
onTabChange,
|
|
20
|
-
enableSharedModalDimensions = false
|
|
21
|
-
}) {
|
|
22
|
-
const selectedMutation = useGetMutationById(selectedMutationId);
|
|
23
|
-
const [modalMode, setModalMode] = useState("bottomSheet");
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Fall back to the list when the selected mutation leaves the cache.
|
|
27
|
-
*
|
|
28
|
-
* Without this the whole tool disappears. `Remove` (and a mutation-cache
|
|
29
|
-
* clear, and ordinary garbage collection) drops the entry while the id that
|
|
30
|
-
* selected it is still set, so this modal bails out on the missing mutation
|
|
31
|
-
* and the browser stays hidden behind an `inDetail` that is still true —
|
|
32
|
-
* leaving an "open" tool with nothing on screen and no way back except
|
|
33
|
-
* closing and reopening it from the dial.
|
|
34
|
-
*
|
|
35
|
-
* The ref is what makes it safe: `useGetMutationById` resolves on a
|
|
36
|
-
* `setTimeout(0)`, so the mutation is legitimately undefined for the first
|
|
37
|
-
* tick after a selection. Only a mutation that was HERE and then went away
|
|
38
|
-
* counts as gone.
|
|
39
|
-
*/
|
|
40
|
-
const seenMutationId = useRef(undefined);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
if (selectedMutation) {
|
|
43
|
-
seenMutationId.current = selectedMutation.mutationId;
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
// Only THIS mutation going missing counts. Keying the check to the id
|
|
47
|
-
// matters: leaving a detail view leaves the last-seen id behind, and a
|
|
48
|
-
// plain "we had one and now we don't" flag would fire on the very next
|
|
49
|
-
// selection — during the tick before its own lookup resolves — and bounce
|
|
50
|
-
// the user straight back out of the mutation they just opened.
|
|
51
|
-
if (visible && seenMutationId.current !== undefined && seenMutationId.current === selectedMutationId) {
|
|
52
|
-
seenMutationId.current = undefined;
|
|
53
|
-
onMutationSelect(undefined);
|
|
54
|
-
}
|
|
55
|
-
}, [visible, selectedMutation, selectedMutationId, onMutationSelect]);
|
|
56
|
-
const handleModeChange = useCallback(mode => {
|
|
57
|
-
setModalMode(mode);
|
|
58
|
-
}, []);
|
|
59
|
-
|
|
60
|
-
// JsModal overlays the footer on the content and only reserves `footerHeight`
|
|
61
|
-
// of padding beneath it. MutationEditorActionsFooter pads its bottom with
|
|
62
|
-
// `insets.bottom + 8` when docked, so the reserve must grow by the same
|
|
63
|
-
// amount or the editor bottom hides behind the action bar.
|
|
64
|
-
const insets = useSafeAreaInsets({
|
|
65
|
-
minBottom: 16
|
|
66
|
-
});
|
|
67
|
-
const footerHeight = modalMode === "floating" ? 72 : 80 + insets.bottom;
|
|
68
|
-
const renderHeaderContent = () => /*#__PURE__*/_jsx(ReactQueryModalHeader, {
|
|
69
|
-
selectedMutation: selectedMutation,
|
|
70
|
-
activeTab: "mutations",
|
|
71
|
-
onTabChange: onTabChange,
|
|
72
|
-
onBack: () => onMutationSelect(undefined)
|
|
73
|
-
});
|
|
74
|
-
const storagePrefix = enableSharedModalDimensions ? devToolsStorageKeys.reactQuery.modal() : devToolsStorageKeys.reactQuery.mutationModal();
|
|
75
|
-
if (!visible || !selectedMutation) return null;
|
|
76
|
-
const footerNode = /*#__PURE__*/_jsx(MutationEditorActionsFooter, {
|
|
77
|
-
selectedMutation: selectedMutation,
|
|
78
|
-
isFloatingMode: modalMode === "floating"
|
|
79
|
-
});
|
|
80
|
-
return /*#__PURE__*/_jsx(JsModal, {
|
|
81
|
-
visible: visible,
|
|
82
|
-
onClose: onClose,
|
|
83
|
-
onMinimize: onMinimize,
|
|
84
|
-
persistenceKey: storagePrefix,
|
|
85
|
-
header: {
|
|
86
|
-
customContent: renderHeaderContent(),
|
|
87
|
-
showToggleButton: true
|
|
88
|
-
},
|
|
89
|
-
onModeChange: handleModeChange,
|
|
90
|
-
enablePersistence: true,
|
|
91
|
-
initialMode: "bottomSheet",
|
|
92
|
-
enableGlitchEffects: true,
|
|
93
|
-
styles: {},
|
|
94
|
-
footer: footerNode,
|
|
95
|
-
footerHeight: footerHeight,
|
|
96
|
-
children: /*#__PURE__*/_jsx(MutationEditorMode, {
|
|
97
|
-
selectedMutation: selectedMutation,
|
|
98
|
-
isFloatingMode: modalMode === "floating",
|
|
99
|
-
disableInternalFooter: true
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
}
|
|
1
|
+
"use strict";import{JsModal as C,useSafeAreaInsets as E,devToolsStorageKeys as s}from"@buoy-gg/shared-ui";import{useGetMutationById as x}from"../../hooks/useSelectedMutation";import{ReactQueryModalHeader as B}from"./ReactQueryModalHeader";import{MutationEditorMode as F,MutationEditorActionsFooter as H}from"../MutationEditorMode";import{useState as T,useCallback as I,useEffect as Q,useRef as S}from"react";import{jsx as n}from"react/jsx-runtime";export function MutationEditorModal({visible:t,selectedMutationId:r,onMutationSelect:a,onClose:d,onMinimize:u,onTabChange:f,enableSharedModalDimensions:c=false}){const e=x(r);const[i,l]=T("bottomSheet");const o=S(void 0);Q(()=>{if(e){o.current=e.mutationId;return}if(t&&o.current!==void 0&&o.current===r){o.current=void 0;a(void 0)}},[t,e,r,a]);const m=I(y=>{l(y)},[]);const M=E({minBottom:16});const g=i==="floating"?72:80+M.bottom;const h=()=>n(B,{selectedMutation:e,activeTab:"mutations",onTabChange:f,onBack:()=>a(void 0)});const p=c?s.reactQuery.modal():s.reactQuery.mutationModal();if(!t||!e)return null;const b=n(H,{selectedMutation:e,isFloatingMode:i==="floating"});return n(C,{visible:t,onClose:d,onMinimize:u,persistenceKey:p,header:{customContent:h(),showToggleButton:true},onModeChange:m,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:b,footerHeight:g,children:n(F,{selectedMutation:e,isFloatingMode:i==="floating",disableInternalFooter:true})})}
|
|
@@ -1,51 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { View, StyleSheet } from "react-native";
|
|
4
|
-
import { ToolFooter, useSafeAreaInsets } from "@buoy-gg/shared-ui";
|
|
5
|
-
import QueryStatusCount from "../query-browser/QueryStatusCount";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
/**
|
|
8
|
-
* Footer component for QueryBrowserModal following composition principles
|
|
9
|
-
*
|
|
10
|
-
* Applied principles:
|
|
11
|
-
* - Decompose by Responsibility: Dedicated footer component for filter controls
|
|
12
|
-
* - Prefer Composition over Configuration: Specialized footer matching DataEditorMode pattern
|
|
13
|
-
* - Extract Reusable Logic: Consistent footer styling across modal types
|
|
14
|
-
*/
|
|
15
|
-
export function QueryBrowserFooter({
|
|
16
|
-
activeFilter,
|
|
17
|
-
onFilterChange,
|
|
18
|
-
isFloatingMode = true,
|
|
19
|
-
// Default to floating mode if not specified
|
|
20
|
-
size = "default"
|
|
21
|
-
}) {
|
|
22
|
-
// Use safe area insets with a minimum bottom padding of 16 for docked mode
|
|
23
|
-
// This ensures proper spacing even on resized simulators or devices without home indicator
|
|
24
|
-
const insets = useSafeAreaInsets({
|
|
25
|
-
minBottom: 16
|
|
26
|
-
});
|
|
27
|
-
return /*#__PURE__*/_jsx(ToolFooter, {
|
|
28
|
-
floating: isFloatingMode,
|
|
29
|
-
safeArea: false,
|
|
30
|
-
paddingBottom: !isFloatingMode ? insets.bottom : 0,
|
|
31
|
-
style: styles.filterFooter,
|
|
32
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
33
|
-
style: styles.filterContainer,
|
|
34
|
-
children: /*#__PURE__*/_jsx(QueryStatusCount, {
|
|
35
|
-
activeFilter: activeFilter,
|
|
36
|
-
onFilterChange: onFilterChange,
|
|
37
|
-
size: size
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const styles = StyleSheet.create({
|
|
43
|
-
filterFooter: {
|
|
44
|
-
paddingTop: 8,
|
|
45
|
-
paddingHorizontal: 0
|
|
46
|
-
},
|
|
47
|
-
filterContainer: {
|
|
48
|
-
minHeight: 32,
|
|
49
|
-
justifyContent: "center"
|
|
50
|
-
}
|
|
51
|
-
});
|
|
1
|
+
"use strict";import{View as a,StyleSheet as l}from"react-native";import{ToolFooter as f,useSafeAreaInsets as m}from"@buoy-gg/shared-ui";import u from"../query-browser/QueryStatusCount";import{jsx as t}from"react/jsx-runtime";export function QueryBrowserFooter({activeFilter:r,onFilterChange:i,isFloatingMode:e=true,size:n="default"}){const s=m({minBottom:16});return t(f,{floating:e,safeArea:false,paddingBottom:!e?s.bottom:0,style:o.filterFooter,children:t(a,{style:o.filterContainer,children:t(u,{activeFilter:r,onFilterChange:i,size:n})})})}const o=l.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});
|