@buoy-gg/core 7.0.41 → 7.0.43
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 -95
- package/bin/buoy.js +19 -340
- package/lib/commonjs/Buoy.js +1 -107
- package/lib/commonjs/browserRegister.js +1 -48
- package/lib/commonjs/browserRegister.server.js +1 -10
- 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 -376
- 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 -150
- package/lib/commonjs/floatingMenu/DefaultConfigContext.js +1 -45
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +1 -18
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1114
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +1 -48
- package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +1 -49
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -559
- package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -415
- 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 -377
- 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 -471
- package/lib/commonjs/floatingMenu/autoExternalSync.js +1 -443
- 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 -895
- package/lib/commonjs/floatingMenu/dial/DialHyperspace.js +1 -177
- package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -304
- 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 -12
- 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 -14
- package/lib/commonjs/index.js +1 -291
- package/lib/commonjs/index.web.js +1 -241
- package/lib/commonjs/reactDevtoolsTypes.js +1 -1
- 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 -46
- package/lib/commonjs/utils/createWebTool.js +1 -20
- package/lib/commonjs/utils/createWebTools.js +1 -30
- package/lib/commonjs/version.js +1 -18
- package/lib/module/Buoy.js +1 -102
- package/lib/module/browserRegister.js +1 -44
- package/lib/module/browserRegister.server.js +1 -6
- 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 -368
- 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 -146
- package/lib/module/floatingMenu/DefaultConfigContext.js +1 -39
- package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -3
- package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1110
- package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +1 -44
- package/lib/module/floatingMenu/DevToolsVisibilityContext.js +1 -44
- package/lib/module/floatingMenu/FloatingDevTools.js +1 -556
- package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -412
- 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 -374
- 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 -467
- package/lib/module/floatingMenu/autoExternalSync.js +1 -436
- 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 -891
- package/lib/module/floatingMenu/dial/DialHyperspace.js +1 -173
- package/lib/module/floatingMenu/dial/DialIcon.js +1 -301
- 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 -3
- 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 -10
- package/lib/module/index.js +1 -41
- package/lib/module/index.web.js +1 -36
- package/lib/module/reactDevtoolsTypes.js +1 -1
- 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 -38
- package/lib/module/utils/createWebTool.js +1 -17
- package/lib/module/utils/createWebTools.js +1 -25
- package/lib/module/version.js +1 -14
- package/lib/typescript/commonjs/browserRegister.d.ts +9 -1
- package/lib/typescript/commonjs/browserRegister.server.d.ts +1 -0
- package/lib/typescript/commonjs/earlyHookScript.d.ts +12 -0
- package/lib/typescript/commonjs/earlyNetwork.d.ts +52 -0
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +1 -0
- package/lib/typescript/commonjs/releaseOptIn.d.ts +4 -0
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/browserRegister.d.ts +9 -1
- package/lib/typescript/module/browserRegister.server.d.ts +1 -0
- package/lib/typescript/module/earlyHookScript.d.ts +12 -0
- package/lib/typescript/module/earlyNetwork.d.ts +52 -0
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/module/index.web.d.ts +1 -0
- package/lib/typescript/module/releaseOptIn.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 -2
- package/lib/web/chunks/chunk-R7RGRTY5.mjs +1 -2
- package/lib/web/index.mjs +2 -3
- package/lib/web/register-server.mjs +1 -2
- package/lib/web/register.mjs +1 -2
- package/lib/web/toolkit.mjs +1 -2
- package/package.json +6 -9
- package/lib/typescript/commonjs/Buoy.d.ts.map +0 -1
- package/lib/typescript/commonjs/browserRegister.d.ts.map +0 -1
- package/lib/typescript/commonjs/browserRegister.server.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/BrowserToolRuntime.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.shared.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/floatingMenu/useDesktopSyncStatus.web.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/reactDevtoolsTypes.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/utils/createWebTool.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/createWebTools.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/browserRegister.d.ts.map +0 -1
- package/lib/typescript/module/browserRegister.server.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/BrowserToolRuntime.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.shared.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/floatingMenu/useDesktopSyncStatus.web.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/reactDevtoolsTypes.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/utils/createWebTool.d.ts.map +0 -1
- package/lib/typescript/module/utils/createWebTools.d.ts.map +0 -1
- package/lib/typescript/module/version.d.ts.map +0 -1
- package/lib/web/chunks/chunk-5NZOQR6Q.mjs +0 -2
- package/lib/web/chunks/chunk-CGDSLLZF.mjs +0 -2
- package/lib/web/chunks/chunk-DCJDUSNR.mjs +0 -2
- package/lib/web/chunks/chunk-IDSHFS6G.mjs +0 -2
- package/lib/web/chunks/chunk-JOAMJGCS.mjs +0 -2
- package/lib/web/chunks/chunk-KYKZ2N52.mjs +0 -2
- package/lib/web/chunks/chunk-NGM7JGGS.mjs +0 -2
- package/lib/web/chunks/chunk-Z3XWDDIO.mjs +0 -2
- package/lib/web/chunks/chunk-ZTGQ6TTY.mjs +0 -2
|
@@ -1,288 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MinimizedToolsStack = MinimizedToolsStack;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _MinimizedToolsContext = require("./MinimizedToolsContext.js");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
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); }
|
|
13
|
-
/**
|
|
14
|
-
* A hidden tool's "I need you". See `setToolAttention` in shared-ui — the tool
|
|
15
|
-
* publishes, the rail draws. Read through useSyncExternalStore so a badge set
|
|
16
|
-
* from inside a minimized sheet lands on the chip without the rail polling.
|
|
17
|
-
*/function useToolAttention(toolId) {
|
|
18
|
-
return (0, _react.useSyncExternalStore)(_sharedUi.subscribeToolAttention, () => (0, _sharedUi.getToolAttention)(toolId), () => (0, _sharedUi.getToolAttention)(toolId));
|
|
19
|
-
}
|
|
20
|
-
const ATTENTION_COLORS = {
|
|
21
|
-
needsInput: "#FF8329",
|
|
22
|
-
done: "#20C997",
|
|
23
|
-
failed: "#FF3B30"
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/** needsInput outranks failed outranks done — the peek shows the one that matters most. */
|
|
27
|
-
const ATTENTION_RANK = {
|
|
28
|
-
needsInput: 3,
|
|
29
|
-
failed: 2,
|
|
30
|
-
done: 1
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/** The strongest attention across every minimized tool, for the folded peek. */
|
|
34
|
-
function useStrongestAttention(toolIds) {
|
|
35
|
-
const key = toolIds.join("|");
|
|
36
|
-
return (0, _react.useSyncExternalStore)(_sharedUi.subscribeToolAttention, () => strongest(key), () => strongest(key));
|
|
37
|
-
}
|
|
38
|
-
const strongestCache = new Map();
|
|
39
|
-
function strongest(key) {
|
|
40
|
-
let best = null;
|
|
41
|
-
for (const id of key ? key.split("|") : []) {
|
|
42
|
-
const a = (0, _sharedUi.getToolAttention)(id);
|
|
43
|
-
if (a && (!best || ATTENTION_RANK[a.kind] > ATTENTION_RANK[best.kind])) best = a;
|
|
44
|
-
}
|
|
45
|
-
// Same value → same object, or useSyncExternalStore re-renders forever.
|
|
46
|
-
const prev = strongestCache.get(key);
|
|
47
|
-
if (prev && best && prev.kind === best.kind && prev.label === best.label) return prev;
|
|
48
|
-
if (!prev && !best) return null;
|
|
49
|
-
strongestCache.set(key, best);
|
|
50
|
-
return best;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// ============================================================================
|
|
54
|
-
// Constants
|
|
55
|
-
// ============================================================================
|
|
56
|
-
|
|
57
|
-
const PEEK_HEIGHT = 28;
|
|
58
|
-
const TOOLBAR_WIDTH = 44;
|
|
59
|
-
const TOOL_ITEM_SIZE = 32;
|
|
60
|
-
const ICON_GAP = 6;
|
|
61
|
-
const TOOLBAR_PADDING = 8;
|
|
62
|
-
const COLLAPSE_BUTTON_SIZE = 24;
|
|
63
|
-
const STORAGE_KEY_EXPANDED = "@react_buoy_minimized_stack_expanded";
|
|
64
|
-
|
|
65
|
-
// Glitch effect constants
|
|
66
|
-
const GLITCH_DURATION_MS = 80;
|
|
67
|
-
const MIN_GLITCH_DELAY = 2000;
|
|
68
|
-
const MAX_GLITCH_DELAY = 6000;
|
|
69
|
-
|
|
70
|
-
// ============================================================================
|
|
71
|
-
// Glitch Tool Button Component
|
|
72
|
-
// ============================================================================
|
|
73
|
-
|
|
74
|
-
function GlitchToolButton({
|
|
75
|
-
tool,
|
|
76
|
-
onSelect,
|
|
77
|
-
index
|
|
78
|
-
}) {
|
|
79
|
-
const attention = useToolAttention(tool.id);
|
|
80
|
-
const glitchX = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
81
|
-
const glitchOpacity = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
82
|
-
const glitchScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
83
|
-
(0, _react.useEffect)(() => {
|
|
84
|
-
let isMounted = true;
|
|
85
|
-
const runGlitch = () => {
|
|
86
|
-
if (!isMounted) return;
|
|
87
|
-
const d = GLITCH_DURATION_MS;
|
|
88
|
-
_reactNative.Animated.parallel([
|
|
89
|
-
// X displacement - quick shake
|
|
90
|
-
_reactNative.Animated.sequence([_reactNative.Animated.timing(glitchX, {
|
|
91
|
-
toValue: 3,
|
|
92
|
-
duration: d * 0.2,
|
|
93
|
-
easing: _reactNative.Easing.linear,
|
|
94
|
-
useNativeDriver: true
|
|
95
|
-
}), _reactNative.Animated.timing(glitchX, {
|
|
96
|
-
toValue: -3,
|
|
97
|
-
duration: d * 0.2,
|
|
98
|
-
easing: _reactNative.Easing.linear,
|
|
99
|
-
useNativeDriver: true
|
|
100
|
-
}), _reactNative.Animated.timing(glitchX, {
|
|
101
|
-
toValue: 2,
|
|
102
|
-
duration: d * 0.2,
|
|
103
|
-
easing: _reactNative.Easing.linear,
|
|
104
|
-
useNativeDriver: true
|
|
105
|
-
}), _reactNative.Animated.timing(glitchX, {
|
|
106
|
-
toValue: -1,
|
|
107
|
-
duration: d * 0.2,
|
|
108
|
-
easing: _reactNative.Easing.linear,
|
|
109
|
-
useNativeDriver: true
|
|
110
|
-
}), _reactNative.Animated.timing(glitchX, {
|
|
111
|
-
toValue: 0,
|
|
112
|
-
duration: d * 0.2,
|
|
113
|
-
easing: _reactNative.Easing.linear,
|
|
114
|
-
useNativeDriver: true
|
|
115
|
-
})]),
|
|
116
|
-
// Opacity flicker
|
|
117
|
-
_reactNative.Animated.sequence([_reactNative.Animated.timing(glitchOpacity, {
|
|
118
|
-
toValue: 0.4,
|
|
119
|
-
duration: d * 0.25,
|
|
120
|
-
useNativeDriver: true
|
|
121
|
-
}), _reactNative.Animated.timing(glitchOpacity, {
|
|
122
|
-
toValue: 1,
|
|
123
|
-
duration: d * 0.25,
|
|
124
|
-
useNativeDriver: true
|
|
125
|
-
}), _reactNative.Animated.timing(glitchOpacity, {
|
|
126
|
-
toValue: 0.6,
|
|
127
|
-
duration: d * 0.25,
|
|
128
|
-
useNativeDriver: true
|
|
129
|
-
}), _reactNative.Animated.timing(glitchOpacity, {
|
|
130
|
-
toValue: 1,
|
|
131
|
-
duration: d * 0.25,
|
|
132
|
-
useNativeDriver: true
|
|
133
|
-
})]),
|
|
134
|
-
// Scale pulse
|
|
135
|
-
_reactNative.Animated.sequence([_reactNative.Animated.timing(glitchScale, {
|
|
136
|
-
toValue: 1.1,
|
|
137
|
-
duration: d * 0.3,
|
|
138
|
-
useNativeDriver: true
|
|
139
|
-
}), _reactNative.Animated.timing(glitchScale, {
|
|
140
|
-
toValue: 0.95,
|
|
141
|
-
duration: d * 0.4,
|
|
142
|
-
useNativeDriver: true
|
|
143
|
-
}), _reactNative.Animated.timing(glitchScale, {
|
|
144
|
-
toValue: 1,
|
|
145
|
-
duration: d * 0.3,
|
|
146
|
-
useNativeDriver: true
|
|
147
|
-
})])]).start();
|
|
148
|
-
};
|
|
149
|
-
const scheduleNextGlitch = () => {
|
|
150
|
-
if (!isMounted) return;
|
|
151
|
-
const delay = MIN_GLITCH_DELAY + Math.random() * (MAX_GLITCH_DELAY - MIN_GLITCH_DELAY) + index * 300;
|
|
152
|
-
setTimeout(() => {
|
|
153
|
-
if (isMounted) {
|
|
154
|
-
runGlitch();
|
|
155
|
-
scheduleNextGlitch();
|
|
156
|
-
}
|
|
157
|
-
}, delay);
|
|
158
|
-
};
|
|
159
|
-
const initialDelay = 500 + Math.random() * 1500 + index * 200;
|
|
160
|
-
const timeoutId = setTimeout(() => {
|
|
161
|
-
if (isMounted) {
|
|
162
|
-
runGlitch();
|
|
163
|
-
scheduleNextGlitch();
|
|
164
|
-
}
|
|
165
|
-
}, initialDelay);
|
|
166
|
-
return () => {
|
|
167
|
-
isMounted = false;
|
|
168
|
-
clearTimeout(timeoutId);
|
|
169
|
-
};
|
|
170
|
-
}, [glitchX, glitchOpacity, glitchScale, index]);
|
|
171
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
172
|
-
onPress: () => onSelect(tool),
|
|
173
|
-
activeOpacity: 0.7,
|
|
174
|
-
style: styles.toolButton,
|
|
175
|
-
accessibilityLabel: attention ? `${tool.title} — ${attention.label}. Restore` : `Restore ${tool.title}`,
|
|
176
|
-
accessibilityRole: "button",
|
|
177
|
-
testID: `buoy-dock-restore-${tool.id}`,
|
|
178
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
179
|
-
style: {
|
|
180
|
-
opacity: glitchOpacity,
|
|
181
|
-
transform: [{
|
|
182
|
-
translateX: glitchX
|
|
183
|
-
}, {
|
|
184
|
-
scale: glitchScale
|
|
185
|
-
}]
|
|
186
|
-
},
|
|
187
|
-
children: tool.icon
|
|
188
|
-
}), attention ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
189
|
-
style: [styles.badge, {
|
|
190
|
-
backgroundColor: ATTENTION_COLORS[attention.kind]
|
|
191
|
-
}],
|
|
192
|
-
testID: `buoy-dock-badge-${tool.id}-${attention.kind}`,
|
|
193
|
-
pointerEvents: "none",
|
|
194
|
-
children: attention.kind === "needsInput" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
195
|
-
style: styles.badgeText,
|
|
196
|
-
children: "!"
|
|
197
|
-
}) : null
|
|
198
|
-
}) : null]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// ============================================================================
|
|
203
|
-
// Types
|
|
204
|
-
// ============================================================================
|
|
205
|
-
|
|
206
|
-
// ============================================================================
|
|
207
|
-
// Main Component
|
|
208
|
-
// ============================================================================
|
|
209
|
-
|
|
210
|
-
function MinimizedToolsStack({
|
|
211
|
-
onRestore,
|
|
212
|
-
containerWidth = TOOLBAR_WIDTH
|
|
213
|
-
}) {
|
|
214
|
-
const {
|
|
215
|
-
minimizedTools,
|
|
216
|
-
restore
|
|
217
|
-
} = (0, _MinimizedToolsContext.useMinimizedTools)();
|
|
218
|
-
const peekAttention = useStrongestAttention(minimizedTools.map(t => t.id));
|
|
219
|
-
|
|
220
|
-
// Calculate expanded height based on number of tools
|
|
221
|
-
const expandedHeight = TOOLBAR_PADDING + minimizedTools.length * TOOL_ITEM_SIZE + (minimizedTools.length - 1) * ICON_GAP + ICON_GAP + COLLAPSE_BUTTON_SIZE + 4;
|
|
222
|
-
|
|
223
|
-
// Handle tool press (restore)
|
|
224
|
-
const handleToolPress = (0, _react.useCallback)(tool => {
|
|
225
|
-
const restored = restore(tool.instanceId);
|
|
226
|
-
if (restored && onRestore) {
|
|
227
|
-
onRestore(restored);
|
|
228
|
-
}
|
|
229
|
-
}, [restore, onRestore]);
|
|
230
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ExpandablePopover, {
|
|
231
|
-
hasItems: minimizedTools.length > 0,
|
|
232
|
-
itemCount: minimizedTools.length,
|
|
233
|
-
showCount: true,
|
|
234
|
-
width: containerWidth,
|
|
235
|
-
expandedHeight: expandedHeight,
|
|
236
|
-
persistState: true,
|
|
237
|
-
storageKey: STORAGE_KEY_EXPANDED,
|
|
238
|
-
peekHeight: PEEK_HEIGHT,
|
|
239
|
-
collapsedLabel: `Show ${minimizedTools.length} minimized tools`,
|
|
240
|
-
testID: "buoy-dock-peek",
|
|
241
|
-
collapseTestID: "buoy-dock-collapse",
|
|
242
|
-
attention: peekAttention ? {
|
|
243
|
-
color: ATTENTION_COLORS[peekAttention.kind],
|
|
244
|
-
glyph: peekAttention.kind === "needsInput" ? "!" : undefined,
|
|
245
|
-
label: peekAttention.label
|
|
246
|
-
} : null,
|
|
247
|
-
children: [...minimizedTools].reverse().map((tool, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(GlitchToolButton, {
|
|
248
|
-
tool: tool,
|
|
249
|
-
onSelect: handleToolPress,
|
|
250
|
-
index: index
|
|
251
|
-
}, tool.instanceId))
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// ============================================================================
|
|
256
|
-
// Styles
|
|
257
|
-
// ============================================================================
|
|
258
|
-
|
|
259
|
-
const styles = _reactNative.StyleSheet.create({
|
|
260
|
-
toolButton: {
|
|
261
|
-
width: TOOL_ITEM_SIZE,
|
|
262
|
-
height: TOOL_ITEM_SIZE,
|
|
263
|
-
alignItems: "center",
|
|
264
|
-
justifyContent: "center",
|
|
265
|
-
backgroundColor: "transparent"
|
|
266
|
-
},
|
|
267
|
-
// Top-right of the chip. Needs-input carries a glyph; done/failed are a dot —
|
|
268
|
-
// the colour says which, the glyph says "act".
|
|
269
|
-
badge: {
|
|
270
|
-
position: "absolute",
|
|
271
|
-
top: 0,
|
|
272
|
-
right: 0,
|
|
273
|
-
minWidth: 12,
|
|
274
|
-
height: 12,
|
|
275
|
-
borderRadius: 6,
|
|
276
|
-
paddingHorizontal: 2,
|
|
277
|
-
alignItems: "center",
|
|
278
|
-
justifyContent: "center",
|
|
279
|
-
borderWidth: 1.5,
|
|
280
|
-
borderColor: "#0C0C0C"
|
|
281
|
-
},
|
|
282
|
-
badgeText: {
|
|
283
|
-
color: "#000",
|
|
284
|
-
fontSize: 8,
|
|
285
|
-
fontWeight: "800",
|
|
286
|
-
lineHeight: 9
|
|
287
|
-
}
|
|
288
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.MinimizedToolsStack=MinimizedToolsStack;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _MinimizedToolsContext=require("./MinimizedToolsContext.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(t,i){if("function"==typeof WeakMap)var n=new WeakMap,s=new WeakMap;return(_interopRequireWildcard=function(e,l){if(!l&&e&&e.__esModule)return e;var o,r,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(o=l?s:n){if(o.has(e))return o.get(e);o.set(e,u)}for(const c in e)"default"!==c&&{}.hasOwnProperty.call(e,c)&&((r=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,c))&&(r.get||r.set)?o(u,c,r):u[c]=e[c]);return u})(t,i)}function useToolAttention(t){return(0,_react.useSyncExternalStore)(_sharedUi.subscribeToolAttention,()=>(0,_sharedUi.getToolAttention)(t),()=>(0,_sharedUi.getToolAttention)(t))}const ATTENTION_COLORS={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"};const ATTENTION_RANK={needsInput:3,failed:2,done:1};function useStrongestAttention(t){const i=t.join("|");return(0,_react.useSyncExternalStore)(_sharedUi.subscribeToolAttention,()=>strongest(i),()=>strongest(i))}const strongestCache=new Map;function strongest(t){let i=null;for(const s of t?t.split("|"):[]){const e=(0,_sharedUi.getToolAttention)(s);if(e&&(!i||ATTENTION_RANK[e.kind]>ATTENTION_RANK[i.kind]))i=e}const n=strongestCache.get(t);if(n&&i&&n.kind===i.kind&&n.label===i.label)return n;if(!n&&!i)return null;strongestCache.set(t,i);return i}const PEEK_HEIGHT=28;const TOOLBAR_WIDTH=44;const TOOL_ITEM_SIZE=32;const ICON_GAP=6;const TOOLBAR_PADDING=8;const COLLAPSE_BUTTON_SIZE=24;const STORAGE_KEY_EXPANDED="@react_buoy_minimized_stack_expanded";const GLITCH_DURATION_MS=80;const MIN_GLITCH_DELAY=2e3;const MAX_GLITCH_DELAY=6e3;function GlitchToolButton({tool:t,onSelect:i,index:n}){const s=useToolAttention(t.id);const e=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const l=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current;const o=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current;(0,_react.useEffect)(()=>{let r=true;const u=()=>{if(!r)return;const a=GLITCH_DURATION_MS;_reactNative.Animated.parallel([_reactNative.Animated.sequence([_reactNative.Animated.timing(e,{toValue:3,duration:a*.2,easing:_reactNative.Easing.linear,useNativeDriver:true}),_reactNative.Animated.timing(e,{toValue:-3,duration:a*.2,easing:_reactNative.Easing.linear,useNativeDriver:true}),_reactNative.Animated.timing(e,{toValue:2,duration:a*.2,easing:_reactNative.Easing.linear,useNativeDriver:true}),_reactNative.Animated.timing(e,{toValue:-1,duration:a*.2,easing:_reactNative.Easing.linear,useNativeDriver:true}),_reactNative.Animated.timing(e,{toValue:0,duration:a*.2,easing:_reactNative.Easing.linear,useNativeDriver:true})]),_reactNative.Animated.sequence([_reactNative.Animated.timing(l,{toValue:.4,duration:a*.25,useNativeDriver:true}),_reactNative.Animated.timing(l,{toValue:1,duration:a*.25,useNativeDriver:true}),_reactNative.Animated.timing(l,{toValue:.6,duration:a*.25,useNativeDriver:true}),_reactNative.Animated.timing(l,{toValue:1,duration:a*.25,useNativeDriver:true})]),_reactNative.Animated.sequence([_reactNative.Animated.timing(o,{toValue:1.1,duration:a*.3,useNativeDriver:true}),_reactNative.Animated.timing(o,{toValue:.95,duration:a*.4,useNativeDriver:true}),_reactNative.Animated.timing(o,{toValue:1,duration:a*.3,useNativeDriver:true})])]).start()};const c=()=>{if(!r)return;const a=MIN_GLITCH_DELAY+Math.random()*(MAX_GLITCH_DELAY-MIN_GLITCH_DELAY)+n*300;setTimeout(()=>{if(r){u();c()}},a)};const d=500+Math.random()*1500+n*200;const g=setTimeout(()=>{if(r){u();c()}},d);return()=>{r=false;clearTimeout(g)}},[e,l,o,n]);return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:()=>i(t),activeOpacity:.7,style:styles.toolButton,accessibilityLabel:s?`${t.title} \u2014 ${s.label}. Restore`:`Restore ${t.title}`,accessibilityRole:"button",testID:`buoy-dock-restore-${t.id}`,children:[(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{opacity:l,transform:[{translateX:e},{scale:o}]},children:t.icon}),s?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.badge,{backgroundColor:ATTENTION_COLORS[s.kind]}],testID:`buoy-dock-badge-${t.id}-${s.kind}`,pointerEvents:"none",children:s.kind==="needsInput"?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.badgeText,children:"!"}):null}):null]})}function MinimizedToolsStack({onRestore:t,containerWidth:i=TOOLBAR_WIDTH}){const{minimizedTools:n,restore:s}=(0,_MinimizedToolsContext.useMinimizedTools)();const e=useStrongestAttention(n.map(r=>r.id));const l=TOOLBAR_PADDING+n.length*TOOL_ITEM_SIZE+(n.length-1)*ICON_GAP+ICON_GAP+COLLAPSE_BUTTON_SIZE+4;const o=(0,_react.useCallback)(r=>{const u=s(r.instanceId);if(u&&t){t(u)}},[s,t]);return(0,_jsxRuntime.jsx)(_sharedUi.ExpandablePopover,{hasItems:n.length>0,itemCount:n.length,showCount:true,width:i,expandedHeight:l,persistState:true,storageKey:STORAGE_KEY_EXPANDED,peekHeight:PEEK_HEIGHT,collapsedLabel:`Show ${n.length} minimized tools`,testID:"buoy-dock-peek",collapseTestID:"buoy-dock-collapse",attention:e?{color:ATTENTION_COLORS[e.kind],glyph:e.kind==="needsInput"?"!":void 0,label:e.label}:null,children:[...n].reverse().map((r,u)=>(0,_jsxRuntime.jsx)(GlitchToolButton,{tool:r,onSelect:o,index:u},r.instanceId))})}const styles=_reactNative.StyleSheet.create({toolButton:{width:TOOL_ITEM_SIZE,height:TOOL_ITEM_SIZE,alignItems:"center",justifyContent:"center",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,paddingHorizontal:2,alignItems:"center",justifyContent:"center",borderWidth:1.5,borderColor:"#0C0C0C"},badgeText:{color:"#000",fontSize:8,fontWeight:"800",lineHeight:9}});
|
|
@@ -1,377 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MinimizedToolsStack = MinimizedToolsStack;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _AppHostWeb = require("./AppHost.web.js");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
/**
|
|
12
|
-
* MinimizedToolsStack — Web twin of MinimizedToolsStack.tsx +
|
|
13
|
-
* shared-ui's ExpandablePopover (inlined: the popover is only used here on
|
|
14
|
-
* web). A vertical stack of minimized-tool icons fused to the top of the
|
|
15
|
-
* floating bubble's drag handle:
|
|
16
|
-
* - collapsed: a 28px "peek" tab (chevron-up + count) with top corners only
|
|
17
|
-
* - expanded: animated-height panel, icons newest-first, collapse chevron
|
|
18
|
-
* - expanded state persists under "@react_buoy_minimized_stack_expanded"
|
|
19
|
-
* - each icon runs the native randomized glitch loop (translateX shake +
|
|
20
|
-
* opacity flicker + scale pulse, 80ms), scheduled every 2-6s + index*300ms
|
|
21
|
-
*
|
|
22
|
-
* Data comes from the web AppHost (openApps with minimized === true) instead
|
|
23
|
-
* of the native MinimizedToolsContext — same derivation the MinimizedDock
|
|
24
|
-
* used before this replaced it.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/** Twin of the native hook — see MinimizedToolsStack.tsx. */
|
|
28
|
-
function useToolAttention(toolId) {
|
|
29
|
-
return (0, _react.useSyncExternalStore)(_sharedUi.subscribeToolAttention, () => (0, _sharedUi.getToolAttention)(toolId), () => (0, _sharedUi.getToolAttention)(toolId));
|
|
30
|
-
}
|
|
31
|
-
const ATTENTION_COLORS = {
|
|
32
|
-
needsInput: '#FF8329',
|
|
33
|
-
done: '#20C997',
|
|
34
|
-
failed: '#FF3B30'
|
|
35
|
-
};
|
|
36
|
-
const ATTENTION_RANK = {
|
|
37
|
-
needsInput: 3,
|
|
38
|
-
failed: 2,
|
|
39
|
-
done: 1
|
|
40
|
-
};
|
|
41
|
-
const strongestCache = new Map();
|
|
42
|
-
function strongest(key) {
|
|
43
|
-
let best = null;
|
|
44
|
-
for (const id of key ? key.split('|') : []) {
|
|
45
|
-
const a = (0, _sharedUi.getToolAttention)(id);
|
|
46
|
-
if (a && (!best || ATTENTION_RANK[a.kind] > ATTENTION_RANK[best.kind])) best = a;
|
|
47
|
-
}
|
|
48
|
-
const prev = strongestCache.get(key);
|
|
49
|
-
if (prev && best && prev.kind === best.kind && prev.label === best.label) return prev;
|
|
50
|
-
if (!prev && !best) return null;
|
|
51
|
-
strongestCache.set(key, best);
|
|
52
|
-
return best;
|
|
53
|
-
}
|
|
54
|
-
/** Twin of the native hook: the strongest attention across the folded dock. */
|
|
55
|
-
function useStrongestAttention(toolIds) {
|
|
56
|
-
const key = toolIds.join('|');
|
|
57
|
-
return (0, _react.useSyncExternalStore)(_sharedUi.subscribeToolAttention, () => strongest(key), () => strongest(key));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// native MinimizedToolsStack.tsx constants
|
|
61
|
-
const PEEK_HEIGHT = 28;
|
|
62
|
-
const TOOL_ITEM_SIZE = 32;
|
|
63
|
-
const ICON_GAP = 6;
|
|
64
|
-
const TOOLBAR_PADDING = 8;
|
|
65
|
-
const COLLAPSE_BUTTON_SIZE = 24;
|
|
66
|
-
const STORAGE_KEY_EXPANDED = '@react_buoy_minimized_stack_expanded';
|
|
67
|
-
const GLITCH_DURATION_MS = 80;
|
|
68
|
-
const MIN_GLITCH_DELAY = 2000;
|
|
69
|
-
const MAX_GLITCH_DELAY = 6000;
|
|
70
|
-
|
|
71
|
-
// native shared-ui buoyColors (gameUIColors.ts) — card + textMuted
|
|
72
|
-
const CARD = '#1A1A1A';
|
|
73
|
-
const TEXT_MUTED = '#888888';
|
|
74
|
-
function ChevronGlyph({
|
|
75
|
-
down = false
|
|
76
|
-
}) {
|
|
77
|
-
// native: ChevronUp size 12, strokeWidth 2, buoyColors.textMuted
|
|
78
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
79
|
-
width: 12,
|
|
80
|
-
height: 12,
|
|
81
|
-
viewBox: "0 0 24 24",
|
|
82
|
-
"aria-hidden": "true",
|
|
83
|
-
style: {
|
|
84
|
-
transform: down ? 'rotate(180deg)' : undefined
|
|
85
|
-
},
|
|
86
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
87
|
-
d: "M18 15l-6-6-6 6",
|
|
88
|
-
fill: "none",
|
|
89
|
-
stroke: TEXT_MUTED,
|
|
90
|
-
strokeWidth: "2",
|
|
91
|
-
strokeLinecap: "round",
|
|
92
|
-
strokeLinejoin: "round"
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function GlitchToolButton({
|
|
97
|
-
id,
|
|
98
|
-
title,
|
|
99
|
-
icon,
|
|
100
|
-
index,
|
|
101
|
-
onPress
|
|
102
|
-
}) {
|
|
103
|
-
const attention = useToolAttention(id);
|
|
104
|
-
const innerRef = (0, _react.useRef)(null);
|
|
105
|
-
(0, _react.useEffect)(() => {
|
|
106
|
-
let mounted = true;
|
|
107
|
-
let timer;
|
|
108
|
-
const runGlitch = () => {
|
|
109
|
-
// native: parallel translateX shake / opacity flicker / scale pulse,
|
|
110
|
-
// all inside GLITCH_DURATION_MS — one WAAPI animation with offsets.
|
|
111
|
-
innerRef.current?.animate([{
|
|
112
|
-
transform: 'translateX(0) scale(1)',
|
|
113
|
-
opacity: 1,
|
|
114
|
-
offset: 0
|
|
115
|
-
}, {
|
|
116
|
-
transform: 'translateX(3px) scale(1.05)',
|
|
117
|
-
opacity: 0.4,
|
|
118
|
-
offset: 0.2
|
|
119
|
-
}, {
|
|
120
|
-
transform: 'translateX(-3px) scale(1.1)',
|
|
121
|
-
opacity: 1,
|
|
122
|
-
offset: 0.4
|
|
123
|
-
}, {
|
|
124
|
-
transform: 'translateX(2px) scale(1.0)',
|
|
125
|
-
opacity: 0.6,
|
|
126
|
-
offset: 0.6
|
|
127
|
-
}, {
|
|
128
|
-
transform: 'translateX(-1px) scale(0.95)',
|
|
129
|
-
opacity: 1,
|
|
130
|
-
offset: 0.8
|
|
131
|
-
}, {
|
|
132
|
-
transform: 'translateX(0) scale(1)',
|
|
133
|
-
opacity: 1,
|
|
134
|
-
offset: 1
|
|
135
|
-
}], {
|
|
136
|
-
duration: GLITCH_DURATION_MS,
|
|
137
|
-
easing: 'linear'
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
const schedule = initial => {
|
|
141
|
-
const delay = initial ? 500 + Math.random() * 1500 + index * 200 : MIN_GLITCH_DELAY + Math.random() * (MAX_GLITCH_DELAY - MIN_GLITCH_DELAY) + index * 300;
|
|
142
|
-
timer = setTimeout(() => {
|
|
143
|
-
if (!mounted) return;
|
|
144
|
-
runGlitch();
|
|
145
|
-
schedule(false);
|
|
146
|
-
}, delay);
|
|
147
|
-
};
|
|
148
|
-
schedule(true);
|
|
149
|
-
return () => {
|
|
150
|
-
mounted = false;
|
|
151
|
-
clearTimeout(timer);
|
|
152
|
-
};
|
|
153
|
-
}, [index]);
|
|
154
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
155
|
-
type: "button",
|
|
156
|
-
"aria-label": attention ? `${title} — ${attention.label}. Restore` : `Restore ${title}`,
|
|
157
|
-
onClick: onPress,
|
|
158
|
-
style: {
|
|
159
|
-
width: TOOL_ITEM_SIZE,
|
|
160
|
-
height: TOOL_ITEM_SIZE,
|
|
161
|
-
display: 'flex',
|
|
162
|
-
alignItems: 'center',
|
|
163
|
-
justifyContent: 'center',
|
|
164
|
-
background: 'none',
|
|
165
|
-
border: 'none',
|
|
166
|
-
padding: 0,
|
|
167
|
-
cursor: 'pointer',
|
|
168
|
-
position: 'relative'
|
|
169
|
-
},
|
|
170
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
171
|
-
ref: innerRef,
|
|
172
|
-
style: {
|
|
173
|
-
display: 'flex',
|
|
174
|
-
alignItems: 'center',
|
|
175
|
-
justifyContent: 'center'
|
|
176
|
-
},
|
|
177
|
-
children: icon
|
|
178
|
-
}), attention ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
179
|
-
"aria-hidden": true,
|
|
180
|
-
"data-testid": `buoy-dock-badge-${id}-${attention.kind}`,
|
|
181
|
-
style: {
|
|
182
|
-
position: 'absolute',
|
|
183
|
-
top: 0,
|
|
184
|
-
right: 0,
|
|
185
|
-
minWidth: 12,
|
|
186
|
-
height: 12,
|
|
187
|
-
borderRadius: 6,
|
|
188
|
-
padding: '0 2px',
|
|
189
|
-
boxSizing: 'border-box',
|
|
190
|
-
background: ATTENTION_COLORS[attention.kind],
|
|
191
|
-
border: '1.5px solid #0C0C0C',
|
|
192
|
-
color: '#000',
|
|
193
|
-
fontSize: 8,
|
|
194
|
-
fontWeight: 800,
|
|
195
|
-
lineHeight: '9px',
|
|
196
|
-
display: 'flex',
|
|
197
|
-
alignItems: 'center',
|
|
198
|
-
justifyContent: 'center'
|
|
199
|
-
},
|
|
200
|
-
children: attention.kind === 'needsInput' ? '!' : ''
|
|
201
|
-
}) : null]
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
function MinimizedToolsStack({
|
|
205
|
-
containerWidth = 32
|
|
206
|
-
}) {
|
|
207
|
-
const {
|
|
208
|
-
openApps,
|
|
209
|
-
restore
|
|
210
|
-
} = (0, _AppHostWeb.useAppHost)();
|
|
211
|
-
const minimized = openApps.filter(app => app.minimized && app.launchMode !== 'toggle-only');
|
|
212
|
-
const [isExpanded, setIsExpanded] = (0, _react.useState)(false);
|
|
213
|
-
const [isStateRestored, setIsStateRestored] = (0, _react.useState)(false);
|
|
214
|
-
const peekAttention = useStrongestAttention(minimized.map(app => app.id));
|
|
215
|
-
|
|
216
|
-
// Restore + persist the expanded flag (native ExpandablePopover persistState).
|
|
217
|
-
(0, _react.useEffect)(() => {
|
|
218
|
-
let cancelled = false;
|
|
219
|
-
const load = async () => {
|
|
220
|
-
const saved = await _sharedUi.persistentStorage.getItem(STORAGE_KEY_EXPANDED);
|
|
221
|
-
if (!cancelled && saved === 'true') setIsExpanded(true);
|
|
222
|
-
if (!cancelled) setIsStateRestored(true);
|
|
223
|
-
};
|
|
224
|
-
void load();
|
|
225
|
-
return () => {
|
|
226
|
-
cancelled = true;
|
|
227
|
-
};
|
|
228
|
-
}, []);
|
|
229
|
-
(0, _react.useEffect)(() => {
|
|
230
|
-
if (!isStateRestored) return;
|
|
231
|
-
void _sharedUi.persistentStorage.setItem(STORAGE_KEY_EXPANDED, isExpanded ? 'true' : 'false');
|
|
232
|
-
}, [isExpanded, isStateRestored]);
|
|
233
|
-
const handleRestore = (0, _react.useCallback)(instanceId => {
|
|
234
|
-
restore(instanceId);
|
|
235
|
-
}, [restore]);
|
|
236
|
-
if (minimized.length === 0) return null;
|
|
237
|
-
|
|
238
|
-
// native: expandedHeight = padding + n*item + (n-1)*gap + gap + collapse + 4
|
|
239
|
-
const expandedHeight = TOOLBAR_PADDING + minimized.length * TOOL_ITEM_SIZE + (minimized.length - 1) * ICON_GAP + ICON_GAP + COLLAPSE_BUTTON_SIZE + 4;
|
|
240
|
-
const frame = {
|
|
241
|
-
// native peekButton/expandedContainer: card bg, top corners 6, 1px border
|
|
242
|
-
// on top/left/right only (fuses with the bubble below)
|
|
243
|
-
backgroundColor: CARD,
|
|
244
|
-
borderTopLeftRadius: 6,
|
|
245
|
-
borderTopRightRadius: 6,
|
|
246
|
-
borderTop: `1px solid ${TEXT_MUTED}66`,
|
|
247
|
-
borderLeft: `1px solid ${TEXT_MUTED}66`,
|
|
248
|
-
borderRight: `1px solid ${TEXT_MUTED}66`,
|
|
249
|
-
borderBottom: 'none',
|
|
250
|
-
boxSizing: 'border-box'
|
|
251
|
-
};
|
|
252
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
253
|
-
style: {
|
|
254
|
-
height: PEEK_HEIGHT,
|
|
255
|
-
overflow: 'visible',
|
|
256
|
-
position: 'relative'
|
|
257
|
-
},
|
|
258
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
259
|
-
style: {
|
|
260
|
-
position: 'absolute',
|
|
261
|
-
bottom: 'var(--buoy-stack-bottom, 0px)',
|
|
262
|
-
top: 'var(--buoy-stack-top, auto)',
|
|
263
|
-
left: 0,
|
|
264
|
-
width: containerWidth,
|
|
265
|
-
maxHeight: 'var(--buoy-stack-space, calc(100vh - 48px))',
|
|
266
|
-
visibility: isExpanded ? 'visible' : 'hidden',
|
|
267
|
-
height: isExpanded ? expandedHeight : 0,
|
|
268
|
-
opacity: isExpanded ? 1 : 0,
|
|
269
|
-
overflowY: 'auto',
|
|
270
|
-
overflowX: 'hidden',
|
|
271
|
-
transition: 'height 200ms ease, opacity 200ms ease',
|
|
272
|
-
pointerEvents: isExpanded ? 'auto' : 'none',
|
|
273
|
-
...frame
|
|
274
|
-
},
|
|
275
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
276
|
-
style: {
|
|
277
|
-
height: expandedHeight,
|
|
278
|
-
display: 'flex',
|
|
279
|
-
flexDirection: 'column',
|
|
280
|
-
alignItems: 'center',
|
|
281
|
-
paddingTop: TOOLBAR_PADDING,
|
|
282
|
-
gap: ICON_GAP,
|
|
283
|
-
boxSizing: 'border-box'
|
|
284
|
-
},
|
|
285
|
-
children: [[...minimized].reverse().map((app, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(GlitchToolButton, {
|
|
286
|
-
id: app.id,
|
|
287
|
-
title: app.title || app.id,
|
|
288
|
-
icon: app.icon ?? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
289
|
-
style: {
|
|
290
|
-
color: '#fff',
|
|
291
|
-
fontSize: 13
|
|
292
|
-
},
|
|
293
|
-
children: (app.title || app.id).slice(0, 1).toUpperCase()
|
|
294
|
-
}),
|
|
295
|
-
index: index,
|
|
296
|
-
onPress: () => handleRestore(app.instanceId)
|
|
297
|
-
}, app.instanceId)), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
298
|
-
type: "button",
|
|
299
|
-
"aria-label": "Collapse",
|
|
300
|
-
onClick: () => setIsExpanded(false),
|
|
301
|
-
style: {
|
|
302
|
-
width: '100%',
|
|
303
|
-
height: COLLAPSE_BUTTON_SIZE,
|
|
304
|
-
marginTop: 3,
|
|
305
|
-
display: 'flex',
|
|
306
|
-
alignItems: 'center',
|
|
307
|
-
justifyContent: 'center',
|
|
308
|
-
background: 'none',
|
|
309
|
-
border: 'none',
|
|
310
|
-
cursor: 'pointer',
|
|
311
|
-
padding: 0
|
|
312
|
-
},
|
|
313
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronGlyph, {
|
|
314
|
-
down: true
|
|
315
|
-
})
|
|
316
|
-
})]
|
|
317
|
-
})
|
|
318
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
319
|
-
type: "button",
|
|
320
|
-
"aria-label": `Show ${minimized.length} minimized tools`,
|
|
321
|
-
tabIndex: isExpanded ? -1 : 0,
|
|
322
|
-
"aria-hidden": isExpanded,
|
|
323
|
-
onClick: () => setIsExpanded(true),
|
|
324
|
-
style: {
|
|
325
|
-
position: 'absolute',
|
|
326
|
-
bottom: 0,
|
|
327
|
-
left: 0,
|
|
328
|
-
width: containerWidth,
|
|
329
|
-
height: PEEK_HEIGHT,
|
|
330
|
-
display: 'flex',
|
|
331
|
-
flexDirection: 'row',
|
|
332
|
-
alignItems: 'center',
|
|
333
|
-
justifyContent: 'center',
|
|
334
|
-
gap: 2,
|
|
335
|
-
cursor: 'pointer',
|
|
336
|
-
padding: 0,
|
|
337
|
-
opacity: isExpanded ? 0 : 1,
|
|
338
|
-
transform: isExpanded ? 'scale(0.9)' : 'scale(1)',
|
|
339
|
-
transition: 'opacity 200ms ease, transform 200ms ease',
|
|
340
|
-
pointerEvents: isExpanded ? 'none' : 'auto',
|
|
341
|
-
...frame
|
|
342
|
-
},
|
|
343
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronGlyph, {}), peekAttention ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
344
|
-
"aria-hidden": true,
|
|
345
|
-
"data-testid": `buoy-dock-peek-attention`,
|
|
346
|
-
style: {
|
|
347
|
-
position: 'absolute',
|
|
348
|
-
top: 2,
|
|
349
|
-
right: 2,
|
|
350
|
-
minWidth: 11,
|
|
351
|
-
height: 11,
|
|
352
|
-
borderRadius: 6,
|
|
353
|
-
padding: '0 2px',
|
|
354
|
-
boxSizing: 'border-box',
|
|
355
|
-
background: ATTENTION_COLORS[peekAttention.kind],
|
|
356
|
-
border: '1.5px solid #0C0C0C',
|
|
357
|
-
color: '#000',
|
|
358
|
-
fontSize: 8,
|
|
359
|
-
fontWeight: 800,
|
|
360
|
-
lineHeight: '9px',
|
|
361
|
-
display: 'flex',
|
|
362
|
-
alignItems: 'center',
|
|
363
|
-
justifyContent: 'center'
|
|
364
|
-
},
|
|
365
|
-
children: peekAttention.kind === 'needsInput' ? '!' : ''
|
|
366
|
-
}) : null, minimized.length > 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
367
|
-
style: {
|
|
368
|
-
fontSize: 9,
|
|
369
|
-
fontWeight: 600,
|
|
370
|
-
color: TEXT_MUTED,
|
|
371
|
-
marginLeft: 1
|
|
372
|
-
},
|
|
373
|
-
children: minimized.length
|
|
374
|
-
})]
|
|
375
|
-
})]
|
|
376
|
-
});
|
|
377
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.MinimizedToolsStack=MinimizedToolsStack;var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _AppHostWeb=require("./AppHost.web.js");var _jsxRuntime=require("react/jsx-runtime");function useToolAttention(t){return(0,_react.useSyncExternalStore)(_sharedUi.subscribeToolAttention,()=>(0,_sharedUi.getToolAttention)(t),()=>(0,_sharedUi.getToolAttention)(t))}const ATTENTION_COLORS={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"};const ATTENTION_RANK={needsInput:3,failed:2,done:1};const strongestCache=new Map;function strongest(t){let n=null;for(const i of t?t.split("|"):[]){const o=(0,_sharedUi.getToolAttention)(i);if(o&&(!n||ATTENTION_RANK[o.kind]>ATTENTION_RANK[n.kind]))n=o}const s=strongestCache.get(t);if(s&&n&&s.kind===n.kind&&s.label===n.label)return s;if(!s&&!n)return null;strongestCache.set(t,n);return n}function useStrongestAttention(t){const n=t.join("|");return(0,_react.useSyncExternalStore)(_sharedUi.subscribeToolAttention,()=>strongest(n),()=>strongest(n))}const PEEK_HEIGHT=28;const TOOL_ITEM_SIZE=32;const ICON_GAP=6;const TOOLBAR_PADDING=8;const COLLAPSE_BUTTON_SIZE=24;const STORAGE_KEY_EXPANDED="@react_buoy_minimized_stack_expanded";const GLITCH_DURATION_MS=80;const MIN_GLITCH_DELAY=2e3;const MAX_GLITCH_DELAY=6e3;const CARD="#1A1A1A";const TEXT_MUTED="#888888";function ChevronGlyph({down:t=false}){return(0,_jsxRuntime.jsx)("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:t?"rotate(180deg)":void 0},children:(0,_jsxRuntime.jsx)("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:TEXT_MUTED,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function GlitchToolButton({id:t,title:n,icon:s,index:i,onPress:o}){const r=useToolAttention(t);const l=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{let c=true;let a;const f=()=>{l.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:GLITCH_DURATION_MS,easing:"linear"})};const d=u=>{const e=u?500+Math.random()*1500+i*200:MIN_GLITCH_DELAY+Math.random()*(MAX_GLITCH_DELAY-MIN_GLITCH_DELAY)+i*300;a=setTimeout(()=>{if(!c)return;f();d(false)},e)};d(true);return()=>{c=false;clearTimeout(a)}},[i]);return(0,_jsxRuntime.jsxs)("button",{type:"button","aria-label":r?`${n} \u2014 ${r.label}. Restore`:`Restore ${n}`,onClick:o,style:{width:TOOL_ITEM_SIZE,height:TOOL_ITEM_SIZE,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[(0,_jsxRuntime.jsx)("div",{ref:l,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:s}),r?(0,_jsxRuntime.jsx)("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${t}-${r.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:ATTENTION_COLORS[r.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:r.kind==="needsInput"?"!":""}):null]})}function MinimizedToolsStack({containerWidth:t=32}){const{openApps:n,restore:s}=(0,_AppHostWeb.useAppHost)();const i=n.filter(e=>e.minimized&&e.launchMode!=="toggle-only");const[o,r]=(0,_react.useState)(false);const[l,c]=(0,_react.useState)(false);const a=useStrongestAttention(i.map(e=>e.id));(0,_react.useEffect)(()=>{let e=false;const p=async()=>{const h=await _sharedUi.persistentStorage.getItem(STORAGE_KEY_EXPANDED);if(!e&&h==="true")r(true);if(!e)c(true)};void p();return()=>{e=true}},[]);(0,_react.useEffect)(()=>{if(!l)return;void _sharedUi.persistentStorage.setItem(STORAGE_KEY_EXPANDED,o?"true":"false")},[o,l]);const f=(0,_react.useCallback)(e=>{s(e)},[s]);if(i.length===0)return null;const d=TOOLBAR_PADDING+i.length*TOOL_ITEM_SIZE+(i.length-1)*ICON_GAP+ICON_GAP+COLLAPSE_BUTTON_SIZE+4;const u={backgroundColor:CARD,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${TEXT_MUTED}66`,borderLeft:`1px solid ${TEXT_MUTED}66`,borderRight:`1px solid ${TEXT_MUTED}66`,borderBottom:"none",boxSizing:"border-box"};return(0,_jsxRuntime.jsxs)("div",{style:{height:PEEK_HEIGHT,overflow:"visible",position:"relative"},children:[(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:t,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:o?"visible":"hidden",height:o?d:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...u},children:(0,_jsxRuntime.jsxs)("div",{style:{height:d,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:TOOLBAR_PADDING,gap:ICON_GAP,boxSizing:"border-box"},children:[[...i].reverse().map((e,p)=>(0,_jsxRuntime.jsx)(GlitchToolButton,{id:e.id,title:e.title||e.id,icon:e.icon??(0,_jsxRuntime.jsx)("span",{style:{color:"#fff",fontSize:13},children:(e.title||e.id).slice(0,1).toUpperCase()}),index:p,onPress:()=>f(e.instanceId)},e.instanceId)),(0,_jsxRuntime.jsx)("button",{type:"button","aria-label":"Collapse",onClick:()=>r(false),style:{width:"100%",height:COLLAPSE_BUTTON_SIZE,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:(0,_jsxRuntime.jsx)(ChevronGlyph,{down:true})})]})}),(0,_jsxRuntime.jsxs)("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>r(true),style:{position:"absolute",bottom:0,left:0,width:t,height:PEEK_HEIGHT,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:o?0:1,transform:o?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:o?"none":"auto",...u},children:[(0,_jsxRuntime.jsx)(ChevronGlyph,{}),a?(0,_jsxRuntime.jsx)("span",{"aria-hidden":true,"data-testid":`buoy-dock-peek-attention`,style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:ATTENTION_COLORS[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null,i.length>1&&(0,_jsxRuntime.jsx)("span",{style:{fontSize:9,fontWeight:600,color:TEXT_MUTED,marginLeft:1},children:i.length})]})]})}
|