@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,95 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Modal state to restore when reopening a minimized tool
|
|
4
|
+
*/
|
|
5
|
+
export interface ModalRestoreState {
|
|
6
|
+
/** Modal display mode */
|
|
7
|
+
mode: "bottomSheet" | "floating";
|
|
8
|
+
/** Panel height for bottom sheet mode */
|
|
9
|
+
panelHeight?: number;
|
|
10
|
+
/** Position for floating mode */
|
|
11
|
+
floatingPosition?: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
};
|
|
15
|
+
/** Dimensions for floating mode */
|
|
16
|
+
floatingDimensions?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Represents a minimized tool that can be restored
|
|
23
|
+
*/
|
|
24
|
+
export interface MinimizedTool {
|
|
25
|
+
/** Unique instance ID for this minimized tool */
|
|
26
|
+
instanceId: string;
|
|
27
|
+
/** Tool identifier (e.g., "storage", "network") */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Display name for the tool */
|
|
30
|
+
title: string;
|
|
31
|
+
/** Icon component or element to display in the minimized stack */
|
|
32
|
+
icon: ReactNode;
|
|
33
|
+
/** Accent color for the tool */
|
|
34
|
+
color?: string;
|
|
35
|
+
/** Timestamp when the tool was minimized */
|
|
36
|
+
minimizedAt: number;
|
|
37
|
+
/** Modal state to restore when reopening */
|
|
38
|
+
modalState?: ModalRestoreState;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Position for a minimized tool icon in the stack
|
|
42
|
+
*/
|
|
43
|
+
export interface IconPosition {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Calculate the position of a minimized tool icon in the stack
|
|
49
|
+
* Icons stack upward from bottom-right corner
|
|
50
|
+
*/
|
|
51
|
+
export declare function getIconPosition(index: number): IconPosition;
|
|
52
|
+
/**
|
|
53
|
+
* Get the icon size constant
|
|
54
|
+
*/
|
|
55
|
+
export declare function getIconSize(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Context value for minimized tools management
|
|
58
|
+
*/
|
|
59
|
+
interface MinimizedToolsContextValue {
|
|
60
|
+
/** List of currently minimized tools */
|
|
61
|
+
minimizedTools: MinimizedTool[];
|
|
62
|
+
/** Minimize a tool - removes from open apps and adds to minimized stack */
|
|
63
|
+
minimize: (tool: Omit<MinimizedTool, "minimizedAt">) => void;
|
|
64
|
+
/** Restore a minimized tool - removes from stack and triggers reopen */
|
|
65
|
+
restore: (instanceId: string) => MinimizedTool | null;
|
|
66
|
+
/** Check if a tool is currently minimized */
|
|
67
|
+
isMinimized: (id: string) => boolean;
|
|
68
|
+
/** Get a minimized tool by its instance ID */
|
|
69
|
+
getMinimizedTool: (instanceId: string) => MinimizedTool | undefined;
|
|
70
|
+
/** Clear all minimized tools */
|
|
71
|
+
clearAll: () => void;
|
|
72
|
+
/** Number of minimized tools */
|
|
73
|
+
count: number;
|
|
74
|
+
/** Get the target position for a new minimized icon (for animation) */
|
|
75
|
+
getNextIconPosition: () => IconPosition;
|
|
76
|
+
/** Get position of an existing minimized tool's icon */
|
|
77
|
+
getToolIconPosition: (instanceId: string) => IconPosition | null;
|
|
78
|
+
}
|
|
79
|
+
interface MinimizedToolsProviderProps {
|
|
80
|
+
children: ReactNode;
|
|
81
|
+
/** Callback to get icon for a tool by its id (used for restoration from storage) */
|
|
82
|
+
getToolIcon?: (id: string) => ReactNode;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Provider component for minimized tools management.
|
|
86
|
+
* Handles state, persistence, and provides context to children.
|
|
87
|
+
*/
|
|
88
|
+
export declare function MinimizedToolsProvider({ children, getToolIcon, }: MinimizedToolsProviderProps): React.JSX.Element;
|
|
89
|
+
/**
|
|
90
|
+
* Hook to access minimized tools context.
|
|
91
|
+
* Must be used within a MinimizedToolsProvider.
|
|
92
|
+
*/
|
|
93
|
+
export declare function useMinimizedTools(): MinimizedToolsContextValue;
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=MinimizedToolsContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinimizedToolsContext.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/MinimizedToolsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,SAAS,EAEV,MAA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M,KAAK,aAAa,GAAG,IAAI,CAAC;IACtD,6CAA6C;IAC7C,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,8CAA8C;IAC9C,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IACpE,gCAAgC;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,mBAAmB,EAAE,MAAM,YAAY,CAAC;IACxC,wDAAwD;IACxD,mBAAmB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,YAAY,GAAG,IAAI,CAAC;CAClE;AAkCD,UAAU,2BAA2B;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,oFAAoF;IACpF,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,WAAW,GACZ,EAAE,2BAA2B,qBAwJ7B;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAmB9D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MinimizedTool } from "./MinimizedToolsContext";
|
|
3
|
+
export interface MinimizedToolsStackProps {
|
|
4
|
+
/** Callback when a tool should be restored */
|
|
5
|
+
onRestore?: (tool: MinimizedTool) => void;
|
|
6
|
+
/** Width of the parent container (for matching widths) */
|
|
7
|
+
containerWidth?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function MinimizedToolsStack({ onRestore, containerWidth, }: MinimizedToolsStackProps): React.JSX.Element;
|
|
10
|
+
//# sourceMappingURL=MinimizedToolsStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinimizedToolsStack.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/MinimizedToolsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAS9D,OAAO,EAAqB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA+K3E,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,cAA8B,GAC/B,EAAE,wBAAwB,qBA8C1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToggleStateManager
|
|
3
|
+
*
|
|
4
|
+
* Global event emitter for toggle-only dev tools to notify when their state changes.
|
|
5
|
+
* This allows FloatingMenu to re-render and update icon colors.
|
|
6
|
+
*/
|
|
7
|
+
type Listener = () => void;
|
|
8
|
+
declare class ToggleStateManager {
|
|
9
|
+
private listeners;
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to any toggle state change
|
|
12
|
+
*/
|
|
13
|
+
subscribe(listener: Listener): () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Notify all subscribers that a toggle state changed
|
|
16
|
+
*/
|
|
17
|
+
notify(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const toggleStateManager: ToggleStateManager;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=ToggleStateManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleStateManager.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/ToggleStateManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,cAAM,kBAAkB;IACtB,OAAO,CAAC,SAAS,CAA4B;IAE7C;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IAOzC;;OAEG;IACH,MAAM,IAAI,IAAI;CAGf;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { InstalledApp } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Automatically discovers and loads dev tool presets from installed packages.
|
|
4
|
+
*
|
|
5
|
+
* This function attempts to import presets from known dev tool packages.
|
|
6
|
+
* If a package is installed, its preset will be automatically loaded.
|
|
7
|
+
* If a package is not installed, it will be silently skipped.
|
|
8
|
+
*
|
|
9
|
+
* This enables zero-config setup - just install the packages you want
|
|
10
|
+
* and they'll automatically appear in your dev tools!
|
|
11
|
+
*
|
|
12
|
+
* @returns Array of automatically discovered preset configurations
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { FloatingDevTools, autoDiscoverPresets } from '@buoy-gg/core';
|
|
17
|
+
*
|
|
18
|
+
* // Automatically discover and load all installed dev tool presets
|
|
19
|
+
* const autoPresets = autoDiscoverPresets();
|
|
20
|
+
*
|
|
21
|
+
* function App() {
|
|
22
|
+
* return (
|
|
23
|
+
* <FloatingDevTools
|
|
24
|
+
* apps={autoPresets} // That's it! All installed tools load automatically
|
|
25
|
+
* environment="local"
|
|
26
|
+
* userRole="admin"
|
|
27
|
+
* />
|
|
28
|
+
* );
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Combine auto-discovery with custom tools
|
|
35
|
+
* const autoPresets = autoDiscoverPresets();
|
|
36
|
+
* const customTools = [
|
|
37
|
+
* {
|
|
38
|
+
* id: "my-custom-tool",
|
|
39
|
+
* name: "CUSTOM",
|
|
40
|
+
* // ... custom config
|
|
41
|
+
* },
|
|
42
|
+
* ];
|
|
43
|
+
*
|
|
44
|
+
* const allTools = [...autoPresets, ...customTools];
|
|
45
|
+
*
|
|
46
|
+
* <FloatingDevTools apps={allTools} />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function autoDiscoverPresets(): InstalledApp[];
|
|
50
|
+
/**
|
|
51
|
+
* Merges auto-discovered presets with custom tools, ensuring no duplicates.
|
|
52
|
+
* Custom tools take precedence over auto-discovered ones with the same ID.
|
|
53
|
+
*
|
|
54
|
+
* @param customTools - Array of custom tool configurations
|
|
55
|
+
* @returns Combined array of tools with custom tools taking precedence
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* import { FloatingDevTools, autoDiscoverPresetsWithCustom } from '@buoy-gg/core';
|
|
60
|
+
* import { createEnvTool } from '@buoy-gg/env';
|
|
61
|
+
*
|
|
62
|
+
* const customTools = [
|
|
63
|
+
* // Override the env preset with custom config
|
|
64
|
+
* createEnvTool({
|
|
65
|
+
* requiredEnvVars: myRequiredVars,
|
|
66
|
+
* }),
|
|
67
|
+
* ];
|
|
68
|
+
*
|
|
69
|
+
* const allTools = autoDiscoverPresetsWithCustom(customTools);
|
|
70
|
+
*
|
|
71
|
+
* <FloatingDevTools apps={allTools} />
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function autoDiscoverPresetsWithCustom(customTools: InstalledApp[]): InstalledApp[];
|
|
75
|
+
//# sourceMappingURL=autoDiscoverPresets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoDiscoverPresets.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/autoDiscoverPresets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,EAAE,CA0IpD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,YAAY,EAAE,GAC1B,YAAY,EAAE,CAahB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-safe default configuration for React Buoy DevTools.
|
|
3
|
+
*
|
|
4
|
+
* This module provides a simple, type-safe way for teams to configure
|
|
5
|
+
* which tools are enabled by default in the floating menu and dial menu.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { FloatingDevTools } from '@buoy-gg/core';
|
|
10
|
+
*
|
|
11
|
+
* // Simple: Enable specific tools by default
|
|
12
|
+
* <FloatingDevTools
|
|
13
|
+
* defaultFloatingTools={['env', 'environment', 'network']}
|
|
14
|
+
* defaultDialTools={['env', 'network', 'storage', 'query']}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* All known tool IDs that can appear in the floating menu or dial menu.
|
|
20
|
+
* This is a union type of all auto-discovered tool IDs.
|
|
21
|
+
*/
|
|
22
|
+
export type BuiltInToolId = 'env' | 'network' | 'storage' | 'query' | 'query-wifi-toggle' | 'route-events' | 'debug-borders' | 'highlight-updates' | 'highlight-updates-modal' | 'benchmark';
|
|
23
|
+
/**
|
|
24
|
+
* Special floating-only tool IDs that only appear in the floating bubble row.
|
|
25
|
+
*/
|
|
26
|
+
export type FloatingOnlyToolId = 'environment';
|
|
27
|
+
/**
|
|
28
|
+
* All tool IDs that can appear in the floating menu (bubble row).
|
|
29
|
+
* Includes all built-in tools plus floating-only tools.
|
|
30
|
+
*/
|
|
31
|
+
export type FloatingToolId = BuiltInToolId | FloatingOnlyToolId;
|
|
32
|
+
/**
|
|
33
|
+
* Tool IDs that can appear in the dial menu.
|
|
34
|
+
* Same as BuiltInToolId (environment badge is floating-only).
|
|
35
|
+
*/
|
|
36
|
+
export type DialToolId = BuiltInToolId;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum number of tools allowed in the dial menu.
|
|
39
|
+
*/
|
|
40
|
+
export declare const MAX_DIAL_TOOLS = 6;
|
|
41
|
+
/**
|
|
42
|
+
* Configuration for default floating menu tools.
|
|
43
|
+
* Pass an array of tool IDs to enable by default.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* const floatingDefaults: DefaultFloatingConfig = ['env', 'environment', 'network'];
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export type DefaultFloatingConfig = FloatingToolId[];
|
|
51
|
+
/**
|
|
52
|
+
* Configuration for default dial menu tools.
|
|
53
|
+
* Pass an array of 1-6 tool IDs to enable by default.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* const dialDefaults: DefaultDialConfig = ['env', 'network', 'storage', 'query'];
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export type DefaultDialConfig = DialToolId[];
|
|
61
|
+
/**
|
|
62
|
+
* Validates that a dial configuration doesn't exceed the maximum allowed tools.
|
|
63
|
+
* Throws an error with helpful message if validation fails.
|
|
64
|
+
*
|
|
65
|
+
* @param tools - Array of dial tool IDs to validate
|
|
66
|
+
* @throws Error if more than MAX_DIAL_TOOLS are provided
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // This is valid
|
|
71
|
+
* validateDialConfig(['env', 'network', 'storage']);
|
|
72
|
+
*
|
|
73
|
+
* // This throws an error
|
|
74
|
+
* validateDialConfig(['env', 'network', 'storage', 'query', 'route-events', 'debug-borders', 'benchmark']);
|
|
75
|
+
* // Error: "Dial menu default configuration has 7 tools, but maximum is 6..."
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateDialConfig(tools: DefaultDialConfig): void;
|
|
79
|
+
/**
|
|
80
|
+
* Helper to create a type-safe default configuration.
|
|
81
|
+
* Provides autocomplete and validation at compile time.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* import { createDefaultConfig } from '@buoy-gg/core';
|
|
86
|
+
*
|
|
87
|
+
* const config = createDefaultConfig({
|
|
88
|
+
* floating: ['env', 'environment', 'network', 'query-wifi-toggle'],
|
|
89
|
+
* dial: ['env', 'network', 'storage', 'query', 'route-events', 'debug-borders'],
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* <FloatingDevTools
|
|
93
|
+
* defaultFloatingTools={config.floating}
|
|
94
|
+
* defaultDialTools={config.dial}
|
|
95
|
+
* />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function createDefaultConfig<F extends FloatingToolId[], D extends DialToolId[]>(config: {
|
|
99
|
+
floating?: F;
|
|
100
|
+
dial?: D;
|
|
101
|
+
}): {
|
|
102
|
+
floating: F | undefined;
|
|
103
|
+
dial: D | undefined;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Type guard to check if a string is a valid FloatingToolId.
|
|
107
|
+
*/
|
|
108
|
+
export declare function isFloatingToolId(id: string): id is FloatingToolId;
|
|
109
|
+
/**
|
|
110
|
+
* Type guard to check if a string is a valid DialToolId.
|
|
111
|
+
*/
|
|
112
|
+
export declare function isDialToolId(id: string): id is DialToolId;
|
|
113
|
+
/**
|
|
114
|
+
* Converts an array of tool IDs into a settings record.
|
|
115
|
+
* Used internally to convert default config to DevToolsSettings format.
|
|
116
|
+
*
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
export declare function toolIdsToRecord<T extends string>(ids: T[], allPossibleIds: T[]): Record<string, boolean>;
|
|
120
|
+
//# sourceMappingURL=defaultConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConfig.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/defaultConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,SAAS,GACT,SAAS,GACT,OAAO,GACP,mBAAmB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|
+
import { ReactNode, FC } from "react";
|
|
2
|
+
import { type DevToolsSettings } from "../DevToolsSettingsModal";
|
|
3
|
+
import type { InstalledApp, FloatingMenuActions, FloatingMenuState } from "../types";
|
|
4
|
+
export type IconType = {
|
|
5
|
+
id?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Original icon component/function for dynamic rendering with hooks.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ IMPORTANT - DO NOT REMOVE THIS PROPERTY ⚠️
|
|
12
|
+
* This allows DialIcon to render the icon as a JSX component, enabling
|
|
13
|
+
* React hooks to work (e.g., WiFi toggle subscribing to onlineManager).
|
|
14
|
+
*/
|
|
15
|
+
iconComponent?: (ctx: {
|
|
16
|
+
slot?: string;
|
|
17
|
+
size?: number;
|
|
18
|
+
state?: FloatingMenuState;
|
|
19
|
+
actions?: FloatingMenuActions;
|
|
20
|
+
}) => ReactNode;
|
|
21
|
+
color: string;
|
|
22
|
+
onPress: () => void;
|
|
23
|
+
};
|
|
24
|
+
interface DialDevToolsProps {
|
|
25
|
+
onClose?: () => void;
|
|
26
|
+
onSettingsPress?: () => void;
|
|
27
|
+
settings?: DevToolsSettings;
|
|
28
|
+
autoOpenSettings?: boolean;
|
|
29
|
+
apps: InstalledApp[];
|
|
30
|
+
state?: FloatingMenuState;
|
|
31
|
+
actions?: FloatingMenuActions;
|
|
32
|
+
}
|
|
33
|
+
export declare const DialDevTools: FC<DialDevToolsProps>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=DialDevTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialDevTools.d.ts","sourceRoot":"","sources":["../../../../../src/floatingMenu/dial/DialDevTools.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,SAAS,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmB5E,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAqBlB,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;KAAE,KAAK,SAAS,CAAC;IAC/H,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAgpB9C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { Animated } from "react-native";
|
|
3
|
+
import { IconType } from "./DialDevTools";
|
|
4
|
+
type Props = {
|
|
5
|
+
index: number;
|
|
6
|
+
icon: IconType;
|
|
7
|
+
iconsProgress: Animated.Value;
|
|
8
|
+
onPress: (index: number) => void;
|
|
9
|
+
selectedIcon: number;
|
|
10
|
+
totalIcons: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const DialIcon: FC<Props>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=DialIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialIcon.d.ts","sourceRoot":"","sources":["../../../../../src/floatingMenu/dial/DialIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,EAAE,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAML,QAAQ,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAmB1C,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC;IAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,KAAK,CA2L9B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface OnboardingTooltipProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
/** Optional custom title. Defaults to "Welcome to Buoy Tools!" */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** Optional custom message. Defaults to dial menu instruction */
|
|
8
|
+
message?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const OnboardingTooltip: FC<OnboardingTooltipProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=OnboardingTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnboardingTooltip.d.ts","sourceRoot":"","sources":["../../../../../src/floatingMenu/dial/OnboardingTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAY9C,UAAU,sBAAsB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAiJxD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for onboarding tooltip positioning
|
|
3
|
+
* These ensure the floating menu aligns perfectly under the tooltip arrow
|
|
4
|
+
* All positions are calculated dynamically based on screen size
|
|
5
|
+
*/
|
|
6
|
+
export declare const ARROW_BOTTOM_OFFSET = -40;
|
|
7
|
+
export declare const ARROW_HEIGHT = 20;
|
|
8
|
+
export declare const SPACING_GAP = 10;
|
|
9
|
+
/**
|
|
10
|
+
* Calculate the center Y position of the screen
|
|
11
|
+
* This is used to vertically center the onboarding UI
|
|
12
|
+
*
|
|
13
|
+
* @returns Y coordinate at the center of the screen
|
|
14
|
+
*/
|
|
15
|
+
export declare function getScreenCenterY(): number;
|
|
16
|
+
/**
|
|
17
|
+
* Calculate the tooltip position to center it vertically on screen
|
|
18
|
+
* Uses flexbox-style centering - tooltip will center itself with its actual size
|
|
19
|
+
*
|
|
20
|
+
* @returns Distance from screen bottom for tooltip positioning
|
|
21
|
+
*/
|
|
22
|
+
export declare function calculateTooltipPosition(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Calculate the position where a target element should be placed
|
|
25
|
+
* to align directly under the tooltip arrow
|
|
26
|
+
*
|
|
27
|
+
* @returns Distance from screen bottom where element should be positioned
|
|
28
|
+
*/
|
|
29
|
+
export declare function calculateTargetPosition(): number;
|
|
30
|
+
//# sourceMappingURL=onboardingConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboardingConstants.d.ts","sourceRoot":"","sources":["../../../../../src/floatingMenu/dial/onboardingConstants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAGH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAUjD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAWhD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { type Environment } from "@buoy-gg/shared-ui";
|
|
3
|
+
import { type UserRole } from "@buoy-gg/floating-tools-core";
|
|
4
|
+
export type { UserRole };
|
|
5
|
+
export declare function Divider(): import("react").JSX.Element;
|
|
6
|
+
export declare function UserStatus({ userRole, onPress, }: {
|
|
7
|
+
userRole: UserRole;
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export type FloatingToolsProps = {
|
|
11
|
+
enablePositionPersistence?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/** When true, pushes the bubble to the side (hidden position) */
|
|
14
|
+
pushToSide?: boolean;
|
|
15
|
+
/** When true, centers the bubble on screen (for onboarding) */
|
|
16
|
+
centerOnboarding?: boolean;
|
|
17
|
+
/** Current environment for the environment selector */
|
|
18
|
+
environment?: Environment;
|
|
19
|
+
/** Available environments for switching */
|
|
20
|
+
availableEnvironments?: Environment[];
|
|
21
|
+
/** Callback when environment is selected */
|
|
22
|
+
onEnvironmentSwitch?: (env: Environment) => void;
|
|
23
|
+
/** Whether environment selector should be shown */
|
|
24
|
+
showEnvironmentSelector?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* FloatingTools - A draggable, resizable bubble for development tools
|
|
28
|
+
*
|
|
29
|
+
* This component provides a floating bubble interface that can contain various
|
|
30
|
+
* development tools and controls. It features:
|
|
31
|
+
* - Drag and drop positioning with boundary constraints
|
|
32
|
+
* - Hide/show functionality by dragging to screen edge
|
|
33
|
+
* - Position persistence across app restarts
|
|
34
|
+
* - Safe area aware positioning
|
|
35
|
+
* - Automatic divider insertion between child components
|
|
36
|
+
*
|
|
37
|
+
* @param props - Configuration for the floating tools
|
|
38
|
+
* @param props.enablePositionPersistence - Whether to save/restore position (default: true)
|
|
39
|
+
* @param props.children - Child components to render in the bubble
|
|
40
|
+
*
|
|
41
|
+
* @returns JSX.Element representing the floating tools bubble
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* <FloatingTools enablePositionPersistence={true}>
|
|
46
|
+
* <UserStatus userRole="admin" onPress={handleUserPress} />
|
|
47
|
+
* <ToolButton onPress={openSettings} />
|
|
48
|
+
* </FloatingTools>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @performance Uses native driver animations for smooth positioning
|
|
52
|
+
* @performance Implements efficient boundary checking and position validation
|
|
53
|
+
* @performance Includes debounced position saving for optimal storage performance
|
|
54
|
+
*/
|
|
55
|
+
export declare function FloatingTools({ enablePositionPersistence, pushToSide, centerOnboarding, children, environment, availableEnvironments, onEnvironmentSwitch, showEnvironmentSelector, }: FloatingToolsProps): import("react").JSX.Element;
|
|
56
|
+
//# sourceMappingURL=floatingTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floatingTools.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/floatingTools.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,SAAS,EACV,MAAM,OAAO,CAAC;AAsBf,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjF,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,8BAA8B,CAAC;AAGtC,YAAY,EAAE,QAAQ,EAAE,CAAC;AAiPzB,wBAAgB,OAAO,gCAQtB;AAuBD,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,+BA8CA;AAmBD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uDAAuD;IACvD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,WAAW,EAAE,CAAC;IACtC,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,mDAAmD;IACnD,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,yBAAgC,EAChC,UAAkB,EAClB,gBAAwB,EACxB,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,uBAA+B,GAChC,EAAE,kBAAkB,+BA+ZpB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DevToolsSettings } from './DevToolsSettingsModal';
|
|
2
|
+
type Listener<T> = (payload: T) => void;
|
|
3
|
+
declare class SimpleEventBus<T = DevToolsSettings> {
|
|
4
|
+
private listeners;
|
|
5
|
+
emit(payload: T): void;
|
|
6
|
+
addListener(listener: Listener<T>): () => boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const settingsBus: SimpleEventBus<DevToolsSettings>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=settingsBus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsBus.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/settingsBus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;AAExC,cAAM,cAAc,CAAC,CAAC,GAAG,gBAAgB;IACvC,OAAO,CAAC,SAAS,CAA+B;IAEhD,IAAI,CAAC,OAAO,EAAE,CAAC;IAUf,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;CAIlC;AAED,eAAO,MAAM,WAAW,kCAAyC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
/** Where a tool should render within the floating menu surface. */
|
|
3
|
+
export type AppSlot = "row" | "dial" | "both";
|
|
4
|
+
/** Generic, dynamic context shared with floating tools. */
|
|
5
|
+
export type FloatingMenuState = Record<string, unknown>;
|
|
6
|
+
/** Named callbacks that floating tools can invoke. */
|
|
7
|
+
export type FloatingMenuActions = Record<string, (...args: any[]) => void>;
|
|
8
|
+
/**
|
|
9
|
+
* Runtime details provided to tool icon renderers so they can adapt to the menu slot
|
|
10
|
+
* and size they are rendered within.
|
|
11
|
+
*/
|
|
12
|
+
export type FloatingMenuRenderCtx = {
|
|
13
|
+
/** Slot where the icon is being rendered (row or dial). */
|
|
14
|
+
slot: AppSlot;
|
|
15
|
+
/** Pixel size that the icon should try to fit within. */
|
|
16
|
+
size: number;
|
|
17
|
+
/** Optional shared state object supplied by the host. */
|
|
18
|
+
state?: FloatingMenuState;
|
|
19
|
+
/** Optional shared action callbacks supplied by the host. */
|
|
20
|
+
actions?: FloatingMenuActions;
|
|
21
|
+
};
|
|
22
|
+
/** Declarative description of an app that can be launched from the floating menu. */
|
|
23
|
+
export interface InstalledApp {
|
|
24
|
+
/** Unique identifier used for persistence and settings. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Human readable name shown in accessibility labels and modal headers. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Brief description of what this tool does, shown in settings. */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Visual or functional icon to render in the floating menu. */
|
|
31
|
+
icon: React.ReactNode | ((ctx: FloatingMenuRenderCtx) => React.ReactNode);
|
|
32
|
+
/** Preferred layout slot; defaults to `"both"` when unspecified. */
|
|
33
|
+
slot?: AppSlot;
|
|
34
|
+
/** Optional accent color for the tool. */
|
|
35
|
+
color?: string;
|
|
36
|
+
/** Plug-and-play launching component handled by the AppHost. */
|
|
37
|
+
component: ComponentType<any>;
|
|
38
|
+
/** Props to pass to the launched component (e.g. requiredEnvVars). */
|
|
39
|
+
props?: Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* How to render the component:
|
|
42
|
+
* - self-modal: component expects visible/onClose; we supply them.
|
|
43
|
+
* - host-modal: we wrap your component in a simple RN Modal.
|
|
44
|
+
* - inline: full-screen overlay, absolutely positioned.
|
|
45
|
+
* - toggle-only: no modal/overlay, only calls onPress callback.
|
|
46
|
+
*/
|
|
47
|
+
launchMode?: "self-modal" | "host-modal" | "inline" | "toggle-only";
|
|
48
|
+
/** Prevent more than one instance of this app at a time. */
|
|
49
|
+
singleton?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Optional callback invoked when the app icon is pressed.
|
|
52
|
+
* For toggle-only tools, call `actions?.notifyToggleChange?.()` to update icon colors.
|
|
53
|
+
*/
|
|
54
|
+
onPress?: (actions?: FloatingMenuActions) => void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/floatingMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,M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CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { FloatingDevTools } from "./floatingMenu/FloatingDevTools";
|
|
2
|
+
export type { FloatingDevToolsProps, EnvVarConfig, StorageKeyConfig, } from "./floatingMenu/FloatingDevTools";
|
|
3
|
+
export { autoDiscoverPresets, autoDiscoverPresetsWithCustom, } from "./floatingMenu/autoDiscoverPresets";
|
|
4
|
+
export { createDefaultConfig, validateDialConfig, isFloatingToolId, isDialToolId, MAX_DIAL_TOOLS, } from "./floatingMenu/defaultConfig";
|
|
5
|
+
export type { BuiltInToolId, FloatingToolId, FloatingOnlyToolId, DialToolId, DefaultFloatingConfig, DefaultDialConfig, } from "./floatingMenu/defaultConfig";
|
|
6
|
+
export { FloatingMenu } from "./floatingMenu/FloatingMenu";
|
|
7
|
+
export * from "./floatingMenu/types";
|
|
8
|
+
export { DevToolsSettingsModal, useDevToolsSettings, } from "./floatingMenu/DevToolsSettingsModal";
|
|
9
|
+
export type { DevToolsSettings, GlobalDevToolsSettings } from "./floatingMenu/DevToolsSettingsModal";
|
|
10
|
+
export { AppHostProvider, AppOverlay, useAppHost, } from "./floatingMenu/AppHost";
|
|
11
|
+
export { DevToolsVisibilityProvider, useDevToolsVisibility, } from "./floatingMenu/DevToolsVisibilityContext";
|
|
12
|
+
export { toggleStateManager } from "./floatingMenu/ToggleStateManager";
|
|
13
|
+
export { MinimizedToolsProvider, useMinimizedTools, getIconPosition, getIconSize, } from "./floatingMenu/MinimizedToolsContext";
|
|
14
|
+
export type { MinimizedTool, ModalRestoreState, IconPosition, } from "./floatingMenu/MinimizedToolsContext";
|
|
15
|
+
export { MinimizedToolsStack } from "./floatingMenu/MinimizedToolsStack";
|
|
16
|
+
export { LicenseManager, useLicense, useFeatureAccess, useSeats, useIsPro, setLicenseKey, isPro, hasEntitlement, } from "@buoy-gg/license";
|
|
17
|
+
export type { LicenseState, LicenseEvent, LicenseListener, } from "@buoy-gg/license";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,YAAY,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,GACjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAGrG,OAAO,EACL,eAAe,EACf,UAAU,EACV,UAAU,GACX,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,WAAW,GACZ,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,EACL,cAAc,EACd,UAAU,EACV,gBAAgB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