@buoy-gg/core 1.7.7 → 2.1.1
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/lib/commonjs/floatingMenu/AppHost.js +3 -3
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +25 -13
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +746 -0
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +16 -4
- package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +153 -0
- package/lib/commonjs/floatingMenu/FloatingMenu.js +8 -8
- package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +2 -2
- package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +30 -0
- package/lib/commonjs/floatingMenu/defaultConfig.js +14 -7
- package/lib/commonjs/floatingMenu/dial/DialDevTools.js +12 -6
- package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +593 -0
- package/lib/commonjs/floatingMenu/floatingTools.js +218 -38
- package/lib/commonjs/floatingMenu/floatingTools.web.js +357 -0
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.web.js +131 -0
- package/lib/commonjs/utils/autoDiscoverPresets.web.js +181 -0
- package/lib/module/floatingMenu/AppHost.js +4 -4
- package/lib/module/floatingMenu/DevToolsSettingsModal.js +28 -16
- package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +756 -0
- package/lib/module/floatingMenu/FloatingDevTools.js +17 -5
- package/lib/module/floatingMenu/FloatingDevTools.web.js +149 -0
- package/lib/module/floatingMenu/FloatingMenu.js +9 -9
- package/lib/module/floatingMenu/MinimizedToolsContext.js +3 -3
- package/lib/module/floatingMenu/autoDiscoverPresets.js +30 -0
- package/lib/module/floatingMenu/defaultConfig.js +14 -7
- package/lib/module/floatingMenu/dial/DialDevTools.js +13 -7
- package/lib/module/floatingMenu/dial/DialDevTools.web.js +590 -0
- package/lib/module/floatingMenu/floatingTools.js +219 -39
- package/lib/module/floatingMenu/floatingTools.web.js +357 -0
- package/lib/module/index.js +2 -2
- package/lib/module/index.web.js +24 -0
- package/lib/module/utils/autoDiscoverPresets.web.js +174 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +23 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts +1 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +48 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +8 -7
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts +26 -0
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts +1 -1
- package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts +27 -0
- package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.web.d.ts +20 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +58 -0
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +23 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +48 -0
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +8 -7
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts +26 -0
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/floatingTools.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts +27 -0
- package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +1 -0
- package/lib/typescript/module/index.web.d.ts +20 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +58 -0
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +1 -0
- package/package.json +5 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { persistentStorage } from "@buoy-gg/shared-ui";
|
|
4
4
|
import React, { createContext, useCallback, useContext, useMemo, useState, useEffect, useRef } from "react";
|
|
5
5
|
import { BackHandler, Modal, StyleSheet, View } from "react-native";
|
|
6
6
|
import { resolveOpenAppsState } from "./AppHostLogic.js";
|
|
7
7
|
import { useMinimizedTools } from "./MinimizedToolsContext.js";
|
|
8
|
-
import { useDevToolsSettings } from "./DevToolsSettingsModal
|
|
8
|
+
import { useDevToolsSettings } from "./DevToolsSettingsModal";
|
|
9
9
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
10
|
const AppHostContext = /*#__PURE__*/createContext(null);
|
|
11
11
|
const STORAGE_KEY_OPEN_APPS = "@react_buoy_open_apps";
|
|
@@ -87,7 +87,7 @@ export const AppHostProvider = ({
|
|
|
87
87
|
useEffect(() => {
|
|
88
88
|
const restoreOpenApps = async () => {
|
|
89
89
|
try {
|
|
90
|
-
const saved = await
|
|
90
|
+
const saved = await persistentStorage.getItem(STORAGE_KEY_OPEN_APPS);
|
|
91
91
|
if (saved) {
|
|
92
92
|
const parsed = JSON.parse(saved);
|
|
93
93
|
// Handle both old format (string[]) and new format (PersistedAppState[])
|
|
@@ -133,7 +133,7 @@ export const AppHostProvider = ({
|
|
|
133
133
|
id: app.id,
|
|
134
134
|
minimized: app.minimized ?? false
|
|
135
135
|
}));
|
|
136
|
-
|
|
136
|
+
persistentStorage.setItem(STORAGE_KEY_OPEN_APPS, JSON.stringify(appStates));
|
|
137
137
|
}, PERSISTENCE_DELAY);
|
|
138
138
|
return () => {
|
|
139
139
|
if (persistenceTimeoutRef.current) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
4
4
|
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Dimensions } from "react-native";
|
|
5
5
|
import { settingsBus } from "./settingsBus.js";
|
|
6
|
-
import { SentryBugIcon, WifiCircuitIcon, BenchmarkIcon, RenderCountIcon, Info, Layers, ChevronRightIcon, ChevronDown,
|
|
7
|
-
import { EnvIcon, StorageIcon, RoutesIcon, NetworkIcon, QueryIcon, HighlighterIcon } from "@buoy-gg/floating-tools-core";
|
|
6
|
+
import { SentryBugIcon, WifiCircuitIcon, BenchmarkIcon, RenderCountIcon, Info, Layers, ChevronRightIcon, ChevronDown, getStorageBackendType, persistentStorage, Database, Trash2, CheckCircle2, AlertTriangle, Zap, FileText, HardDrive, Copy, FileCode, RefreshCw, Smartphone, Plus, copyToClipboard, LicenseEntryModal, SectionHeader } from "@buoy-gg/shared-ui";
|
|
7
|
+
import { EnvIcon, StorageIcon, RoutesIcon, NetworkIcon, QueryIcon, HighlighterIcon, ReduxIcon } from "@buoy-gg/floating-tools-core";
|
|
8
8
|
import { useDefaultConfig } from "./DefaultConfigContext.js";
|
|
9
|
-
import { JsModal, devToolsStorageKeys
|
|
9
|
+
import { JsModal, devToolsStorageKeys } from "@buoy-gg/shared-ui";
|
|
10
10
|
import { useSafeAreaInsets } from "@buoy-gg/shared-ui";
|
|
11
11
|
import { ModalHeader } from "@buoy-gg/shared-ui";
|
|
12
12
|
import { TabSelector } from "@buoy-gg/shared-ui";
|
|
@@ -115,6 +115,7 @@ const mergeWithDefaults = (defaults, stored, options) => {
|
|
|
115
115
|
* @param availableApps - List of available apps from auto-discovery
|
|
116
116
|
* @param defaultFloatingTools - Optional array of tool IDs to enable by default in floating bubble
|
|
117
117
|
* @param defaultDialTools - Optional array of tool IDs to enable by default in dial menu
|
|
118
|
+
* If not provided, all dial-compatible tools are enabled by default (up to 6)
|
|
118
119
|
*/
|
|
119
120
|
const generateDefaultSettings = (availableApps = [], defaultFloatingTools, defaultDialTools) => {
|
|
120
121
|
const dialDefaults = {};
|
|
@@ -124,14 +125,17 @@ const generateDefaultSettings = (availableApps = [], defaultFloatingTools, defau
|
|
|
124
125
|
// Cast to Set<string> to allow comparison with any tool ID (including custom tools)
|
|
125
126
|
const enabledFloatingSet = new Set(defaultFloatingTools ?? []);
|
|
126
127
|
const enabledDialSet = new Set(defaultDialTools ?? []);
|
|
128
|
+
|
|
129
|
+
// If no defaultDialTools specified, auto-enable all dial-compatible tools
|
|
130
|
+
const autoEnableDialTools = !defaultDialTools || defaultDialTools.length === 0;
|
|
127
131
|
for (const app of availableApps) {
|
|
128
132
|
const {
|
|
129
133
|
id,
|
|
130
134
|
slot = "both"
|
|
131
135
|
} = app;
|
|
132
136
|
if (slot === "dial" || slot === "both") {
|
|
133
|
-
//
|
|
134
|
-
dialDefaults[id] = enabledDialSet.has(id);
|
|
137
|
+
// Auto-enable if no defaults specified, otherwise check the set
|
|
138
|
+
dialDefaults[id] = autoEnableDialTools ? true : enabledDialSet.has(id);
|
|
135
139
|
}
|
|
136
140
|
if (slot === "row" || slot === "both") {
|
|
137
141
|
// Enable if in defaultFloatingTools, otherwise false
|
|
@@ -181,7 +185,7 @@ export const DevToolsSettingsModal = ({
|
|
|
181
185
|
useEffect(() => {
|
|
182
186
|
const loadActiveTab = async () => {
|
|
183
187
|
try {
|
|
184
|
-
const savedTab = await
|
|
188
|
+
const savedTab = await persistentStorage.getItem(devToolsStorageKeys.settings.activeTab());
|
|
185
189
|
if (savedTab && ["dial", "floating", "settings", "pro"].includes(savedTab)) {
|
|
186
190
|
setActiveTab(savedTab);
|
|
187
191
|
}
|
|
@@ -198,7 +202,7 @@ export const DevToolsSettingsModal = ({
|
|
|
198
202
|
useEffect(() => {
|
|
199
203
|
// Only persist after initial state is loaded to avoid overwriting with default
|
|
200
204
|
if (!activeTabLoaded) return;
|
|
201
|
-
|
|
205
|
+
persistentStorage.setItem(devToolsStorageKeys.settings.activeTab(), activeTab).catch(error => {
|
|
202
206
|
// Failed to save active tab - continue without persistence
|
|
203
207
|
console.warn("Failed to save settings active tab:", error);
|
|
204
208
|
});
|
|
@@ -241,7 +245,7 @@ export const DevToolsSettingsModal = ({
|
|
|
241
245
|
|
|
242
246
|
const loadSettings = useCallback(async () => {
|
|
243
247
|
try {
|
|
244
|
-
const savedSettings = await
|
|
248
|
+
const savedSettings = await persistentStorage.getItem(STORAGE_KEY);
|
|
245
249
|
if (savedSettings) {
|
|
246
250
|
const parsed = JSON.parse(savedSettings);
|
|
247
251
|
const merged = mergeWithDefaults(defaultSettings, parsed, {
|
|
@@ -285,7 +289,7 @@ export const DevToolsSettingsModal = ({
|
|
|
285
289
|
...newSettings,
|
|
286
290
|
dialTools: enforceDialLimit(newSettings.dialTools)
|
|
287
291
|
};
|
|
288
|
-
await
|
|
292
|
+
await persistentStorage.setItem(STORAGE_KEY, JSON.stringify(limitedSettings));
|
|
289
293
|
setSettings(limitedSettings);
|
|
290
294
|
onSettingsChange?.(limitedSettings);
|
|
291
295
|
// Notify listeners (e.g., floating bubble) to refresh immediately
|
|
@@ -522,6 +526,10 @@ export const DevToolsSettingsModal = ({
|
|
|
522
526
|
size: 16,
|
|
523
527
|
color: buoyColors.textSecondary
|
|
524
528
|
});
|
|
529
|
+
case "redux":
|
|
530
|
+
return /*#__PURE__*/_jsx(ReduxIcon, {
|
|
531
|
+
size: 16
|
|
532
|
+
});
|
|
525
533
|
default:
|
|
526
534
|
return /*#__PURE__*/_jsx(Info, {
|
|
527
535
|
size: 16,
|
|
@@ -910,13 +918,10 @@ export const DevToolsSettingsModal = ({
|
|
|
910
918
|
style: styles.exportHintBanner,
|
|
911
919
|
children: [/*#__PURE__*/_jsx(Zap, {
|
|
912
920
|
size: 14,
|
|
913
|
-
color: buoyColors.
|
|
914
|
-
}), /*#__PURE__*/
|
|
921
|
+
color: buoyColors.textMuted
|
|
922
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
915
923
|
style: styles.exportHintText,
|
|
916
|
-
children:
|
|
917
|
-
style: styles.exportHintBold,
|
|
918
|
-
children: "New!"
|
|
919
|
-
}), " Configure your tools above, then export to set team defaults."]
|
|
924
|
+
children: "Configure tools, then export as props for your team."
|
|
920
925
|
})]
|
|
921
926
|
}), isExportExpanded && /*#__PURE__*/_jsxs(View, {
|
|
922
927
|
style: styles.exportCodeContainer,
|
|
@@ -1373,12 +1378,19 @@ const basicDefaultSettings = {
|
|
|
1373
1378
|
/**
|
|
1374
1379
|
* Creates default settings from the team configuration arrays.
|
|
1375
1380
|
* Used by the hook when no stored settings exist.
|
|
1381
|
+
*
|
|
1382
|
+
* Note: This function doesn't have access to availableApps, so it can only
|
|
1383
|
+
* enable tools that are explicitly listed in the config arrays.
|
|
1384
|
+
* For auto-enabling all dial tools, the generateDefaultSettings function
|
|
1385
|
+
* (which has access to availableApps) handles that case.
|
|
1376
1386
|
*/
|
|
1377
1387
|
const createDefaultsFromConfig = (defaultFloatingTools, defaultDialTools) => {
|
|
1378
1388
|
const floatingSet = new Set(defaultFloatingTools ?? []);
|
|
1379
1389
|
const dialSet = new Set(defaultDialTools ?? []);
|
|
1380
1390
|
|
|
1381
1391
|
// Build dial tools record from defaults
|
|
1392
|
+
// Note: If no defaults specified, dialTools will be empty here
|
|
1393
|
+
// but generateDefaultSettings will auto-enable all tools when it has access to availableApps
|
|
1382
1394
|
const dialTools = {};
|
|
1383
1395
|
for (const id of dialSet) {
|
|
1384
1396
|
dialTools[id] = true;
|
|
@@ -1426,7 +1438,7 @@ export const useDevToolsSettings = () => {
|
|
|
1426
1438
|
const [settings, setSettings] = useState(effectiveDefaults);
|
|
1427
1439
|
const loadSettings = useCallback(async () => {
|
|
1428
1440
|
try {
|
|
1429
|
-
const savedSettings = await
|
|
1441
|
+
const savedSettings = await persistentStorage.getItem(STORAGE_KEY);
|
|
1430
1442
|
if (savedSettings) {
|
|
1431
1443
|
const parsed = JSON.parse(savedSettings);
|
|
1432
1444
|
const merged = mergeWithDefaults(effectiveDefaults, parsed);
|