@buoy-gg/core 7.0.40 → 7.0.42
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 +14 -85
- package/bin/buoy.js +20 -347
- package/lib/commonjs/Buoy.js +1 -107
- package/lib/commonjs/browserRegister.js +1 -0
- package/lib/commonjs/browserRegister.server.js +1 -0
- package/lib/commonjs/earlyHookScript.js +1 -0
- package/lib/commonjs/earlyNetwork.js +1 -0
- package/lib/commonjs/floatingMenu/AppHost.js +1 -460
- package/lib/commonjs/floatingMenu/AppHost.web.js +1 -364
- package/lib/commonjs/floatingMenu/AppHostLogic.js +1 -50
- package/lib/commonjs/floatingMenu/AppIcon.js +1 -91
- package/lib/commonjs/floatingMenu/AppIcon.web.js +1 -53
- package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -0
- package/lib/commonjs/floatingMenu/DefaultConfigContext.js +1 -45
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +1 -1119
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -0
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +1 -1048
- package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +1 -49
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -554
- package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -401
- package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -371
- package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +1 -274
- package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +1 -288
- package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +1 -371
- package/lib/commonjs/floatingMenu/ToggleStateManager.js +1 -36
- package/lib/commonjs/floatingMenu/ToolHost.js +1 -281
- package/lib/commonjs/floatingMenu/ToolOpenerBridge.js +1 -41
- package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +1 -461
- package/lib/commonjs/floatingMenu/autoExternalSync.js +1 -434
- package/lib/commonjs/floatingMenu/defaultConfig.js +1 -167
- package/lib/commonjs/floatingMenu/deviceIdentity.js +1 -173
- package/lib/commonjs/floatingMenu/dial/DialDevTools.js +1 -904
- package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -821
- package/lib/commonjs/floatingMenu/dial/DialHyperspace.js +1 -177
- package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -302
- package/lib/commonjs/floatingMenu/dial/DialPagination.js +1 -165
- package/lib/commonjs/floatingMenu/dial/DialSnow.js +1 -92
- package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +1 -246
- package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.web.js +2 -147
- package/lib/commonjs/floatingMenu/dial/dialUsageStore.js +1 -93
- package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +1 -42
- package/lib/commonjs/floatingMenu/dial/onboardingConstants.web.js +1 -42
- package/lib/commonjs/floatingMenu/externalSyncGate.js +1 -49
- package/lib/commonjs/floatingMenu/floatingTools.js +1 -42
- package/lib/commonjs/floatingMenu/floatingTools.web.js +1 -30
- package/lib/commonjs/floatingMenu/optionalRequire.js +1 -37
- package/lib/commonjs/floatingMenu/settingsBus.js +1 -23
- package/lib/commonjs/floatingMenu/sync/appSyncAdapter.js +1 -115
- package/lib/commonjs/floatingMenu/types.js +1 -5
- package/lib/commonjs/floatingMenu/useDesktopSyncStatus.js +1 -28
- package/lib/commonjs/floatingMenu/useDesktopSyncStatus.web.js +1 -0
- package/lib/commonjs/index.js +1 -291
- package/lib/commonjs/index.web.js +1 -150
- package/lib/commonjs/reactDevtoolsTypes.js +1 -0
- package/lib/commonjs/releaseOptIn.js +1 -0
- package/lib/commonjs/telemetry/installPing.js +1 -131
- package/lib/commonjs/toolkit.js +1 -584
- package/lib/commonjs/toolkitComponents.js +1 -241
- package/lib/commonjs/utils/autoDiscoverPresets.web.js +1 -219
- package/lib/commonjs/utils/createWebTool.js +1 -0
- package/lib/commonjs/utils/createWebTools.js +1 -0
- package/lib/commonjs/version.js +1 -18
- package/lib/module/Buoy.js +1 -102
- package/lib/module/browserRegister.js +1 -0
- package/lib/module/browserRegister.server.js +1 -0
- package/lib/module/earlyHookScript.js +1 -0
- package/lib/module/earlyNetwork.js +1 -0
- package/lib/module/floatingMenu/AppHost.js +1 -452
- package/lib/module/floatingMenu/AppHost.web.js +1 -356
- package/lib/module/floatingMenu/AppHostLogic.js +1 -45
- package/lib/module/floatingMenu/AppIcon.js +1 -84
- package/lib/module/floatingMenu/AppIcon.web.js +1 -47
- package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -0
- package/lib/module/floatingMenu/DefaultConfigContext.js +1 -39
- package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -1115
- package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -0
- package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +1 -1055
- package/lib/module/floatingMenu/DevToolsVisibilityContext.js +1 -44
- package/lib/module/floatingMenu/FloatingDevTools.js +1 -551
- package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -399
- package/lib/module/floatingMenu/FloatingMenu.js +1 -366
- package/lib/module/floatingMenu/MinimizedToolsContext.js +1 -266
- package/lib/module/floatingMenu/MinimizedToolsStack.js +1 -285
- package/lib/module/floatingMenu/MinimizedToolsStack.web.js +1 -368
- package/lib/module/floatingMenu/ToggleStateManager.js +1 -32
- package/lib/module/floatingMenu/ToolHost.js +1 -273
- package/lib/module/floatingMenu/ToolOpenerBridge.js +1 -37
- package/lib/module/floatingMenu/autoDiscoverPresets.js +1 -457
- package/lib/module/floatingMenu/autoExternalSync.js +1 -427
- package/lib/module/floatingMenu/defaultConfig.js +1 -158
- package/lib/module/floatingMenu/deviceIdentity.js +1 -163
- package/lib/module/floatingMenu/dial/DialDevTools.js +1 -900
- package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -818
- package/lib/module/floatingMenu/dial/DialHyperspace.js +1 -173
- package/lib/module/floatingMenu/dial/DialIcon.js +1 -299
- package/lib/module/floatingMenu/dial/DialPagination.js +1 -160
- package/lib/module/floatingMenu/dial/DialSnow.js +1 -90
- package/lib/module/floatingMenu/dial/OnboardingTooltip.js +1 -240
- package/lib/module/floatingMenu/dial/OnboardingTooltip.web.js +2 -142
- package/lib/module/floatingMenu/dial/dialUsageStore.js +1 -85
- package/lib/module/floatingMenu/dial/onboardingConstants.js +1 -3
- package/lib/module/floatingMenu/dial/onboardingConstants.web.js +1 -3
- package/lib/module/floatingMenu/externalSyncGate.js +1 -44
- package/lib/module/floatingMenu/floatingTools.js +1 -27
- package/lib/module/floatingMenu/floatingTools.web.js +1 -3
- package/lib/module/floatingMenu/optionalRequire.js +1 -33
- package/lib/module/floatingMenu/settingsBus.js +1 -19
- package/lib/module/floatingMenu/sync/appSyncAdapter.js +1 -112
- package/lib/module/floatingMenu/types.js +1 -3
- package/lib/module/floatingMenu/useDesktopSyncStatus.js +1 -25
- package/lib/module/floatingMenu/useDesktopSyncStatus.web.js +1 -0
- package/lib/module/index.js +1 -41
- package/lib/module/index.web.js +1 -29
- package/lib/module/reactDevtoolsTypes.js +1 -0
- package/lib/module/releaseOptIn.js +1 -0
- package/lib/module/telemetry/installPing.js +1 -127
- package/lib/module/toolkit.js +1 -62
- package/lib/module/toolkitComponents.js +1 -230
- package/lib/module/utils/autoDiscoverPresets.web.js +1 -213
- package/lib/module/utils/createWebTool.js +1 -0
- package/lib/module/utils/createWebTools.js +1 -0
- package/lib/module/version.js +1 -14
- package/lib/typescript/commonjs/browserRegister.d.ts +13 -0
- package/lib/typescript/commonjs/browserRegister.server.d.ts +6 -0
- package/lib/typescript/commonjs/earlyHookScript.d.ts +12 -0
- package/lib/typescript/commonjs/earlyNetwork.d.ts +52 -0
- package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts +3 -3
- package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts +14 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +12 -6
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +1 -9
- package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
- package/lib/typescript/commonjs/index.web.d.ts +7 -0
- package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts +8 -0
- package/lib/typescript/commonjs/releaseOptIn.d.ts +4 -0
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +3 -40
- package/lib/typescript/commonjs/utils/createWebTool.d.ts +6 -0
- package/lib/typescript/commonjs/utils/createWebTools.d.ts +4 -0
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/browserRegister.d.ts +13 -0
- package/lib/typescript/module/browserRegister.server.d.ts +6 -0
- package/lib/typescript/module/earlyHookScript.d.ts +12 -0
- package/lib/typescript/module/earlyNetwork.d.ts +52 -0
- package/lib/typescript/module/floatingMenu/AppHost.web.d.ts +3 -3
- package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts +14 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +12 -6
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts +1 -9
- package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
- package/lib/typescript/module/index.web.d.ts +7 -0
- package/lib/typescript/module/reactDevtoolsTypes.d.ts +8 -0
- package/lib/typescript/module/releaseOptIn.d.ts +4 -0
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +3 -40
- package/lib/typescript/module/utils/createWebTool.d.ts +6 -0
- package/lib/typescript/module/utils/createWebTools.d.ts +4 -0
- package/lib/typescript/module/version.d.ts +1 -1
- package/lib/web/chunks/chunk-5SGL6QL4.mjs +1 -0
- package/lib/web/chunks/chunk-FROELTJH.mjs +1 -0
- package/lib/web/chunks/chunk-QZDVCMCT.mjs +1 -0
- package/lib/web/chunks/chunk-R7RGRTY5.mjs +1 -0
- package/lib/web/index.mjs +10 -0
- package/lib/web/register-server.mjs +1 -0
- package/lib/web/register.mjs +1 -0
- package/lib/web/toolkit.mjs +1 -0
- package/package.json +50 -12
- package/lib/typescript/commonjs/Buoy.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppIcon.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/deviceIdentity.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialPagination.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialSnow.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/externalSyncGate.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/optionalRequire.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/telemetry/installPing.d.ts.map +0 -1
- package/lib/typescript/commonjs/toolkit.d.ts.map +0 -1
- package/lib/typescript/commonjs/toolkitComponents.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/version.d.ts.map +0 -1
- package/lib/typescript/module/Buoy.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppIcon.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/deviceIdentity.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialPagination.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/DialSnow.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/externalSyncGate.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/optionalRequire.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/types.d.ts.map +0 -1
- package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
- package/lib/typescript/module/index.d.ts.map +0 -1
- package/lib/typescript/module/index.web.d.ts.map +0 -1
- package/lib/typescript/module/telemetry/installPing.d.ts.map +0 -1
- package/lib/typescript/module/toolkit.d.ts.map +0 -1
- package/lib/typescript/module/toolkitComponents.d.ts.map +0 -1
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +0 -1
- package/lib/typescript/module/version.d.ts.map +0 -1
|
@@ -1,364 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useAppHost = exports.AppOverlay = exports.AppHostProvider = void 0;
|
|
7
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _AppHostLogic = require("./AppHostLogic.js");
|
|
10
|
-
var _AppIcon = require("./AppIcon");
|
|
11
|
-
var _floatingToolsWeb = require("./floatingTools.web.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
/**
|
|
14
|
-
* AppHost.web.tsx — DOM port of AppHost.tsx (React Native).
|
|
15
|
-
*
|
|
16
|
-
* Same state machine (shared `AppHostLogic.ts`), same `@react_buoy_open_apps`
|
|
17
|
-
* persistence key + JSON shape (`{id, minimized}[]`, 500ms debounce), same
|
|
18
|
-
* launch modes and z-order model (base 9000 + stack index).
|
|
19
|
-
*
|
|
20
|
-
* Intentional deviations from the native file (all logged):
|
|
21
|
-
* - No `MinimizedToolsContext`/`MinimizedToolsStack` second store: the
|
|
22
|
-
* minimized dock derives directly from `openApps` (`minimized === true`),
|
|
23
|
-
* the same simplification the Flutter port made deliberately
|
|
24
|
-
* (packages-flutter/buoy_core — see FLUTTER_TOOLS_PORT/MASTER_PLAN.md).
|
|
25
|
-
* `@react_buoy_minimized_tools` is therefore not written on web.
|
|
26
|
-
* - `BackHandler` (Android hardware back) → `Escape` keydown closes the
|
|
27
|
-
* top-most open tool.
|
|
28
|
-
* - No `setExpandableWindowControls` / global settings bridge — the web
|
|
29
|
-
* settings modal has no global-settings tab yet.
|
|
30
|
-
* - `minimizeTargetPosition` is computed from the dock layout below instead
|
|
31
|
-
* of `MinimizedToolsContext.getNextIconPosition()`.
|
|
32
|
-
*
|
|
33
|
-
* @platform React DOM Web
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
const AppHostContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
37
|
-
const STORAGE_KEY_OPEN_APPS = "@react_buoy_open_apps";
|
|
38
|
-
const PERSISTENCE_DELAY = 500;
|
|
39
|
-
|
|
40
|
-
// Minimized dock geometry — mirrors MinimizedToolsContext.tsx constants.
|
|
41
|
-
const ICON_SIZE = 44;
|
|
42
|
-
const ICON_GAP = 12;
|
|
43
|
-
const BOTTOM_OFFSET = 100;
|
|
44
|
-
const RIGHT_OFFSET = 16;
|
|
45
|
-
const dockIconPosition = index => ({
|
|
46
|
-
x: window.innerWidth - ICON_SIZE - RIGHT_OFFSET,
|
|
47
|
-
y: window.innerHeight - BOTTOM_OFFSET - ICON_SIZE - index * (ICON_SIZE + ICON_GAP)
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Provides the floating dev tools application host for web. Tracks open tool
|
|
52
|
-
* instances, restores persisted state, and exposes the same imperative
|
|
53
|
-
* helpers as the native `AppHostProvider`.
|
|
54
|
-
*/
|
|
55
|
-
const AppHostProvider = ({
|
|
56
|
-
children
|
|
57
|
-
}) => {
|
|
58
|
-
const [openApps, setOpenApps] = (0, _react.useState)([]);
|
|
59
|
-
const [isRestored, setIsRestored] = (0, _react.useState)(false);
|
|
60
|
-
const persistenceTimeoutRef = (0, _react.useRef)(null);
|
|
61
|
-
const installedAppsRef = (0, _react.useRef)([]);
|
|
62
|
-
const pendingRestoreRef = (0, _react.useRef)(null);
|
|
63
|
-
const open = (0, _react.useCallback)(def => {
|
|
64
|
-
let resolvedId = "";
|
|
65
|
-
setOpenApps(current => {
|
|
66
|
-
const {
|
|
67
|
-
apps,
|
|
68
|
-
instanceId
|
|
69
|
-
} = (0, _AppHostLogic.resolveOpenAppsState)(current, def, () => `${def.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
70
|
-
resolvedId = instanceId;
|
|
71
|
-
return apps;
|
|
72
|
-
});
|
|
73
|
-
return resolvedId;
|
|
74
|
-
}, []);
|
|
75
|
-
const tryRestorePending = (0, _react.useCallback)(() => {
|
|
76
|
-
if (isRestored) return;
|
|
77
|
-
if (!installedAppsRef.current.length) return;
|
|
78
|
-
const pendingApps = pendingRestoreRef.current;
|
|
79
|
-
if (!pendingApps || pendingApps.length === 0) {
|
|
80
|
-
setIsRestored(true);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
pendingRestoreRef.current = null;
|
|
84
|
-
pendingApps.forEach(({
|
|
85
|
-
id: appId,
|
|
86
|
-
minimized
|
|
87
|
-
}) => {
|
|
88
|
-
const appDef = installedAppsRef.current.find(app => app.id === appId);
|
|
89
|
-
if (appDef && appDef.component) {
|
|
90
|
-
const resolvedIcon = (0, _AppIcon.renderAppIcon)(appDef.icon, {
|
|
91
|
-
slot: "dial",
|
|
92
|
-
size: 20,
|
|
93
|
-
color: appDef.color
|
|
94
|
-
});
|
|
95
|
-
open({
|
|
96
|
-
id: appDef.id,
|
|
97
|
-
title: appDef.name,
|
|
98
|
-
component: appDef.component,
|
|
99
|
-
props: appDef.props,
|
|
100
|
-
launchMode: appDef.launchMode || "self-modal",
|
|
101
|
-
singleton: appDef.singleton,
|
|
102
|
-
icon: resolvedIcon,
|
|
103
|
-
color: appDef.color,
|
|
104
|
-
minimized
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
setIsRestored(true);
|
|
109
|
-
}, [isRestored, open]);
|
|
110
|
-
|
|
111
|
-
// Restore open apps on mount. Handles both the legacy `string[]` shape and
|
|
112
|
-
// the current `{id, minimized}[]` shape — same tolerance as native.
|
|
113
|
-
(0, _react.useEffect)(() => {
|
|
114
|
-
const restoreOpenApps = async () => {
|
|
115
|
-
try {
|
|
116
|
-
const saved = await _sharedUi.persistentStorage.getItem(STORAGE_KEY_OPEN_APPS);
|
|
117
|
-
if (saved) {
|
|
118
|
-
const parsed = JSON.parse(saved);
|
|
119
|
-
let savedApps;
|
|
120
|
-
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
121
|
-
if (typeof parsed[0] === "string") {
|
|
122
|
-
savedApps = parsed.map(id => ({
|
|
123
|
-
id,
|
|
124
|
-
minimized: false
|
|
125
|
-
}));
|
|
126
|
-
} else {
|
|
127
|
-
savedApps = parsed;
|
|
128
|
-
}
|
|
129
|
-
if (savedApps.length) {
|
|
130
|
-
pendingRestoreRef.current = savedApps;
|
|
131
|
-
tryRestorePending();
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
} catch {
|
|
137
|
-
// Failed to restore open apps - continue with fresh state
|
|
138
|
-
}
|
|
139
|
-
setIsRestored(true);
|
|
140
|
-
};
|
|
141
|
-
restoreOpenApps();
|
|
142
|
-
}, [tryRestorePending]);
|
|
143
|
-
|
|
144
|
-
// Save open apps with debounce
|
|
145
|
-
(0, _react.useEffect)(() => {
|
|
146
|
-
if (!isRestored) return;
|
|
147
|
-
if (persistenceTimeoutRef.current) {
|
|
148
|
-
clearTimeout(persistenceTimeoutRef.current);
|
|
149
|
-
}
|
|
150
|
-
persistenceTimeoutRef.current = setTimeout(() => {
|
|
151
|
-
const appStates = openApps.map(app => ({
|
|
152
|
-
id: app.id,
|
|
153
|
-
minimized: app.minimized ?? false
|
|
154
|
-
}));
|
|
155
|
-
_sharedUi.persistentStorage.setItem(STORAGE_KEY_OPEN_APPS, JSON.stringify(appStates));
|
|
156
|
-
}, PERSISTENCE_DELAY);
|
|
157
|
-
return () => {
|
|
158
|
-
if (persistenceTimeoutRef.current) {
|
|
159
|
-
clearTimeout(persistenceTimeoutRef.current);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
}, [openApps, isRestored]);
|
|
163
|
-
|
|
164
|
-
// Store reference to installed apps for restoration
|
|
165
|
-
const registerApps = (0, _react.useCallback)(apps => {
|
|
166
|
-
installedAppsRef.current = apps;
|
|
167
|
-
tryRestorePending();
|
|
168
|
-
}, [tryRestorePending]);
|
|
169
|
-
const close = (0, _react.useCallback)(instanceId => {
|
|
170
|
-
setOpenApps(s => {
|
|
171
|
-
if (!s.length) return s;
|
|
172
|
-
if (!instanceId) return s.slice(0, -1);
|
|
173
|
-
return s.filter(a => a.instanceId !== instanceId);
|
|
174
|
-
});
|
|
175
|
-
}, []);
|
|
176
|
-
const closeAll = (0, _react.useCallback)(() => setOpenApps([]), []);
|
|
177
|
-
const minimize = (0, _react.useCallback)(instanceId => {
|
|
178
|
-
setOpenApps(s => s.map(app => app.instanceId === instanceId ? {
|
|
179
|
-
...app,
|
|
180
|
-
minimized: true
|
|
181
|
-
} : app));
|
|
182
|
-
}, []);
|
|
183
|
-
const restore = (0, _react.useCallback)(instanceId => {
|
|
184
|
-
setOpenApps(s => s.map(app => app.instanceId === instanceId ? {
|
|
185
|
-
...app,
|
|
186
|
-
minimized: false
|
|
187
|
-
} : app));
|
|
188
|
-
}, []);
|
|
189
|
-
const isMinimized = (0, _react.useCallback)(instanceId => {
|
|
190
|
-
const app = openApps.find(a => a.instanceId === instanceId);
|
|
191
|
-
return app?.minimized ?? false;
|
|
192
|
-
}, [openApps]);
|
|
193
|
-
|
|
194
|
-
// Escape closes the top-most open tool — web analog of the native
|
|
195
|
-
// hardware-back handler.
|
|
196
|
-
const hasVisibleApps = openApps.some(app => app.launchMode !== "toggle-only" && !app.minimized);
|
|
197
|
-
(0, _react.useEffect)(() => {
|
|
198
|
-
if (!hasVisibleApps) return;
|
|
199
|
-
const handler = event => {
|
|
200
|
-
if (event.key !== "Escape") return;
|
|
201
|
-
close();
|
|
202
|
-
};
|
|
203
|
-
window.addEventListener("keydown", handler);
|
|
204
|
-
return () => window.removeEventListener("keydown", handler);
|
|
205
|
-
}, [hasVisibleApps, close]);
|
|
206
|
-
const value = (0, _react.useMemo)(() => ({
|
|
207
|
-
openApps,
|
|
208
|
-
isAnyOpen: hasVisibleApps,
|
|
209
|
-
open,
|
|
210
|
-
close,
|
|
211
|
-
closeAll,
|
|
212
|
-
registerApps,
|
|
213
|
-
minimize,
|
|
214
|
-
restore,
|
|
215
|
-
isMinimized
|
|
216
|
-
}), [openApps, hasVisibleApps, open, close, closeAll, registerApps, minimize, restore, isMinimized]);
|
|
217
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AppHostContext.Provider, {
|
|
218
|
-
value: value,
|
|
219
|
-
children: children
|
|
220
|
-
});
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Accessor hook for the web app host. Falls back to a no-op implementation
|
|
225
|
-
* when rendered outside the provider — same contract as native.
|
|
226
|
-
*/
|
|
227
|
-
exports.AppHostProvider = AppHostProvider;
|
|
228
|
-
const useAppHost = () => {
|
|
229
|
-
const ctx = (0, _react.useContext)(AppHostContext);
|
|
230
|
-
if (!ctx) {
|
|
231
|
-
return {
|
|
232
|
-
openApps: [],
|
|
233
|
-
isAnyOpen: false,
|
|
234
|
-
open: () => "",
|
|
235
|
-
close: () => {},
|
|
236
|
-
closeAll: () => {},
|
|
237
|
-
registerApps: () => {},
|
|
238
|
-
minimize: () => {},
|
|
239
|
-
restore: () => {},
|
|
240
|
-
isMinimized: () => false
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
return ctx;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
// Base z-index for tool surfaces — parity with native AppOverlay.
|
|
247
|
-
exports.useAppHost = useAppHost;
|
|
248
|
-
const BASE_ZINDEX = 9000;
|
|
249
|
-
// The dock sits above tool panels but below the dial/settings overlays (10000).
|
|
250
|
-
|
|
251
|
-
const backdropStyle = {
|
|
252
|
-
position: "fixed",
|
|
253
|
-
inset: 0,
|
|
254
|
-
backgroundColor: "rgba(0,0,0,0.28)",
|
|
255
|
-
display: "flex",
|
|
256
|
-
alignItems: "center",
|
|
257
|
-
justifyContent: "center"
|
|
258
|
-
};
|
|
259
|
-
const cardStyle = {
|
|
260
|
-
maxHeight: "90%",
|
|
261
|
-
width: "94%",
|
|
262
|
-
borderRadius: 12,
|
|
263
|
-
backgroundColor: "white",
|
|
264
|
-
overflow: "hidden"
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Renders a single app instance — DOM twin of the native `AppRenderer`.
|
|
269
|
-
* Keeps the component mounted while minimized (visible={false} /
|
|
270
|
-
* display:none) so tool state and listeners survive, like native.
|
|
271
|
-
*/
|
|
272
|
-
const AppRenderer = ({
|
|
273
|
-
app,
|
|
274
|
-
zIndex,
|
|
275
|
-
onClose,
|
|
276
|
-
onMinimize,
|
|
277
|
-
minimizeTargetPosition
|
|
278
|
-
}) => {
|
|
279
|
-
const Comp = app.component;
|
|
280
|
-
const isVisible = !app.minimized;
|
|
281
|
-
if (app.launchMode === "self-modal") {
|
|
282
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
283
|
-
...(app.props ?? {}),
|
|
284
|
-
visible: isVisible,
|
|
285
|
-
onClose: onClose,
|
|
286
|
-
onRequestClose: onClose,
|
|
287
|
-
onMinimize: onMinimize,
|
|
288
|
-
minimizeTargetPosition: minimizeTargetPosition,
|
|
289
|
-
instanceId: app.instanceId,
|
|
290
|
-
zIndex: zIndex
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
if (app.launchMode === "inline") {
|
|
294
|
-
if (!isVisible) return null;
|
|
295
|
-
// pointerEvents:none matches native box-none: the layer never eats input;
|
|
296
|
-
// inline tool components opt back in with pointerEvents:auto on their own
|
|
297
|
-
// interactive surfaces.
|
|
298
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
299
|
-
style: {
|
|
300
|
-
position: "fixed",
|
|
301
|
-
inset: 0,
|
|
302
|
-
zIndex,
|
|
303
|
-
pointerEvents: "none"
|
|
304
|
-
},
|
|
305
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
306
|
-
...(app.props ?? {}),
|
|
307
|
-
onClose: onClose,
|
|
308
|
-
onMinimize: onMinimize,
|
|
309
|
-
minimizeTargetPosition: minimizeTargetPosition,
|
|
310
|
-
instanceId: app.instanceId
|
|
311
|
-
})
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// host-modal mode
|
|
316
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
317
|
-
style: {
|
|
318
|
-
...backdropStyle,
|
|
319
|
-
zIndex,
|
|
320
|
-
display: isVisible ? "flex" : "none"
|
|
321
|
-
},
|
|
322
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
323
|
-
style: cardStyle,
|
|
324
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
325
|
-
...(app.props ?? {}),
|
|
326
|
-
onClose: onClose,
|
|
327
|
-
onMinimize: onMinimize,
|
|
328
|
-
minimizeTargetPosition: minimizeTargetPosition,
|
|
329
|
-
instanceId: app.instanceId
|
|
330
|
-
})
|
|
331
|
-
})
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Renders all open dev tool surfaces — DOM twin of the native `AppOverlay`.
|
|
337
|
-
* Later-opened tools stack on top (base z 9000 + index). Minimized tools are
|
|
338
|
-
* shown by the MinimizedToolsStack fused to the floating bubble (native
|
|
339
|
-
* parity) — the old fixed bottom-right MinimizedDock was replaced by it.
|
|
340
|
-
*/
|
|
341
|
-
const AppOverlay = () => {
|
|
342
|
-
const {
|
|
343
|
-
openApps,
|
|
344
|
-
close,
|
|
345
|
-
minimize
|
|
346
|
-
} = useAppHost();
|
|
347
|
-
const renderableApps = openApps.filter(app => app.launchMode !== "toggle-only");
|
|
348
|
-
if (renderableApps.length === 0) return null;
|
|
349
|
-
const minimizedCount = renderableApps.filter(app => app.minimized).length;
|
|
350
|
-
|
|
351
|
-
// Minimize animation shrinks toward the bubble (where the stack lives);
|
|
352
|
-
// fall back to the legacy dock slot if the bubble hasn't mounted yet.
|
|
353
|
-
const minimizeTarget = (0, _floatingToolsWeb.getBubbleAnchorPosition)() ?? dockIconPosition(minimizedCount);
|
|
354
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
355
|
-
children: renderableApps.map((app, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(AppRenderer, {
|
|
356
|
-
app: app,
|
|
357
|
-
zIndex: BASE_ZINDEX + index,
|
|
358
|
-
onClose: () => close(app.instanceId),
|
|
359
|
-
onMinimize: () => minimize(app.instanceId),
|
|
360
|
-
minimizeTargetPosition: minimizeTarget
|
|
361
|
-
}, app.instanceId))
|
|
362
|
-
});
|
|
363
|
-
};
|
|
364
|
-
exports.AppOverlay = AppOverlay;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useAppHost=exports.AppOverlay=exports.AppHostProvider=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _react=require("react");var _AppHostLogic=require("./AppHostLogic.js");var _AppIcon=require("./AppIcon");var _ToolHost=require("./ToolHost.js");var _DevToolsSettingsModalShared=require("./DevToolsSettingsModal.shared.js");var _floatingToolsWeb=require("./floatingTools.web.js");var _jsxRuntime=require("react/jsx-runtime");const AppHostContext=(0,_react.createContext)(null);const STORAGE_KEY_OPEN_APPS="@react_buoy_open_apps";const ICON_SIZE=44;const ICON_GAP=12;const BOTTOM_OFFSET=100;const RIGHT_OFFSET=16;const dockIconPosition=t=>({x:window.innerWidth-ICON_SIZE-RIGHT_OFFSET,y:window.innerHeight-BOTTOM_OFFSET-ICON_SIZE-t*(ICON_SIZE+ICON_GAP)});const AppHostProvider=({children:t})=>{const[r,l]=(0,_react.useState)([]);const[d,c]=(0,_react.useState)(false);const f=(0,_react.useRef)([]);const u=(0,_react.useRef)(null);const i=(0,_react.useRef)(false);const p=(0,_react.useRef)(false);const g=(0,_react.useRef)(false);const h=(0,_react.useCallback)(n=>{let s="";l(o=>{const{apps:e,instanceId:a}=(0,_AppHostLogic.resolveOpenAppsState)(o,n,()=>`${n.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);s=a;return e});return s},[]);const v=(0,_react.useCallback)(()=>{if(i.current||!p.current||!g.current)return;i.current=true;const n=u.current;if(!n||n.length===0){c(true);return}u.current=null;n.forEach(({id:s,minimized:o})=>{const e=f.current.find(a=>a.id===s);if(e&&e.component){const a=(0,_AppIcon.renderAppIcon)(e.icon,{slot:"dial",size:20,color:e.color});h({id:e.id,title:e.name,component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:a,color:e.color,minimized:o})}});c(true)},[h]);(0,_react.useEffect)(()=>{let n=false;const s=async()=>{try{const o=await _sharedUi.persistentStorage.getItem(STORAGE_KEY_OPEN_APPS);if(n)return;if(o){const e=JSON.parse(o);let a;if(Array.isArray(e)&&e.length>0){if(typeof e[0]==="string"){a=e.map(m=>({id:m,minimized:false}))}else{a=e.filter(m=>typeof m==="object"&&m!==null&&typeof m.id==="string")}if(a.length){u.current=a}}}}catch{}if(n)return;p.current=true;v()};void s();return()=>{n=true}},[v]);(0,_react.useEffect)(()=>{if(!d)return;const n=r.map(s=>({id:s.id,minimized:s.minimized??false}));void _sharedUi.persistentStorage.setItem(STORAGE_KEY_OPEN_APPS,JSON.stringify(n))},[r,d]);const b=(0,_react.useCallback)(n=>{f.current=n;g.current=true;v()},[v]);const A=(0,_react.useCallback)(n=>{l(s=>{if(!s.length)return s;if(!n)return s.slice(0,-1);return s.filter(o=>o.instanceId!==n)})},[]);const S=(0,_react.useCallback)(()=>l([]),[]);const x=(0,_react.useCallback)((n,s)=>{l(o=>o.map(e=>e.instanceId===n?{...e,minimized:true,restoreState:s}:e))},[]);const I=(0,_react.useCallback)((n,s)=>{l(o=>o.map(e=>e.instanceId===n?{...e,minimized:false,restoreState:s??e.restoreState}:e))},[]);const M=(0,_react.useCallback)(n=>{const s=r.find(o=>o.instanceId===n);return s?.minimized??false},[r]);const y=r.some(n=>n.launchMode!=="toggle-only"&&!n.minimized);(0,_react.useEffect)(()=>{if(!y)return;const n=s=>{if(s.key!=="Escape")return;if(s.defaultPrevented)return;const o=[...r].reverse().find(e=>e.launchMode!=="toggle-only"&&!e.minimized);if(o)A(o.instanceId)};window.addEventListener("keydown",n);return()=>window.removeEventListener("keydown",n)},[y,A,r]);const z=(0,_react.useMemo)(()=>({openApps:r,isAnyOpen:y,open:h,close:A,closeAll:S,registerApps:b,minimize:x,restore:I,isMinimized:M}),[r,y,h,A,S,b,x,I,M]);return(0,_jsxRuntime.jsx)(AppHostContext.Provider,{value:z,children:t})};exports.AppHostProvider=AppHostProvider;const useAppHost=()=>{const t=(0,_react.useContext)(AppHostContext);if(!t){return{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}}return t};exports.useAppHost=useAppHost;const BASE_ZINDEX=9e3;const backdropStyle={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"};const cardStyle={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"};const AppRenderer=({app:t,zIndex:r,onClose:l,onMinimize:d,minimizeTargetPosition:c,enableSharedModalDimensions:f})=>{const u=t.component;const i=!t.minimized;const p={...t.props??{},...f?{enableSharedModalDimensions:true}:{}};if(t.modal&&(!t.launchMode||t.launchMode==="self-modal")){return(0,_jsxRuntime.jsx)(_ToolHost.ToolModalShell,{app:t,config:t.modal,visible:i,zIndex:r,onClose:l,onMinimize:d,initialModalState:t.restoreState,enableSharedModalDimensions:f,bodyProps:p})}if(t.launchMode==="self-modal"){return(0,_jsxRuntime.jsx)(u,{...p,visible:i,onClose:l,onRequestClose:l,onMinimize:d,minimizeTargetPosition:c,instanceId:t.instanceId,zIndex:r,initialModalState:t.restoreState})}if(t.launchMode==="inline"){if(!i)return null;return(0,_jsxRuntime.jsx)("div",{style:{position:"fixed",inset:0,zIndex:r,pointerEvents:"none"},children:(0,_jsxRuntime.jsx)(u,{...p,onClose:l,onMinimize:d,minimizeTargetPosition:c,instanceId:t.instanceId})})}return(0,_jsxRuntime.jsx)("div",{style:{...backdropStyle,zIndex:r,display:i?"flex":"none"},children:(0,_jsxRuntime.jsx)("div",{style:cardStyle,children:(0,_jsxRuntime.jsx)(u,{...p,onClose:l,onMinimize:d,minimizeTargetPosition:c,instanceId:t.instanceId})})})};const AppOverlay=()=>{const{openApps:t,close:r,minimize:l}=useAppHost();const{settings:d}=(0,_DevToolsSettingsModalShared.useDevToolsSettings)();const c=t.filter(i=>i.launchMode!=="toggle-only");if(c.length===0)return null;const f=c.filter(i=>i.minimized).length;const u=(0,_floatingToolsWeb.getBubbleAnchorPosition)()??dockIconPosition(f);return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:c.map((i,p)=>(0,_jsxRuntime.jsx)(AppRenderer,{app:i,zIndex:BASE_ZINDEX+p,onClose:()=>r(i.instanceId),onMinimize:g=>l(i.instanceId,g),enableSharedModalDimensions:d.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:u},i.instanceId))})};exports.AppOverlay=AppOverlay;
|
|
@@ -1,50 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.resolveOpenAppsState = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Modal state to restore when reopening a minimized tool. Defined here (the
|
|
9
|
-
* platform-free logic module) so the web host doesn't pull in the native
|
|
10
|
-
* MinimizedToolsContext; that file re-exports this type for back-compat.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Computes the new list of open tool instances when a user launches a dev app. Singleton
|
|
15
|
-
* tools reuse their existing instance while non-singletons create a new entry using the
|
|
16
|
-
* provided `generateId` helper.
|
|
17
|
-
*
|
|
18
|
-
* @param current - Current stack of open app instances.
|
|
19
|
-
* @param def - Descriptor of the tool to launch (without runtime instance id).
|
|
20
|
-
* @param generateId - Callback used to generate a unique instance identifier.
|
|
21
|
-
* @returns Updated instance list alongside the resolved instance id.
|
|
22
|
-
*/
|
|
23
|
-
const resolveOpenAppsState = (current, def, generateId) => {
|
|
24
|
-
if (def.singleton) {
|
|
25
|
-
const existing = current.find(app => app.id === def.id);
|
|
26
|
-
if (existing) {
|
|
27
|
-
const wasMinimized = existing.minimized ?? false;
|
|
28
|
-
return {
|
|
29
|
-
instanceId: existing.instanceId,
|
|
30
|
-
wasMinimized,
|
|
31
|
-
apps: [...current.filter(app => app.instanceId !== existing.instanceId),
|
|
32
|
-
// Un-minimize the existing app when re-opening it
|
|
33
|
-
{
|
|
34
|
-
...existing,
|
|
35
|
-
minimized: false
|
|
36
|
-
}]
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const instanceId = generateId();
|
|
41
|
-
return {
|
|
42
|
-
instanceId,
|
|
43
|
-
wasMinimized: false,
|
|
44
|
-
apps: [...current, {
|
|
45
|
-
...def,
|
|
46
|
-
instanceId
|
|
47
|
-
}]
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
exports.resolveOpenAppsState = resolveOpenAppsState;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveOpenAppsState=void 0;const resolveOpenAppsState=(s,i,p)=>{if(i.singleton){const e=s.find(n=>n.id===i.id);if(e){const n=e.minimized??false;return{instanceId:e.instanceId,wasMinimized:n,apps:[...s.filter(a=>a.instanceId!==e.instanceId),{...e,minimized:false}]}}}const t=p();return{instanceId:t,wasMinimized:false,apps:[...s,{...i,instanceId:t}]}};exports.resolveOpenAppsState=resolveOpenAppsState;
|
|
@@ -1,91 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.AppTextIcon = AppTextIcon;
|
|
7
|
-
exports.renderAppIcon = renderAppIcon;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
/**
|
|
14
|
-
* Icon resolution for `InstalledApp.icon`.
|
|
15
|
-
*
|
|
16
|
-
* Custom tools may provide an icon three ways:
|
|
17
|
-
* - a component `({ slot, size }) => node` (dynamic, hook-capable)
|
|
18
|
-
* - a pre-built ReactNode
|
|
19
|
-
* - a PLAIN STRING — "AUTH", "KIT", "🗑️" — rendered as an auto-fitting text
|
|
20
|
-
* icon so simple tools never need an icon library.
|
|
21
|
-
*
|
|
22
|
-
* Every menu surface (dial, row, minimize stack, restore path) resolves icons
|
|
23
|
-
* through `renderAppIcon` so all three forms behave identically.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/** Visible glyphs, not UTF-16 units — "🗑️" is one glyph, not three. */
|
|
27
|
-
function glyphCount(label) {
|
|
28
|
-
// Strip variation selectors + zero-width joiners before counting.
|
|
29
|
-
const stripped = label.replace(/[\uFE00-\uFE0F\u200D]/g, "");
|
|
30
|
-
return Math.max(Array.from(stripped).length, 1);
|
|
31
|
-
}
|
|
32
|
-
function AppTextIcon({
|
|
33
|
-
label,
|
|
34
|
-
size,
|
|
35
|
-
color = _sharedUi.toolTheme.colors.text
|
|
36
|
-
}) {
|
|
37
|
-
const chars = glyphCount(label);
|
|
38
|
-
// Short labels stay square; longer ones ("AUTH") get a wider box — the
|
|
39
|
-
// dial/row layouts have breathing room and the label reads better than a
|
|
40
|
-
// squashed square would. The computed font size is what fits the box on
|
|
41
|
-
// web; adjustsFontSizeToFit covers native font-metric drift.
|
|
42
|
-
const maxWidth = chars <= 2 ? size : size * 1.6;
|
|
43
|
-
const fontSize = Math.max(7, Math.min(size * (chars === 1 ? 0.7 : 0.62), maxWidth / (0.62 * chars)));
|
|
44
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
45
|
-
style: {
|
|
46
|
-
minWidth: size,
|
|
47
|
-
maxWidth,
|
|
48
|
-
height: size,
|
|
49
|
-
alignItems: "center",
|
|
50
|
-
justifyContent: "center"
|
|
51
|
-
},
|
|
52
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
53
|
-
numberOfLines: 1,
|
|
54
|
-
adjustsFontSizeToFit: true,
|
|
55
|
-
minimumFontScale: 0.5,
|
|
56
|
-
style: {
|
|
57
|
-
color,
|
|
58
|
-
fontSize,
|
|
59
|
-
fontWeight: "800",
|
|
60
|
-
letterSpacing: 0.5,
|
|
61
|
-
textAlign: "center"
|
|
62
|
-
},
|
|
63
|
-
children: label
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Resolve any `InstalledApp.icon` form to a renderable node. Function icons
|
|
70
|
-
* become elements (createElement — hooks keep working); strings become
|
|
71
|
-
* auto-fitting text icons; nodes pass through.
|
|
72
|
-
*/
|
|
73
|
-
function renderAppIcon(icon, ctx) {
|
|
74
|
-
if (icon == null) return icon;
|
|
75
|
-
if (typeof icon === "function") {
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(icon, {
|
|
77
|
-
slot: ctx.slot,
|
|
78
|
-
size: ctx.size,
|
|
79
|
-
state: ctx.state,
|
|
80
|
-
actions: ctx.actions
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (typeof icon === "string" || typeof icon === "number") {
|
|
84
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AppTextIcon, {
|
|
85
|
-
label: String(icon),
|
|
86
|
-
size: ctx.size,
|
|
87
|
-
color: ctx.color
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
return icon;
|
|
91
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AppTextIcon=AppTextIcon;exports.renderAppIcon=renderAppIcon;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function glyphCount(e){const t=e.replace(/[\uFE00-\uFE0F\u200D]/g,"");return Math.max(Array.from(t).length,1)}function AppTextIcon({label:e,size:t,color:u=_sharedUi.toolTheme.colors.text}){const r=glyphCount(e);const n=r<=2?t:t*1.6;const i=Math.max(7,Math.min(t*(r===1?.7:.62),n/(.62*r)));return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center"},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.5,style:{color:u,fontSize:i,fontWeight:"800",letterSpacing:.5,textAlign:"center"},children:e})})}function renderAppIcon(e,t){if(e==null)return e;if(typeof e==="function"){return _react.default.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions})}if(typeof e==="string"||typeof e==="number"){return(0,_jsxRuntime.jsx)(AppTextIcon,{label:String(e),size:t.size,color:t.color})}return e}
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.AppTextIcon = AppTextIcon;
|
|
7
|
-
exports.renderAppIcon = renderAppIcon;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/** DOM twin of the native icon resolver; importing RN breaks pure web hosts. */
|
|
13
|
-
function AppTextIcon({
|
|
14
|
-
label,
|
|
15
|
-
size,
|
|
16
|
-
color = _sharedUi.toolTheme.colors.text
|
|
17
|
-
}) {
|
|
18
|
-
const chars = Math.max(Array.from(label.replace(/[\uFE00-\uFE0F\u200D]/g, "")).length, 1);
|
|
19
|
-
const maxWidth = chars <= 2 ? size : size * 1.6;
|
|
20
|
-
const fontSize = Math.max(7, Math.min(size * (chars === 1 ? 0.7 : 0.62), maxWidth / (0.62 * chars)));
|
|
21
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
22
|
-
style: {
|
|
23
|
-
display: "inline-flex",
|
|
24
|
-
minWidth: size,
|
|
25
|
-
maxWidth,
|
|
26
|
-
height: size,
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
justifyContent: "center",
|
|
29
|
-
color,
|
|
30
|
-
fontSize,
|
|
31
|
-
fontWeight: 800,
|
|
32
|
-
letterSpacing: 0.5,
|
|
33
|
-
whiteSpace: "nowrap",
|
|
34
|
-
overflow: "hidden"
|
|
35
|
-
},
|
|
36
|
-
children: label
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function renderAppIcon(icon, ctx) {
|
|
40
|
-
if (icon == null) return icon;
|
|
41
|
-
if (typeof icon === "function") return /*#__PURE__*/_react.default.createElement(icon, {
|
|
42
|
-
slot: ctx.slot,
|
|
43
|
-
size: ctx.size,
|
|
44
|
-
state: ctx.state,
|
|
45
|
-
actions: ctx.actions
|
|
46
|
-
});
|
|
47
|
-
if (typeof icon === "string" || typeof icon === "number") return /*#__PURE__*/(0, _jsxRuntime.jsx)(AppTextIcon, {
|
|
48
|
-
label: String(icon),
|
|
49
|
-
size: ctx.size,
|
|
50
|
-
color: ctx.color
|
|
51
|
-
});
|
|
52
|
-
return icon;
|
|
53
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AppTextIcon=AppTextIcon;exports.renderAppIcon=renderAppIcon;var _react=_interopRequireDefault(require("react"));var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function AppTextIcon({label:e,size:t,color:o=_sharedUi.toolTheme.colors.text}){const r=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1);const n=r<=2?t:t*1.6;const a=Math.max(7,Math.min(t*(r===1?.7:.62),n/(.62*r)));return(0,_jsxRuntime.jsx)("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:a,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function renderAppIcon(e,t){if(e==null)return e;if(typeof e==="function")return _react.default.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions});if(typeof e==="string"||typeof e==="number")return(0,_jsxRuntime.jsx)(AppTextIcon,{label:String(e),size:t.size,color:t.color});return e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BrowserToolRuntime=BrowserToolRuntime;var _react=require("react");var _license=require("@buoy-gg/license");var _sharedUi=require("@buoy-gg/shared-ui");var _externalSyncGate=require("./externalSyncGate.js");var _deviceIdentity=require("./deviceIdentity.js");var _appSyncAdapter=require("./sync/appSyncAdapter.js");var _jsxRuntime=require("react/jsx-runtime");const roots=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const overlays=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function BrowserToolRuntime(e){const o=(0,_react.useMemo)(()=>Object.fromEntries(Object.entries(e.modules).map(([i,u])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),u])),[e.modules]);const c=o["react-query"];return c?.useReactQuerySyncAdapter?(0,_jsxRuntime.jsx)(QueryRuntime,{...e,modules:o,query:c}):(0,_jsxRuntime.jsx)(ToolRuntime,{...e,modules:o})}function QueryRuntime(e){const o=e.query.useReactQuerySyncAdapter();return(0,_jsxRuntime.jsx)(ToolRuntime,{...e,queryAdapter:o})}function ToolRuntime({modules:e,apps:o,requiredEnvVars:c,externalSync:i,headless:u,sentryGetClient:l,queryAdapter:s}){const{isPro:y,tier:S}=(0,_license.useLicense)();const f=(0,_react.useMemo)(()=>{const n={app:_appSyncAdapter.appSyncAdapter};for(const[t,r]of Object.entries(e)){for(const[a,p]of Object.entries(r)){if(a.endsWith("SyncAdapter")&&p&&typeof p==="object")n[t]=p}}if(s)n.query=s;if(e.env?.createEnvSyncAdapter)n.env=e.env.createEnvSyncAdapter(c??[]);for(const t of o??[])if(t.sync)n[`custom:${t.id}`]=t.sync;return n},[e,o,c,s]);const d=(0,_react.useRef)(f);d.current=f;(0,_react.useEffect)(()=>(0,_sharedUi.registerToolAdapters)(()=>d.current),[]);(0,_react.useEffect)(()=>{const n=[];const t=r=>{const a=r?.();if(typeof a==="function")n.push(a)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const r of n.reverse())r()}},[e]);const v=e["external-sync"];const g=typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production";const j=(0,_externalSyncGate.shouldMountExternalSync)({isDevelopment:g,isLicensed:y,externalSync:i,isAvailable:Boolean(v)});const b=e.sentry?.SentryRoot;return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[Object.entries(e).flatMap(([n,t])=>roots.map(r=>{const a=t[r];return a?(0,_jsxRuntime.jsx)(a,{},`${n}:${r}`):null})),b&&(0,_jsxRuntime.jsx)(b,{getClient:l}),Object.entries(e).flatMap(([n,t])=>overlays.map(r=>{const a=t[r];return a&&(!u||r==="ScenariosOverlay"||r==="ImpersonateOverlay")?(0,_jsxRuntime.jsx)(a,{},`${n}:${r}`):null})),j&&(0,_jsxRuntime.jsx)(BrowserExternalSync,{module:v,tools:f,options:(0,_externalSyncGate.externalSyncOptions)(i),isPro:y,tier:S})]})}function BrowserExternalSync({module:e,tools:o,options:c,isPro:i,tier:u}){const l=(0,_deviceIdentity.useDeviceIdentity)(c,{appName:typeof document==="undefined"?null:document.title||location.hostname,hardwareName:"Browser",platform:"web"});const{socket:s}=e.useExternalSyncSocket({deviceName:l?.deviceName??"Buoy Browser",socketURL:c?.socketURL??e.getDefaultSocketURL(),persistentDeviceId:l?.deviceId??null,platform:"web",enableLogs:c?.enableLogs});(0,_react.useEffect)(()=>{if(!s)return;const y=()=>{if(s.connected&&_license.LicenseManager.hasAccountAccess())s.emit("device-license",{isPro:i?"1":"0",tier:u})};y();s.on("connect",y);return()=>{s.off("connect",y)}},[s,i,u]);e.useExternalSync({tools:o,socket:s,deviceId:l?.deviceId??null,enableLogs:c?.enableLogs});return null}
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DefaultConfigProvider = DefaultConfigProvider;
|
|
7
|
-
exports.useDefaultConfig = useDefaultConfig;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
-
/**
|
|
12
|
-
* Context value for default configuration settings.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const DefaultConfigContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Provider for default configuration that can be consumed by the settings system.
|
|
19
|
-
* This allows teams to set default tool configurations without prop drilling.
|
|
20
|
-
*
|
|
21
|
-
* @internal Used by FloatingDevTools to provide defaults to the settings hook.
|
|
22
|
-
*/
|
|
23
|
-
function DefaultConfigProvider({
|
|
24
|
-
children,
|
|
25
|
-
defaultFloatingTools,
|
|
26
|
-
defaultDialTools
|
|
27
|
-
}) {
|
|
28
|
-
const value = _react.default.useMemo(() => ({
|
|
29
|
-
defaultFloatingTools,
|
|
30
|
-
defaultDialTools
|
|
31
|
-
}), [defaultFloatingTools, defaultDialTools]);
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultConfigContext.Provider, {
|
|
33
|
-
value: value,
|
|
34
|
-
children: children
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Hook to access the default configuration from context.
|
|
40
|
-
*
|
|
41
|
-
* @internal Used by useDevToolsSettings to apply defaults.
|
|
42
|
-
*/
|
|
43
|
-
function useDefaultConfig() {
|
|
44
|
-
return (0, _react.useContext)(DefaultConfigContext);
|
|
45
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DefaultConfigProvider=DefaultConfigProvider;exports.useDefaultConfig=useDefaultConfig;var _react=_interopRequireWildcard(require("react"));var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(f,u){if("function"==typeof WeakMap)var o=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(e,c){if(!c&&e&&e.__esModule)return e;var t,i,n={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return n;if(t=c?a:o){if(t.has(e))return t.get(e);t.set(e,n)}for(const r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((i=(t=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,r))&&(i.get||i.set)?t(n,r,i):n[r]=e[r]);return n})(f,u)}const DefaultConfigContext=(0,_react.createContext)({});function DefaultConfigProvider({children:f,defaultFloatingTools:u,defaultDialTools:o}){const a=_react.default.useMemo(()=>({defaultFloatingTools:u,defaultDialTools:o}),[u,o]);return(0,_jsxRuntime.jsx)(DefaultConfigContext.Provider,{value:a,children:f})}function useDefaultConfig(){return(0,_react.useContext)(DefaultConfigContext)}
|