@buoy-gg/core 1.7.2
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 +43 -0
- package/lib/commonjs/floatingMenu/AppHost.js +410 -0
- package/lib/commonjs/floatingMenu/AppHostLogic.js +44 -0
- package/lib/commonjs/floatingMenu/DefaultConfigContext.js +45 -0
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +2274 -0
- package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +49 -0
- package/lib/commonjs/floatingMenu/DraggableHeader.js +114 -0
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +254 -0
- package/lib/commonjs/floatingMenu/FloatingMenu.js +364 -0
- package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +247 -0
- package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +206 -0
- package/lib/commonjs/floatingMenu/ToggleStateManager.js +36 -0
- package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +241 -0
- package/lib/commonjs/floatingMenu/defaultConfig.js +160 -0
- package/lib/commonjs/floatingMenu/dial/DialDevTools.js +835 -0
- package/lib/commonjs/floatingMenu/dial/DialIcon.js +246 -0
- package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +249 -0
- package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +70 -0
- package/lib/commonjs/floatingMenu/floatingTools.js +771 -0
- package/lib/commonjs/floatingMenu/settingsBus.js +23 -0
- package/lib/commonjs/floatingMenu/types.js +5 -0
- package/lib/commonjs/index.js +240 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/floatingMenu/AppHost.js +402 -0
- package/lib/module/floatingMenu/AppHostLogic.js +39 -0
- package/lib/module/floatingMenu/DefaultConfigContext.js +39 -0
- package/lib/module/floatingMenu/DevToolsSettingsModal.js +2273 -0
- package/lib/module/floatingMenu/DevToolsVisibilityContext.js +44 -0
- package/lib/module/floatingMenu/DraggableHeader.js +110 -0
- package/lib/module/floatingMenu/FloatingDevTools.js +249 -0
- package/lib/module/floatingMenu/FloatingMenu.js +358 -0
- package/lib/module/floatingMenu/MinimizedToolsContext.js +239 -0
- package/lib/module/floatingMenu/MinimizedToolsStack.js +202 -0
- package/lib/module/floatingMenu/ToggleStateManager.js +32 -0
- package/lib/module/floatingMenu/autoDiscoverPresets.js +236 -0
- package/lib/module/floatingMenu/defaultConfig.js +151 -0
- package/lib/module/floatingMenu/dial/DialDevTools.js +829 -0
- package/lib/module/floatingMenu/dial/DialIcon.js +241 -0
- package/lib/module/floatingMenu/dial/OnboardingTooltip.js +244 -0
- package/lib/module/floatingMenu/dial/onboardingConstants.js +64 -0
- package/lib/module/floatingMenu/floatingTools.js +767 -0
- package/lib/module/floatingMenu/settingsBus.js +19 -0
- package/lib/module/floatingMenu/types.js +3 -0
- package/lib/module/index.js +29 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts +39 -0
- package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts +37 -0
- package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts +27 -0
- package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +57 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts +25 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/DraggableHeader.d.ts +30 -0
- package/lib/typescript/commonjs/floatingMenu/DraggableHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts +226 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts +39 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts +95 -0
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts +10 -0
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts +21 -0
- package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts +75 -0
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +120 -0
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts +35 -0
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts +14 -0
- package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts +12 -0
- package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts +30 -0
- package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts +56 -0
- package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +10 -0
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/types.d.ts +56 -0
- package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +18 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/module/floatingMenu/AppHost.d.ts +39 -0
- package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts +37 -0
- package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts +27 -0
- package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +57 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts +25 -0
- package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DraggableHeader.d.ts +30 -0
- package/lib/typescript/module/floatingMenu/DraggableHeader.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts +226 -0
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts +39 -0
- package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts +95 -0
- package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts +10 -0
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts +21 -0
- package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts +75 -0
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +120 -0
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts +35 -0
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts +14 -0
- package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts +12 -0
- package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts +30 -0
- package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/floatingTools.d.ts +56 -0
- package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts +10 -0
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/types.d.ts +56 -0
- package/lib/typescript/module/floatingMenu/types.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +18 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class SimpleEventBus {
|
|
4
|
+
listeners = new Set();
|
|
5
|
+
emit(payload) {
|
|
6
|
+
this.listeners.forEach(l => {
|
|
7
|
+
try {
|
|
8
|
+
l(payload);
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.error("Error emitting event:", e);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
addListener(listener) {
|
|
15
|
+
this.listeners.add(listener);
|
|
16
|
+
return () => this.listeners.delete(listener);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const settingsBus = new SimpleEventBus();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Export unified component - primary interface
|
|
4
|
+
export { FloatingDevTools } from "./floatingMenu/FloatingDevTools.js";
|
|
5
|
+
// Export auto-discovery utilities
|
|
6
|
+
export { autoDiscoverPresets, autoDiscoverPresetsWithCustom } from "./floatingMenu/autoDiscoverPresets.js";
|
|
7
|
+
|
|
8
|
+
// Export default configuration types and utilities
|
|
9
|
+
export { createDefaultConfig, validateDialConfig, isFloatingToolId, isDialToolId, MAX_DIAL_TOOLS } from "./floatingMenu/defaultConfig.js";
|
|
10
|
+
// Export FloatingMenu and its types
|
|
11
|
+
export { FloatingMenu } from "./floatingMenu/FloatingMenu.js";
|
|
12
|
+
export * from "./floatingMenu/types.js";
|
|
13
|
+
export { DevToolsSettingsModal, useDevToolsSettings } from "./floatingMenu/DevToolsSettingsModal.js";
|
|
14
|
+
// Export AppHost components for advanced use cases
|
|
15
|
+
export { AppHostProvider, AppOverlay, useAppHost } from "./floatingMenu/AppHost.js";
|
|
16
|
+
|
|
17
|
+
// Export DevTools visibility tracking
|
|
18
|
+
export { DevToolsVisibilityProvider, useDevToolsVisibility } from "./floatingMenu/DevToolsVisibilityContext.js";
|
|
19
|
+
|
|
20
|
+
// Export toggle state manager
|
|
21
|
+
export { toggleStateManager } from "./floatingMenu/ToggleStateManager.js";
|
|
22
|
+
|
|
23
|
+
// Export minimized tools components
|
|
24
|
+
export { MinimizedToolsProvider, useMinimizedTools, getIconPosition, getIconSize } from "./floatingMenu/MinimizedToolsContext.js";
|
|
25
|
+
export { MinimizedToolsStack } from "./floatingMenu/MinimizedToolsStack.js";
|
|
26
|
+
|
|
27
|
+
// Re-export license functionality from @buoy-gg/license
|
|
28
|
+
// These are re-exported for convenience so users can import from @buoy-gg/core
|
|
29
|
+
export { LicenseManager, useLicense, useFeatureAccess, useSeats, useIsPro, setLicenseKey, isPro, hasEntitlement } from "@buoy-gg/license";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { AppInstance } from "./AppHostLogic";
|
|
3
|
+
import { ModalRestoreState } from "./MinimizedToolsContext";
|
|
4
|
+
type AppHostContextValue = {
|
|
5
|
+
openApps: AppInstance[];
|
|
6
|
+
isAnyOpen: boolean;
|
|
7
|
+
open: (def: Omit<AppInstance, "instanceId">) => string;
|
|
8
|
+
close: (instanceId?: string) => void;
|
|
9
|
+
closeAll: () => void;
|
|
10
|
+
registerApps?: (apps: any[]) => void;
|
|
11
|
+
/** Minimize a tool - hides the modal but keeps state */
|
|
12
|
+
minimize: (instanceId: string) => void;
|
|
13
|
+
/** Restore a minimized tool to visible state, optionally with saved modal state */
|
|
14
|
+
restore: (instanceId: string, restoreState?: ModalRestoreState) => void;
|
|
15
|
+
/** Check if a specific tool is minimized */
|
|
16
|
+
isMinimized: (instanceId: string) => boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Provides the floating dev tools application host. Tracks open tool instances, restores
|
|
20
|
+
* persisted state, and exposes imperative helpers used by `FloatingMenu` and friends.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AppHostProvider: ({ children }: {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}) => React.JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Accessor hook for the dev tools app host. Components can open/close tools or inspect
|
|
27
|
+
* the active stack. Falls back to a no-op implementation when rendered outside the provider.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useAppHost: () => AppHostContextValue;
|
|
30
|
+
/**
|
|
31
|
+
* Renders all dev tool surfaces. Keeps minimized apps mounted but hidden
|
|
32
|
+
* so their state and listeners are preserved (similar to React Navigation screens).
|
|
33
|
+
*
|
|
34
|
+
* Supports multiple simultaneous modals - each modal gets a z-index based on
|
|
35
|
+
* its position in the stack (later opened modals appear on top).
|
|
36
|
+
*/
|
|
37
|
+
export declare const AppOverlay: () => React.JSX.Element | null;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=AppHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHost.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/AppHost.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAQZ,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,WAAW,EAIZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAGjC,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,KAAK,MAAM,CAAC;IACvD,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACrC,wDAAwD;IACxD,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mFAAmF;IACnF,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACxE,4CAA4C;IAC5C,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9C,CAAC;AAaF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,sBA2NpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,2BAgBtB,CAAC;AAgGF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,gCAgFtB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { ModalRestoreState } from "./MinimizedToolsContext";
|
|
3
|
+
export type LaunchMode = "self-modal" | "host-modal" | "inline" | "toggle-only";
|
|
4
|
+
export type AppInstance = {
|
|
5
|
+
instanceId: string;
|
|
6
|
+
id: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
component: ComponentType<any>;
|
|
9
|
+
props?: Record<string, unknown>;
|
|
10
|
+
launchMode: LaunchMode;
|
|
11
|
+
singleton?: boolean;
|
|
12
|
+
/** Whether this app instance is currently minimized */
|
|
13
|
+
minimized?: boolean;
|
|
14
|
+
/** Icon to display when minimized */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Accent color for the tool */
|
|
17
|
+
color?: string;
|
|
18
|
+
/** Modal state to restore when un-minimizing */
|
|
19
|
+
restoreState?: ModalRestoreState;
|
|
20
|
+
};
|
|
21
|
+
export type OpenDefinition = Omit<AppInstance, "instanceId">;
|
|
22
|
+
/**
|
|
23
|
+
* Computes the new list of open tool instances when a user launches a dev app. Singleton
|
|
24
|
+
* tools reuse their existing instance while non-singletons create a new entry using the
|
|
25
|
+
* provided `generateId` helper.
|
|
26
|
+
*
|
|
27
|
+
* @param current - Current stack of open app instances.
|
|
28
|
+
* @param def - Descriptor of the tool to launch (without runtime instance id).
|
|
29
|
+
* @param generateId - Callback used to generate a unique instance identifier.
|
|
30
|
+
* @returns Updated instance list alongside the resolved instance id.
|
|
31
|
+
*/
|
|
32
|
+
export declare const resolveOpenAppsState: (current: AppInstance[], def: OpenDefinition, generateId: () => string) => {
|
|
33
|
+
apps: AppInstance[];
|
|
34
|
+
instanceId: string;
|
|
35
|
+
wasMinimized: boolean;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=AppHostLogic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHostLogic.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/AppHostLogic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEhF,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAE7D;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,WAAW,EAAE,EACtB,KAAK,cAAc,EACnB,YAAY,MAAM,MAAM,KACvB;IAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAuBlE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { DefaultFloatingConfig, DefaultDialConfig } from './defaultConfig';
|
|
3
|
+
/**
|
|
4
|
+
* Context value for default configuration settings.
|
|
5
|
+
*/
|
|
6
|
+
export interface DefaultConfigContextValue {
|
|
7
|
+
/** Default tools to enable in the floating bubble when no user settings exist. */
|
|
8
|
+
defaultFloatingTools?: DefaultFloatingConfig;
|
|
9
|
+
/** Default tools to enable in the dial menu when no user settings exist (max 6). */
|
|
10
|
+
defaultDialTools?: DefaultDialConfig;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Provider for default configuration that can be consumed by the settings system.
|
|
14
|
+
* This allows teams to set default tool configurations without prop drilling.
|
|
15
|
+
*
|
|
16
|
+
* @internal Used by FloatingDevTools to provide defaults to the settings hook.
|
|
17
|
+
*/
|
|
18
|
+
export declare function DefaultConfigProvider({ children, defaultFloatingTools, defaultDialTools, }: DefaultConfigContextValue & {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Hook to access the default configuration from context.
|
|
23
|
+
*
|
|
24
|
+
* @internal Used by useDevToolsSettings to apply defaults.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useDefaultConfig(): DefaultConfigContextValue;
|
|
27
|
+
//# sourceMappingURL=DefaultConfigContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/DefaultConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,qBAAqB,CAAC;IAC7C,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;CACtC;AAID;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,GACjB,EAAE,yBAAyB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,qBAcrD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,yBAAyB,CAE5D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Global settings that apply to all dev tools.
|
|
4
|
+
* These settings override individual tool configurations.
|
|
5
|
+
*/
|
|
6
|
+
export interface GlobalDevToolsSettings {
|
|
7
|
+
/**
|
|
8
|
+
* When true, all modals share the same dimensions/position.
|
|
9
|
+
* When false (default), each modal has its own independent persistence.
|
|
10
|
+
* Priority: Settings UI > Prop override > Default (false)
|
|
11
|
+
*/
|
|
12
|
+
enableSharedModalDimensions?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Serialized preferences that power the floating dev tools UI. Values persist across sessions
|
|
16
|
+
* via AsyncStorage so teams can tailor which tools appear in the dial or floating row.
|
|
17
|
+
*/
|
|
18
|
+
export interface DevToolsSettings {
|
|
19
|
+
/** Map of dial tool ids to enabled state (max slots enforced elsewhere). */
|
|
20
|
+
dialTools: Record<string, boolean>;
|
|
21
|
+
/** Map of floating tool ids to enabled state plus the environment indicator toggle. */
|
|
22
|
+
floatingTools: Record<string, boolean> & {
|
|
23
|
+
environment: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Global settings that apply to all dev tools */
|
|
26
|
+
globalSettings?: GlobalDevToolsSettings;
|
|
27
|
+
}
|
|
28
|
+
interface DevToolsSettingsModalProps {
|
|
29
|
+
visible: boolean;
|
|
30
|
+
onClose: () => void;
|
|
31
|
+
onSettingsChange?: (settings: DevToolsSettings) => void;
|
|
32
|
+
initialSettings?: DevToolsSettings;
|
|
33
|
+
availableApps?: {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
slot?: "dial" | "row" | "both";
|
|
38
|
+
}[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Configurable modal surface that lets engineers pick which dev tools appear in the dial and
|
|
42
|
+
* floating row. Persists preferences and enforces slot limits for a consistent UX.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DevToolsSettingsModal: FC<DevToolsSettingsModalProps>;
|
|
45
|
+
/**
|
|
46
|
+
* Convenience hook for accessing persisted dev tools settings. Subscribes to the internal
|
|
47
|
+
* event bus so all surfaces stay in sync when the modal saves new preferences.
|
|
48
|
+
*
|
|
49
|
+
* When no saved settings exist, the hook uses the default configuration from
|
|
50
|
+
* the DefaultConfigProvider (if available) to determine initial tool states.
|
|
51
|
+
*/
|
|
52
|
+
export declare const useDevToolsSettings: () => {
|
|
53
|
+
settings: DevToolsSettings;
|
|
54
|
+
refreshSettings: () => void;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=DevToolsSettingsModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevToolsSettingsModal.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/DevToolsSettingsModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6C,EAAE,EAAE,MAAM,OAAO,CAAC;AA8MtE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,uFAAuF;IACvF,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QACvC,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,kDAAkD;IAClD,cAAc,CAAC,EAAE,sBAAsB,CAAC;CACzC;AAED,UAAU,0BAA0B;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,aAAa,CAAC,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;KAChC,EAAE,CAAC;CACL;AAsDD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAgrChE,CAAC;AAiDF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;CAuD/B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DevToolsVisibilityContext
|
|
3
|
+
*
|
|
4
|
+
* Tracks when DevTools UI is visible (dial menu, modals, etc.)
|
|
5
|
+
* Used by other tools (like debug borders) to hide when DevTools are active
|
|
6
|
+
*/
|
|
7
|
+
import { ReactNode } from "react";
|
|
8
|
+
interface DevToolsVisibilityContextValue {
|
|
9
|
+
/** True when dial menu is open */
|
|
10
|
+
isDialOpen: boolean;
|
|
11
|
+
/** True when any DevTools modal/tool is open */
|
|
12
|
+
isToolOpen: boolean;
|
|
13
|
+
/** True when either dial or any tool is open */
|
|
14
|
+
isDevToolsActive: boolean;
|
|
15
|
+
/** Set dial open state */
|
|
16
|
+
setDialOpen: (open: boolean) => void;
|
|
17
|
+
/** Set tool open state */
|
|
18
|
+
setToolOpen: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function DevToolsVisibilityProvider({ children, }: {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
export declare function useDevToolsVisibility(): DevToolsVisibilityContextValue;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=DevToolsVisibilityContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevToolsVisibilityContext.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/DevToolsVisibilityContext.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAGL,SAAS,EAKV,MAAM,OAAO,CAAC;AAEf,UAAU,8BAA8B;IACtC,kCAAkC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0BAA0B;IAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,0BAA0B;IAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC;AAKD,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAyBA;AAED,wBAAgB,qBAAqB,mCAapC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Animated, type ViewStyle, type StyleProp } from 'react-native';
|
|
3
|
+
interface DraggableHeaderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
position: Animated.ValueXY;
|
|
6
|
+
onDragStart?: () => void;
|
|
7
|
+
onDragEnd?: (finalPosition: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}) => void;
|
|
11
|
+
onTap?: () => void;
|
|
12
|
+
containerBounds?: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
elementSize?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
minPosition?: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
maxOverflowX?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare const DraggableHeader: import("react").NamedExoticComponent<DraggableHeaderProps>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=DraggableHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraggableHeader.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/DraggableHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAsB,QAAQ,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAExG,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,WAAW,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,4DA4F1B,CAAC"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type FloatingMenuProps } from "./FloatingMenu";
|
|
3
|
+
import type { InstalledApp } from "./types";
|
|
4
|
+
import { type DefaultFloatingConfig, type DefaultDialConfig } from "./defaultConfig";
|
|
5
|
+
/**
|
|
6
|
+
* Environment variable configuration
|
|
7
|
+
*
|
|
8
|
+
* This type is compatible with RequiredEnvVar from @buoy-gg/env
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // Simple string (just check existence)
|
|
13
|
+
* "API_URL"
|
|
14
|
+
*
|
|
15
|
+
* // Check for specific type
|
|
16
|
+
* { key: "DEBUG_MODE", expectedType: "boolean" }
|
|
17
|
+
*
|
|
18
|
+
* // Check for specific value
|
|
19
|
+
* { key: "ENVIRONMENT", expectedValue: "development" }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export type EnvVarConfig = string | {
|
|
23
|
+
key: string;
|
|
24
|
+
expectedValue: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
} | {
|
|
27
|
+
key: string;
|
|
28
|
+
expectedType: "string" | "number" | "boolean" | "object" | "array" | "url";
|
|
29
|
+
description?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Storage key configuration for monitoring
|
|
33
|
+
*/
|
|
34
|
+
export interface StorageKeyConfig {
|
|
35
|
+
key: string;
|
|
36
|
+
expectedType?: "string" | "number" | "boolean" | "object";
|
|
37
|
+
expectedValue?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
storageType: "async" | "secure" | "mmkv";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props for FloatingDevTools component.
|
|
43
|
+
* Apps prop is optional - if not provided, all installed dev tools are auto-discovered.
|
|
44
|
+
*/
|
|
45
|
+
export interface FloatingDevToolsProps extends Omit<FloatingMenuProps, "apps"> {
|
|
46
|
+
/**
|
|
47
|
+
* Optional array of custom dev tool apps or overrides.
|
|
48
|
+
* Use this ONLY for custom tools or to override built-in tool behavior.
|
|
49
|
+
* Auto-discovered tools will be merged with these apps.
|
|
50
|
+
* Apps with matching IDs will override auto-discovered ones.
|
|
51
|
+
*/
|
|
52
|
+
apps?: InstalledApp[];
|
|
53
|
+
/**
|
|
54
|
+
* Optional environment variables to validate.
|
|
55
|
+
* Just pass the array directly - no wrapper function needed!
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <FloatingDevTools
|
|
60
|
+
* requiredEnvVars={[
|
|
61
|
+
* "API_URL", // Just check if exists
|
|
62
|
+
* { key: "DEBUG_MODE", expectedType: "boolean" },
|
|
63
|
+
* { key: "ENVIRONMENT", expectedValue: "development" },
|
|
64
|
+
* ]}
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
requiredEnvVars?: EnvVarConfig[];
|
|
69
|
+
/**
|
|
70
|
+
* Optional storage keys to monitor.
|
|
71
|
+
* Just pass the array directly!
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <FloatingDevTools
|
|
76
|
+
* requiredStorageKeys={[
|
|
77
|
+
* { key: "@app/session", expectedType: "string", storageType: "async" },
|
|
78
|
+
* ]}
|
|
79
|
+
* />
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
requiredStorageKeys?: StorageKeyConfig[];
|
|
83
|
+
/**
|
|
84
|
+
* Optional children to render within the DevToolsVisibilityProvider context.
|
|
85
|
+
* Useful for tools that need to react to DevTools visibility (like DebugBordersStandaloneOverlay).
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* <FloatingDevTools>
|
|
90
|
+
* <DebugBordersStandaloneOverlay />
|
|
91
|
+
* </FloatingDevTools>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
children?: React.ReactNode;
|
|
95
|
+
/**
|
|
96
|
+
* Disable all onboarding hints and tooltips.
|
|
97
|
+
* Set to true if you don't want to show any first-time user hints.
|
|
98
|
+
*
|
|
99
|
+
* @default false
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <FloatingDevTools disableHints />
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
disableHints?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Default tools to enable in the floating bubble row when no user settings exist.
|
|
108
|
+
* Teams can use this to pre-configure which tools appear by default.
|
|
109
|
+
* User settings (once saved) will override these defaults.
|
|
110
|
+
*
|
|
111
|
+
* Type-safe: Only valid tool IDs are allowed with full autocomplete support.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <FloatingDevTools
|
|
116
|
+
* defaultFloatingTools={['env', 'environment', 'network', 'query-wifi-toggle']}
|
|
117
|
+
* />
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
defaultFloatingTools?: DefaultFloatingConfig;
|
|
121
|
+
/**
|
|
122
|
+
* Default tools to enable in the dial menu when no user settings exist.
|
|
123
|
+
* Teams can use this to pre-configure which tools appear by default.
|
|
124
|
+
* User settings (once saved) will override these defaults.
|
|
125
|
+
*
|
|
126
|
+
* Type-safe: Only valid tool IDs are allowed with full autocomplete support.
|
|
127
|
+
* Maximum 6 tools allowed - validation will throw a helpful error if exceeded.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <FloatingDevTools
|
|
132
|
+
* defaultDialTools={['env', 'network', 'storage', 'query', 'route-events', 'debug-borders']}
|
|
133
|
+
* />
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
defaultDialTools?: DefaultDialConfig;
|
|
137
|
+
/**
|
|
138
|
+
* List of environments available for switching.
|
|
139
|
+
* When provided along with onEnvironmentSwitch, the environment badge becomes
|
|
140
|
+
* interactive and allows users to switch between environments.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```tsx
|
|
144
|
+
* <FloatingDevTools
|
|
145
|
+
* environment="dev"
|
|
146
|
+
* availableEnvironments={['dev', 'qa', 'staging', 'prod']}
|
|
147
|
+
* onEnvironmentSwitch={(env) => {
|
|
148
|
+
* // Handle environment switch - update your app's environment
|
|
149
|
+
* setCurrentEnvironment(env);
|
|
150
|
+
* }}
|
|
151
|
+
* />
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
availableEnvironments?: import("@buoy-gg/shared-ui").Environment[];
|
|
155
|
+
/**
|
|
156
|
+
* Callback fired when the user selects an environment from the switcher.
|
|
157
|
+
* The app is responsible for actually switching environments and updating
|
|
158
|
+
* the `environment` prop - we just notify you of the user's selection.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```tsx
|
|
162
|
+
* onEnvironmentSwitch={(env) => {
|
|
163
|
+
* // Your logic here - e.g., update API base URL, clear caches, etc.
|
|
164
|
+
* console.log(`User wants to switch to ${env}`);
|
|
165
|
+
* setCurrentEnvironment(env);
|
|
166
|
+
* }}
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
onEnvironmentSwitch?: (environment: import("@buoy-gg/shared-ui").Environment) => void;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Unified floating development tools component with automatic preset discovery.
|
|
173
|
+
*
|
|
174
|
+
* This component combines AppHostProvider, FloatingMenu, and AppOverlay
|
|
175
|
+
* into a single component for simplified setup and better developer experience.
|
|
176
|
+
*
|
|
177
|
+
* **Zero-Config Usage:**
|
|
178
|
+
* ```tsx
|
|
179
|
+
* <FloatingDevTools environment="local" userRole="admin" />
|
|
180
|
+
* // All installed dev tools automatically appear!
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* **With Team Default Configuration (Type-Safe!):**
|
|
184
|
+
* ```tsx
|
|
185
|
+
* // Set which tools are enabled by default for your team
|
|
186
|
+
* <FloatingDevTools
|
|
187
|
+
* // Floating bubble: ENV badge + WiFi toggle
|
|
188
|
+
* defaultFloatingTools={['env', 'environment', 'query-wifi-toggle']}
|
|
189
|
+
* // Dial menu: your team's 6 favorite tools (max 6!)
|
|
190
|
+
* defaultDialTools={['env', 'network', 'storage', 'query', 'route-events', 'debug-borders']}
|
|
191
|
+
* environment="local"
|
|
192
|
+
* userRole="admin"
|
|
193
|
+
* />
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* **With Validation (Super Simple!):**
|
|
197
|
+
* ```tsx
|
|
198
|
+
* <FloatingDevTools
|
|
199
|
+
* requiredEnvVars={[
|
|
200
|
+
* "API_URL", // Just check existence
|
|
201
|
+
* { key: "DEBUG_MODE", expectedType: "boolean" },
|
|
202
|
+
* ]}
|
|
203
|
+
* requiredStorageKeys={[
|
|
204
|
+
* { key: "@app/session", storageType: "async" },
|
|
205
|
+
* ]}
|
|
206
|
+
* environment="local"
|
|
207
|
+
* userRole="admin"
|
|
208
|
+
* />
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* **With Custom Tools:**
|
|
212
|
+
* ```tsx
|
|
213
|
+
* <FloatingDevTools
|
|
214
|
+
* apps={[myCustomTool]}
|
|
215
|
+
* environment="local"
|
|
216
|
+
* userRole="admin"
|
|
217
|
+
* />
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* The component is absolutely positioned to float on top of your application
|
|
221
|
+
* regardless of where it's placed in the component tree.
|
|
222
|
+
*
|
|
223
|
+
* @param props - FloatingDevTools props
|
|
224
|
+
*/
|
|
225
|
+
export declare const FloatingDevTools: ({ apps, requiredEnvVars, requiredStorageKeys, children, disableHints, defaultFloatingTools, defaultDialTools, ...props }: FloatingDevToolsProps) => React.JSX.Element;
|
|
226
|
+
//# sourceMappingURL=FloatingDevTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingDevTools.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/FloatingDevTools.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAG1E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,KAAK,CAAC;IACV,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAC5E;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;IAEtB;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;IAEjC;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEzC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,qBAAqB,CAAC;IAE7C;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IAErC;;;;;;;;;;;;;;;;OAgBG;IACH,qBAAqB,CAAC,EAAE,OAAO,oBAAoB,EAAE,WAAW,EAAE,CAAC;IAEnE;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,oBAAoB,EAAE,WAAW,KAAK,IAAI,CAAC;CAEvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,gBAAgB,GAAI,0HAS9B,qBAAqB,sBAuIvB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { UserRole } from "./floatingTools";
|
|
3
|
+
import type { InstalledApp, FloatingMenuActions, FloatingMenuState } from "./types";
|
|
4
|
+
import type { DefaultFloatingConfig, DefaultDialConfig } from "./defaultConfig";
|
|
5
|
+
import type { Environment } from "@buoy-gg/shared-ui";
|
|
6
|
+
/**
|
|
7
|
+
* Props for the floating developer tools launcher. Controls which apps are shown and
|
|
8
|
+
* how the menu integrates with the current host environment.
|
|
9
|
+
*/
|
|
10
|
+
export interface FloatingMenuProps {
|
|
11
|
+
/** Dev tool apps that can be opened from the floating menu. */
|
|
12
|
+
apps: InstalledApp[];
|
|
13
|
+
/** Shared state object passed to app renderers (e.g. icons) and the dial. */
|
|
14
|
+
state?: FloatingMenuState;
|
|
15
|
+
/** Shared action callbacks exposed to app renderers for interacting with the menu. */
|
|
16
|
+
actions?: FloatingMenuActions;
|
|
17
|
+
/** When true, hides the floating row (used when another dev app takes focus). */
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
/** Active environment metadata displayed via the environment indicator, if enabled. */
|
|
20
|
+
environment?: Environment;
|
|
21
|
+
/** Optional role that determines which user status badge is rendered. */
|
|
22
|
+
userRole?: UserRole;
|
|
23
|
+
/** Default tools to enable in the floating bubble when no user settings exist. */
|
|
24
|
+
defaultFloatingTools?: DefaultFloatingConfig;
|
|
25
|
+
/** Default tools to enable in the dial menu when no user settings exist (max 6). */
|
|
26
|
+
defaultDialTools?: DefaultDialConfig;
|
|
27
|
+
/**
|
|
28
|
+
* List of environments available for switching.
|
|
29
|
+
* When provided along with onEnvironmentSwitch, the environment badge becomes interactive.
|
|
30
|
+
*/
|
|
31
|
+
availableEnvironments?: Environment[];
|
|
32
|
+
/**
|
|
33
|
+
* Callback fired when the user selects an environment from the switcher.
|
|
34
|
+
* The app is responsible for actually switching environments and updating the `environment` prop.
|
|
35
|
+
*/
|
|
36
|
+
onEnvironmentSwitch?: (environment: Environment) => void;
|
|
37
|
+
}
|
|
38
|
+
export declare const FloatingMenu: FC<FloatingMenuProps>;
|
|
39
|
+
//# sourceMappingURL=FloatingMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingMenu.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/FloatingMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAqD,MAAM,OAAO,CAAC;AASrF,OAAO,EAAiB,QAAQ,EAAc,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAetD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,sFAAsF;IACtF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,kFAAkF;IAClF,oBAAoB,CAAC,EAAE,qBAAqB,CAAC;IAC7C,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,WAAW,EAAE,CAAC;IACtC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1D;AAYD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAoU9C,CAAC"}
|