@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,117 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { persistentStorage } from "@buoy-gg/shared-ui";
|
|
4
|
-
|
|
5
|
-
// Helper functions for persisting panel state using shared storage wrapper
|
|
6
|
-
const setItem = async (key, value) => {
|
|
7
|
-
await persistentStorage.setItem(key, value);
|
|
8
|
-
};
|
|
9
|
-
const getItem = async key => {
|
|
10
|
-
return persistentStorage.getItem(key);
|
|
11
|
-
};
|
|
12
|
-
// Storage operations
|
|
13
|
-
/**
|
|
14
|
-
* Persist the draggable panel dimensions so future sessions can restore the last window size.
|
|
15
|
-
*/
|
|
16
|
-
export const savePanelDimensions = async (storagePrefix, dimensions) => {
|
|
17
|
-
try {
|
|
18
|
-
await setItem(`${storagePrefix}_panel_dimensions`, JSON.stringify(dimensions));
|
|
19
|
-
} catch {
|
|
20
|
-
// Silently fail - persistence is optional
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/** Remember the last snap height of the panel for bottom-sheet style layouts. */
|
|
25
|
-
export const savePanelHeight = async (storagePrefix, height) => {
|
|
26
|
-
try {
|
|
27
|
-
await setItem(`${storagePrefix}_panel_height`, height.toString());
|
|
28
|
-
} catch {
|
|
29
|
-
// Silently fail - persistence is optional
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Persist whether the panel was in floating mode so we can reopen at the same presentation style.
|
|
35
|
-
*/
|
|
36
|
-
export const saveFloatingMode = async (storagePrefix, isFloating) => {
|
|
37
|
-
try {
|
|
38
|
-
await setItem(`${storagePrefix}_is_floating_mode`, isFloating.toString());
|
|
39
|
-
} catch {
|
|
40
|
-
// Silently fail - persistence is optional
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Retrieve persisted panel geometry and presentation mode. Returns null values when nothing was
|
|
46
|
-
* previously stored so callers can fall back to defaults.
|
|
47
|
-
*/
|
|
48
|
-
export const loadPanelState = async storagePrefix => {
|
|
49
|
-
try {
|
|
50
|
-
const [dimensionsStr, heightStr, floatingModeStr] = await Promise.all([getItem(`${storagePrefix}_panel_dimensions`), getItem(`${storagePrefix}_panel_height`), getItem(`${storagePrefix}_is_floating_mode`)]);
|
|
51
|
-
const dimensions = dimensionsStr ? JSON.parse(dimensionsStr) : null;
|
|
52
|
-
const height = heightStr ? parseInt(heightStr, 10) : null;
|
|
53
|
-
const isFloating = floatingModeStr ? floatingModeStr === "true" : null;
|
|
54
|
-
return {
|
|
55
|
-
dimensions,
|
|
56
|
-
height,
|
|
57
|
-
isFloating
|
|
58
|
-
};
|
|
59
|
-
} catch {
|
|
60
|
-
// Return defaults on error
|
|
61
|
-
return {
|
|
62
|
-
dimensions: null,
|
|
63
|
-
height: null,
|
|
64
|
-
isFloating: null
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Modal visibility state operations
|
|
70
|
-
/**
|
|
71
|
-
* Persist the comprehensive modal visibility state (open flags, selected query, etc.). Stored as a
|
|
72
|
-
* single JSON blob keyed by the provided prefix.
|
|
73
|
-
*/
|
|
74
|
-
export const saveModalVisibilityState = async (storagePrefix, state) => {
|
|
75
|
-
try {
|
|
76
|
-
const stateJson = JSON.stringify(state);
|
|
77
|
-
// storagePrefix already contains the full key, don't append _modal_state
|
|
78
|
-
const key = storagePrefix;
|
|
79
|
-
await setItem(key, stateJson);
|
|
80
|
-
} catch {
|
|
81
|
-
// Silently fail - persistence is a nice-to-have feature
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Read previously persisted modal visibility state. Returns null when no entry is stored or the
|
|
87
|
-
* payload cannot be parsed.
|
|
88
|
-
*/
|
|
89
|
-
export const loadModalVisibilityState = async storagePrefix => {
|
|
90
|
-
try {
|
|
91
|
-
// storagePrefix already contains the full key, don't append _modal_state
|
|
92
|
-
const key = storagePrefix;
|
|
93
|
-
const stateStr = await getItem(key);
|
|
94
|
-
if (stateStr && stateStr !== "") {
|
|
95
|
-
const parsed = JSON.parse(stateStr);
|
|
96
|
-
return parsed;
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
99
|
-
} catch {
|
|
100
|
-
// Silently fail - persistence is a nice-to-have feature
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Clear the cached modal visibility state. Useful when all modals close so we avoid reopening
|
|
107
|
-
* unintentionally on the next session.
|
|
108
|
-
*/
|
|
109
|
-
export const clearModalVisibilityState = async storagePrefix => {
|
|
110
|
-
try {
|
|
111
|
-
// storagePrefix already contains the full key, don't append _modal_state
|
|
112
|
-
const key = storagePrefix;
|
|
113
|
-
await setItem(key, "");
|
|
114
|
-
} catch {
|
|
115
|
-
// Silently fail - persistence is a nice-to-have feature
|
|
116
|
-
}
|
|
117
|
-
};
|
|
1
|
+
"use strict";import{persistentStorage as o}from"@buoy-gg/shared-ui";const e=async(t,n)=>{await o.setItem(t,n)};const i=async t=>{return o.getItem(t)};export const savePanelDimensions=async(t,n)=>{try{await e(`${t}_panel_dimensions`,JSON.stringify(n))}catch{}};export const savePanelHeight=async(t,n)=>{try{await e(`${t}_panel_height`,n.toString())}catch{}};export const saveFloatingMode=async(t,n)=>{try{await e(`${t}_is_floating_mode`,n.toString())}catch{}};export const loadPanelState=async t=>{try{const[n,a,s]=await Promise.all([i(`${t}_panel_dimensions`),i(`${t}_panel_height`),i(`${t}_is_floating_mode`)]);const c=n?JSON.parse(n):null;const r=a?parseInt(a,10):null;const l=s?s==="true":null;return{dimensions:c,height:r,isFloating:l}}catch{return{dimensions:null,height:null,isFloating:null}}};export const saveModalVisibilityState=async(t,n)=>{try{const a=JSON.stringify(n);const s=t;await e(s,a)}catch{}};export const loadModalVisibilityState=async t=>{try{const n=t;const a=await i(n);if(a&&a!==""){const s=JSON.parse(a);return s}return null}catch{return null}};export const clearModalVisibilityState=async t=>{try{const n=t;await e(n,"")}catch{}};
|
|
@@ -1,140 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { buoyColors } from "@buoy-gg/shared-ui";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Centralized storage query keys for all storage hooks
|
|
7
|
-
* This ensures consistency across MMKV, AsyncStorage, and SecureStorage hooks
|
|
8
|
-
* and allows easy modification of the base storage key in one place
|
|
9
|
-
*/
|
|
10
|
-
export const storageQueryKeys = {
|
|
11
|
-
/**
|
|
12
|
-
* Base storage key - change this to update all storage-related queries
|
|
13
|
-
*/
|
|
14
|
-
base: () => ["#storage"],
|
|
15
|
-
/**
|
|
16
|
-
* MMKV storage query keys
|
|
17
|
-
*/
|
|
18
|
-
mmkv: {
|
|
19
|
-
root: () => [...storageQueryKeys.base(), "mmkv"],
|
|
20
|
-
key: key => [...storageQueryKeys.mmkv.root(), key],
|
|
21
|
-
all: () => [...storageQueryKeys.mmkv.root(), "all"]
|
|
22
|
-
},
|
|
23
|
-
/**
|
|
24
|
-
* AsyncStorage query keys
|
|
25
|
-
*/
|
|
26
|
-
async: {
|
|
27
|
-
root: () => [...storageQueryKeys.base(), "async"],
|
|
28
|
-
key: key => [...storageQueryKeys.async.root(), key],
|
|
29
|
-
all: () => [...storageQueryKeys.async.root(), "all"]
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* SecureStorage query keys
|
|
33
|
-
*/
|
|
34
|
-
secure: {
|
|
35
|
-
root: () => [...storageQueryKeys.base(), "secure"],
|
|
36
|
-
key: key => [...storageQueryKeys.secure.root(), key],
|
|
37
|
-
all: () => [...storageQueryKeys.secure.root(), "all"]
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Storage types that can be enabled/disabled
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Check if a query key matches any of the storage patterns
|
|
47
|
-
*/
|
|
48
|
-
export function isStorageQuery(queryKey) {
|
|
49
|
-
if (!Array.isArray(queryKey) || queryKey.length === 0) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return queryKey[0] === "#storage";
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get the storage type from a query key
|
|
57
|
-
*/
|
|
58
|
-
export function getStorageType(queryKey) {
|
|
59
|
-
if (!isStorageQuery(queryKey) || queryKey.length < 2) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
const storageType = queryKey[1];
|
|
63
|
-
if (storageType === "mmkv" || storageType === "async" || storageType === "secure") {
|
|
64
|
-
return storageType;
|
|
65
|
-
}
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Get display label for storage type
|
|
71
|
-
*/
|
|
72
|
-
export function getStorageTypeLabel(storageType) {
|
|
73
|
-
switch (storageType) {
|
|
74
|
-
case "mmkv":
|
|
75
|
-
return "MMKV";
|
|
76
|
-
case "async":
|
|
77
|
-
return "Async";
|
|
78
|
-
case "secure":
|
|
79
|
-
return "Secure";
|
|
80
|
-
default:
|
|
81
|
-
return storageType;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get storage type color class for styling
|
|
87
|
-
*/
|
|
88
|
-
export function getStorageTypeColor(storageType) {
|
|
89
|
-
switch (storageType) {
|
|
90
|
-
case "mmkv":
|
|
91
|
-
return "purple";
|
|
92
|
-
// Premium, high-performance
|
|
93
|
-
case "async":
|
|
94
|
-
return "blue";
|
|
95
|
-
// Standard, reliable
|
|
96
|
-
case "secure":
|
|
97
|
-
return "green";
|
|
98
|
-
// Security, safety
|
|
99
|
-
default:
|
|
100
|
-
return "gray";
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Get storage type hex color for UI components
|
|
106
|
-
* Design rationale:
|
|
107
|
-
* - MMKV: Primary teal - Premium, high-performance, sophisticated
|
|
108
|
-
* - Async: Warning color - Standard, reliable, default
|
|
109
|
-
* - Secure: Success color - Security, safety, protection
|
|
110
|
-
*/
|
|
111
|
-
export function getStorageTypeHexColor(storageType) {
|
|
112
|
-
switch (storageType) {
|
|
113
|
-
case "mmkv":
|
|
114
|
-
return buoyColors.primary;
|
|
115
|
-
// Premium, high-performance
|
|
116
|
-
case "async":
|
|
117
|
-
return buoyColors.warning;
|
|
118
|
-
// Standard, reliable
|
|
119
|
-
case "secure":
|
|
120
|
-
return buoyColors.success;
|
|
121
|
-
// Security, safety
|
|
122
|
-
default:
|
|
123
|
-
return buoyColors.textMuted;
|
|
124
|
-
// Gray
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Extract clean storage key from storage query key
|
|
130
|
-
* Example: ["#storage", "async", "@dev_tools_modal_state"] → "@dev_tools_modal_state"
|
|
131
|
-
*/
|
|
132
|
-
export function getCleanStorageKey(queryKey) {
|
|
133
|
-
if (!isStorageQuery(queryKey) || queryKey.length < 3) {
|
|
134
|
-
return "Unknown Storage Key";
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Return everything after the storage type (index 2 and beyond)
|
|
138
|
-
const cleanKeys = queryKey.slice(2);
|
|
139
|
-
return cleanKeys.filter(k => k != null).map(k => String(k)).join(" › ") || "Unknown Storage Key";
|
|
140
|
-
}
|
|
1
|
+
"use strict";import{buoyColors as t}from"@buoy-gg/shared-ui";export const storageQueryKeys={base:()=>["#storage"],mmkv:{root:()=>[...storageQueryKeys.base(),"mmkv"],key:e=>[...storageQueryKeys.mmkv.root(),e],all:()=>[...storageQueryKeys.mmkv.root(),"all"]},async:{root:()=>[...storageQueryKeys.base(),"async"],key:e=>[...storageQueryKeys.async.root(),e],all:()=>[...storageQueryKeys.async.root(),"all"]},secure:{root:()=>[...storageQueryKeys.base(),"secure"],key:e=>[...storageQueryKeys.secure.root(),e],all:()=>[...storageQueryKeys.secure.root(),"all"]}};export function isStorageQuery(e){if(!Array.isArray(e)||e.length===0){return false}return e[0]==="#storage"}export function getStorageType(e){if(!isStorageQuery(e)||e.length<2){return null}const r=e[1];if(r==="mmkv"||r==="async"||r==="secure"){return r}return null}export function getStorageTypeLabel(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}export function getStorageTypeColor(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}export function getStorageTypeHexColor(e){switch(e){case"mmkv":return t.primary;case"async":return t.warning;case"secure":return t.success;default:return t.textMuted}}export function getCleanStorageKey(e){if(!isStorageQuery(e)||e.length<3){return"Unknown Storage Key"}const r=e.slice(2);return r.filter(n=>n!=null).map(n=>String(n)).join(" \u203A ")||"Unknown Storage Key"}
|
|
@@ -1,54 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Stable e2e handles for the React Query tool.
|
|
5
|
-
*
|
|
6
|
-
* Rows are addressed by their KEY, never by an index or a per-session id: a
|
|
7
|
-
* query's position moves every time the list re-sorts by `dataUpdatedAt`, and
|
|
8
|
-
* a mutation's `mutationId` is a counter that restarts with the process. The
|
|
9
|
-
* key is the one thing that means the same query on the next launch, which is
|
|
10
|
-
* also the only thing a test can name up front.
|
|
11
|
-
*
|
|
12
|
-
* `queryHash` would be stable too, but it is raw JSON (`["qbench","fresh"]`) —
|
|
13
|
-
* quotes and brackets that neither Detox's `by.id` nor a Maestro selector
|
|
14
|
-
* handles cleanly. So the parts are slugged and joined the way the rest of
|
|
15
|
-
* Buoy's handles read: `buoy-rq-query-row-qbench-fresh`.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/** One key part → a testID-safe slug. */
|
|
19
|
-
function slugPart(part) {
|
|
20
|
-
return String(part).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** A query/mutation key (array or scalar) → its slug, e.g. `qbench-fresh`. */
|
|
24
|
-
export function keySlug(key) {
|
|
25
|
-
const parts = Array.isArray(key) ? key : [key];
|
|
26
|
-
return parts.filter(part => part != null).map(slugPart).filter(Boolean).join("-") || "unkeyed";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** `buoy-rq-query-row-<slug>` for a query key. */
|
|
30
|
-
export function queryRowTestID(queryKey) {
|
|
31
|
-
return `buoy-rq-query-row-${keySlug(queryKey)}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* `buoy-rq-mutation-row-<slug>` for a mutation.
|
|
36
|
-
*
|
|
37
|
-
* Anonymous mutations (no `mutationKey`) fall back to the id — unstable across
|
|
38
|
-
* launches, but so is the mutation itself, and an unkeyed mutation has nothing
|
|
39
|
-
* else to be named by.
|
|
40
|
-
*/
|
|
41
|
-
export function mutationRowTestID(mutationKey, mutationId) {
|
|
42
|
-
return mutationKey == null ? `buoy-rq-mutation-row-id-${mutationId}` : `buoy-rq-mutation-row-${keySlug(mutationKey)}`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* `buoy-rq-explorer-<path>` for one node of the data explorer.
|
|
47
|
-
*
|
|
48
|
-
* The path is the same array the editor writes through
|
|
49
|
-
* (`updateNestedDataByPath`), so the handle and the write target can't drift:
|
|
50
|
-
* `buoy-rq-explorer-nested-count` edits `data.nested.count`.
|
|
51
|
-
*/
|
|
52
|
-
export function explorerTestID(dataPath) {
|
|
53
|
-
return dataPath.length === 0 ? "buoy-rq-explorer-root" : `buoy-rq-explorer-${dataPath.map(slugPart).filter(Boolean).join("-")}`;
|
|
54
|
-
}
|
|
1
|
+
"use strict";function e(r){return String(r).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}export function keySlug(r){const o=Array.isArray(r)?r:[r];return o.filter(t=>t!=null).map(e).filter(Boolean).join("-")||"unkeyed"}export function queryRowTestID(r){return`buoy-rq-query-row-${keySlug(r)}`}export function mutationRowTestID(r,o){return r==null?`buoy-rq-mutation-row-id-${o}`:`buoy-rq-mutation-row-${keySlug(r)}`}export function explorerTestID(r){return r.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${r.map(e).filter(Boolean).join("-")}`}
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* updates nested data by path
|
|
5
|
-
*
|
|
6
|
-
* @param {JsonValue} oldData Data to be updated
|
|
7
|
-
* @param {Array<string>} updatePath Path to the data to be updated
|
|
8
|
-
* @param {JsonValue} value New value
|
|
9
|
-
*/
|
|
10
|
-
export const updateNestedDataByPath = (oldData, updatePath, value) => {
|
|
11
|
-
if (updatePath.length === 0) {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
if (oldData instanceof Map) {
|
|
15
|
-
const newData = new Map(oldData);
|
|
16
|
-
if (updatePath.length === 1) {
|
|
17
|
-
newData.set(updatePath[0], value);
|
|
18
|
-
return newData;
|
|
19
|
-
}
|
|
20
|
-
const [head, ...tail] = updatePath;
|
|
21
|
-
const currentValue = newData.get(head);
|
|
22
|
-
newData.set(head, updateNestedDataByPath(currentValue ?? null, tail, value));
|
|
23
|
-
return newData;
|
|
24
|
-
}
|
|
25
|
-
if (oldData instanceof Set) {
|
|
26
|
-
const setAsArray = updateNestedDataByPath(Array.from(oldData), updatePath, value);
|
|
27
|
-
return new Set(Array.isArray(setAsArray) ? setAsArray : []);
|
|
28
|
-
}
|
|
29
|
-
if (Array.isArray(oldData)) {
|
|
30
|
-
const newData = [...oldData];
|
|
31
|
-
if (updatePath.length === 1) {
|
|
32
|
-
// @ts-expect-error NAS
|
|
33
|
-
newData[updatePath[0]] = value;
|
|
34
|
-
return newData;
|
|
35
|
-
}
|
|
36
|
-
const [head, ...tail] = updatePath;
|
|
37
|
-
// @ts-expect-error NAS
|
|
38
|
-
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
39
|
-
return newData;
|
|
40
|
-
}
|
|
41
|
-
if (oldData instanceof Object) {
|
|
42
|
-
const newData = {
|
|
43
|
-
...oldData
|
|
44
|
-
};
|
|
45
|
-
if (updatePath.length === 1) {
|
|
46
|
-
// @ts-expect-error NAS
|
|
47
|
-
newData[updatePath[0]] = value;
|
|
48
|
-
return newData;
|
|
49
|
-
}
|
|
50
|
-
const [head, ...tail] = updatePath;
|
|
51
|
-
// @ts-expect-error NAS
|
|
52
|
-
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
53
|
-
return newData;
|
|
54
|
-
}
|
|
55
|
-
return oldData;
|
|
56
|
-
};
|
|
1
|
+
"use strict";export const updateNestedDataByPath=(e,r,s)=>{if(r.length===0){return s}if(e instanceof Map){const n=new Map(e);if(r.length===1){n.set(r[0],s);return n}const[t,...i]=r;const c=n.get(t);n.set(t,updateNestedDataByPath(c??null,i,s));return n}if(e instanceof Set){const n=updateNestedDataByPath(Array.from(e),r,s);return new Set(Array.isArray(n)?n:[])}if(Array.isArray(e)){const n=[...e];if(r.length===1){n[r[0]]=s;return n}const[t,...i]=r;n[t]=updateNestedDataByPath(n[t],i,s);return n}if(e instanceof Object){const n={...e};if(r.length===1){n[r[0]]=s;return n}const[t,...i]=r;n[t]=updateNestedDataByPath(n[t],i,s);return n}return e};
|