@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,36 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.toggleStateManager = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* ToggleStateManager
|
|
9
|
-
*
|
|
10
|
-
* Global event emitter for toggle-only dev tools to notify when their state changes.
|
|
11
|
-
* This allows FloatingMenu to re-render and update icon colors.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
class ToggleStateManager {
|
|
15
|
-
listeners = new Set();
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Subscribe to any toggle state change
|
|
19
|
-
*/
|
|
20
|
-
subscribe(listener) {
|
|
21
|
-
this.listeners.add(listener);
|
|
22
|
-
return () => {
|
|
23
|
-
this.listeners.delete(listener);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Notify all subscribers that a toggle state changed
|
|
29
|
-
*/
|
|
30
|
-
notify() {
|
|
31
|
-
this.listeners.forEach(listener => listener());
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Singleton instance
|
|
36
|
-
const toggleStateManager = exports.toggleStateManager = new ToggleStateManager();
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.toggleStateManager=void 0;class ToggleStateManager{listeners=new Set;subscribe(e){this.listeners.add(e);return()=>{this.listeners.delete(e)}}notify(){this.listeners.forEach(e=>e())}}const toggleStateManager=exports.toggleStateManager=new ToggleStateManager;
|
|
@@ -1,281 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ToolModalShell = ToolModalShell;
|
|
7
|
-
exports.useToolHeader = useToolHeader;
|
|
8
|
-
exports.useToolHost = useToolHost;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
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); }
|
|
14
|
-
/**
|
|
15
|
-
* ToolHost — the declarative chrome layer for custom tools.
|
|
16
|
-
*
|
|
17
|
-
* When an `InstalledApp` declares `modal: {...}`, the AppHost renders its
|
|
18
|
-
* component inside `ToolModalShell` instead of raw: the shared JsModal
|
|
19
|
-
* (drag/resize, floating⇄bottom-sheet, minimize, dimension persistence) plus
|
|
20
|
-
* a managed header (title/subtitle, back navigation, search, actions) and a
|
|
21
|
-
* lightweight toast layer. The tool body talks back to the shell through
|
|
22
|
-
* `useToolHost()` / `useToolHeader()`.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/** Per-screen header overrides a tool body can apply (see `useToolHeader`). */
|
|
26
|
-
|
|
27
|
-
const noop = () => {};
|
|
28
|
-
const FALLBACK_CONTEXT = {
|
|
29
|
-
search: "",
|
|
30
|
-
isSearchActive: false,
|
|
31
|
-
clearSearch: noop,
|
|
32
|
-
close: noop,
|
|
33
|
-
minimize: noop,
|
|
34
|
-
showToast: noop,
|
|
35
|
-
setHeaderOverride: noop
|
|
36
|
-
};
|
|
37
|
-
const ToolHostContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Access the hosting shell from a custom tool body: search query, toasts,
|
|
41
|
-
* close. Safe to call outside the shell (returns inert no-ops) so tool
|
|
42
|
-
* components can also be mounted standalone.
|
|
43
|
-
*/
|
|
44
|
-
function useToolHost() {
|
|
45
|
-
return (0, _react.useContext)(ToolHostContext) ?? FALLBACK_CONTEXT;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Declare per-screen header state (title/subtitle/actions/back) from inside a
|
|
50
|
-
* tool body. Applies while the calling component is mounted and reverts to
|
|
51
|
-
* the preset's static config on unmount — so a detail screen simply mounts
|
|
52
|
-
* with its own header and the list header returns when it unmounts.
|
|
53
|
-
*
|
|
54
|
-
* ```tsx
|
|
55
|
-
* useToolHeader(
|
|
56
|
-
* { title: flag.key, onBack: () => setScreen("list"), actions: <CopyButton value={flag} /> },
|
|
57
|
-
* [flag.key]
|
|
58
|
-
* );
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
function useToolHeader(override, deps) {
|
|
62
|
-
const {
|
|
63
|
-
setHeaderOverride
|
|
64
|
-
} = useToolHost();
|
|
65
|
-
(0, _react.useEffect)(() => {
|
|
66
|
-
setHeaderOverride(override);
|
|
67
|
-
return () => setHeaderOverride(null);
|
|
68
|
-
// Caller-provided deps intentionally control when the override refreshes.
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
}, deps);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ---------------------------------------------------------------------------
|
|
74
|
-
// Toast layer
|
|
75
|
-
// ---------------------------------------------------------------------------
|
|
76
|
-
|
|
77
|
-
const TOAST_DURATION_MS = 2200;
|
|
78
|
-
const TOAST_COLORS = {
|
|
79
|
-
success: _sharedUi.gameUIColors.success,
|
|
80
|
-
error: _sharedUi.gameUIColors.error,
|
|
81
|
-
info: _sharedUi.gameUIColors.info
|
|
82
|
-
};
|
|
83
|
-
function ToastView({
|
|
84
|
-
message,
|
|
85
|
-
type,
|
|
86
|
-
nonce
|
|
87
|
-
}) {
|
|
88
|
-
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
89
|
-
(0, _react.useEffect)(() => {
|
|
90
|
-
opacity.setValue(0);
|
|
91
|
-
_reactNative.Animated.sequence([_reactNative.Animated.timing(opacity, {
|
|
92
|
-
toValue: 1,
|
|
93
|
-
duration: 150,
|
|
94
|
-
useNativeDriver: true
|
|
95
|
-
}), _reactNative.Animated.delay(TOAST_DURATION_MS - 450), _reactNative.Animated.timing(opacity, {
|
|
96
|
-
toValue: 0,
|
|
97
|
-
duration: 300,
|
|
98
|
-
useNativeDriver: true
|
|
99
|
-
})]).start();
|
|
100
|
-
}, [nonce, opacity]);
|
|
101
|
-
const color = TOAST_COLORS[type];
|
|
102
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
103
|
-
pointerEvents: "none",
|
|
104
|
-
style: [styles.toast, {
|
|
105
|
-
opacity,
|
|
106
|
-
borderColor: color + "60"
|
|
107
|
-
}],
|
|
108
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
109
|
-
style: [styles.toastDot, {
|
|
110
|
-
backgroundColor: color
|
|
111
|
-
}]
|
|
112
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
113
|
-
style: styles.toastText,
|
|
114
|
-
numberOfLines: 2,
|
|
115
|
-
children: message
|
|
116
|
-
})]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ---------------------------------------------------------------------------
|
|
121
|
-
// Shell
|
|
122
|
-
// ---------------------------------------------------------------------------
|
|
123
|
-
|
|
124
|
-
function ToolModalShell({
|
|
125
|
-
app,
|
|
126
|
-
config,
|
|
127
|
-
visible,
|
|
128
|
-
zIndex,
|
|
129
|
-
onClose,
|
|
130
|
-
onMinimize,
|
|
131
|
-
initialModalState,
|
|
132
|
-
enableSharedModalDimensions,
|
|
133
|
-
bodyProps
|
|
134
|
-
}) {
|
|
135
|
-
const Body = app.component;
|
|
136
|
-
const [isSearchActive, setIsSearchActive] = (0, _react.useState)(false);
|
|
137
|
-
const [search, setSearch] = (0, _react.useState)("");
|
|
138
|
-
const [headerOverride, setHeaderOverride] = (0, _react.useState)(null);
|
|
139
|
-
const [toast, setToast] = (0, _react.useState)(null);
|
|
140
|
-
const toastTimeoutRef = (0, _react.useRef)(null);
|
|
141
|
-
const clearSearch = (0, _react.useCallback)(() => {
|
|
142
|
-
setIsSearchActive(false);
|
|
143
|
-
setSearch("");
|
|
144
|
-
}, []);
|
|
145
|
-
const showToast = (0, _react.useCallback)((message, type = "info") => {
|
|
146
|
-
if (toastTimeoutRef.current) clearTimeout(toastTimeoutRef.current);
|
|
147
|
-
setToast(prev => ({
|
|
148
|
-
message,
|
|
149
|
-
type,
|
|
150
|
-
nonce: (prev?.nonce ?? 0) + 1
|
|
151
|
-
}));
|
|
152
|
-
toastTimeoutRef.current = setTimeout(() => setToast(null), TOAST_DURATION_MS);
|
|
153
|
-
}, []);
|
|
154
|
-
(0, _react.useEffect)(() => {
|
|
155
|
-
return () => {
|
|
156
|
-
if (toastTimeoutRef.current) clearTimeout(toastTimeoutRef.current);
|
|
157
|
-
};
|
|
158
|
-
}, []);
|
|
159
|
-
const contextValue = (0, _react.useMemo)(() => ({
|
|
160
|
-
search: isSearchActive ? search : "",
|
|
161
|
-
isSearchActive,
|
|
162
|
-
clearSearch,
|
|
163
|
-
close: onClose,
|
|
164
|
-
// Bare call: JsModal persists its own dimensions, so restoring brings
|
|
165
|
-
// the tool back the size the user last left it.
|
|
166
|
-
minimize: () => onMinimize(),
|
|
167
|
-
showToast,
|
|
168
|
-
setHeaderOverride,
|
|
169
|
-
instanceId: app.instanceId
|
|
170
|
-
}), [search, isSearchActive, clearSearch, onClose, onMinimize, showToast, app.instanceId]);
|
|
171
|
-
const title = headerOverride?.title ?? config.title ?? app.title ?? app.id;
|
|
172
|
-
const subtitle = headerOverride?.subtitle ?? config.subtitle;
|
|
173
|
-
const onBack = headerOverride?.onBack;
|
|
174
|
-
const actions = headerOverride?.actions ?? config.headerActions;
|
|
175
|
-
const searchable = headerOverride?.searchable ?? config.searchable;
|
|
176
|
-
|
|
177
|
-
// A screen that hides search while it's open would strand the input with
|
|
178
|
-
// no way to dismiss it — close it on entry instead.
|
|
179
|
-
(0, _react.useEffect)(() => {
|
|
180
|
-
if (!searchable && isSearchActive) clearSearch();
|
|
181
|
-
}, [searchable, isSearchActive, clearSearch]);
|
|
182
|
-
|
|
183
|
-
// Tool-scoped persistence via the custom namespace unless the user has the
|
|
184
|
-
// shared-dimensions global setting on (all tools share one window size).
|
|
185
|
-
const persistenceKey = enableSharedModalDimensions ? _sharedUi.devToolsStorageKeys.modal.root() : _sharedUi.devToolsStorageKeys.custom(app.id).modal();
|
|
186
|
-
const header = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader, {
|
|
187
|
-
children: [onBack && !isSearchActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation, {
|
|
188
|
-
onBack: onBack
|
|
189
|
-
}), isSearchActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Search, {
|
|
190
|
-
value: search,
|
|
191
|
-
onChangeText: setSearch,
|
|
192
|
-
onCancel: clearSearch,
|
|
193
|
-
placeholder: config.searchPlaceholder,
|
|
194
|
-
testID: `tool-search-field-${app.id}`
|
|
195
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
|
|
196
|
-
title: title,
|
|
197
|
-
subtitle: subtitle
|
|
198
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions, {
|
|
199
|
-
children: [!isSearchActive && actions, searchable && !isSearchActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.HeaderSearchButton, {
|
|
200
|
-
variant: "chip",
|
|
201
|
-
testID: `tool-search-${app.id}`,
|
|
202
|
-
onPress: () => setIsSearchActive(true)
|
|
203
|
-
})]
|
|
204
|
-
})]
|
|
205
|
-
});
|
|
206
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolHostContext.Provider, {
|
|
207
|
-
value: contextValue,
|
|
208
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.JsModal, {
|
|
209
|
-
visible: visible,
|
|
210
|
-
onClose: onClose,
|
|
211
|
-
onBack: onBack,
|
|
212
|
-
onMinimize: onMinimize,
|
|
213
|
-
initialModalState: initialModalState,
|
|
214
|
-
zIndex: zIndex,
|
|
215
|
-
persistenceKey: persistenceKey,
|
|
216
|
-
enablePersistence: true,
|
|
217
|
-
initialMode: config.initialMode ?? "bottomSheet",
|
|
218
|
-
header: {
|
|
219
|
-
customContent: header,
|
|
220
|
-
showToggleButton: true
|
|
221
|
-
}
|
|
222
|
-
// Tool bodies own their scrolling (ScrollView/FlatList) — the shell
|
|
223
|
-
// must not add a competing wrapper.
|
|
224
|
-
,
|
|
225
|
-
disableScrollWrapper: true,
|
|
226
|
-
styles: {},
|
|
227
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
228
|
-
style: styles.bodyRoot,
|
|
229
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.TickProvider, {
|
|
230
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Body, {
|
|
231
|
-
...bodyProps
|
|
232
|
-
})
|
|
233
|
-
}), toast && /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastView, {
|
|
234
|
-
message: toast.message,
|
|
235
|
-
type: toast.type,
|
|
236
|
-
nonce: toast.nonce
|
|
237
|
-
})]
|
|
238
|
-
})
|
|
239
|
-
})
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
const styles = _reactNative.StyleSheet.create({
|
|
243
|
-
bodyRoot: {
|
|
244
|
-
flex: 1,
|
|
245
|
-
minHeight: 0,
|
|
246
|
-
// Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
|
|
247
|
-
backgroundColor: "transparent"
|
|
248
|
-
},
|
|
249
|
-
toast: {
|
|
250
|
-
position: "absolute",
|
|
251
|
-
bottom: 16,
|
|
252
|
-
alignSelf: "center",
|
|
253
|
-
flexDirection: "row",
|
|
254
|
-
alignItems: "center",
|
|
255
|
-
gap: 8,
|
|
256
|
-
maxWidth: "86%",
|
|
257
|
-
backgroundColor: _sharedUi.buoyColors.card,
|
|
258
|
-
borderWidth: 1,
|
|
259
|
-
borderRadius: 8,
|
|
260
|
-
paddingHorizontal: 12,
|
|
261
|
-
paddingVertical: 8,
|
|
262
|
-
shadowColor: "#000",
|
|
263
|
-
shadowOpacity: 0.4,
|
|
264
|
-
shadowRadius: 8,
|
|
265
|
-
shadowOffset: {
|
|
266
|
-
width: 0,
|
|
267
|
-
height: 2
|
|
268
|
-
},
|
|
269
|
-
elevation: 6
|
|
270
|
-
},
|
|
271
|
-
toastDot: {
|
|
272
|
-
width: 6,
|
|
273
|
-
height: 6,
|
|
274
|
-
borderRadius: 3
|
|
275
|
-
},
|
|
276
|
-
toastText: {
|
|
277
|
-
flex: 1,
|
|
278
|
-
fontSize: 12,
|
|
279
|
-
color: _sharedUi.buoyColors.text
|
|
280
|
-
}
|
|
281
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ToolModalShell=ToolModalShell;exports.useToolHeader=useToolHeader;exports.useToolHost=useToolHost;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(t,o){if("function"==typeof WeakMap)var a=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,l){if(!l&&e&&e.__esModule)return e;var n,u,c={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return c;if(n=l?r:a){if(n.has(e))return n.get(e);n.set(e,c)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((u=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(u.get||u.set)?n(c,i,u):c[i]=e[i]);return c})(t,o)}const noop=()=>{};const FALLBACK_CONTEXT={search:"",isSearchActive:false,clearSearch:noop,close:noop,minimize:noop,showToast:noop,setHeaderOverride:noop};const ToolHostContext=(0,_react.createContext)(null);function useToolHost(){return(0,_react.useContext)(ToolHostContext)??FALLBACK_CONTEXT}function useToolHeader(t,o){const{setHeaderOverride:a}=useToolHost();(0,_react.useEffect)(()=>{a(t);return()=>a(null)},o)}const TOAST_DURATION_MS=2200;const TOAST_COLORS={success:_sharedUi.gameUIColors.success,error:_sharedUi.gameUIColors.error,info:_sharedUi.gameUIColors.info};function ToastView({message:t,type:o,nonce:a}){const r=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;(0,_react.useEffect)(()=>{r.setValue(0);_reactNative.Animated.sequence([_reactNative.Animated.timing(r,{toValue:1,duration:150,useNativeDriver:true}),_reactNative.Animated.delay(TOAST_DURATION_MS-450),_reactNative.Animated.timing(r,{toValue:0,duration:300,useNativeDriver:true})]).start()},[a,r]);const e=TOAST_COLORS[o];return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{pointerEvents:"none",style:[styles.toast,{opacity:r,borderColor:e+"60"}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.toastDot,{backgroundColor:e}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.toastText,numberOfLines:2,children:t})]})}function ToolModalShell({app:t,config:o,visible:a,zIndex:r,onClose:e,onMinimize:l,initialModalState:n,enableSharedModalDimensions:u,bodyProps:c}){const i=t.component;const[s,T]=(0,_react.useState)(false);const[m,y]=(0,_react.useState)("");const[d,j]=(0,_react.useState)(null);const[x,S]=(0,_react.useState)(null);const h=(0,_react.useRef)(null);const f=(0,_react.useCallback)(()=>{T(false);y("")},[]);const g=(0,_react.useCallback)((A,H="info")=>{if(h.current)clearTimeout(h.current);S(k=>({message:A,type:H,nonce:(k?.nonce??0)+1}));h.current=setTimeout(()=>S(null),TOAST_DURATION_MS)},[]);(0,_react.useEffect)(()=>{return()=>{if(h.current)clearTimeout(h.current)}},[]);const p=(0,_react.useMemo)(()=>({search:s?m:"",isSearchActive:s,clearSearch:f,close:e,minimize:()=>l(),showToast:g,setHeaderOverride:j,instanceId:t.instanceId}),[m,s,f,e,l,g,t.instanceId]);const C=d?.title??o.title??t.title??t.id;const w=d?.subtitle??o.subtitle;const b=d?.onBack;const O=d?.actions??o.headerActions;const v=d?.searchable??o.searchable;(0,_react.useEffect)(()=>{if(!v&&s)f()},[v,s,f]);const M=u?_sharedUi.devToolsStorageKeys.modal.root():_sharedUi.devToolsStorageKeys.custom(t.id).modal();const _=(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[b&&!s&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:b}),s?(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Search,{value:m,onChangeText:y,onCancel:f,placeholder:o.searchPlaceholder,testID:`tool-search-field-${t.id}`}):(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:C,subtitle:w}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[!s&&O,v&&!s&&(0,_jsxRuntime.jsx)(_sharedUi.HeaderSearchButton,{variant:"chip",testID:`tool-search-${t.id}`,onPress:()=>T(true)})]})]});return(0,_jsxRuntime.jsx)(ToolHostContext.Provider,{value:p,children:(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:a,onClose:e,onBack:b,onMinimize:l,initialModalState:n,zIndex:r,persistenceKey:M,enablePersistence:true,initialMode:o.initialMode??"bottomSheet",header:{customContent:_,showToggleButton:true},disableScrollWrapper:true,styles:{},children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.bodyRoot,children:[(0,_jsxRuntime.jsx)(_sharedUi.TickProvider,{children:(0,_jsxRuntime.jsx)(i,{...c})}),x&&(0,_jsxRuntime.jsx)(ToastView,{message:x.message,type:x.type,nonce:x.nonce})]})})})}const styles=_reactNative.StyleSheet.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:_sharedUi.buoyColors.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:_sharedUi.buoyColors.text}});
|
|
@@ -1,41 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ToolOpenerBridge = ToolOpenerBridge;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _AppHost = require("./AppHost");
|
|
10
|
-
/**
|
|
11
|
-
* ToolOpenerBridge — publishes "bring a tool back on screen" to the overlays.
|
|
12
|
-
*
|
|
13
|
-
* Renders nothing. It exists only to sit INSIDE `AppHostProvider` (where the
|
|
14
|
-
* open-tool state lives) and hand that capability out through the global seam
|
|
15
|
-
* in `@buoy-gg/shared-ui`, so an overlay rendered as a sibling of the provider
|
|
16
|
-
* can still offer a button that opens a tool. See `toolUiBridge.ts` for why the
|
|
17
|
-
* overlays can't just be moved inside the provider.
|
|
18
|
-
*
|
|
19
|
-
* It only RESTORES a tool that is already open — including one that has been
|
|
20
|
-
* minimized, which is the case that matters (the macro recorder minimizes
|
|
21
|
-
* Scenarios so the tester can drive the app, then needs it back). It
|
|
22
|
-
* deliberately does not construct and open a tool from scratch: an opener that
|
|
23
|
-
* guesses at an instance is a worse failure than reporting that it couldn't,
|
|
24
|
-
* and every caller already has to handle `false`.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
function ToolOpenerBridge() {
|
|
28
|
-
const {
|
|
29
|
-
openApps,
|
|
30
|
-
restore
|
|
31
|
-
} = (0, _AppHost.useAppHost)();
|
|
32
|
-
(0, _react.useEffect)(() => {
|
|
33
|
-
return (0, _sharedUi.registerToolOpener)(toolId => {
|
|
34
|
-
const instance = openApps.find(app => app.id === toolId);
|
|
35
|
-
if (!instance) return false;
|
|
36
|
-
restore(instance.instanceId);
|
|
37
|
-
return true;
|
|
38
|
-
});
|
|
39
|
-
}, [openApps, restore]);
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ToolOpenerBridge=ToolOpenerBridge;var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _AppHost=require("./AppHost");function ToolOpenerBridge(){const{openApps:e,restore:r}=(0,_AppHost.useAppHost)();(0,_react.useEffect)(()=>{return(0,_sharedUi.registerToolOpener)(s=>{const t=e.find(n=>n.id===s);if(!t)return false;r(t.instanceId);return true})},[e,r]);return null}
|