@buoy-gg/core 7.0.55 → 7.0.57

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.
Files changed (58) hide show
  1. package/lib/commonjs/browserRegister.js +1 -1
  2. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -1
  3. package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -1
  4. package/lib/commonjs/floatingMenu/BuoyCodeSignIn.js +1 -0
  5. package/lib/commonjs/floatingMenu/BuoySignIn.js +1 -1
  6. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  7. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -1
  8. package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +1 -1
  9. package/lib/commonjs/floatingMenu/capacitorBackButton.js +1 -0
  10. package/lib/commonjs/floatingMenu/capacitorHostInfo.js +1 -0
  11. package/lib/commonjs/floatingMenu/deviceIdentity.js +1 -1
  12. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -1
  13. package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -1
  14. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.web.js +1 -1
  15. package/lib/commonjs/floatingMenu/dial/dialA11y.js +1 -0
  16. package/lib/commonjs/index.web.js +1 -1
  17. package/lib/commonjs/version.js +1 -1
  18. package/lib/module/browserRegister.js +1 -1
  19. package/lib/module/floatingMenu/AppHost.web.js +1 -1
  20. package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -1
  21. package/lib/module/floatingMenu/BuoyCodeSignIn.js +1 -0
  22. package/lib/module/floatingMenu/BuoySignIn.js +1 -1
  23. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  24. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -1
  25. package/lib/module/floatingMenu/MinimizedToolsStack.web.js +1 -1
  26. package/lib/module/floatingMenu/capacitorBackButton.js +1 -0
  27. package/lib/module/floatingMenu/capacitorHostInfo.js +1 -0
  28. package/lib/module/floatingMenu/deviceIdentity.js +1 -1
  29. package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -1
  30. package/lib/module/floatingMenu/dial/DialIcon.js +1 -1
  31. package/lib/module/floatingMenu/dial/OnboardingTooltip.web.js +1 -1
  32. package/lib/module/floatingMenu/dial/dialA11y.js +1 -0
  33. package/lib/module/index.web.js +1 -1
  34. package/lib/module/version.js +1 -1
  35. package/lib/typescript/commonjs/floatingMenu/BuoyCodeSignIn.d.ts +4 -0
  36. package/lib/typescript/commonjs/floatingMenu/BuoySignIn.d.ts +1 -3
  37. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +27 -2
  38. package/lib/typescript/commonjs/floatingMenu/capacitorBackButton.d.ts +17 -0
  39. package/lib/typescript/commonjs/floatingMenu/capacitorHostInfo.d.ts +75 -0
  40. package/lib/typescript/commonjs/floatingMenu/dial/dialA11y.d.ts +2 -0
  41. package/lib/typescript/commonjs/index.web.d.ts +2 -0
  42. package/lib/typescript/commonjs/version.d.ts +1 -1
  43. package/lib/typescript/module/floatingMenu/BuoyCodeSignIn.d.ts +4 -0
  44. package/lib/typescript/module/floatingMenu/BuoySignIn.d.ts +1 -3
  45. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +27 -2
  46. package/lib/typescript/module/floatingMenu/capacitorBackButton.d.ts +17 -0
  47. package/lib/typescript/module/floatingMenu/capacitorHostInfo.d.ts +75 -0
  48. package/lib/typescript/module/floatingMenu/dial/dialA11y.d.ts +2 -0
  49. package/lib/typescript/module/index.web.d.ts +2 -0
  50. package/lib/typescript/module/version.d.ts +1 -1
  51. package/lib/web/chunks/chunk-CLXYMJTS.mjs +1 -0
  52. package/lib/web/chunks/{chunk-QZDVCMCT.mjs → chunk-GLXZCY6W.mjs} +1 -1
  53. package/lib/web/index.mjs +2 -2
  54. package/lib/web/register-server.mjs +1 -1
  55. package/lib/web/register.mjs +1 -1
  56. package/lib/web/toolkit.mjs +1 -1
  57. package/package.json +5 -5
  58. package/lib/web/chunks/chunk-R7RGRTY5.mjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={FloatingDevTools:true,createWebTool:true,clearReleaseOptIn:true,FloatingTools:true,UserStatus:true,Divider:true,DialMenu:true,SettingsModal:true,AppHostProvider:true,AppOverlay:true,useAppHost:true,autoDiscoverWebPresets:true,autoDiscoverWithCustom:true,getToolsBySlot:true,getEnabledTools:true,defaultToolPresets:true,useSettings:true,useFloatingTools:true,getToolLabel:true,getToolDescription:true,getToolColor:true,settingsColors:true,settingsStyles:true,dialColors:true,dialStyles:true,createWebTools:true,useToolHost:true,useToolHeader:true,DevToolsVisibilityProvider:true,useDevToolsVisibility:true,appSyncAdapter:true};Object.defineProperty(exports,"AppHostProvider",{enumerable:true,get:function(){return _AppHostWeb.AppHostProvider}});Object.defineProperty(exports,"AppOverlay",{enumerable:true,get:function(){return _AppHostWeb.AppOverlay}});Object.defineProperty(exports,"DevToolsVisibilityProvider",{enumerable:true,get:function(){return _DevToolsVisibilityContext.DevToolsVisibilityProvider}});Object.defineProperty(exports,"DialMenu",{enumerable:true,get:function(){return _DialDevToolsWeb.DialMenu}});Object.defineProperty(exports,"Divider",{enumerable:true,get:function(){return _floatingToolsWeb.Divider}});Object.defineProperty(exports,"FloatingDevTools",{enumerable:true,get:function(){return _FloatingDevToolsWeb.FloatingDevTools}});Object.defineProperty(exports,"FloatingTools",{enumerable:true,get:function(){return _floatingToolsWeb.FloatingTools}});Object.defineProperty(exports,"SettingsModal",{enumerable:true,get:function(){return _DevToolsSettingsModalWeb.SettingsModal}});Object.defineProperty(exports,"UserStatus",{enumerable:true,get:function(){return _floatingToolsWeb.UserStatus}});Object.defineProperty(exports,"appSyncAdapter",{enumerable:true,get:function(){return _appSyncAdapter.appSyncAdapter}});Object.defineProperty(exports,"autoDiscoverWebPresets",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.autoDiscoverWebPresets}});Object.defineProperty(exports,"autoDiscoverWithCustom",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.autoDiscoverWithCustom}});Object.defineProperty(exports,"clearReleaseOptIn",{enumerable:true,get:function(){return _releaseOptIn.clearReleaseOptIn}});Object.defineProperty(exports,"createWebTool",{enumerable:true,get:function(){return _createWebTool.createWebTool}});Object.defineProperty(exports,"createWebTools",{enumerable:true,get:function(){return _createWebTools.createWebTools}});Object.defineProperty(exports,"defaultToolPresets",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.defaultToolPresets}});Object.defineProperty(exports,"dialColors",{enumerable:true,get:function(){return _floatingToolsReact.dialColors}});Object.defineProperty(exports,"dialStyles",{enumerable:true,get:function(){return _floatingToolsReact.dialStyles}});Object.defineProperty(exports,"getEnabledTools",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.getEnabledTools}});Object.defineProperty(exports,"getToolColor",{enumerable:true,get:function(){return _floatingToolsReact.getToolColor}});Object.defineProperty(exports,"getToolDescription",{enumerable:true,get:function(){return _floatingToolsReact.getToolDescription}});Object.defineProperty(exports,"getToolLabel",{enumerable:true,get:function(){return _floatingToolsReact.getToolLabel}});Object.defineProperty(exports,"getToolsBySlot",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.getToolsBySlot}});Object.defineProperty(exports,"settingsColors",{enumerable:true,get:function(){return _floatingToolsReact.settingsColors}});Object.defineProperty(exports,"settingsStyles",{enumerable:true,get:function(){return _floatingToolsReact.settingsStyles}});Object.defineProperty(exports,"useAppHost",{enumerable:true,get:function(){return _AppHostWeb.useAppHost}});Object.defineProperty(exports,"useDevToolsVisibility",{enumerable:true,get:function(){return _DevToolsVisibilityContext.useDevToolsVisibility}});Object.defineProperty(exports,"useFloatingTools",{enumerable:true,get:function(){return _floatingToolsReact.useFloatingTools}});Object.defineProperty(exports,"useSettings",{enumerable:true,get:function(){return _floatingToolsReact.useSettings}});Object.defineProperty(exports,"useToolHeader",{enumerable:true,get:function(){return _ToolHost.useToolHeader}});Object.defineProperty(exports,"useToolHost",{enumerable:true,get:function(){return _ToolHost.useToolHost}});var _FloatingDevToolsWeb=require("./floatingMenu/FloatingDevTools.web.js");var _createWebTool=require("./utils/createWebTool.js");var _releaseOptIn=require("./releaseOptIn.js");var _floatingToolsWeb=require("./floatingMenu/floatingTools.web.js");var _DialDevToolsWeb=require("./floatingMenu/dial/DialDevTools.web.js");var _DevToolsSettingsModalWeb=require("./floatingMenu/DevToolsSettingsModal.web.js");var _AppHostWeb=require("./floatingMenu/AppHost.web.js");var _autoDiscoverPresetsWeb=require("./utils/autoDiscoverPresets.web.js");var _floatingToolsReact=require("@buoy-gg/floating-tools-react");var _createWebTools=require("./utils/createWebTools.js");var _toolkit=require("./toolkit.js");Object.keys(_toolkit).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolkit[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolkit[e]}})});var _ToolHost=require("./floatingMenu/ToolHost.js");var _DevToolsVisibilityContext=require("./floatingMenu/DevToolsVisibilityContext.js");var _appSyncAdapter=require("./floatingMenu/sync/appSyncAdapter.js");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={FloatingDevTools:true,createWebTool:true,clearReleaseOptIn:true,isBuoyHoldingBackButton:true,FloatingTools:true,UserStatus:true,Divider:true,DialMenu:true,SettingsModal:true,AppHostProvider:true,AppOverlay:true,useAppHost:true,autoDiscoverWebPresets:true,autoDiscoverWithCustom:true,getToolsBySlot:true,getEnabledTools:true,defaultToolPresets:true,useSettings:true,useFloatingTools:true,getToolLabel:true,getToolDescription:true,getToolColor:true,settingsColors:true,settingsStyles:true,dialColors:true,dialStyles:true,createWebTools:true,useToolHost:true,useToolHeader:true,DevToolsVisibilityProvider:true,useDevToolsVisibility:true,appSyncAdapter:true,LicenseManager:true};Object.defineProperty(exports,"AppHostProvider",{enumerable:true,get:function(){return _AppHostWeb.AppHostProvider}});Object.defineProperty(exports,"AppOverlay",{enumerable:true,get:function(){return _AppHostWeb.AppOverlay}});Object.defineProperty(exports,"DevToolsVisibilityProvider",{enumerable:true,get:function(){return _DevToolsVisibilityContext.DevToolsVisibilityProvider}});Object.defineProperty(exports,"DialMenu",{enumerable:true,get:function(){return _DialDevToolsWeb.DialMenu}});Object.defineProperty(exports,"Divider",{enumerable:true,get:function(){return _floatingToolsWeb.Divider}});Object.defineProperty(exports,"FloatingDevTools",{enumerable:true,get:function(){return _FloatingDevToolsWeb.FloatingDevTools}});Object.defineProperty(exports,"FloatingTools",{enumerable:true,get:function(){return _floatingToolsWeb.FloatingTools}});Object.defineProperty(exports,"LicenseManager",{enumerable:true,get:function(){return _license.LicenseManager}});Object.defineProperty(exports,"SettingsModal",{enumerable:true,get:function(){return _DevToolsSettingsModalWeb.SettingsModal}});Object.defineProperty(exports,"UserStatus",{enumerable:true,get:function(){return _floatingToolsWeb.UserStatus}});Object.defineProperty(exports,"appSyncAdapter",{enumerable:true,get:function(){return _appSyncAdapter.appSyncAdapter}});Object.defineProperty(exports,"autoDiscoverWebPresets",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.autoDiscoverWebPresets}});Object.defineProperty(exports,"autoDiscoverWithCustom",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.autoDiscoverWithCustom}});Object.defineProperty(exports,"clearReleaseOptIn",{enumerable:true,get:function(){return _releaseOptIn.clearReleaseOptIn}});Object.defineProperty(exports,"createWebTool",{enumerable:true,get:function(){return _createWebTool.createWebTool}});Object.defineProperty(exports,"createWebTools",{enumerable:true,get:function(){return _createWebTools.createWebTools}});Object.defineProperty(exports,"defaultToolPresets",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.defaultToolPresets}});Object.defineProperty(exports,"dialColors",{enumerable:true,get:function(){return _floatingToolsReact.dialColors}});Object.defineProperty(exports,"dialStyles",{enumerable:true,get:function(){return _floatingToolsReact.dialStyles}});Object.defineProperty(exports,"getEnabledTools",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.getEnabledTools}});Object.defineProperty(exports,"getToolColor",{enumerable:true,get:function(){return _floatingToolsReact.getToolColor}});Object.defineProperty(exports,"getToolDescription",{enumerable:true,get:function(){return _floatingToolsReact.getToolDescription}});Object.defineProperty(exports,"getToolLabel",{enumerable:true,get:function(){return _floatingToolsReact.getToolLabel}});Object.defineProperty(exports,"getToolsBySlot",{enumerable:true,get:function(){return _autoDiscoverPresetsWeb.getToolsBySlot}});Object.defineProperty(exports,"isBuoyHoldingBackButton",{enumerable:true,get:function(){return _capacitorBackButton.isBuoyHoldingBackButton}});Object.defineProperty(exports,"settingsColors",{enumerable:true,get:function(){return _floatingToolsReact.settingsColors}});Object.defineProperty(exports,"settingsStyles",{enumerable:true,get:function(){return _floatingToolsReact.settingsStyles}});Object.defineProperty(exports,"useAppHost",{enumerable:true,get:function(){return _AppHostWeb.useAppHost}});Object.defineProperty(exports,"useDevToolsVisibility",{enumerable:true,get:function(){return _DevToolsVisibilityContext.useDevToolsVisibility}});Object.defineProperty(exports,"useFloatingTools",{enumerable:true,get:function(){return _floatingToolsReact.useFloatingTools}});Object.defineProperty(exports,"useSettings",{enumerable:true,get:function(){return _floatingToolsReact.useSettings}});Object.defineProperty(exports,"useToolHeader",{enumerable:true,get:function(){return _ToolHost.useToolHeader}});Object.defineProperty(exports,"useToolHost",{enumerable:true,get:function(){return _ToolHost.useToolHost}});var _FloatingDevToolsWeb=require("./floatingMenu/FloatingDevTools.web.js");var _createWebTool=require("./utils/createWebTool.js");var _releaseOptIn=require("./releaseOptIn.js");var _capacitorBackButton=require("./floatingMenu/capacitorBackButton.js");var _floatingToolsWeb=require("./floatingMenu/floatingTools.web.js");var _DialDevToolsWeb=require("./floatingMenu/dial/DialDevTools.web.js");var _DevToolsSettingsModalWeb=require("./floatingMenu/DevToolsSettingsModal.web.js");var _AppHostWeb=require("./floatingMenu/AppHost.web.js");var _autoDiscoverPresetsWeb=require("./utils/autoDiscoverPresets.web.js");var _floatingToolsReact=require("@buoy-gg/floating-tools-react");var _createWebTools=require("./utils/createWebTools.js");var _toolkit=require("./toolkit.js");Object.keys(_toolkit).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolkit[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolkit[e]}})});var _ToolHost=require("./floatingMenu/ToolHost.js");var _DevToolsVisibilityContext=require("./floatingMenu/DevToolsVisibilityContext.js");var _appSyncAdapter=require("./floatingMenu/sync/appSyncAdapter.js");var _license=require("@buoy-gg/license");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.55";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.57";
@@ -1 +1 @@
1
- "use strict";import*as l from"react-devtools-core";import{installEarlyNetworkRecorder as m}from"./earlyNetwork.js";import{hasReleaseOptIn as A}from"./releaseOptIn.js";export{earlyHookScript}from"./earlyHookScript.js";const d=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];export function registerBrowserDevTools(u={}){if(typeof window==="undefined"||typeof document==="undefined")return false;const p=typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production";if(!p&&!u.enableInRelease&&!A())return false;m();const n=window;const o=n.__REACT_DEVTOOLS_GLOBAL_HOOK__;const f=o&&o.supportsFiber&&!o.getFiberRoots&&!o.sub&&Object.getOwnPropertyDescriptor(n,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(f)delete n.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n.__REACT_DEVTOOLS_GLOBAL_HOOK__){const L=l.initialize??l.default?.initialize;L({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false});if(f){const i=n.__REACT_DEVTOOLS_GLOBAL_HOOK__;const O=i.inject;const _=new Map;i.inject=e=>{const t=O(e);_.set(t,o.inject(e));return t};for(const e of d){const t=i[e];if(typeof t!=="function")continue;i[e]=(r,...s)=>{if(_.has(r))o[e]?.(_.get(r),...s);return t(r,...s)}}const c=new Map;o.renderers?.forEach?.((e,t)=>c.set(t,O(e)));if(c.size){for(const e of d){const t=o[e];o[e]=function(r,...s){const E=t?.call(this,r,...s);const a=c.get(r);if(a!==void 0)i[e]?.(a,...s);return E}}}}}return Boolean(n.__REACT_DEVTOOLS_GLOBAL_HOOK__)}registerBrowserDevTools();
1
+ "use strict";import*as d from"react-devtools-core";import{installEarlyNetworkRecorder as A}from"./earlyNetwork.js";import{hasReleaseOptIn as R}from"./releaseOptIn.js";import{installCapacitorBridge as D}from"@buoy-gg/license/capacitor";export{earlyHookScript}from"./earlyHookScript.js";const m=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];export function registerBrowserDevTools(E={}){if(typeof window==="undefined"||typeof document==="undefined")return false;const a=window.Capacitor;const f=(()=>{try{return a?.isNativePlatform?.()===true}catch{return false}})();const l=f?a?.DEBUG===true:typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production";if(!l&&!E.enableInRelease&&!R())return false;A();if(f)D({release:!l});const n=window;const t=n.__REACT_DEVTOOLS_GLOBAL_HOOK__;const O=t&&t.supportsFiber&&!t.getFiberRoots&&!t.sub&&Object.getOwnPropertyDescriptor(n,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(O)delete n.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n.__REACT_DEVTOOLS_GLOBAL_HOOK__){const L=d.initialize??d.default?.initialize;L({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false});if(O){const i=n.__REACT_DEVTOOLS_GLOBAL_HOOK__;const u=i.inject;const c=new Map;i.inject=e=>{const o=u(e);c.set(o,t.inject(e));return o};for(const e of m){const o=i[e];if(typeof o!=="function")continue;i[e]=(r,...s)=>{if(c.has(r))t[e]?.(c.get(r),...s);return o(r,...s)}}const _=new Map;t.renderers?.forEach?.((e,o)=>_.set(o,u(e)));if(_.size){for(const e of m){const o=t[e];t[e]=function(r,...s){const C=o?.call(this,r,...s);const p=_.get(r);if(p!==void 0)i[e]?.(p,...s);return C}}}}}return Boolean(n.__REACT_DEVTOOLS_GLOBAL_HOOK__)}registerBrowserDevTools();
@@ -1 +1 @@
1
- "use strict";import{persistentStorage as P}from"@buoy-gg/shared-ui";import{createContext as D,useCallback as p,useContext as F,useEffect as M,useMemo as H,useRef as y,useState as C}from"react";import{resolveOpenAppsState as N}from"./AppHostLogic.js";import{renderAppIcon as j}from"./AppIcon";import{ToolModalShell as B}from"./ToolHost.js";import{useDevToolsSettings as G}from"./DevToolsSettingsModal.shared.js";import{getBubbleAnchorPosition as $}from"./floatingTools.web.js";import{jsx as a,Fragment as J}from"react/jsx-runtime";const _=D(null);const T="@react_buoy_open_apps";const b=44;const L=12;const V=100;const Z=16;const q=t=>({x:window.innerWidth-b-Z,y:window.innerHeight-V-b-t*(b+L)});export const AppHostProvider=({children:t})=>{const[r,l]=C([]);const[m,c]=C(false);const g=y([]);const u=y(null);const s=y(false);const f=y(false);const A=y(false);const I=p(n=>{let o="";l(i=>{const{apps:e,instanceId:d}=N(i,n,()=>`${n.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);o=d;return e});return o},[]);const S=p(()=>{if(s.current||!f.current||!A.current)return;s.current=true;const n=u.current;if(!n||n.length===0){c(true);return}u.current=null;n.forEach(({id:o,minimized:i})=>{const e=g.current.find(d=>d.id===o);if(e&&e.component){const d=j(e.icon,{slot:"dial",size:20,color:e.color});I({id:e.id,title:e.name,component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:d,color:e.color,minimized:i})}});c(true)},[I]);M(()=>{let n=false;const o=async()=>{try{const i=await P.getItem(T);if(n)return;if(i){const e=JSON.parse(i);let d;if(Array.isArray(e)&&e.length>0){if(typeof e[0]==="string"){d=e.map(h=>({id:h,minimized:false}))}else{d=e.filter(h=>typeof h==="object"&&h!==null&&typeof h.id==="string")}if(d.length){u.current=d}}}}catch{}if(n)return;f.current=true;S()};void o();return()=>{n=true}},[S]);M(()=>{if(!m)return;const n=r.map(o=>({id:o.id,minimized:o.minimized??false}));void P.setItem(T,JSON.stringify(n))},[r,m]);const O=p(n=>{g.current=n;A.current=true;S()},[S]);const v=p(n=>{l(o=>{if(!o.length)return o;if(!n)return o.slice(0,-1);return o.filter(i=>i.instanceId!==n)})},[]);const R=p(()=>l([]),[]);const w=p((n,o)=>{l(i=>i.map(e=>e.instanceId===n?{...e,minimized:true,restoreState:o}:e))},[]);const x=p((n,o)=>{l(i=>i.map(e=>e.instanceId===n?{...e,minimized:false,restoreState:o??e.restoreState}:e))},[]);const E=p(n=>{const o=r.find(i=>i.instanceId===n);return o?.minimized??false},[r]);const z=r.some(n=>n.launchMode!=="toggle-only"&&!n.minimized);M(()=>{if(!z)return;const n=o=>{if(o.key!=="Escape")return;if(o.defaultPrevented)return;const i=[...r].reverse().find(e=>e.launchMode!=="toggle-only"&&!e.minimized);if(i)v(i.instanceId)};window.addEventListener("keydown",n);return()=>window.removeEventListener("keydown",n)},[z,v,r]);const k=H(()=>({openApps:r,isAnyOpen:z,open:I,close:v,closeAll:R,registerApps:O,minimize:w,restore:x,isMinimized:E}),[r,z,I,v,R,O,w,x,E]);return a(_.Provider,{value:k,children:t})};export const useAppHost=()=>{const t=F(_);if(!t){return{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}}return t};const K=9e3;const W={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"};const X={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"};const Y=({app:t,zIndex:r,onClose:l,onMinimize:m,minimizeTargetPosition:c,enableSharedModalDimensions:g})=>{const u=t.component;const s=!t.minimized;const f={...t.props??{},...g?{enableSharedModalDimensions:true}:{}};if(t.modal&&(!t.launchMode||t.launchMode==="self-modal")){return a(B,{app:t,config:t.modal,visible:s,zIndex:r,onClose:l,onMinimize:m,initialModalState:t.restoreState,enableSharedModalDimensions:g,bodyProps:f})}if(t.launchMode==="self-modal"){return a(u,{...f,visible:s,onClose:l,onRequestClose:l,onMinimize:m,minimizeTargetPosition:c,instanceId:t.instanceId,zIndex:r,initialModalState:t.restoreState})}if(t.launchMode==="inline"){if(!s)return null;return a("div",{style:{position:"fixed",inset:0,zIndex:r,pointerEvents:"none"},children:a(u,{...f,onClose:l,onMinimize:m,minimizeTargetPosition:c,instanceId:t.instanceId})})}return a("div",{style:{...W,zIndex:r,display:s?"flex":"none"},children:a("div",{style:X,children:a(u,{...f,onClose:l,onMinimize:m,minimizeTargetPosition:c,instanceId:t.instanceId})})})};export const AppOverlay=()=>{const{openApps:t,close:r,minimize:l}=useAppHost();const{settings:m}=G();const c=t.filter(s=>s.launchMode!=="toggle-only");if(c.length===0)return null;const g=c.filter(s=>s.minimized).length;const u=$()??q(g);return a(J,{children:c.map((s,f)=>a(Y,{app:s,zIndex:K+f,onClose:()=>r(s.instanceId),onMinimize:A=>l(s.instanceId,A),enableSharedModalDimensions:m.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:u},s.instanceId))})};
1
+ "use strict";import{persistentStorage as R,setExpandableWindowControls as D}from"@buoy-gg/shared-ui";import{createContext as $,useCallback as p,useContext as F,useEffect as M,useMemo as H,useRef as S,useState as P}from"react";import{resolveOpenAppsState as N}from"./AppHostLogic.js";import{renderAppIcon as B}from"./AppIcon";import{ToolModalShell as j}from"./ToolHost.js";import{useDevToolsSettings as W}from"./DevToolsSettingsModal.shared.js";import{getBubbleAnchorPosition as G}from"./floatingTools.web.js";import{useCapacitorBackButton as J}from"./capacitorBackButton.js";import{jsx as d,Fragment as L}from"react/jsx-runtime";const _=$(null);const T="@react_buoy_open_apps";const z=44;const V=12;const Z=100;const q=16;const K=t=>({x:window.innerWidth-z-q,y:window.innerHeight-Z-z-t*(z+V)});export const AppHostProvider=({children:t})=>{const[i,l]=P([]);const[c,a]=P(false);const g=S([]);const m=S(null);const r=S(false);const f=S(false);const b=S(false);const A=p(n=>{let o="";l(s=>{const{apps:e,instanceId:u}=N(s,n,()=>`${n.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);o=u;return e});return o},[]);const v=p(()=>{if(r.current||!f.current||!b.current)return;r.current=true;const n=m.current;if(!n||n.length===0){a(true);return}m.current=null;n.forEach(({id:o,minimized:s})=>{const e=g.current.find(u=>u.id===o);if(e&&e.component){const u=B(e.icon,{slot:"dial",size:20,color:e.color});A({id:e.id,title:e.name,component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:u,color:e.color,minimized:s})}});a(true)},[A]);M(()=>{let n=false;const o=async()=>{try{const s=await R.getItem(T);if(n)return;if(s){const e=JSON.parse(s);let u;if(Array.isArray(e)&&e.length>0){if(typeof e[0]==="string"){u=e.map(y=>({id:y,minimized:false}))}else{u=e.filter(y=>typeof y==="object"&&y!==null&&typeof y.id==="string")}if(u.length){m.current=u}}}}catch{}if(n)return;f.current=true;v()};void o();return()=>{n=true}},[v]);M(()=>{if(!c)return;const n=i.map(o=>({id:o.id,minimized:o.minimized??false}));void R.setItem(T,JSON.stringify(n))},[i,c]);const w=p(n=>{g.current=n;b.current=true;v()},[v]);const h=p(n=>{l(o=>{if(!o.length)return o;if(!n)return o.slice(0,-1);return o.filter(s=>s.instanceId!==n)})},[]);const x=p(()=>l([]),[]);const C=p((n,o)=>{l(s=>s.map(e=>e.instanceId===n?{...e,minimized:true,restoreState:o}:e))},[]);const E=p((n,o)=>{l(s=>s.map(e=>e.instanceId===n?{...e,minimized:false,restoreState:o??e.restoreState}:e))},[]);const O=p(n=>{const o=i.find(s=>s.instanceId===n);return o?.minimized??false},[i]);const I=i.some(n=>n.launchMode!=="toggle-only"&&!n.minimized);M(()=>{if(!I)return;const n=o=>{if(o.key!=="Escape")return;if(o.defaultPrevented)return;const s=[...i].reverse().find(e=>e.launchMode!=="toggle-only"&&!e.minimized);if(s)h(s.instanceId)};window.addEventListener("keydown",n);return()=>window.removeEventListener("keydown",n)},[I,h,i]);J(i.length>0,()=>h());const k=H(()=>({openApps:i,isAnyOpen:I,open:A,close:h,closeAll:x,registerApps:w,minimize:C,restore:E,isMinimized:O}),[i,I,A,h,x,w,C,E,O]);return d(_.Provider,{value:k,children:t})};export const useAppHost=()=>{const t=F(_);if(!t){return{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}}return t};const X=9e3;const Y={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"};const Q={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"};const U=({app:t,zIndex:i,onClose:l,onMinimize:c,minimizeTargetPosition:a,enableSharedModalDimensions:g})=>{const m=t.component;const r=!t.minimized;const f={...t.props??{},...g?{enableSharedModalDimensions:true}:{}};if(t.modal&&(!t.launchMode||t.launchMode==="self-modal")){return d("div",{"data-testid":`buoy-tool-instance-${t.id}`,style:{position:"fixed",inset:0,zIndex:i,pointerEvents:"none"},children:d(j,{app:t,config:t.modal,visible:r,zIndex:i,onClose:l,onMinimize:c,initialModalState:t.restoreState,enableSharedModalDimensions:g,bodyProps:f})})}if(t.launchMode==="self-modal"){return d("div",{"data-testid":`buoy-tool-instance-${t.id}`,style:{position:"fixed",inset:0,zIndex:i,pointerEvents:"none"},children:d(m,{...f,visible:r,onClose:l,onRequestClose:l,onMinimize:c,minimizeTargetPosition:a,instanceId:t.instanceId,zIndex:i,initialModalState:t.restoreState})})}if(t.launchMode==="inline"){if(!r)return null;return d("div",{"data-testid":`buoy-tool-instance-${t.id}`,style:{position:"fixed",inset:0,zIndex:i,pointerEvents:"none"},children:d(m,{...f,onClose:l,onMinimize:c,minimizeTargetPosition:a,initialModalState:t.restoreState,instanceId:t.instanceId})})}return d("div",{"data-testid":`buoy-tool-instance-${t.id}`,style:{...Y,zIndex:i,display:r?"flex":"none"},children:d("div",{style:Q,children:d(m,{...f,onClose:l,onMinimize:c,minimizeTargetPosition:a,initialModalState:t.restoreState,instanceId:t.instanceId})})})};export const AppOverlay=()=>{const{openApps:t,close:i,minimize:l}=useAppHost();const{settings:c}=W();M(()=>{D(c.globalSettings?.expandableWindowControls!==false)},[c.globalSettings?.expandableWindowControls]);const a=t.filter(r=>r.launchMode!=="toggle-only");if(a.length===0)return null;const g=a.filter(r=>r.minimized).length;const m=G()??K(g);return d(L,{children:a.map((r,f)=>d(U,{app:r,zIndex:X+f,onClose:()=>i(r.instanceId),onMinimize:b=>l(r.instanceId,b),enableSharedModalDimensions:c.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:m},r.instanceId))})};
@@ -1 +1 @@
1
- "use strict";import{useEffect as R,useMemo as g,useRef as L}from"react";import{LicenseManager as I,useLicense as j}from"@buoy-gg/license";import{registerToolAdapters as x}from"@buoy-gg/shared-ui";import{RELEASE_DEFAULT_SOCKET_URL as k,applyReleaseActionPolicy as T,externalSyncOptions as h,releaseTransportProblem as B,shouldMountExternalSync as D}from"./externalSyncGate.js";import{useDeviceIdentity as M}from"./deviceIdentity.js";import{appSyncAdapter as N}from"./sync/appSyncAdapter.js";import{jsx as l,Fragment as U,jsxs as C}from"react/jsx-runtime";const P=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const $=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];export function BrowserToolRuntime(e){const o=g(()=>Object.fromEntries(Object.entries(e.modules).map(([i,f])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),f])),[e.modules]);const s=o["react-query"];return s?.useReactQuerySyncAdapter?l(Q,{...e,modules:o,query:s}):l(E,{...e,modules:o})}function Q(e){const o=e.query.useReactQuerySyncAdapter();return l(E,{...e,queryAdapter:o})}function E({modules:e,apps:o,requiredEnvVars:s,externalSync:i,headless:f,sentryGetClient:p,queryAdapter:u}){const{isPro:c,tier:d}=j();const m=g(()=>{const r={app:N};for(const[t,n]of Object.entries(e)){for(const[a,b]of Object.entries(n)){if(a.endsWith("SyncAdapter")&&b&&typeof b==="object")r[t]=b}}if(u)r.query=u;if(e.env?.createEnvSyncAdapter)r.env=e.env.createEnvSyncAdapter(s??[]);for(const t of o??[])if(t.sync)r[`custom:${t.id}`]=t.sync;return r},[e,o,s,u]);const y=L(m);y.current=m;R(()=>x(()=>y.current),[]);R(()=>{const r=[];const t=n=>{const a=n?.();if(typeof a==="function")r.push(a)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const n of r.reverse())n()}},[e]);const A=e["external-sync"];const S=typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production";const _=D({isDevelopment:S,isLicensed:c,externalSync:i,isAvailable:Boolean(A)});const v=h(i);if(!S&&v?.enableInRelease)q(B(v.socketURL,v));const O=e.sentry?.SentryRoot;return C(U,{children:[Object.entries(e).flatMap(([r,t])=>P.map(n=>{const a=t[n];return a?l(a,{},`${r}:${n}`):null})),O&&l(O,{getClient:p}),Object.entries(e).flatMap(([r,t])=>$.map(n=>{const a=t[n];return a&&(!f||n==="ScenariosOverlay"||n==="ImpersonateOverlay")?l(a,{},`${r}:${n}`):null})),_&&l(F,{module:A,tools:m,options:v,isPro:c,tier:d,dev:S})]})}let w=null;function q(e){if(!e||e===w)return;w=e;console.warn(e)}function F({module:e,tools:o,options:s,isPro:i,tier:f,dev:p}){const u=M(s,{appName:typeof document==="undefined"?null:document.title||location.hostname,hardwareName:"Browser",platform:"web"});const{socket:c}=e.useExternalSyncSocket({deviceName:u?.deviceName??"Buoy Browser",socketURL:s?.socketURL??(p?e.getDefaultSocketURL():k),persistentDeviceId:u?.deviceId??null,platform:"web",enableLogs:s?.enableLogs});R(()=>{if(!c)return;const y=()=>{if(c.connected&&I.hasAccountAccess())c.emit("device-license",{isPro:i?"1":"0",tier:f})};y();c.on("connect",y);return()=>{c.off("connect",y)}},[c,i,f]);const d=s?.releaseActions?.join(",")??"";const m=g(()=>T(o,p,d?d.split(","):void 0),[o,p,d]);e.useExternalSync({tools:m,socket:c,deviceId:u?.deviceId??null,enableLogs:s?.enableLogs});return null}
1
+ "use strict";import{useEffect as g,useMemo as S,useRef as k}from"react";import{LicenseManager as w,installCapacitorBridge as x,resolveDevBuild as O,useLicense as B}from"@buoy-gg/license";import{registerToolAdapters as T}from"@buoy-gg/shared-ui";import{RELEASE_DEFAULT_SOCKET_URL as h,applyReleaseActionPolicy as j,externalSyncOptions as N,releaseTransportProblem as U,shouldMountExternalSync as M}from"./externalSyncGate.js";import{useDeviceIdentity as P}from"./deviceIdentity.js";import{capacitorBrokerURL as C,capacitorTransportProblem as $,useHostInfo as V}from"./capacitorHostInfo.js";import{appSyncAdapter as F}from"./sync/appSyncAdapter.js";import{jsx as f,Fragment as Q,jsxs as q}from"react/jsx-runtime";const H=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"];const K=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];export function BrowserToolRuntime(e){const a=S(()=>Object.fromEntries(Object.entries(e.modules).map(([u,p])=>[u.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),p])),[e.modules]);const o=a["react-query"];return o?.useReactQuerySyncAdapter?f(J,{...e,modules:a,query:o}):f(I,{...e,modules:a})}function J(e){const a=e.query.useReactQuerySyncAdapter();return f(I,{...e,queryAdapter:a})}function I({modules:e,apps:a,requiredEnvVars:o,externalSync:u,headless:p,sentryGetClient:y,queryAdapter:r}){const{isPro:d,tier:v}=B();const n=S(()=>{const c={app:F};for(const[t,s]of Object.entries(e)){for(const[l,A]of Object.entries(s)){if(l.endsWith("SyncAdapter")&&A&&typeof A==="object")c[t]=A}}if(r)c.query=r;if(e.env?.createEnvSyncAdapter)c.env=e.env.createEnvSyncAdapter(o??[]);for(const t of a??[])if(t.sync)c[`custom:${t.id}`]=t.sync;return c},[e,a,o,r]);const m=k(n);m.current=n;g(()=>T(()=>m.current),[]);g(()=>{const c=[];const t=s=>{const l=s?.();if(typeof l==="function")c.push(l)};t(e.network?.startNetworkCapture);t(e.storage?.startBrowserStorageCapture);t(e.assets?.startBrowserAssetCapture);if(O(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production")){t(e["time-machine"]?.startTimeMachineFloatingToolPersistence)}if(e.storage?.storageSyncAdapter?.subscribe)t(()=>e.storage.storageSyncAdapter.subscribe(()=>{}));if(e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe)t(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{}));return()=>{for(const s of c.reverse())s()}},[e]);const _=e["external-sync"];const i=O(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const b=M({isDevelopment:i,isLicensed:d,externalSync:u,isAvailable:Boolean(_)});const R=N(u);x({release:!i&&Boolean(R?.enableInRelease)});if(!i&&R?.enableInRelease)D(U(R.socketURL,R));const E=e.sentry?.SentryRoot;return q(Q,{children:[Object.entries(e).flatMap(([c,t])=>H.map(s=>{const l=t[s];return l?f(l,{},`${c}:${s}`):null})),E&&f(E,{getClient:y}),Object.entries(e).flatMap(([c,t])=>K.map(s=>{const l=t[s];return l&&(!p||s==="ScenariosOverlay"||s==="ImpersonateOverlay")?f(l,{},`${c}:${s}`):null})),b&&f(W,{module:_,tools:n,options:R,isPro:d,tier:v,dev:i})]})}let L=null;function D(e){if(!e||e===L)return;L=e;console.warn(e)}function W({module:e,tools:a,options:o,isPro:u,tier:p,dev:y}){const r=V();const d=P(o,{appName:r.appName,hardwareName:r.hardwareName,platform:r.platform});const v=S(()=>C(o?.socketURL??(y?e.getDefaultSocketURL():h),Boolean(o?.socketURL),r.platform),[o?.socketURL,y,e,r.platform]);const{socket:n}=e.useExternalSyncSocket({deviceName:d?.deviceName??"Buoy Browser",socketURL:v,persistentDeviceId:r.ready?d?.deviceId??null:null,platform:r.platform,extraDeviceInfo:r.extraDeviceInfo,enableLogs:o?.enableLogs});g(()=>{const i=$(v,r.platform);if(!n||!i)return;const b=()=>D(i);n.on("connect_error",b);return()=>{n.off("connect_error",b)}},[n,v,r.platform]);g(()=>{if(!n)return;const i=()=>{if(n.connected&&w.hasAccountAccess())n.emit("device-license",{isPro:u?"1":"0",tier:p})};i();n.on("connect",i);return()=>{n.off("connect",i)}},[n,u,p]);const m=o?.releaseActions?.join(",")??"";const _=S(()=>j(a,y,m?m.split(","):void 0),[a,y,m]);e.useExternalSync({tools:_,socket:n,deviceId:r.ready?d?.deviceId??null:null,enableLogs:o?.enableLogs});return null}
@@ -0,0 +1 @@
1
+ "use strict";import{useCallback as w,useEffect as f,useRef as I,useState as b}from"react";import{ActivityIndicator as p,Modal as k,Pressable as y,StyleSheet as S,Text as i,View as l}from"react-native";import*as T from"@buoy-gg/license";import{AccountSetupButton as D,QrCodeView as P,monoFont as v,night as s}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as a,Fragment as x}from"react/jsx-runtime";function h(){try{return T.SessionManager}catch{return void 0}}const z=o=>o.replace(/^https?:\/\//,"");function B(){const[o,n]=b(()=>h()?.getStatus().state??"signed_out");f(()=>{const r=h();if(!r)return;const c=()=>n(r.getStatus().state);c();return r.subscribe(c)},[]);return o}export function BuoySignIn({needsPlan:o=false}){const[n,r]=b(false);const c=B();return a(l,{pointerEvents:"box-none",style:t.root,children:[e(D,{expanded:n,onPress:()=>r(true)}),n?e(k,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>r(false),children:a(l,{style:t.overlay,accessibilityViewIsModal:true,children:[e(y,{style:S.absoluteFill,onPress:()=>r(false),accessible:false}),o&&c==="active"?e(W,{onClose:()=>r(false)}):e(R,{onClose:()=>r(false)})]})}):null]})}function C({onClose:o}){return a(l,{style:t.header,children:[a(l,{style:t.brand,children:[e(l,{style:t.brandDot}),e(i,{style:t.wordmark,children:"BUOY"})]}),e(y,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:o,style:t.close,testID:"buoy-signin-close",children:e(i,{style:t.closeText,children:"\u2715"})})]})}function R({onClose:o}){const[n,r]=b({kind:"starting"});const c=I(null);const m=w(()=>{c.current?.abort();const d=h();if(!d?.signInWithCode){r({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}const u=new AbortController;c.current=u;r({kind:"starting"});d.signInWithCode(g=>r({kind:"waiting",prompt:g}),{signal:u.signal}).then(()=>{if(!u.signal.aborted)o()}).catch(g=>{if(u.signal.aborted)return;r({kind:"error",message:g instanceof Error?g.message:"Sign-in did not work. Try again."})})},[o]);f(()=>{m();return()=>c.current?.abort()},[m]);return a(l,{style:t.card,testID:"buoy-code-signin",children:[e(C,{onClose:o}),e(i,{style:t.title,children:"Sign in to Buoy"}),n.kind==="starting"?e(l,{style:t.center,children:e(p,{color:s.color.accent})}):null,n.kind==="waiting"?a(x,{children:[e(i,{style:t.body,children:"Scan this with your phone's camera."}),e(l,{style:t.qr,testID:"buoy-signin-qr",children:e(P,{value:n.prompt.verificationUriComplete,size:196})}),a(i,{style:t.body,children:["Or go to ",e(i,{style:t.strong,children:z(n.prompt.verificationUri)})," and type:"]}),e(i,{style:t.code,selectable:true,testID:"buoy-signin-code",children:n.prompt.userCode}),a(l,{style:t.waiting,children:[e(p,{size:"small",color:s.color.textSecondary}),e(i,{style:t.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,n.kind==="error"?a(x,{children:[e(i,{style:t.body,testID:"buoy-signin-error",children:n.message}),e(y,{accessibilityRole:"button",onPress:m,style:({pressed:d})=>[t.primary,d&&t.primaryPressed],testID:"buoy-signin-retry",children:e(i,{style:t.primaryText,children:"Get a new code"})})]}):null]})}function W({onClose:o}){return a(l,{style:t.card,testID:"buoy-signin-needs-plan",children:[e(C,{onClose:o}),e(i,{style:t.title,children:"You're signed in"}),e(i,{style:t.body,children:"Buoy in this build needs a Pro or Business plan."}),e(y,{accessibilityRole:"button",onPress:()=>void h()?.signOut(),style:({pressed:n})=>[t.primary,n&&t.primaryPressed],testID:"buoy-signout",children:e(i,{style:t.primaryText,children:"Sign out"})})]})}const t=S.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},card:{width:"100%",maxWidth:368,backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:24},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},brand:{flexDirection:"row",alignItems:"center",gap:8},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:s.color.accent},wordmark:{color:s.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:s.color.textSecondary,fontSize:14},title:{color:s.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:s.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:s.color.text,fontWeight:"600"},muted:{color:s.color.textSecondary,fontSize:13},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:s.color.text,fontFamily:v,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:s.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:s.color.accentPressed},primaryText:{color:s.color.onAccent,fontSize:15,fontWeight:"600"}});
@@ -1 +1 @@
1
- "use strict";import{useCallback as w,useEffect as f,useRef as I,useState as b}from"react";import{ActivityIndicator as p,Modal as k,Pressable as y,StyleSheet as S,Text as i,View as l}from"react-native";import*as T from"@buoy-gg/license";import{AccountSetupButton as D,QrCodeView as P,monoFont as v,night as s}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as a,Fragment as x}from"react/jsx-runtime";function h(){try{return T.SessionManager}catch{return void 0}}const z=o=>o.replace(/^https?:\/\//,"");function B(){const[o,n]=b(()=>h()?.getStatus().state??"signed_out");f(()=>{const r=h();if(!r)return;const c=()=>n(r.getStatus().state);c();return r.subscribe(c)},[]);return o}export function BuoySignIn({needsPlan:o=false}){const[n,r]=b(false);const c=B();return a(l,{pointerEvents:"box-none",style:t.root,children:[e(D,{expanded:n,onPress:()=>r(true)}),n?e(k,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>r(false),children:a(l,{style:t.overlay,accessibilityViewIsModal:true,children:[e(y,{style:S.absoluteFill,onPress:()=>r(false),accessible:false}),o&&c==="active"?e(W,{onClose:()=>r(false)}):e(R,{onClose:()=>r(false)})]})}):null]})}function C({onClose:o}){return a(l,{style:t.header,children:[a(l,{style:t.brand,children:[e(l,{style:t.brandDot}),e(i,{style:t.wordmark,children:"BUOY"})]}),e(y,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:o,style:t.close,testID:"buoy-signin-close",children:e(i,{style:t.closeText,children:"\u2715"})})]})}function R({onClose:o}){const[n,r]=b({kind:"starting"});const c=I(null);const m=w(()=>{c.current?.abort();const d=h();if(!d?.signInWithCode){r({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}const u=new AbortController;c.current=u;r({kind:"starting"});d.signInWithCode(g=>r({kind:"waiting",prompt:g}),{signal:u.signal}).then(()=>{if(!u.signal.aborted)o()}).catch(g=>{if(u.signal.aborted)return;r({kind:"error",message:g instanceof Error?g.message:"Sign-in did not work. Try again."})})},[o]);f(()=>{m();return()=>c.current?.abort()},[m]);return a(l,{style:t.card,testID:"buoy-code-signin",children:[e(C,{onClose:o}),e(i,{style:t.title,children:"Sign in to Buoy"}),n.kind==="starting"?e(l,{style:t.center,children:e(p,{color:s.color.accent})}):null,n.kind==="waiting"?a(x,{children:[e(i,{style:t.body,children:"Scan this with your phone's camera."}),e(l,{style:t.qr,testID:"buoy-signin-qr",children:e(P,{value:n.prompt.verificationUriComplete,size:196})}),a(i,{style:t.body,children:["Or go to ",e(i,{style:t.strong,children:z(n.prompt.verificationUri)})," and type:"]}),e(i,{style:t.code,selectable:true,testID:"buoy-signin-code",children:n.prompt.userCode}),a(l,{style:t.waiting,children:[e(p,{size:"small",color:s.color.textSecondary}),e(i,{style:t.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,n.kind==="error"?a(x,{children:[e(i,{style:t.body,testID:"buoy-signin-error",children:n.message}),e(y,{accessibilityRole:"button",onPress:m,style:({pressed:d})=>[t.primary,d&&t.primaryPressed],testID:"buoy-signin-retry",children:e(i,{style:t.primaryText,children:"Get a new code"})})]}):null]})}function W({onClose:o}){return a(l,{style:t.card,testID:"buoy-signin-needs-plan",children:[e(C,{onClose:o}),e(i,{style:t.title,children:"You're signed in"}),e(i,{style:t.body,children:"Buoy in this build needs a Pro or Business plan."}),e(y,{accessibilityRole:"button",onPress:()=>void h()?.signOut(),style:({pressed:n})=>[t.primary,n&&t.primaryPressed],testID:"buoy-signout",children:e(i,{style:t.primaryText,children:"Sign out"})})]})}const t=S.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},card:{width:"100%",maxWidth:368,backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:24},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},brand:{flexDirection:"row",alignItems:"center",gap:8},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:s.color.accent},wordmark:{color:s.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:s.color.textSecondary,fontSize:14},title:{color:s.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:s.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:s.color.text,fontWeight:"600"},muted:{color:s.color.textSecondary,fontSize:13},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:s.color.text,fontFamily:v,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:s.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:s.color.accentPressed},primaryText:{color:s.color.onAccent,fontSize:15,fontWeight:"600"}});
1
+ "use strict";export{BuoySignIn}from"./BuoyCodeSignIn.js";
@@ -1 +1 @@
1
- "use strict";import{useState as S,useEffect as I,useCallback as A,useMemo as W}from"react";import{View as y,Text as h,StyleSheet as Xe,ScrollView as Se,TouchableOpacity as j,Dimensions as be,Platform as Ze}from"react-native";import{settingsBus as N}from"./settingsBus.js";import{useDesktopSyncStatus as et}from"./useDesktopSyncStatus";import{SentryIcon as tt,WifiCircuitIcon as ot,ImageOverlayIcon as nt,RenderCountIcon as st,Info as Q,Layers as rt,ChevronRightIcon as we,ChevronDown as Te,getStorageBackendType as it,getUseLicense as at,signOutOfBuoy as lt,persistentStorage as D,Trash2 as ct,CheckCircle2 as ve,LicenseEntryModal as dt,BackgroundSwitcher as gt,night as o,NightCard as R,NightRows as X,NightSectionLabel as ut,NightFootnote as xe,NightSwitch as ze,NightButton as Z,NightSegmented as yt,NightBadge as v,NightSeparator as ht,monoFont as Ie}from"@buoy-gg/shared-ui";import{EnvIcon as Ce,StorageIcon as ft,RoutesIcon as pt,NetworkIcon as mt,QueryIcon as St,HighlighterIcon as bt,ReduxIcon as wt,EventsIcon as Tt}from"@buoy-gg/floating-tools-core";import{useDefaultConfig as Le}from"./DefaultConfigContext.js";import{renderAppIcon as vt}from"./AppIcon";import{JsModal as xt,devToolsStorageKeys as ee,onSettingsApplied as zt}from"@buoy-gg/shared-ui";import{useSafeAreaInsets as It}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as r,Fragment as P}from"react/jsx-runtime";const H="@react_buoy_dev_tools_settings";const Ct=6;const V=d=>{let g=Ct;const a={};for(const[f,l]of Object.entries(d)){if(l&&g>0){a[f]=true;g-=1}else{a[f]=false}}return a};const Lt=(d,g)=>{const{userStatus:a,environment:f,...l}=d;const u=g?Object.entries(l).filter(([p])=>g.includes(p)):Object.entries(l);return{...Object.fromEntries(u),environment:f??false}};const De=(d,g,a)=>{if(!g)return d;const f={...d.dialTools,...g.dialTools??{}};const l=a?.allowedDialKeys?Object.entries(f).filter(([p])=>a.allowedDialKeys?.includes(p)):Object.entries(f);const u=V(Object.fromEntries(l));return{dialTools:u,floatingTools:Lt({...d.floatingTools,...g.floatingTools??{}},a?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...g.globalSettings??{}}}};const Dt=(d=[],g,a)=>{const f={};const l={};const u=new Set(g??[]);const p=new Set(a??[]);const m=!a||a.length===0;for(const x of d){const{id:c,slot:C="both"}=x;if(C==="dial"||C==="both"){f[c]=m?true:p.has(c)}if(C==="row"||C==="both"){l[c]=u.has(c)}}return{dialTools:V(f),floatingTools:{...l,environment:u.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}};export const DevToolsSettingsModal=({visible:d,onClose:g,onSettingsChange:a,initialSettings:f,availableApps:l=[],storage:u=D,zIndex:p})=>{const{defaultFloatingTools:m,defaultDialTools:x}=Le();const c=W(()=>Dt(l,m,x),[l,m,x]);const C=W(()=>Object.keys(c.dialTools),[c]);const oe=W(()=>Object.keys(c.floatingTools).filter(t=>t!=="environment"),[c]);const[z,E]=S(f||M||c);const[B,ne]=S(te??"floating");const[se,Ee]=S(te!==null);const[_,Fe]=S(new Set);const[Oe,J]=S(false);const[ke,Pe]=S(false);I(()=>{const t=requestAnimationFrame(()=>Pe(true));return()=>cancelAnimationFrame(t)},[]);const b=et();I(()=>{const t=async()=>{try{const s=await D.getItem(ee.settings.activeTab());if(s&&["floating","settings","pro"].includes(s)){const i=s;te=i;ne(T=>T===i?T:i)}}catch(s){}finally{Ee(true)}};t()},[]);I(()=>{if(!se)return;D.setItem(ee.settings.activeTab(),B).catch(t=>{console.warn("Failed to save settings active tab:",t)})},[B,se]);const He=at();const F=He?.();const O=F?.isPro??false;const U=!O&&F?.licenseKey?F.error:null;const Me=F?.errorKind==="transport";const[w,Ke]=S(Re);const[G,re]=S(false);const[q,Y]=S(false);const[k,Ae]=S(false);const[$,ie]=S([]);const[ae,le]=S(false);const ce=It();const de=be.get("window").height;const ge=be.get("window").width;const We=Math.floor(de*.33);const je=Math.min(ge-32,400);const ue=A(async()=>{try{const t=await u.getItem(H);if(t){const s=JSON.parse(t);const i=De(c,s,{allowedDialKeys:C,allowedFloatingKeys:oe});M=i;E(T=>Be(T,i)?T:i);return}M=c;E(s=>Be(s,c)?s:c)}catch(t){console.error("Failed to load dev tools settings:",t);E(c)}},[c,C,oe,u]);I(()=>{ue()},[ue]);I(()=>{it().then(t=>{Re=t;Ke(s=>s===t?s:t)})},[]);I(()=>{if(k){le(true);D.getAllKeys().then(t=>{ie(t.sort())}).catch(()=>{ie([])}).finally(()=>{le(false)})}},[k]);const ye=async t=>{try{const s={...t,dialTools:V(t.dialTools)};await u.setItem(H,JSON.stringify(s));M=s;E(s);a?.(s);N.emit(s)}catch(s){console.error("Failed to save dev tools settings:",s)}};const Ne=t=>{const s={...z,floatingTools:{...z.floatingTools,[t]:!z.floatingTools[t]}};ye(s)};const Ve=t=>{const s={...z,globalSettings:{...z.globalSettings,[t]:!z.globalSettings?.[t]}};ye(s)};const _e=async()=>{re(true);Y(false);try{await D.clear();Y(true);E(c);if(u!==D)await u.setItem(H,JSON.stringify(c));a?.(c);N.emit(c);setTimeout(()=>Y(false),2e3)}catch(t){console.error("Failed to clear storage:",t)}finally{re(false)}};const Je=A(t=>{},[]);const Ue=t=>{const s=l.find(i=>i.id===t);if(s?.description){return s.description}if(t==="environment"){return"Environment badge."}return""};const he=t=>{if(t==="environment"){return"Env Badge"}const s=l.find(i=>i.id===t);return s?.name??t.toUpperCase().replace(/_/g," ")};const Ge=t=>{if(!ke)return null;switch(t){case"query":return e(St,{size:18});case"env":return e(Ce,{size:18});case"sentry":return e(tt,{size:18,color:"#9945FF"});case"storage":return e(ft,{size:18,bgColor:o.color.surface});case"wifi":case"query-wifi-toggle":return e(ot,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return e(pt,{size:18,bgColor:o.color.surface});case"network":return e(mt,{size:18});case"environment":return e(Ce,{size:18});case"debug-borders":return e(rt,{size:18,color:o.color.accent});case"highlight-updates":return e(st,{size:18,color:o.color.accent});case"highlight-updates-modal":return e(bt,{size:18});case"redux":return e(wt,{size:18});case"image-overlay":return e(nt,{size:18});case"events":return e(Tt,{size:18});case"zustand":try{const{ZustandIcon:s}=require("@buoy-gg/zustand");return e(s,{size:18})}catch{return e(Q,{size:18,color:o.color.textSecondary})}case"jotai":try{const{JotaiIcon:s}=require("@buoy-gg/jotai");return e(s,{size:18})}catch{return e(Q,{size:18,color:o.color.textSecondary})}default:{const s=l.find(i=>i.id===t);if(s?.icon!=null){return vt(s.icon,{slot:"row",size:18,color:s.color})}return e(Q,{size:18,color:o.color.textSecondary})}}};const qe=(t,s,i,T)=>{const K=Ue(t);return r(j,{activeOpacity:i?1:.7,onPress:()=>!i&&T(),accessibilityLabel:he(t),accessibilityRole:"button",style:[n.toolRow,i&&n.rowDisabled],children:[e(y,{style:n.toolIconSlot,children:Ge(t)}),r(y,{style:n.rowInfo,children:[r(h,{style:n.rowLabel,children:[he(t),i?" \xB7 max 6":""]}),K?e(h,{style:n.rowCaption,numberOfLines:1,children:K}):null]}),e(ze,{value:s,disabled:i,onValueChange:()=>T()})]},t)};const fe=t=>{Fe(s=>{const i=new Set(s);if(i.has(t)){i.delete(t)}else{i.add(t)}return i})};const pe=(t,s,i,T,K)=>{const Qe=z.globalSettings?.[t]??false;const me=_.has(t);return r(y,{children:[r(j,{activeOpacity:.7,onPress:()=>fe(t),accessibilityLabel:s,style:n.settingRow,children:[r(y,{style:n.rowInfo,children:[e(h,{style:n.rowLabel,children:s}),e(h,{style:n.rowCaption,numberOfLines:me?0:1,children:i})]}),e(ze,{value:Qe,onValueChange:()=>Ve(t)})]}),me&&r(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:T}),e(h,{style:n.settingRowBodyHint,children:K})]})]},t)};const L=(t,s,i)=>r(y,{children:[e(ut,{children:t}),s,i]});const Ye=w==="filesystem"?e(v,{label:"File System",tone:"accent"}):w==="asyncstorage"?e(v,{label:"Async Storage",tone:"warning"}):w==="localstorage"?e(v,{label:"Local Storage",tone:"accent"}):w==="memory"?e(v,{label:"Memory",tone:"danger"}):e(v,{label:"Loading\u2026",tone:"neutral"});const $e=()=>r(y,{style:n.container,children:[r(Se,{style:n.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:n.scrollContainer,children:[B==="floating"&&e(P,{children:L("Floating Tools",e(R,{glass:true,children:e(X,{children:Object.entries(z.floatingTools).map(([t,s])=>qe(t,s,false,()=>Ne(t)))})}),e(xe,{children:"Tools switched on here appear in the floating bubble row."}))}),B==="settings"&&r(P,{children:[L("Background",e(R,{glass:true,padded:true,children:e(gt,{embedded:true})})),L("Storage",r(R,{glass:true,children:[r(j,{activeOpacity:.7,onPress:()=>Ae(!k),accessibilityLabel:"Storage Type",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Storage Type"})}),Ye,k?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),k&&r(P,{children:[r(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:w==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":w==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":w==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":w==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),w==="asyncstorage"&&e(h,{style:[n.settingRowBodyText,n.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),w==="memory"&&e(h,{style:[n.settingRowBodyText,n.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),e(ht,{}),r(y,{style:n.storageExpanded,children:[r(y,{style:n.storageExpandedHeader,children:[e(h,{style:n.storageExpandedTitle,children:"SAVED SETTINGS"}),e(h,{style:n.storageExpandedCount,children:ae?"\u2026":`${$.length} keys`})]}),ae?e(h,{style:n.storageKeyEmpty,children:"Loading\u2026"}):$.length===0?e(h,{style:n.storageKeyEmpty,children:"No settings saved yet"}):e(Se,{style:n.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:$.map(t=>e(y,{style:n.storageKeyItem,children:e(h,{style:n.storageKeyText,numberOfLines:1,children:t.replace("@react_buoy_","")})},t))})]}),e(y,{style:n.cardButtonWrap,children:e(Z,{label:q?"Cleared":G?"Clearing\u2026":"Clear All Settings",variant:q?"secondary":"destructive",size:"md",disabled:G,onPress:_e,icon:q?e(ve,{size:15,color:o.color.accent}):e(ct,{size:15,color:G?o.color.textTertiary:o.color.danger})})})]})]})),b&&b.state!=="idle"&&L("Desktop Sync",r(R,{glass:true,children:[r(j,{activeOpacity:.7,onPress:()=>fe("desktopSync"),accessibilityLabel:"Buoy Desktop",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Buoy Desktop"})}),b.state==="connected"?e(v,{label:"Connected",tone:"accent"}):b.state==="connecting"?e(v,{label:"Connecting\u2026",tone:"neutral"}):e(v,{label:"Retrying",tone:"warning"}),_.has("desktopSync")?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),_.has("desktopSync")&&r(y,{style:n.settingRowBody,children:[r(h,{style:n.settingRowBodyText,children:[b.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",e(h,{style:n.footnoteMono,children:b.targetURL??"(unknown URL)"}),b.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),b.state==="retrying"&&b.lastError&&r(h,{style:[n.settingRowBodyText,n.bodyWarning],children:["Last error: ",b.lastError]})]})]})),L("Modal Behavior",e(R,{glass:true,children:r(X,{children:[pe("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Ze.OS!=="web"?pe("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),B==="pro"&&r(P,{children:[L("License",r(R,{glass:true,children:[r(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"License Status"})}),e(y,{testID:"buoy-settings-license-status",accessibilityLabel:O?"License: Active":"License: Free",children:O?e(v,{label:"Active",tone:"accent"}):e(v,{label:"Free",tone:"neutral"})})]}),F?.tierSource==="session"?r(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Signed in with Buoy"})}),e(Z,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void lt(),testID:"buoy-settings-signout"})]}):null]}),e(xe,{children:O?"You have full access to all Buoy DevTools features.":U?Me?`Couldn't reach the license server (${U}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${U}.`:"Upgrade to Pro to unlock all features and support development."})),!O&&r(P,{children:[L("Pro Features",e(R,{glass:true,children:e(X,{children:["Advanced Settings","Priority Support"].map(t=>r(y,{style:n.featureRow,children:[e(ve,{size:16,color:o.color.accent}),e(h,{style:n.rowLabel,children:t})]},t))})})),e(Z,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>J(true)})]})]})]}),e(dt,{visible:Oe,onClose:()=>J(false),onSuccess:()=>J(false)})]});return e(xt,{visible:d,onClose:g,zIndex:p,variant:"night",header:{showToggleButton:false,customContent:e(y,{style:n.headerRow,children:e(yt,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:B,onChange:t=>ne(t)})})},initialMode:"bottomSheet",onModeChange:Je,persistenceKey:ee.settings.root(),enablePersistence:true,maxHeight:de-ce.top,initialHeight:We,initialFloatingPosition:{x:(ge-je)/2,y:ce.top+20},enableGlitchEffects:true,children:$e()})};const Rt={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}};const Bt=(d,g)=>{const a=new Set(d??[]);const f=new Set(g??[]);const l={};for(const p of f){l[p]=true}const u={environment:a.has("environment")};for(const p of a){if(p!=="environment"){u[p]=true}}return{dialTools:V(l),floatingTools:u,globalSettings:{enableSharedModalDimensions:false}}};let M=null;let te=null;let Re=null;const Be=(d,g)=>JSON.stringify(d)===JSON.stringify(g);N.addListener(d=>{if(d)M=d});export const useDevToolsSettings=()=>{const{defaultFloatingTools:d,defaultDialTools:g}=Le();const a=W(()=>{if(!d&&!g){return Rt}return Bt(d,g)},[d,g]);const[f,l]=S(a);const u=A(async()=>{try{const m=await D.getItem(H);if(m){const x=JSON.parse(m);const c=De(a,x);l(c);return}l(a)}catch(m){console.error("Failed to load dev tools settings:",m);l(a)}},[a]);I(()=>zt(m=>{if(m.includes(H))void u()}),[u]);I(()=>{u();const m=N.addListener(x=>{try{if(x){l(x)}}catch(c){}});return()=>{m()}},[u]);const p=A(()=>{u()},[u]);return{settings:f,refreshSettings:p}};const n=Xe.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:o.gutter,paddingRight:o.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:o.gutter,paddingTop:8,paddingBottom:24,gap:o.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:o.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:o.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:o.color.text,fontSize:o.font.row,fontWeight:"500"},rowCaption:{color:o.color.textTertiary,fontSize:o.font.label},settingRowBody:{paddingHorizontal:o.rowPadH,paddingBottom:o.rowPadV,gap:6},settingRowBodyText:{color:o.color.textSecondary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},settingRowBodyHint:{color:o.color.textTertiary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},bodyWarning:{color:o.color.warning},bodyDanger:{color:o.color.danger},cardButtonWrap:{paddingHorizontal:o.cardPad,paddingTop:10,paddingBottom:o.cardPad},storageExpanded:{paddingHorizontal:o.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:o.color.textSecondary,fontSize:o.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:o.color.textTertiary,fontSize:o.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:o.color.glassElevated,borderRadius:o.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:o.color.textSecondary,fontSize:o.font.micro,fontFamily:Ie},storageKeyEmpty:{color:o.color.textTertiary,fontSize:o.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Ie,fontSize:o.font.label,color:o.color.textSecondary}});
1
+ "use strict";import{useState as S,useEffect as I,useCallback as W,useMemo as A}from"react";import{View as y,Text as h,StyleSheet as Xe,ScrollView as Se,TouchableOpacity as j,Dimensions as be,Platform as Ze}from"react-native";import{settingsBus as N}from"./settingsBus.js";import{useDesktopSyncStatus as et}from"./useDesktopSyncStatus";import{SentryIcon as tt,WifiCircuitIcon as ot,ImageOverlayIcon as nt,RenderCountIcon as rt,Info as Q,Layers as st,ChevronRightIcon as we,ChevronDown as Te,getStorageBackendType as it,getUseLicense as at,signOutOfBuoy as lt,persistentStorage as D,Trash2 as ct,CheckCircle2 as ve,LicenseEntryModal as dt,BackgroundSwitcher as gt,night as o,NightCard as R,NightRows as X,NightSectionLabel as ut,NightFootnote as xe,NightSwitch as ze,NightButton as Z,NightSegmented as yt,NightBadge as v,NightSeparator as ht,monoFont as Ie}from"@buoy-gg/shared-ui";import{EnvIcon as Ce,StorageIcon as ft,RoutesIcon as pt,NetworkIcon as mt,QueryIcon as St,HighlighterIcon as bt,ReduxIcon as wt,EventsIcon as Tt}from"@buoy-gg/floating-tools-core";import{useDefaultConfig as Le}from"./DefaultConfigContext.js";import{renderAppIcon as vt}from"./AppIcon";import{JsModal as xt,devToolsStorageKeys as ee,onSettingsApplied as zt,expandableWindowControlsSupported as It}from"@buoy-gg/shared-ui";import{useSafeAreaInsets as Ct}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as s,Fragment as P}from"react/jsx-runtime";const H="@react_buoy_dev_tools_settings";const Lt=6;const V=d=>{let g=Lt;const a={};for(const[f,l]of Object.entries(d)){if(l&&g>0){a[f]=true;g-=1}else{a[f]=false}}return a};const Dt=(d,g)=>{const{userStatus:a,environment:f,...l}=d;const u=g?Object.entries(l).filter(([p])=>g.includes(p)):Object.entries(l);return{...Object.fromEntries(u),environment:f??false}};const De=(d,g,a)=>{if(!g)return d;const f={...d.dialTools,...g.dialTools??{}};const l=a?.allowedDialKeys?Object.entries(f).filter(([p])=>a.allowedDialKeys?.includes(p)):Object.entries(f);const u=V(Object.fromEntries(l));return{dialTools:u,floatingTools:Dt({...d.floatingTools,...g.floatingTools??{}},a?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...g.globalSettings??{}}}};const Rt=(d=[],g,a)=>{const f={};const l={};const u=new Set(g??[]);const p=new Set(a??[]);const m=!a||a.length===0;for(const x of d){const{id:c,slot:C="both"}=x;if(C==="dial"||C==="both"){f[c]=m?true:p.has(c)}if(C==="row"||C==="both"){l[c]=u.has(c)}}return{dialTools:V(f),floatingTools:{...l,environment:u.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}};export const DevToolsSettingsModal=({visible:d,onClose:g,onSettingsChange:a,initialSettings:f,availableApps:l=[],storage:u=D,zIndex:p})=>{const{defaultFloatingTools:m,defaultDialTools:x}=Le();const c=A(()=>Rt(l,m,x),[l,m,x]);const C=A(()=>Object.keys(c.dialTools),[c]);const oe=A(()=>Object.keys(c.floatingTools).filter(t=>t!=="environment"),[c]);const[z,E]=S(f||M||c);const[B,ne]=S(te??"floating");const[re,Ee]=S(te!==null);const[_,Fe]=S(new Set);const[Oe,J]=S(false);const[ke,Pe]=S(false);I(()=>{const t=requestAnimationFrame(()=>Pe(true));return()=>cancelAnimationFrame(t)},[]);const b=et();I(()=>{const t=async()=>{try{const r=await D.getItem(ee.settings.activeTab());if(r&&["floating","settings","pro"].includes(r)){const i=r;te=i;ne(T=>T===i?T:i)}}catch(r){}finally{Ee(true)}};t()},[]);I(()=>{if(!re)return;D.setItem(ee.settings.activeTab(),B).catch(t=>{console.warn("Failed to save settings active tab:",t)})},[B,re]);const He=at();const F=He?.();const O=F?.isPro??false;const U=!O&&F?.licenseKey?F.error:null;const Me=F?.errorKind==="transport";const[w,Ke]=S(Re);const[G,se]=S(false);const[q,Y]=S(false);const[k,We]=S(false);const[$,ie]=S([]);const[ae,le]=S(false);const ce=Ct();const de=be.get("window").height;const ge=be.get("window").width;const Ae=Math.floor(de*.33);const je=Math.min(ge-32,400);const ue=W(async()=>{try{const t=await u.getItem(H);if(t){const r=JSON.parse(t);const i=De(c,r,{allowedDialKeys:C,allowedFloatingKeys:oe});M=i;E(T=>Be(T,i)?T:i);return}M=c;E(r=>Be(r,c)?r:c)}catch(t){console.error("Failed to load dev tools settings:",t);E(c)}},[c,C,oe,u]);I(()=>{ue()},[ue]);I(()=>{it().then(t=>{Re=t;Ke(r=>r===t?r:t)})},[]);I(()=>{if(k){le(true);D.getAllKeys().then(t=>{ie(t.sort())}).catch(()=>{ie([])}).finally(()=>{le(false)})}},[k]);const ye=async t=>{try{const r={...t,dialTools:V(t.dialTools)};await u.setItem(H,JSON.stringify(r));M=r;E(r);a?.(r);N.emit(r)}catch(r){console.error("Failed to save dev tools settings:",r)}};const Ne=t=>{const r={...z,floatingTools:{...z.floatingTools,[t]:!z.floatingTools[t]}};ye(r)};const Ve=t=>{const r={...z,globalSettings:{...z.globalSettings,[t]:!z.globalSettings?.[t]}};ye(r)};const _e=async()=>{se(true);Y(false);try{await D.clear();Y(true);E(c);if(u!==D)await u.setItem(H,JSON.stringify(c));a?.(c);N.emit(c);setTimeout(()=>Y(false),2e3)}catch(t){console.error("Failed to clear storage:",t)}finally{se(false)}};const Je=W(t=>{},[]);const Ue=t=>{const r=l.find(i=>i.id===t);if(r?.description){return r.description}if(t==="environment"){return"Environment badge."}return""};const he=t=>{if(t==="environment"){return"Env Badge"}const r=l.find(i=>i.id===t);return r?.name??t.toUpperCase().replace(/_/g," ")};const Ge=t=>{if(!ke)return null;switch(t){case"query":return e(St,{size:18});case"env":return e(Ce,{size:18});case"sentry":return e(tt,{size:18,color:"#9945FF"});case"storage":return e(ft,{size:18,bgColor:o.color.surface});case"wifi":case"query-wifi-toggle":return e(ot,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return e(pt,{size:18,bgColor:o.color.surface});case"network":return e(mt,{size:18});case"environment":return e(Ce,{size:18});case"debug-borders":return e(st,{size:18,color:o.color.accent});case"highlight-updates":return e(rt,{size:18,color:o.color.accent});case"highlight-updates-modal":return e(bt,{size:18});case"redux":return e(wt,{size:18});case"image-overlay":return e(nt,{size:18});case"events":return e(Tt,{size:18});case"zustand":try{const{ZustandIcon:r}=require("@buoy-gg/zustand");return e(r,{size:18})}catch{return e(Q,{size:18,color:o.color.textSecondary})}case"jotai":try{const{JotaiIcon:r}=require("@buoy-gg/jotai");return e(r,{size:18})}catch{return e(Q,{size:18,color:o.color.textSecondary})}default:{const r=l.find(i=>i.id===t);if(r?.icon!=null){return vt(r.icon,{slot:"row",size:18,color:r.color})}return e(Q,{size:18,color:o.color.textSecondary})}}};const qe=(t,r,i,T)=>{const K=Ue(t);return s(j,{activeOpacity:i?1:.7,onPress:()=>!i&&T(),accessibilityLabel:he(t),accessibilityRole:"button",style:[n.toolRow,i&&n.rowDisabled],children:[e(y,{style:n.toolIconSlot,children:Ge(t)}),s(y,{style:n.rowInfo,children:[s(h,{style:n.rowLabel,children:[he(t),i?" \xB7 max 6":""]}),K?e(h,{style:n.rowCaption,numberOfLines:1,children:K}):null]}),e(ze,{value:r,disabled:i,onValueChange:()=>T()})]},t)};const fe=t=>{Fe(r=>{const i=new Set(r);if(i.has(t)){i.delete(t)}else{i.add(t)}return i})};const pe=(t,r,i,T,K)=>{const Qe=z.globalSettings?.[t]??false;const me=_.has(t);return s(y,{children:[s(j,{activeOpacity:.7,onPress:()=>fe(t),accessibilityLabel:r,style:n.settingRow,children:[s(y,{style:n.rowInfo,children:[e(h,{style:n.rowLabel,children:r}),e(h,{style:n.rowCaption,numberOfLines:me?0:1,children:i})]}),e(ze,{value:Qe,onValueChange:()=>Ve(t)})]}),me&&s(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:T}),e(h,{style:n.settingRowBodyHint,children:K})]})]},t)};const L=(t,r,i)=>s(y,{children:[e(ut,{children:t}),r,i]});const Ye=w==="filesystem"?e(v,{label:"File System",tone:"accent"}):w==="asyncstorage"?e(v,{label:"Async Storage",tone:"warning"}):w==="localstorage"?e(v,{label:"Local Storage",tone:"accent"}):w==="memory"?e(v,{label:"Memory",tone:"danger"}):e(v,{label:"Loading\u2026",tone:"neutral"});const $e=()=>s(y,{style:n.container,children:[s(Se,{style:n.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:n.scrollContainer,children:[B==="floating"&&e(P,{children:L("Floating Tools",e(R,{glass:true,children:e(X,{children:Object.entries(z.floatingTools).map(([t,r])=>qe(t,r,false,()=>Ne(t)))})}),e(xe,{children:"Tools switched on here appear in the floating bubble row."}))}),B==="settings"&&s(P,{children:[L("Background",e(R,{glass:true,padded:true,children:e(gt,{embedded:true})})),L("Storage",s(R,{glass:true,children:[s(j,{activeOpacity:.7,onPress:()=>We(!k),accessibilityLabel:"Storage Type",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Storage Type"})}),Ye,k?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),k&&s(P,{children:[s(y,{style:n.settingRowBody,children:[e(h,{style:n.settingRowBodyText,children:w==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":w==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":w==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":w==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),w==="asyncstorage"&&e(h,{style:[n.settingRowBodyText,n.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),w==="memory"&&e(h,{style:[n.settingRowBodyText,n.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),e(ht,{}),s(y,{style:n.storageExpanded,children:[s(y,{style:n.storageExpandedHeader,children:[e(h,{style:n.storageExpandedTitle,children:"SAVED SETTINGS"}),e(h,{style:n.storageExpandedCount,children:ae?"\u2026":`${$.length} keys`})]}),ae?e(h,{style:n.storageKeyEmpty,children:"Loading\u2026"}):$.length===0?e(h,{style:n.storageKeyEmpty,children:"No settings saved yet"}):e(Se,{style:n.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:$.map(t=>e(y,{style:n.storageKeyItem,children:e(h,{style:n.storageKeyText,numberOfLines:1,children:t.replace("@react_buoy_","")})},t))})]}),e(y,{style:n.cardButtonWrap,children:e(Z,{label:q?"Cleared":G?"Clearing\u2026":"Clear All Settings",variant:q?"secondary":"destructive",size:"md",disabled:G,onPress:_e,icon:q?e(ve,{size:15,color:o.color.accent}):e(ct,{size:15,color:G?o.color.textTertiary:o.color.danger})})})]})]})),b&&b.state!=="idle"&&L("Desktop Sync",s(R,{glass:true,children:[s(j,{activeOpacity:.7,onPress:()=>fe("desktopSync"),accessibilityLabel:"Buoy Desktop",style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Buoy Desktop"})}),b.state==="connected"?e(v,{label:"Connected",tone:"accent"}):b.state==="connecting"?e(v,{label:"Connecting\u2026",tone:"neutral"}):e(v,{label:"Retrying",tone:"warning"}),_.has("desktopSync")?e(Te,{size:16,color:o.color.textTertiary}):e(we,{size:16,color:o.color.textTertiary})]}),_.has("desktopSync")&&s(y,{style:n.settingRowBody,children:[s(h,{style:n.settingRowBodyText,children:[b.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",e(h,{style:n.footnoteMono,children:b.targetURL??"(unknown URL)"}),b.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),b.state==="retrying"&&b.lastError&&s(h,{style:[n.settingRowBodyText,n.bodyWarning],children:["Last error: ",b.lastError]})]})]})),L("Modal Behavior",e(R,{glass:true,children:s(X,{children:[pe("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),It(Ze.OS==="web")?pe("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),B==="pro"&&s(P,{children:[L("License",s(R,{glass:true,children:[s(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"License Status"})}),e(y,{testID:"buoy-settings-license-status",accessibilityLabel:O?"License: Active":"License: Free",children:O?e(v,{label:"Active",tone:"accent"}):e(v,{label:"Free",tone:"neutral"})})]}),F?.tierSource==="session"?s(y,{style:n.settingRow,children:[e(y,{style:n.rowInfo,children:e(h,{style:n.rowLabel,children:"Signed in with Buoy"})}),e(Z,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void lt(),testID:"buoy-settings-signout"})]}):null]}),e(xe,{children:O?"You have full access to all Buoy DevTools features.":U?Me?`Couldn't reach the license server (${U}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${U}.`:"Upgrade to Pro to unlock all features and support development."})),!O&&s(P,{children:[L("Pro Features",e(R,{glass:true,children:e(X,{children:["Advanced Settings","Priority Support"].map(t=>s(y,{style:n.featureRow,children:[e(ve,{size:16,color:o.color.accent}),e(h,{style:n.rowLabel,children:t})]},t))})})),e(Z,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>J(true)})]})]})]}),e(dt,{visible:Oe,onClose:()=>J(false),onSuccess:()=>J(false)})]});return e(xt,{visible:d,onClose:g,zIndex:p,variant:"night",header:{showToggleButton:false,customContent:e(y,{style:n.headerRow,children:e(yt,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:B,onChange:t=>ne(t)})})},initialMode:"bottomSheet",onModeChange:Je,persistenceKey:ee.settings.root(),enablePersistence:true,maxHeight:de-ce.top,initialHeight:Ae,initialFloatingPosition:{x:(ge-je)/2,y:ce.top+20},enableGlitchEffects:true,children:$e()})};const Bt={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}};const Et=(d,g)=>{const a=new Set(d??[]);const f=new Set(g??[]);const l={};for(const p of f){l[p]=true}const u={environment:a.has("environment")};for(const p of a){if(p!=="environment"){u[p]=true}}return{dialTools:V(l),floatingTools:u,globalSettings:{enableSharedModalDimensions:false}}};let M=null;let te=null;let Re=null;const Be=(d,g)=>JSON.stringify(d)===JSON.stringify(g);N.addListener(d=>{if(d)M=d});export const useDevToolsSettings=()=>{const{defaultFloatingTools:d,defaultDialTools:g}=Le();const a=A(()=>{if(!d&&!g){return Bt}return Et(d,g)},[d,g]);const[f,l]=S(a);const u=W(async()=>{try{const m=await D.getItem(H);if(m){const x=JSON.parse(m);const c=De(a,x);l(c);return}l(a)}catch(m){console.error("Failed to load dev tools settings:",m);l(a)}},[a]);I(()=>zt(m=>{if(m.includes(H))void u()}),[u]);I(()=>{u();const m=N.addListener(x=>{try{if(x){l(x)}}catch(c){}});return()=>{m()}},[u]);const p=W(()=>{u()},[u]);return{settings:f,refreshSettings:p}};const n=Xe.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:o.gutter,paddingRight:o.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:o.gutter,paddingTop:8,paddingBottom:24,gap:o.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:o.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:o.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:o.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:o.color.text,fontSize:o.font.row,fontWeight:"500"},rowCaption:{color:o.color.textTertiary,fontSize:o.font.label},settingRowBody:{paddingHorizontal:o.rowPadH,paddingBottom:o.rowPadV,gap:6},settingRowBodyText:{color:o.color.textSecondary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},settingRowBodyHint:{color:o.color.textTertiary,fontSize:o.font.caption,lineHeight:o.font.caption*1.45},bodyWarning:{color:o.color.warning},bodyDanger:{color:o.color.danger},cardButtonWrap:{paddingHorizontal:o.cardPad,paddingTop:10,paddingBottom:o.cardPad},storageExpanded:{paddingHorizontal:o.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:o.color.textSecondary,fontSize:o.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:o.color.textTertiary,fontSize:o.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:o.color.glassElevated,borderRadius:o.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:o.color.textSecondary,fontSize:o.font.micro,fontFamily:Ie},storageKeyEmpty:{color:o.color.textTertiary,fontSize:o.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:Ie,fontSize:o.font.label,color:o.color.textSecondary}});
@@ -1 +1 @@
1
- "use strict";import{FloatingToolHost as oe}from"@buoy-gg/shared-ui/floating";import{LicenseManager as ie,useLicense as se,sameLicenseKey as re}from"@buoy-gg/license";import{AccountSetup as ae,startSettingsSync as ce}from"@buoy-gg/shared-ui";import{useState as x,useMemo as b,useCallback as O,useEffect as r,useRef as le}from"react";import{useSettings as de,getToolLabel as C,getToolDescription as me,getToolColor as U}from"@buoy-gg/floating-tools-react";import{persistentStorage as u,devToolsStorageKeys as E,EnvironmentIndicator as ue,EnvironmentSelectorInline as pe}from"@buoy-gg/shared-ui";import{autoDiscoverWithCustom as fe,getToolsBySlot as N}from"../utils/autoDiscoverPresets.web.js";import{FloatingTools as ge,UserStatus as ye}from"./floatingTools.web.js";import{DialMenu as ve}from"./dial/DialDevTools.web.js";import{getRankedToolIds as he,recordToolUsage as Te}from"./dial/dialUsageStore.js";import{OnboardingTooltip as be}from"./dial/OnboardingTooltip.web.js";import{SettingsModal as Oe}from"./DevToolsSettingsModal.web.js";import{AppHostProvider as Se,AppOverlay as Ie,useAppHost as De}from"./AppHost.web.js";import{MinimizedToolsStack as we}from"./MinimizedToolsStack.web.js";import{createWebTools as Ce}from"../utils/createWebTools.js";import{BrowserToolRuntime as Ee}from"./BrowserToolRuntime.js";import{clearReleaseOptIn as _e,markReleaseOptIn as Me}from"../releaseOptIn.js";import{BuoySignIn as Pe}from"./BuoySignIn.web.js";import{DevToolsVisibilityProvider as ke,useDevToolsVisibility as xe}from"./DevToolsVisibilityContext.js";import{jsx as t,jsxs as Y}from"react/jsx-runtime";const Ae={};const G="@react_buoy_floating_menu_tooltip_shown";const Le=u;function Ke({size:o=14,color:d="#20C997"}){const s=Math.max(2,o/4);const p=Math.max(1,o/16);return t("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${s}px)`,gap:p,width:o,height:o,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((f,l)=>t("div",{style:{width:s,height:s,borderRadius:s/2,backgroundColor:d}},l))})}function Re(o){return t(ke,{children:t(Se,{children:t(je,{...o})})})}function je({environment:o,userRole:d,availableEnvironments:s,onEnvironmentSwitch:p,apps:f,modules:l=Ae,externalSync:m,requiredEnvVars:H,sentryGetClient:q,disableHints:_=false,headless:A=false}){const[a,S]=x(false);const[g,I]=x(false);const M=le(false);const y=De();const c=b(()=>fe([...Ce(l),...f??[]]),[f,l]);const D=xe();const L=y.openApps.some(e=>!e.minimized);r(()=>{D.setDialOpen(a)},[a,D.setDialOpen]);r(()=>{D.setToolOpen(L||g)},[L,g,D.setToolOpen]);const{registerApps:K}=y;r(()=>{K(c.map(e=>{const n=e.icon;return{...e,icon:typeof n==="function"?({size:i})=>n(i):n}}))},[K,c]);const $=b(()=>c.map(e=>({id:e.id,name:e.name,description:e.description,slot:e.slot})),[c]);const{settings:P}=de({availableTools:$,storage:Le});r(()=>{let e=false;const n=async()=>{const[i,T]=await Promise.all([u.getItem(E.dial.isOpen()),u.getItem(E.settings.modalOpen())]);if(e)return;if(i==="true")S(true);if(T==="true"){S(true);I(true)}M.current=true};void n();return()=>{e=true}},[]);r(()=>{if(!M.current)return;void u.setItem(E.dial.isOpen(),a?"true":"false")},[a]);r(()=>{if(!M.current)return;void u.setItem(E.settings.modalOpen(),g?"true":"false")},[g]);const k=O(e=>{void Te(e.id);if(e.launchMode==="toggle-only"){e.onPress?.();return}if(e.component){const n=typeof e.icon==="function"?e.icon(20):e.icon;y.open({id:e.id,title:e.name||C(e.id),component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:n,color:e.color||U(e.id)})}else{e.onPress?.()}},[y]);const w=b(()=>{const e=N(c,"dial");return e.map(n=>{const i=n.color||U(n.id);let T;if(typeof n.icon==="string"){T=n.icon}else if(typeof n.icon==="function"){T=n.icon(32)}else{T=null}return{id:n.id,name:n.name||C(n.id),icon:T,unavailable:!n.component&&!n.onPress,color:i,onPress:()=>{k(n);S(false)}}})},[c,k]);const J=b(()=>{if(!a)return w;const e=new Map(w.map(n=>[n.id,n]));return he(w.map(n=>n.id)).map(n=>e.get(n)).filter(n=>Boolean(n))},[a,w]);const Q=b(()=>N(c,"row").filter(e=>P.floatingTools[e.id]===true&&(e.component||e.onPress)),[c,P.floatingTools]);const X=b(()=>c.map(e=>({id:e.id,name:e.name||C(e.id),description:e.description||me(e.id),slot:e.slot,icon:e.icon,color:e.color})),[c]);const[Z,R]=x(false);const j=y.openApps.some(e=>!e.minimized);r(()=>{if(_)return;let e=false;const n=setTimeout(async()=>{const i=await u.getItem(G);if(!e&&!i)R(true)},1e3);return()=>{e=true;clearTimeout(n)}},[_]);const v=O(()=>{R(false);void u.setItem(G,"true")},[]);const B=O(()=>{v();S(true)},[v]);const ee=O(()=>{S(false);I(false)},[]);const ne=O(()=>{I(e=>!e)},[]);const te=O(()=>I(false),[]);const V=Boolean(s?.length&&p);const z=P.floatingTools.environment!==false;const h=Z&&!a&&!j;r(()=>{if(!h)return;const e=i=>{if(!(i.target instanceof Element)||!i.target.closest("[data-buoy-root]"))v()};const n=i=>{if(i.key==="Escape")v()};document.addEventListener("pointerdown",e,true);document.addEventListener("keydown",n);return()=>{document.removeEventListener("pointerdown",e,true);document.removeEventListener("keydown",n)}},[h,v]);const W=y.openApps.some(e=>e.minimized&&e.launchMode!=="toggle-only");const F=t(Ee,{modules:l,apps:f,requiredEnvVars:H,externalSync:m,headless:A,sentryGetClient:q});if(A)return F;return Y("div",{"data-buoy-root":"",style:{display:"contents"},children:[F,h&&t("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),Y(ge,{enablePositionPersistence:!h,pushToSide:a||j,suspendPointerEvents:a,centerOnboarding:h,minimizedStack:W?t(we,{}):void 0,hasMinimizedStack:W,children:[o&&z&&!V&&t(ue,{environment:o}),V&&z&&t(pe,{currentEnvironment:o??"local",availableEnvironments:s,onSelect:p}),d?t(ye,{userRole:d,onPress:B}):t("button",{"aria-label":"Open dev tools",onClick:B,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:t(Ke,{})}),Q.map(e=>t("button",{"aria-label":e.name||C(e.id),title:e.description,onClick:()=>k(e),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof e.icon==="function"?e.icon(16):e.icon},e.id))]}),h&&t(be,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:v}),a&&t(ve,{icons:J,onClose:ee,centerLabel:"BUOY",onCenterPress:ne,settingsOpen:g,hintsDisabled:_}),t(Oe,{visible:g,onClose:te,availableTools:X,onSettingsChange:e=>{}}),t(Ie,{}),t(oe,{})]})}export function FloatingDevTools(o){const{access:d,isPro:s,licenseKey:p}=se();r(()=>{void ie.configure(o.licenseKey)},[o.licenseKey]);const f=o.licenseKey===void 0||re(o.licenseKey,p);const l=typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production";const m=f&&d.status==="admitted";r(()=>{if(m)ce()},[m]);r(()=>{if(l||d.status==="initializing")return;if(s&&m)Me();else _e()},[l,s,m,d.status]);if(!l&&!s)return o.signIn&&!o.headless?t(Pe,{}):null;if(!m)return o.headless?null:t(ae,{});return t(Re,{...o})}
1
+ "use strict";import{FloatingToolHost as he}from"@buoy-gg/shared-ui/floating";import*as be from"@buoy-gg/license";import{LicenseManager as Oe,useLicense as Se,sameLicenseKey as Ce,resolveDevBuild as De,capacitorDebug as Ie,isCapacitorNative as Ee,loadCapacitorAppHost as we}from"@buoy-gg/license";import{AccountSetup as _e,HintsProvider as Me,normalizeEnvironment as Pe,registerToolOpener as ke,startSettingsSync as Ae}from"@buoy-gg/shared-ui";import{useState as W,useMemo as g,useCallback as C,useEffect as d,useRef as xe}from"react";import{useSettings as Re,getToolLabel as A,getToolDescription as Le,getToolColor as te}from"@buoy-gg/floating-tools-react";import{persistentStorage as v,devToolsStorageKeys as x,EnvironmentIndicator as je,EnvironmentSelectorInline as Be}from"@buoy-gg/shared-ui";import{autoDiscoverWithCustom as Fe,getToolsBySlot as oe}from"../utils/autoDiscoverPresets.web.js";import{FloatingTools as ze,UserStatus as Ve}from"./floatingTools.web.js";import{DialMenu as We}from"./dial/DialDevTools.web.js";import{getRankedToolIds as Ke,recordToolUsage as He}from"./dial/dialUsageStore.js";import{OnboardingTooltip as Ne}from"./dial/OnboardingTooltip.web.js";import{SettingsModal as Ue}from"./DevToolsSettingsModal.web.js";import{AppHostProvider as $e,AppOverlay as Ye,useAppHost as ie}from"./AppHost.web.js";import{MinimizedToolsStack as Ge}from"./MinimizedToolsStack.web.js";import{createWebTools as Qe}from"../utils/createWebTools.js";import{BrowserToolRuntime as Je}from"./BrowserToolRuntime.js";import{clearReleaseOptIn as Xe,markReleaseOptIn as Ze}from"../releaseOptIn.js";import{BuoySignIn as qe}from"./BuoySignIn.web.js";import{BuoySignIn as se}from"./BuoyCodeSignIn.js";import{DevToolsVisibilityProvider as en,useDevToolsVisibility as nn}from"./DevToolsVisibilityContext.js";import{createWebTool as K}from"../utils/createWebTool.js";import{DefaultConfigProvider as tn}from"./DefaultConfigContext.js";import{useDevToolsSettings as on}from"./DevToolsSettingsModal.shared.js";import{validateDialConfig as re}from"./defaultConfig.js";import{jsx as o,jsxs as E,Fragment as H}from"react/jsx-runtime";const ae={};const ce="@react_buoy_floating_menu_tooltip_shown";const sn=v;function rn({size:n=14,color:s="#20C997"}){const i=Math.max(2,n/4);const c=Math.max(1,n/16);return o("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${i}px)`,gap:c,width:n,height:n,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((a,r)=>o("div",{style:{width:i,height:i,borderRadius:i/2,backgroundColor:s}},r))})}function an(n){const{defaultFloatingTools:s,defaultDialTools:i,disableHints:c=false,children:a}=n;const r=g(()=>i?re(i):i,[i]);return o(tn,{defaultFloatingTools:s,defaultDialTools:r,children:o(Me,{disableHints:c,children:E(en,{children:[o($e,{children:o(mn,{...n})}),a]})})})}const cn=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function ln({modules:n=ae}){return o(H,{children:Object.entries(n).flatMap(([s,i])=>cn.map(c=>{const a=i[c];return a?o(a,{},`${s}:${c}`):null}))})}function dn(){const{openApps:n,restore:s}=ie();d(()=>ke(i=>{const c=n.find(a=>a.id===i);if(!c)return false;s(c.instanceId);return true}),[n,s]);return null}function un(){const n=Ie();const s=n===null?process.env.NODE_ENV:n?"development":"production";return Pe(s??"dev")}function fn(n,s,i,c){const a=D=>Object.entries(n).find(([_])=>_.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===D)?.[1];const r=[];const l=a("env");if(s?.length&&l?.createEnvTool&&l.createEnvVarConfig){r.push(K(l.createEnvTool({requiredEnvVars:l.createEnvVarConfig(s)})))}const f=a("storage");if(i?.length&&f?.createStorageTool){r.push(K(f.createStorageTool({requiredStorageKeys:i})))}const w=a("ask-buoy");if(c&&w?.createAskBuoyTool)r.push(K(w.createAskBuoyTool(c)));return r}function mn({environment:n,userRole:s="admin",availableEnvironments:i,onEnvironmentSwitch:c,apps:a,modules:r=ae,externalSync:l,requiredEnvVars:f,sentryGetClient:w,disableHints:D=false,headless:_=false,hidden:y=false,defaultFloatingTools:le,defaultDialTools:R,zustandStores:L,requiredStorageKeys:N,askBuoy:U}){const j=n??un();const de=g(()=>R?re(R):void 0,[R]);const[m,I]=W(false);const[T,M]=W(false);const B=xe(false);const h=ie();const $=g(()=>fn(r,f,N,U),[r,f,N,U]);const p=g(()=>Fe([...Qe(r),...a??[],...$]),[a,r,$]);const F=g(()=>Object.entries(r).find(([e])=>e.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[r]);d(()=>{if(!L||typeof F?.watchStores!=="function")return;const e=F.watchStores(L);return typeof e==="function"?e:void 0},[L,F]);const P=nn();const Y=h.openApps.some(e=>!e.minimized);d(()=>{P.setDialOpen(m)},[m,P.setDialOpen]);d(()=>{P.setToolOpen(Y||T)},[Y,T,P.setToolOpen]);const{registerApps:G}=h;d(()=>{G(p.map(e=>{const t=e.icon;return{...e,icon:typeof t==="function"?({size:u})=>t(u):t}}))},[G,p]);const ue=g(()=>p.map(e=>({id:e.id,name:e.name,description:e.description,slot:e.slot})),[p]);Re({availableTools:ue,storage:sn});d(()=>{let e=false;const t=async()=>{const[u,S]=await Promise.all([v.getItem(x.dial.isOpen()),v.getItem(x.settings.modalOpen())]);if(e)return;if(u==="true")I(true);if(S==="true"){I(true);M(true)}B.current=true};void t();return()=>{e=true}},[]);d(()=>{if(!B.current)return;void v.setItem(x.dial.isOpen(),m?"true":"false")},[m]);d(()=>{if(!B.current)return;void v.setItem(x.settings.modalOpen(),T?"true":"false")},[T]);const z=C(e=>{void He(e.id);if(e.launchMode==="toggle-only"){e.onPress?.();return}if(e.component){const t=typeof e.icon==="function"?e.icon(20):e.icon;h.open({id:e.id,title:e.name||A(e.id),component:e.component,props:e.props,modal:e.modal,launchMode:e.launchMode||"self-modal",singleton:e.singleton??true,icon:t,color:e.color||te(e.id)})}else{e.onPress?.()}},[h]);const k=g(()=>{const e=oe(p,"dial");return e.map(t=>{const u=t.color||te(t.id);let S;if(typeof t.icon==="string"){S=t.icon}else if(typeof t.icon==="function"){S=t.icon(32)}else{S=null}return{id:t.id,name:t.name||A(t.id),icon:S,unavailable:!t.component&&!t.onPress,color:u,onPress:()=>{z(t);I(false)}}})},[p,z]);const fe=g(()=>{if(!m)return k;const e=new Map(k.map(t=>[t.id,t]));return Ke(k.map(t=>t.id)).map(t=>e.get(t)).filter(t=>Boolean(t))},[m,k]);const{settings:V}=on();const me=g(()=>oe(p,"row").filter(e=>(V.floatingTools[e.id]??false)===true&&(e.component||e.onPress)),[p,V.floatingTools]);const pe=g(()=>p.map(e=>({id:e.id,name:e.name||A(e.id),description:e.description||Le(e.id),slot:e.slot,icon:e.icon,color:e.color})),[p]);const[ge,Q]=W(false);const J=h.openApps.some(e=>!e.minimized);d(()=>{if(D)return;let e=false;const t=setTimeout(async()=>{const u=await v.getItem(ce);if(!e&&!u)Q(true)},1e3);return()=>{e=true;clearTimeout(t)}},[D]);const b=C(()=>{Q(false);void v.setItem(ce,"true")},[]);const X=C(()=>{b();I(true)},[b]);const ve=C(()=>{I(false);M(false)},[]);const ye=C(()=>{M(e=>!e)},[]);const Te=C(()=>M(false),[]);const Z=Boolean(i?.length&&c);const q=V.floatingTools.environment!==false;const O=ge&&!m&&!J&&!y;d(()=>{if(!O)return;const e=u=>{if(!(u.target instanceof Element)||!u.target.closest("[data-buoy-root]"))b()};const t=u=>{if(u.key==="Escape")b()};document.addEventListener("pointerdown",e,true);document.addEventListener("keydown",t);return()=>{document.removeEventListener("pointerdown",e,true);document.removeEventListener("keydown",t)}},[O,b]);const ee=h.openApps.some(e=>e.minimized&&e.launchMode!=="toggle-only");const ne=o(Je,{modules:r,apps:a,requiredEnvVars:f,externalSync:l,headless:_,sentryGetClient:w});if(_)return ne;return E("div",{"data-buoy-root":"",style:{display:"contents"},children:[ne,o(dn,{}),O&&o("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),o("div",{style:y?{visibility:"hidden"}:{display:"contents"},"aria-hidden":y||void 0,children:E(ze,{enablePositionPersistence:!O,pushToSide:m||J,suspendPointerEvents:m,centerOnboarding:O,minimizedStack:ee?o(Ge,{}):void 0,hasMinimizedStack:ee,children:[j&&q&&!Z&&o(je,{environment:j}),Z&&q&&o(Be,{currentEnvironment:j??"local",availableEnvironments:i,onSelect:c}),s?o(Ve,{userRole:s,onPress:X}):o("button",{"aria-label":"Open dev tools",onClick:X,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:o(rn,{})}),me.map(e=>o("button",{"aria-label":e.name||A(e.id),title:e.description,onClick:()=>z(e),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof e.icon==="function"?e.icon(16):e.icon},e.id))]})}),O&&o(Ne,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:b}),m&&!y&&o(We,{icons:fe,onClose:ve,centerLabel:"BUOY",onCenterPress:ye,settingsOpen:T,hintsDisabled:D}),T&&!y&&o(Ue,{visible:true,onClose:Te,availableTools:pe,defaultFloatingTools:le,defaultDialTools:de,onSettingsChange:e=>{}}),!y&&E(H,{children:[o(Ye,{}),o(he,{})]})]})}function pn(n){const s=n&&typeof n==="object"?n.appId:void 0;const i=!!n;d(()=>{if(!i)return;let c=false;const a=be.SessionManager;if(!a)return;const r=l=>{if(c||!l)return;a.configure({audience:`app:${l}`});void a.load().catch(()=>{})};if(s)r(s);else void we().then(l=>r(l?.bundleId)).catch(()=>{});return()=>{c=true}},[i,s])}export function FloatingDevTools(n){const{access:s,isPro:i,licenseKey:c}=Se();d(()=>{void Oe.configure(n.licenseKey)},[n.licenseKey]);const a=n.licenseKey===void 0||Ce(n.licenseKey,c);const r=De(typeof __DEV__!=="undefined"?__DEV__:process.env.NODE_ENV!=="production");const l=a&&s.status==="admitted";d(()=>{if(l)Ae()},[l]);d(()=>{if(r||s.status==="initializing")return;if(i&&l)Ze();else Xe()},[r,i,l,s.status]);const f=Ee();pn(f?n.signIn:void 0);if(!r&&!i){if(!n.signIn||n.headless)return null;return f?o(se,{needsPlan:true}):o(qe,{})}if(!l){return E(H,{children:[s.status==="initializing"&&o(ln,{modules:n.modules}),n.headless?null:n.signIn&&f?o(se,{}):o(_e,{})]})}return o(an,{...n})}
@@ -1 +1 @@
1
- "use strict";import{useCallback as M,useEffect as m,useRef as N,useState as I,useSyncExternalStore as k}from"react";import{persistentStorage as C,getToolAttention as y,subscribeToolAttention as v}from"@buoy-gg/shared-ui";function G(e){return k(v,()=>y(e),()=>y(e))}const A={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"};const _={needsInput:3,failed:2,done:1};const E=new Map;function S(e){let n=null;for(const i of e?e.split("|"):[]){const o=y(i);if(o&&(!n||_[o.kind]>_[n.kind]))n=o}const r=E.get(e);if(r&&n&&r.kind===n.kind&&r.label===n.label)return r;if(!r&&!n)return null;E.set(e,n);return n}function H(e){const n=e.join("|");return k(v,()=>S(n),()=>S(n))}import{useAppHost as X}from"./AppHost.web.js";import{jsx as s,jsxs as h}from"react/jsx-runtime";const R=28;const x=32;const T=6;const L=8;const w=24;const z="@react_buoy_minimized_stack_expanded";const $=80;const O=2e3;const B=6e3;const P="#1A1A1A";const u="#888888";function j({down:e=false}){return s("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:s("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:u,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W({id:e,title:n,icon:r,index:i,onPress:o}){const a=G(e);const d=N(null);m(()=>{let f=true;let l;const g=()=>{d.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:$,easing:"linear"})};const c=p=>{const t=p?500+Math.random()*1500+i*200:O+Math.random()*(B-O)+i*300;l=setTimeout(()=>{if(!f)return;g();c(false)},t)};c(true);return()=>{f=false;clearTimeout(l)}},[i]);return h("button",{type:"button","aria-label":a?`${n} \u2014 ${a.label}. Restore`:`Restore ${n}`,onClick:o,style:{width:x,height:x,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[s("div",{ref:d,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:r}),a?s("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:A[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]})}export function MinimizedToolsStack({containerWidth:e=32}){const{openApps:n,restore:r}=X();const i=n.filter(t=>t.minimized&&t.launchMode!=="toggle-only");const[o,a]=I(false);const[d,f]=I(false);const l=H(i.map(t=>t.id));m(()=>{let t=false;const b=async()=>{const D=await C.getItem(z);if(!t&&D==="true")a(true);if(!t)f(true)};void b();return()=>{t=true}},[]);m(()=>{if(!d)return;void C.setItem(z,o?"true":"false")},[o,d]);const g=M(t=>{r(t)},[r]);if(i.length===0)return null;const c=L+i.length*x+(i.length-1)*T+T+w+4;const p={backgroundColor:P,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${u}66`,borderLeft:`1px solid ${u}66`,borderRight:`1px solid ${u}66`,borderBottom:"none",boxSizing:"border-box"};return h("div",{style:{height:R,overflow:"visible",position:"relative"},children:[s("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:o?"visible":"hidden",height:o?c:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...p},children:h("div",{style:{height:c,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:L,gap:T,boxSizing:"border-box"},children:[[...i].reverse().map((t,b)=>s(W,{id:t.id,title:t.title||t.id,icon:t.icon??s("span",{style:{color:"#fff",fontSize:13},children:(t.title||t.id).slice(0,1).toUpperCase()}),index:b,onPress:()=>g(t.instanceId)},t.instanceId)),s("button",{type:"button","aria-label":"Collapse",onClick:()=>a(false),style:{width:"100%",height:w,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:s(j,{down:true})})]})}),h("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:R,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",...p},children:[s(j,{}),l?s("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:A[l.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:l.kind==="needsInput"?"!":""}):null,i.length>1&&s("span",{style:{fontSize:9,fontWeight:600,color:u,marginLeft:1},children:i.length})]})]})}
1
+ "use strict";import{useCallback as M,useEffect as m,useRef as N,useState as T,useSyncExternalStore as I}from"react";import{persistentStorage as C,getToolAttention as y,subscribeToolAttention as v}from"@buoy-gg/shared-ui";function G(e){return I(v,()=>y(e),()=>y(e))}const A={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"};const _={needsInput:3,failed:2,done:1};const E=new Map;function S(e){let o=null;for(const i of e?e.split("|"):[]){const n=y(i);if(n&&(!o||_[n.kind]>_[o.kind]))o=n}const r=E.get(e);if(r&&o&&r.kind===o.kind&&r.label===o.label)return r;if(!r&&!o)return null;E.set(e,o);return o}function H(e){const o=e.join("|");return I(v,()=>S(o),()=>S(o))}import{useAppHost as X}from"./AppHost.web.js";import{jsx as s,jsxs as h}from"react/jsx-runtime";const R=28;const x=32;const k=6;const L=8;const w=24;const z="@react_buoy_minimized_stack_expanded";const $=80;const O=2e3;const B=6e3;const P="#1A1A1A";const u="#888888";function j({down:e=false}){return s("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:s("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:u,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W({id:e,title:o,icon:r,index:i,onPress:n}){const a=G(e);const d=N(null);m(()=>{let f=true;let l;const b=()=>{d.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:$,easing:"linear"})};const c=p=>{const t=p?500+Math.random()*1500+i*200:O+Math.random()*(B-O)+i*300;l=setTimeout(()=>{if(!f)return;b();c(false)},t)};c(true);return()=>{f=false;clearTimeout(l)}},[i]);return h("button",{type:"button","aria-label":a?`${o} \u2014 ${a.label}. Restore`:`Restore ${o}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:x,height:x,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[s("div",{ref:d,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:r}),a?s("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:A[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]})}export function MinimizedToolsStack({containerWidth:e=32}){const{openApps:o,restore:r}=X();const i=o.filter(t=>t.minimized&&t.launchMode!=="toggle-only");const[n,a]=T(false);const[d,f]=T(false);const l=H(i.map(t=>t.id));m(()=>{let t=false;const g=async()=>{const D=await C.getItem(z);if(!t&&D==="true")a(true);if(!t)f(true)};void g();return()=>{t=true}},[]);m(()=>{if(!d)return;void C.setItem(z,n?"true":"false")},[n,d]);const b=M(t=>{r(t)},[r]);if(i.length===0)return null;const c=L+i.length*x+(i.length-1)*k+k+w+4;const p={backgroundColor:P,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${u}66`,borderLeft:`1px solid ${u}66`,borderRight:`1px solid ${u}66`,borderBottom:"none",boxSizing:"border-box"};return h("div",{style:{height:R,overflow:"visible",position:"relative"},children:[s("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:n?"visible":"hidden",height:n?c:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...p},children:h("div",{style:{height:c,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:L,gap:k,boxSizing:"border-box"},children:[n&&[...i].reverse().map((t,g)=>s(W,{id:t.id,title:t.title||t.id,icon:t.icon??s("span",{style:{color:"#fff",fontSize:13},children:(t.title||t.id).slice(0,1).toUpperCase()}),index:g,onPress:()=>b(t.instanceId)},t.instanceId)),s("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>a(false),style:{width:"100%",height:w,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:s(j,{down:true})})]})}),h("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:R,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...p},children:[s(j,{}),l?s("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:A[l.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:l.kind==="needsInput"?"!":""}):null,i.length>1&&s("span",{style:{fontSize:9,fontWeight:600,color:u,marginLeft:1},children:i.length})]})]})}
@@ -0,0 +1 @@
1
+ "use strict";import{useEffect as s,useRef as l}from"react";import{capacitorPlatform as f,capacitorPlugin as _}from"@buoy-gg/license";export function isBuoyHoldingBackButton(){return globalThis.__BUOY_HOLDS_BACK__===true}export const BUOY_BACK_PRIORITY=99.5;export function ionicHandlesBack(){if(typeof document==="undefined")return false;const e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}export function useCapacitorBackButton(e,u){const n=l(u);n.current=u;s(()=>{if(!e||f()!=="android")return;const o=globalThis;o.__BUOY_HOLDS_BACK__=true;let i;if(ionicHandlesBack()){const t=r=>{r.detail?.register?.(BUOY_BACK_PRIORITY,()=>{n.current()})};document.addEventListener("ionBackButton",t);i=()=>document.removeEventListener("ionBackButton",t)}else{const t=_("App");if(!t?.addListener){o.__BUOY_HOLDS_BACK__=false;return}let r=false;let c=null;void Promise.resolve(t.addListener("backButton",()=>n.current())).then(a=>{if(r)void a.remove();else c=a}).catch(()=>{});i=()=>{r=true;if(c)void c.remove()}}return()=>{i();o.__BUOY_HOLDS_BACK__=false}},[e])}
@@ -0,0 +1 @@
1
+ "use strict";import{useEffect as g,useState as A}from"react";import{capacitorPlatform as y,capacitorPlugin as a,isCapacitorNative as w}from"@buoy-gg/license";export function hardwareFromUserAgent(t,e){if(e==="ios"){if(/iPad/.test(t))return"iPad";if(/iPhone/.test(t))return"iPhone";return null}const n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(t);const r=n?.[1]?.trim();if(!r||r==="K")return null;return r}export function isAndroidEmulatorUserAgent(t){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(t)}function l(){return typeof navigator==="undefined"?"":navigator.userAgent??""}function c(){if(typeof document==="undefined")return null;return document.title||(typeof location==="undefined"?null:location.hostname)||null}export const CAPACITOR_APP_NAME_KEY="@react_buoy_capacitor_app_name";export function persistedAppName(t){try{const e=globalThis.localStorage;if(!e)return t;const n=e.getItem(CAPACITOR_APP_NAME_KEY);if(n)return n;if(t)e.setItem(CAPACITOR_APP_NAME_KEY,t)}catch{}return t}export function initialHostInfo(){const t=y();if(!t){return{platform:"web",appName:c(),hardwareName:"Browser",ready:true}}const e=Boolean(a("App"));return{platform:t,appName:e?c():persistedAppName(c()),hardwareName:hardwareFromUserAgent(l(),t)??t,extraDeviceInfo:{runtime:"capacitor"},ready:!e&&!a("Device")}}export function useHostInfo(){const[t,e]=A(initialHostInfo);g(()=>{if(!w())return;let n=false;const r=a("App");const o=a("Device");void Promise.all([r?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([i,u])=>{if(n)return;const m=i?.name?.trim();const h=u?.name?.trim()||u?.model?.trim();e(s=>({...s,appName:m||s.appName,hardwareName:h||s.hardwareName,ready:true}))});return()=>{n=true}},[]);return t}function d(){if(typeof location==="undefined")return null;const t=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:l(),serverUrl:typeof t==="string"?t:null}}function f(t){if(!t)return null;try{const e=new URL(t);return`${e.protocol}//${e.host}`}catch{return null}}export function isBundledPage(t,e){if(t==="ios"){const n=f(e.serverUrl);return n?n===f(e.origin):e.protocol==="capacitor:"}return p.has(e.hostname)}const p=new Set(["localhost","127.0.0.1","[::1]","::1"]);export function capacitorBrokerURL(t,e,n,r=d()){if(n==="web"||!r)return t;let o;try{o=new URL(t)}catch{return t}const i=isBundledPage(n,r);if(!e&&i&&o.hostname===r.hostname)o.hostname="localhost";if(n==="android"&&p.has(o.hostname)&&isAndroidEmulatorUserAgent(r.userAgent)){o.hostname="10.0.2.2"}return o.toString().replace(/\/$/,"")}export function capacitorTransportProblem(t,e,n=d()){if(e!=="android"||!n||n.protocol!=="https:")return null;if(!/^(http|ws):/i.test(t))return null;return`[Buoy] Can't reach Buoy Desktop at ${t}. This Android WebView serves the app from https://${n.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}
@@ -1 +1 @@
1
- "use strict";import{useEffect as f,useMemo as I,useState as m}from"react";import{Platform as u}from"react-native";import{devToolsStorageKeys as p,persistentStorage as g}from"@buoy-gg/shared-ui";export const INSTALL_ID_LENGTH=8;export function generateInstallId(){let e="";while(e.length<INSTALL_ID_LENGTH){e+=(Math.random()*16|0).toString(16)}return e}function h(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}export function buildDeviceIdentity({appName:e,hardwareName:n,platform:t,installId:r,deviceId:o}){const s=h(e??"buoy")||"buoy";const a=e??"Buoy Device";const l=n?.trim()||t;if(o){return{deviceId:o,deviceName:`${a} (${l})`}}const i=`${s}-${t}-${r}`;return{deviceId:i,deviceName:`${a} (${l} \xB7 ${r.slice(-4)})`}}function y(){const e=globalThis;try{return e.sessionStorage??null}catch{return null}}export async function loadInstallId({platform:e=u.OS,store:n,mint:t=generateInstallId}={}){const r=p.sync.deviceId();const o=n===void 0?e==="web"?y():g:n;if(!o)return t();try{const s=await o.getItem(r);if(s&&s.length>0)return s;const a=t();await o.setItem(r,a);return a}catch{return t()}}let c=null;export function getInstallId(){if(!c)c=loadInstallId();return c}export function resetInstallIdForTests(){c=null}export function useDeviceIdentity(e,n){const t=e?.deviceId;const r=e?.deviceName;const o=n.loadId??getInstallId;const s=n.platform??u.OS;const[a,l]=m(null);f(()=>{if(t)return;let i=false;o().then(d=>{if(!i)l(d)});return()=>{i=true}},[t,o]);return I(()=>{if(!t&&!a)return null;const i=buildDeviceIdentity({appName:n.appName,hardwareName:n.hardwareName,platform:s,installId:a??"",deviceId:t});return r?{...i,deviceName:r}:i},[t,r,a,n.appName,n.hardwareName,s])}
1
+ "use strict";import{useEffect as f,useMemo as m,useState as I}from"react";import{Platform as u}from"react-native";import{devToolsStorageKeys as p,persistentStorage as g}from"@buoy-gg/shared-ui";import{isCapacitorNative as h}from"@buoy-gg/license";export const INSTALL_ID_LENGTH=8;export function generateInstallId(){let e="";while(e.length<INSTALL_ID_LENGTH){e+=(Math.random()*16|0).toString(16)}return e}function y(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}export function buildDeviceIdentity({appName:e,hardwareName:r,platform:t,installId:n,deviceId:o}){const l=y(e??"buoy")||"buoy";const a=e??"Buoy Device";const s=r?.trim()||t;if(o){return{deviceId:o,deviceName:`${a} (${s})`}}const i=`${l}-${t}-${n}`;return{deviceId:i,deviceName:`${a} (${s} \xB7 ${n.slice(-4)})`}}function N(){const e=globalThis;try{return e.sessionStorage??null}catch{return null}}function S(){const e=globalThis;try{return e.localStorage??null}catch{return null}}export async function loadInstallId({platform:e=u.OS,store:r,mint:t=generateInstallId}={}){const n=p.sync.deviceId();const o=r===void 0?h()?S():e==="web"?N():g:r;if(!o)return t();try{const l=await o.getItem(n);if(l&&l.length>0)return l;const a=t();await o.setItem(n,a);return a}catch{return t()}}let c=null;export function getInstallId(){if(!c)c=loadInstallId();return c}export function resetInstallIdForTests(){c=null}export function useDeviceIdentity(e,r){const t=e?.deviceId;const n=e?.deviceName;const o=r.loadId??getInstallId;const l=r.platform??u.OS;const[a,s]=I(null);f(()=>{if(t)return;let i=false;o().then(d=>{if(!i)s(d)});return()=>{i=true}},[t,o]);return m(()=>{if(!t&&!a)return null;const i=buildDeviceIdentity({appName:r.appName,hardwareName:r.hardwareName,platform:l,installId:a??"",deviceId:t});return n?{...i,deviceName:n}:i},[t,n,a,r.appName,r.hardwareName,l])}
@@ -1 +1 @@
1
- "use strict";import{useState as u,useEffect as P,useMemo as Z,useRef as J,useCallback as Q}from"react";import{getDialLayout as Pe,getAllIconPositions as $e,getGridLineRotations as Le,getIconStaggerInputRange as Fe,MAX_DIAL_SLOTS as U,DIAL_ICON_SIZE as We,dialAnimationConfig as ge,getDialCSSKeyframesString as Ge,getDialCSSAnimationStyles as He,dialColors as o,dialStyles as e,withAlpha as he,floatingToolsColors as _e}from"@buoy-gg/floating-tools-react";import{persistentStorage as ye,monoFont as be,ToolBackground as je,useToolBackground as Oe}from"@buoy-gg/shared-ui";import{DialHyperspace as qe}from"./DialHyperspace.js";import{OnboardingTooltip as Ue}from"./OnboardingTooltip.web.js";import{jsx as n,Fragment as Ke,jsxs as B}from"react/jsx-runtime";const Ne={x:.5,y:.5};const Se="@react_buoy_settings_tooltip_shown";let xe=false;function Ve(){if(xe||typeof document==="undefined")return;const r=document.createElement("style");r.textContent=Ge();document.head.appendChild(r);xe=true}const G=r=>1-Math.pow(1-r,3);const le=r=>r*r*r;function Xe({icon:r,index:p,totalIcons:R,position:y,progress:l,onPress:x}){const[M,$]=u(false);const[D,I]=u(false);const w=!r.icon&&r.id.startsWith("empty-");const K=!w&&r.unavailable===true;const C=!w&&!K;const{icons:N}=ge;const b=Fe(p,R);let m=0;if(l<=b[1]){m=0}else if(l<=b[2]){m=(l-b[1])/(b[2]-b[1])}else{m=1}m=Math.max(0,Math.min(1,m));const v=We;const ee=N.pressIn.scale;const H=1.1;const V=m*(D?ee:M?H:1);let A=0;if(m<=0){A=0}else if(m<=.3){A=m}else{A=.3+(m-.3)*(.7/.7)}const te=y.x*m;const ne=y.y*m;return n("button",{role:"menuitem","aria-label":w?"Empty slot":r.name,"aria-disabled":!C,tabIndex:C?0:-1,onClick:C?x:void 0,onMouseEnter:()=>C&&$(true),onMouseLeave:()=>{$(false);I(false)},onMouseDown:()=>C&&I(true),onMouseUp:()=>I(false),style:{position:"absolute",left:"50%",top:"50%",width:v,height:v,marginLeft:-v/2,marginTop:-v/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:C?"pointer":"default",transform:`translate(${te}px, ${ne}px) scale(${V})`,opacity:A,transition:M||D?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:w?n("div",{style:{width:e.emptySlot.dotSize,height:e.emptySlot.dotSize,borderRadius:e.emptySlot.dotSize/2,backgroundColor:o.emptyDotBackground,border:`${e.emptySlot.borderWidth}px solid ${o.emptyDotBorder}`}}):B(Ke,{children:[n("div",{style:{position:"absolute",width:`${e.icon.gradientBgSizePercent}%`,height:`${e.icon.gradientBgSizePercent}%`,borderRadius:e.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:e.icon.gradientBgOpacity}}),n("div",{style:{position:"absolute",width:`${e.icon.innerGlowSizePercent}%`,height:`${e.icon.innerGlowSizePercent}%`,borderRadius:e.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:e.icon.innerGlowOpacity}}),n("div",{style:{marginBottom:e.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:M?"brightness(1.2)":"none"},children:r.icon}),n("span",{style:{fontSize:r.name.length>8?Math.max(e.icon.label.fontSize*.7,e.icon.label.fontSize*8/r.name.length):e.icon.label.fontSize,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,color:o.iconLabel,letterSpacing:e.icon.label.letterSpacing,marginTop:e.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:r.name}),K&&n("span",{style:{fontSize:e.icon.label.fontSize-1,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,letterSpacing:e.icon.label.letterSpacing,color:_e.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function we({side:r,color:p}){const R=r==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]];return n("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:R.map(([y,l,x,M],$)=>n("line",{x1:y,y1:l,x2:x,y2:M,stroke:p,strokeWidth:2},$))})}function Ce({side:r,disabled:p,onClick:R}){const[y,l]=u(false);const x=p?o.emptyDotBorder:o.accent;return B("button",{type:"button","aria-label":`${r==="prev"?"Previous":"Next"} dial page`,disabled:p,onClick:R,onMouseDown:()=>!p&&l(true),onMouseUp:()=>l(false),onMouseLeave:()=>l(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${o.dialBorder}`,backgroundColor:o.dialBackground,color:p?o.iconLabelMuted:o.centerText,fontSize:12,fontWeight:900,fontFamily:be,letterSpacing:1.5,textTransform:"uppercase",cursor:p?"default":"pointer",opacity:p?.4:1,boxShadow:p?"none":`0 0 8px ${he(o.dialShadow,.4)}`,transform:y?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[r==="prev"&&n(we,{side:"prev",color:x}),r==="prev"?"PREV":"NEXT",r==="next"&&n(we,{side:"next",color:x})]})}export function DialMenu({icons:r,onClose:p,centerLabel:R="MENU",onCenterPress:y,settingsOpen:l=false,hintsDisabled:x=false}){const{id:M}=Oe();const[$,D]=u(0);const[I,w]=u(0);const[K,C]=u(0);const[N,b]=u(0);const[m,v]=u(0);const[ee,H]=u(1);const[V,A]=u(false);const[te,ne]=u(false);const[ve,ke]=u(false);const oe=J(null);const de=J(null);const S=J(null);const X=J(false);const{entrance:_,exit:j,interaction:O}=ge;const ze=He();const[ie,Be]=u(()=>({width:window.innerWidth,height:window.innerHeight}));P(()=>{const i=()=>Be({width:window.innerWidth,height:window.innerHeight});window.addEventListener("resize",i);return()=>window.removeEventListener("resize",i)},[]);const s=Z(()=>Pe({screenWidth:ie.width,maxCircleSize:Math.max(120,Math.min(320,ie.height-96))}),[ie]);const Me=Z(()=>Le(),[]);const Ie=Z(()=>$e(U,s.iconRadius),[s.iconRadius]);const[Te,Re]=u(0);const L=Math.max(1,Math.ceil(r.length/U));const k=Math.min(Te,L-1);const ue=Z(()=>{const i=k*U;const t=[...r.slice(i,i+U)];while(t.length<U){t.push({id:`empty-${t.length}`,name:"",icon:null,onPress:()=>{}})}return t},[r,k]);P(()=>{Ve()},[]);P(()=>{const i=_.backdrop.duration;const t=_.dial.rotation.duration;const f=_.centerButton.delay;const c=_.icons.delay;const d=_.icons.duration;const g=performance.now();const h=T=>{const a=T-g;D(Math.min(1,a/i));const z=Math.min(1,a/400);let F=G(z)*1.1;if(z>.7){F-=(z-.7)*.33}if(z>=1)F=1;w(Math.max(0,Math.min(1.05,F)));const E=Math.min(1,a/t);C(G(E)*360);if(a>=f){const W=Math.min(1,(a-f)/300);let ce=G(W)*1.15;if(W>.6){ce-=(W-.6)*.375}if(W>=1)ce=1;b(Math.max(0,Math.min(1.05,ce)))}if(a>=c){const W=Math.min(1,(a-c)/d);v(G(W))}const se=c+d;if(a<se){S.current=requestAnimationFrame(h)}else{D(1);w(1);C(360);b(1);v(1);ke(true)}};S.current=requestAnimationFrame(h);return()=>{if(S.current)cancelAnimationFrame(S.current)}},[]);const q=Q(()=>{if(X.current)return;X.current=true;ne(true);if(S.current){cancelAnimationFrame(S.current)}const i=performance.now();const t=j.icons.duration;const f=j.centerButton.duration;const c=j.dialScale.duration;const d=Math.max(f,c);const g=j.backdrop.duration;const h=T=>{const a=T-i;if(a<t){const E=le(a/t);v(1-E);S.current=requestAnimationFrame(h);return}const z=t;if(a<z+d){v(0);const E=Math.min(1,(a-z)/f);const se=Math.min(1,(a-z)/c);b(1-le(E));w(1-le(se));S.current=requestAnimationFrame(h);return}const F=z+d;if(a<F+g){w(0);b(0);const E=(a-F)/g;D(1-E);S.current=requestAnimationFrame(h);return}D(0);p()};S.current=requestAnimationFrame(h)},[j,p]);P(()=>{const i=document.activeElement;const t=oe.current;return()=>{if(i?.isConnected&&(document.activeElement===document.body||t?.contains(document.activeElement))){i.focus()}}},[]);P(()=>{if(l)return;de.current?.focus();const i=t=>{const f=oe.current;if(!f)return;if(t.key==="Escape"){t.preventDefault();q()}else if(t.key==="Tab"){const c=Array.from(f.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(h=>h.getClientRects().length>0);const d=c[0];const g=c[c.length-1];if(!f.contains(document.activeElement)||(t.shiftKey?document.activeElement===d:document.activeElement===g)){t.preventDefault();(t.shiftKey?g:d)?.focus()}}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(t.key)){const c=Array.from(f.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));const d=c.indexOf(document.activeElement);if(d<0||!c.length)return;t.preventDefault();const g=t.key==="Home"?0:t.key==="End"?c.length-1:(d+(t.key==="ArrowRight"||t.key==="ArrowDown"?1:-1)+c.length)%c.length;c[g].focus()}};document.addEventListener("keydown",i);return()=>document.removeEventListener("keydown",i)},[q,l]);const[re,pe]=u(false);P(()=>{if(x)return;let i=false;const t=setTimeout(async()=>{const f=await ye.getItem(Se);if(!i&&!f)pe(true)},1200);return()=>{i=true;clearTimeout(t)}},[x]);const ae=Q(()=>{pe(false);void ye.setItem(Se,"true")},[]);P(()=>{if(l&&re){ae()}},[l,re,ae]);const De=Q(i=>{if(i.id.startsWith("empty-")||X.current)return;const[t,f]=O.iconSelect.pulse;const c=performance.now();const d=150;const g=h=>{const T=h-c;if(T<d){const a=G(T/d);H(1-(1-t.scale)*a);requestAnimationFrame(g)}else if(T<d*2){const a=G((T-d)/d);H(t.scale+(f.scale-t.scale)*a);requestAnimationFrame(g)}else{H(1)}};requestAnimationFrame(g);setTimeout(()=>{i.onPress();q()},O.iconSelect.actionDelay)},[O.iconSelect,q]);const me=Q(i=>{if(X.current)return;const t=Math.max(0,Math.min(i,L-1));if(t!==k)Re(t)},[L,k]);const Y=s.buttonSize*e.centerButton.containerRatio;const fe=s.buttonSize*e.centerButton.borderRatio;const Ae=s.buttonSize*e.centerButton.containerRatio/2+6;const Ee=ve&&!te;return B("div",{ref:oe,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[n("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:q,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:o.dialBackdrop,opacity:$}}),B("div",{style:{position:"absolute",left:"50%",marginLeft:-s.circleSize/2,bottom:80,width:s.circleSize,height:s.circleSize,borderRadius:"50%",backgroundColor:o.dialBackground,border:`${e.circle.borderWidth}px solid ${o.dialBorder}`,boxShadow:`0 0 ${e.circle.shadowRadius}px ${he(o.dialShadow,e.circle.shadowOpacity)}`,transform:`scale(${I}) rotate(${K}deg)`,opacity:I>.01?1:0,overflow:"hidden"},children:[n("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:o.dialGradient1,opacity:e.gradientLayers[0].opacity}}),n("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:o.dialGradient2,opacity:e.gradientLayers[1].opacity}}),n("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:o.dialGradient3,opacity:e.gradientLayers[2].opacity}}),Me.map(i=>n("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:e.grid.lineHeight,transform:`rotate(${i}deg)`,transformOrigin:"center"},children:["left","right"].map(t=>n("div",{style:{position:"absolute",top:0,[t]:0,width:`calc(50% - ${Ae}px)`,height:e.grid.lineHeight,backgroundColor:o.dialGridLine}},t))},i)),n("div",{"data-testid":"dial-background","data-background":M,style:{position:"absolute",inset:0,pointerEvents:"none"},children:M==="hyperspace"?n(qe,{size:s.circleSize}):n(je,{focus:Ne})}),ue.map((i,t)=>n(Xe,{icon:i,index:t,totalIcons:ue.length,position:Ie[t],progress:m,onPress:()=>De(i)},t)),B("div",{style:{position:"absolute",left:"50%",top:"50%",width:Y,height:Y,marginLeft:-Y/2,marginTop:-Y/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:o.hubHalo,borderRadius:s.buttonSize,overflow:"hidden",transform:`scale(${N*ee})`,opacity:N>.01?1:0},children:[n("div",{style:{position:"absolute",inset:0,backgroundColor:o.dialGradient1,opacity:.5,borderRadius:s.buttonSize}}),n("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:o.dialGradient2,opacity:.3,borderRadius:s.buttonSize}}),n("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:o.dialGradient3,opacity:.2,borderRadius:s.buttonSize}}),n("div",{style:{width:fe,height:fe,borderRadius:s.buttonSize*e.centerButton.borderRadiusRatio,backgroundColor:o.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:n("button",{ref:de,type:"button","aria-label":l?"Close settings":"Open settings",disabled:!y,onClick:y,onMouseEnter:()=>A(true),onMouseLeave:()=>A(false),style:{border:0,padding:0,background:"transparent",width:s.buttonSize,height:s.buttonSize,borderRadius:s.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:y?"pointer":"default",transform:V?`scale(${O.centerHover.scale})`:"scale(1)",transition:`transform ${O.centerHover.duration}ms ease`,animation:Ee&&!V?ze.pulse:"none"},children:l?B("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:e.centerButton.text.fontSize-2,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:o.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${o.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[n("span",{style:{marginBottom:-2},children:"CLOSE"}),n("span",{style:{marginTop:-2},children:"SETTINGS"})]}):n("span",{style:{fontSize:e.centerButton.text.fontSize,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:o.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${o.centerTextGlow}`,textTransform:"uppercase"},children:R})})})]})]}),L>1&&B("div",{style:{position:"absolute",left:"50%",marginLeft:-s.circleSize/2,top:"calc(100% - 64px)",width:s.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,I),transform:`scale(${Math.min(1,I)})`},children:[n(Ce,{side:"prev",disabled:k<=0,onClick:()=>me(k-1)}),B("span",{style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:be,letterSpacing:2,color:o.centerText,textShadow:`0 0 6px ${o.centerTextGlow}`},children:[String(k+1).padStart(2,"0"),B("span",{style:{color:o.iconLabelMuted,textShadow:"none"},children:[" / ",String(L).padStart(2,"0")]})]}),n(Ce,{side:"next",disabled:k>=L-1,onClick:()=>me(k+1)})]}),re&&!l&&n(Ue,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:ae,showArrow:false})]})}
1
+ "use strict";import{useState as u,useEffect as E,useMemo as Z,useRef as J,useCallback as Q}from"react";import{dialAccessibilityLabel as Ee}from"./dialA11y.js";import{getDialLayout as $e,getAllIconPositions as Le,getGridLineRotations as Fe,getIconStaggerInputRange as We,MAX_DIAL_SLOTS as U,DIAL_ICON_SIZE as Ge,dialAnimationConfig as he,getDialCSSKeyframesString as He,getDialCSSAnimationStyles as _e,dialColors as r,dialStyles as e,withAlpha as ye,floatingToolsColors as je}from"@buoy-gg/floating-tools-react";import{persistentStorage as be,monoFont as Se,ToolBackground as Oe,useToolBackground as qe}from"@buoy-gg/shared-ui";import{DialHyperspace as Ue}from"./DialHyperspace.js";import{OnboardingTooltip as Ke}from"./OnboardingTooltip.web.js";import{jsx as o,Fragment as Ne,jsxs as P}from"react/jsx-runtime";const Ve={x:.5,y:.5};const xe="@react_buoy_settings_tooltip_shown";let we=false;function Xe(){if(we||typeof document==="undefined")return;const n=document.createElement("style");n.textContent=He();document.head.appendChild(n);we=true}const G=n=>1-Math.pow(1-n,3);const de=n=>n*n*n;function Ye({icon:n,index:p,totalIcons:D,position:y,progress:c,onPress:x}){const[B,$]=u(false);const[R,w]=u(false);const C=!n.icon&&n.id.startsWith("empty-");const K=!C&&n.unavailable===true;const v=!C&&!K;const{icons:N}=he;const b=We(p,D);let m=0;if(c<=b[1]){m=0}else if(c<=b[2]){m=(c-b[1])/(b[2]-b[1])}else{m=1}m=Math.max(0,Math.min(1,m));const k=Ge;const ee=N.pressIn.scale;const H=1.1;const V=m*(R?ee:B?H:1);let A=0;if(m<=0){A=0}else if(m<=.3){A=m}else{A=.3+(m-.3)*(.7/.7)}const te=y.x*m;const ne=y.y*m;return o("button",{role:"menuitem","aria-label":C?"Empty slot":Ee(n.id,n.name),"data-testid":n.id?`buoy-dial-${n.id}`:void 0,"aria-disabled":!v,tabIndex:v?0:-1,onClick:v?x:void 0,onPointerEnter:oe=>v&&oe.pointerType==="mouse"&&$(true),onPointerLeave:()=>{$(false);w(false)},onPointerDown:()=>v&&w(true),onPointerUp:()=>w(false),onPointerCancel:()=>w(false),style:{position:"absolute",left:"50%",top:"50%",width:k,height:k,marginLeft:-k/2,marginTop:-k/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:v?"pointer":"default",transform:`translate(${te}px, ${ne}px) scale(${V})`,opacity:A,transition:B||R?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:C?o("div",{style:{width:e.emptySlot.dotSize,height:e.emptySlot.dotSize,borderRadius:e.emptySlot.dotSize/2,backgroundColor:r.emptyDotBackground,border:`${e.emptySlot.borderWidth}px solid ${r.emptyDotBorder}`}}):P(Ne,{children:[o("div",{style:{position:"absolute",width:`${e.icon.gradientBgSizePercent}%`,height:`${e.icon.gradientBgSizePercent}%`,borderRadius:e.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:e.icon.gradientBgOpacity}}),o("div",{style:{position:"absolute",width:`${e.icon.innerGlowSizePercent}%`,height:`${e.icon.innerGlowSizePercent}%`,borderRadius:e.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:e.icon.innerGlowOpacity}}),o("div",{style:{marginBottom:e.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:B?"brightness(1.2)":"none"},children:n.icon}),o("span",{style:{fontSize:n.name.length>8?Math.max(e.icon.label.fontSize*.7,e.icon.label.fontSize*8/n.name.length):e.icon.label.fontSize,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,color:r.iconLabel,letterSpacing:e.icon.label.letterSpacing,marginTop:e.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:n.name}),K&&o("span",{style:{fontSize:e.icon.label.fontSize-1,fontWeight:e.icon.label.fontWeight,fontFamily:e.icon.label.fontFamily,letterSpacing:e.icon.label.letterSpacing,color:je.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Ce({side:n,color:p}){const D=n==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]];return o("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:D.map(([y,c,x,B],$)=>o("line",{x1:y,y1:c,x2:x,y2:B,stroke:p,strokeWidth:2},$))})}function ve({side:n,disabled:p,onClick:D}){const[y,c]=u(false);const x=p?r.emptyDotBorder:r.accent;return P("button",{type:"button","aria-label":`${n==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${n}`,disabled:p,onClick:D,onPointerDown:()=>!p&&c(true),onPointerUp:()=>c(false),onPointerLeave:()=>c(false),onPointerCancel:()=>c(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${r.dialBorder}`,backgroundColor:r.dialBackground,color:p?r.iconLabelMuted:r.centerText,fontSize:12,fontWeight:900,fontFamily:Se,letterSpacing:1.5,textTransform:"uppercase",cursor:p?"default":"pointer",opacity:p?.4:1,boxShadow:p?"none":`0 0 8px ${ye(r.dialShadow,.4)}`,transform:y?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[n==="prev"&&o(Ce,{side:"prev",color:x}),n==="prev"?"PREV":"NEXT",n==="next"&&o(Ce,{side:"next",color:x})]})}export function DialMenu({icons:n,onClose:p,centerLabel:D="MENU",onCenterPress:y,settingsOpen:c=false,hintsDisabled:x=false}){const{id:B}=qe();const[$,R]=u(0);const[w,C]=u(0);const[K,v]=u(0);const[N,b]=u(0);const[m,k]=u(0);const[ee,H]=u(1);const[V,A]=u(false);const[te,ne]=u(false);const[oe,ke]=u(false);const ie=J(null);const ue=J(null);const S=J(null);const X=J(false);const{entrance:_,exit:j,interaction:O}=he;const ze=_e();const[re,Te]=u(()=>({width:window.innerWidth,height:window.innerHeight}));E(()=>{const i=()=>Te({width:window.innerWidth,height:window.innerHeight});window.addEventListener("resize",i);return()=>window.removeEventListener("resize",i)},[]);const s=Z(()=>$e({screenWidth:re.width,maxCircleSize:Math.max(120,Math.min(320,re.height-96))}),[re]);const Pe=Z(()=>Fe(),[]);const Be=Z(()=>Le(U,s.iconRadius),[s.iconRadius]);const[Ie,De]=u(0);const L=Math.max(1,Math.ceil(n.length/U));const z=Math.min(Ie,L-1);const pe=Z(()=>{const i=z*U;const t=[...n.slice(i,i+U)];while(t.length<U){t.push({id:`empty-${t.length}`,name:"",icon:null,onPress:()=>{}})}return t},[n,z]);E(()=>{Xe()},[]);E(()=>{const i=_.backdrop.duration;const t=_.dial.rotation.duration;const f=_.centerButton.delay;const l=_.icons.delay;const d=_.icons.duration;const g=performance.now();const h=I=>{const a=I-g;R(Math.min(1,a/i));const T=Math.min(1,a/400);let F=G(T)*1.1;if(T>.7){F-=(T-.7)*.33}if(T>=1)F=1;C(Math.max(0,Math.min(1.05,F)));const M=Math.min(1,a/t);v(G(M)*360);if(a>=f){const W=Math.min(1,(a-f)/300);let ce=G(W)*1.15;if(W>.6){ce-=(W-.6)*.375}if(W>=1)ce=1;b(Math.max(0,Math.min(1.05,ce)))}if(a>=l){const W=Math.min(1,(a-l)/d);k(G(W))}const le=l+d;if(a<le){S.current=requestAnimationFrame(h)}else{R(1);C(1);v(360);b(1);k(1);ke(true)}};S.current=requestAnimationFrame(h);return()=>{if(S.current)cancelAnimationFrame(S.current)}},[]);const q=Q(()=>{if(X.current)return;X.current=true;ne(true);if(S.current){cancelAnimationFrame(S.current)}const i=performance.now();const t=j.icons.duration;const f=j.centerButton.duration;const l=j.dialScale.duration;const d=Math.max(f,l);const g=j.backdrop.duration;const h=I=>{const a=I-i;if(a<t){const M=de(a/t);k(1-M);S.current=requestAnimationFrame(h);return}const T=t;if(a<T+d){k(0);const M=Math.min(1,(a-T)/f);const le=Math.min(1,(a-T)/l);b(1-de(M));C(1-de(le));S.current=requestAnimationFrame(h);return}const F=T+d;if(a<F+g){C(0);b(0);const M=(a-F)/g;R(1-M);S.current=requestAnimationFrame(h);return}R(0);p()};S.current=requestAnimationFrame(h)},[j,p]);E(()=>{const i=document.activeElement;const t=ie.current;return()=>{if(i?.isConnected&&(document.activeElement===document.body||t?.contains(document.activeElement))){i.focus()}}},[]);E(()=>{if(c)return;ue.current?.focus();const i=t=>{const f=ie.current;if(!f)return;if(t.key==="Escape"){t.preventDefault();q()}else if(t.key==="Tab"){const l=Array.from(f.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(h=>h.getClientRects().length>0);const d=l[0];const g=l[l.length-1];if(!f.contains(document.activeElement)||(t.shiftKey?document.activeElement===d:document.activeElement===g)){t.preventDefault();(t.shiftKey?g:d)?.focus()}}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(t.key)){const l=Array.from(f.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));const d=l.indexOf(document.activeElement);if(d<0||!l.length)return;t.preventDefault();const g=t.key==="Home"?0:t.key==="End"?l.length-1:(d+(t.key==="ArrowRight"||t.key==="ArrowDown"?1:-1)+l.length)%l.length;l[g].focus()}};document.addEventListener("keydown",i);return()=>document.removeEventListener("keydown",i)},[q,c]);const[ae,me]=u(false);E(()=>{if(x)return;let i=false;const t=setTimeout(async()=>{const f=await be.getItem(xe);if(!i&&!f)me(true)},1200);return()=>{i=true;clearTimeout(t)}},[x]);const se=Q(()=>{me(false);void be.setItem(xe,"true")},[]);E(()=>{if(c&&ae){se()}},[c,ae,se]);const Re=Q(i=>{if(i.id.startsWith("empty-")||X.current)return;const[t,f]=O.iconSelect.pulse;const l=performance.now();const d=150;const g=h=>{const I=h-l;if(I<d){const a=G(I/d);H(1-(1-t.scale)*a);requestAnimationFrame(g)}else if(I<d*2){const a=G((I-d)/d);H(t.scale+(f.scale-t.scale)*a);requestAnimationFrame(g)}else{H(1)}};requestAnimationFrame(g);setTimeout(()=>{i.onPress();q()},O.iconSelect.actionDelay)},[O.iconSelect,q]);const fe=Q(i=>{if(X.current)return;const t=Math.max(0,Math.min(i,L-1));if(t!==z)De(t)},[L,z]);const Y=s.buttonSize*e.centerButton.containerRatio;const ge=s.buttonSize*e.centerButton.borderRatio;const Ae=s.buttonSize*e.centerButton.containerRatio/2+6;const Me=oe&&!te;return P("div",{ref:ie,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[o("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:q,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:r.dialBackdrop,opacity:$}}),P("div",{style:{position:"absolute",left:"50%",marginLeft:-s.circleSize/2,bottom:80,width:s.circleSize,height:s.circleSize,borderRadius:"50%",backgroundColor:r.dialBackground,border:`${e.circle.borderWidth}px solid ${r.dialBorder}`,boxShadow:`0 0 ${e.circle.shadowRadius}px ${ye(r.dialShadow,e.circle.shadowOpacity)}`,transform:`scale(${w}) rotate(${K}deg)`,opacity:w>.01?1:0,overflow:"hidden"},children:[o("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:r.dialGradient1,opacity:e.gradientLayers[0].opacity}}),o("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:r.dialGradient2,opacity:e.gradientLayers[1].opacity}}),o("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:r.dialGradient3,opacity:e.gradientLayers[2].opacity}}),Pe.map(i=>o("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:e.grid.lineHeight,transform:`rotate(${i}deg)`,transformOrigin:"center"},children:["left","right"].map(t=>o("div",{style:{position:"absolute",top:0,[t]:0,width:`calc(50% - ${Ae}px)`,height:e.grid.lineHeight,backgroundColor:r.dialGridLine}},t))},i)),o("div",{"data-testid":"dial-background","data-background":B,style:{position:"absolute",inset:0,pointerEvents:"none"},children:B==="hyperspace"?o(Ue,{size:s.circleSize}):o(Oe,{focus:Ve})}),pe.map((i,t)=>o(Ye,{icon:i,index:t,totalIcons:pe.length,position:Be[t],progress:m,onPress:()=>Re(i)},t)),P("div",{style:{position:"absolute",left:"50%",top:"50%",width:Y,height:Y,marginLeft:-Y/2,marginTop:-Y/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r.hubHalo,borderRadius:s.buttonSize,overflow:"hidden",transform:`scale(${N*ee})`,opacity:N>.01?1:0},children:[o("div",{style:{position:"absolute",inset:0,backgroundColor:r.dialGradient1,opacity:.5,borderRadius:s.buttonSize}}),o("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:r.dialGradient2,opacity:.3,borderRadius:s.buttonSize}}),o("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:r.dialGradient3,opacity:.2,borderRadius:s.buttonSize}}),o("div",{style:{width:ge,height:ge,borderRadius:s.buttonSize*e.centerButton.borderRadiusRatio,backgroundColor:r.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:o("button",{ref:ue,type:"button","aria-label":c?"Close Settings":"Open Dev Tools Settings",disabled:!y,onClick:y,onPointerEnter:i=>i.pointerType==="mouse"&&A(true),onPointerLeave:()=>A(false),style:{border:0,padding:0,background:"transparent",width:s.buttonSize,height:s.buttonSize,borderRadius:s.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:y?"pointer":"default",transform:V?`scale(${O.centerHover.scale})`:"scale(1)",transition:`transform ${O.centerHover.duration}ms ease`,animation:Me&&!V?ze.pulse:"none"},children:c?P("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:e.centerButton.text.fontSize-2,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:r.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${r.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[o("span",{style:{marginBottom:-2},children:"CLOSE"}),o("span",{style:{marginTop:-2},children:"SETTINGS"})]}):o("span",{style:{fontSize:e.centerButton.text.fontSize,fontWeight:e.centerButton.text.fontWeight,fontFamily:e.centerButton.text.fontFamily,color:r.centerText,letterSpacing:e.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${r.centerTextGlow}`,textTransform:"uppercase"},children:D})})})]})]}),L>1&&P("div",{style:{position:"absolute",left:"50%",marginLeft:-s.circleSize/2,top:"calc(100% - 64px)",width:s.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,w),transform:`scale(${Math.min(1,w)})`},children:[o(ve,{side:"prev",disabled:z<=0,onClick:()=>fe(z-1)}),P("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Se,letterSpacing:2,color:r.centerText,textShadow:`0 0 6px ${r.centerTextGlow}`},children:[String(z+1).padStart(2,"0"),P("span",{style:{color:r.iconLabelMuted,textShadow:"none"},children:[" / ",String(L).padStart(2,"0")]})]}),o(ve,{side:"next",disabled:z>=L-1,onClick:()=>fe(z+1)})]}),ae&&!c&&o(Ke,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:se,showArrow:false})]})}
@@ -1 +1 @@
1
- "use strict";import{useMemo as P,useRef as E}from"react";import{StyleSheet as G,Pressable as N,View as l,Text as V,useWindowDimensions as Y,Animated as n}from"react-native";import{getDialLayout as F,getIconPosition as X,getIconStaggerInputRange as Z,DIAL_START_ANGLE as H,DIAL_ICON_SIZE as J,DIAL_ICON_GLYPH_SIZE as b,dialColors as I,dialStyles as o,dialAnimationConfig as U}from"@buoy-gg/floating-tools-core";import{jsx as i,jsxs as q}from"react/jsx-runtime";const D={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function Q(s,t){if(s&&D[s])return D[s];return t}const u=J;export const DialIcon=({index:s,icon:t,iconsProgress:R,onPress:M,totalIcons:d,active:v})=>{const g=E(new n.Value(1)).current;const{width:S}=Y();const c=P(()=>F({screenWidth:S}),[S]);const j=U?.icons??{pressIn:{scale:.95,damping:15,stiffness:400},pressOut:{scale:1,damping:15,stiffness:400}};const{pressIn:m,pressOut:h}=j;const A=()=>{n.spring(g,{toValue:m.scale,damping:m.damping,stiffness:m.stiffness,useNativeDriver:true}).start()};const L=()=>{n.spring(g,{toValue:h.scale,damping:h.damping,stiffness:h.stiffness,useNativeDriver:true}).start()};const p=P(()=>{const y=X(s,d,c.iconRadius,H);const{x:k,y:T,angle:a}=y;const f=c.iconRadius;const W=Z(s,d);const r=R.interpolate({inputRange:W,outputRange:[0,0,1,1],extrapolate:"clamp"});const C=r.interpolate({inputRange:[0,1],outputRange:[Math.PI*2,0]});const w=r.interpolate({inputRange:[0,1],outputRange:[0,f]});const x=n.add(n.multiply(w,C.interpolate({inputRange:[0,Math.PI*2],outputRange:[Math.cos(a),Math.cos(a+Math.PI*2)]})),r.interpolate({inputRange:[0,1],outputRange:[0,k-f*Math.cos(a+Math.PI*2)]}));const z=n.add(n.multiply(w,C.interpolate({inputRange:[0,Math.PI*2],outputRange:[Math.sin(a),Math.sin(a+Math.PI*2)]})),r.interpolate({inputRange:[0,1],outputRange:[0,T-f*Math.sin(a+Math.PI*2)]}));const B=r.interpolate({inputRange:[0,.3,1],outputRange:[0,.3,1]});return{translateX:x,translateY:z,itemOpacity:B,progressScale:r}},[s,d,R,c]);const _={position:"absolute",left:c.circleRadius-u/2,top:c.circleRadius-u/2,opacity:p.itemOpacity,transform:[{translateX:p.translateX},{translateY:p.translateY},{scale:n.multiply(g,p.progressScale)}]};const O=t.icon===null&&!t.iconComponent;return i(n.View,{style:[e.view,_,!v&&e.hidden],children:O?i(l,{style:e.emptySpot,children:i(l,{style:e.emptyDot})}):q(N,{onPress:()=>M(t),onPressIn:A,onPressOut:L,style:e.pressable,testID:t.id?`buoy-dial-${t.id}`:void 0,accessibilityLabel:Q(t.id,t.name),accessibilityRole:"button",children:[i(l,{style:[e.iconGradientBg,{backgroundColor:"rgba(0, 0, 0, 0.2)"}]}),i(l,{style:[e.iconInnerGlow,{backgroundColor:"rgba(255, 255, 255, 0.02)"}]}),i(l,{style:e.iconWrapper,children:t.iconComponent?(()=>{const y=t.iconComponent;return i(y,{slot:"dial",size:b})})():i(l,{style:e.iconClamp,children:t.icon})}),i(V,{style:e.label,numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.7,children:t.name.toUpperCase()})]})})};const e=G.create({view:{width:u,height:u,justifyContent:"center",alignItems:"center"},hidden:{display:"none"},pressable:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center",padding:4,backgroundColor:"transparent"},iconGradientBg:{position:"absolute",width:"85%",height:"85%",borderRadius:12,opacity:.3},iconInnerGlow:{position:"absolute",width:"70%",height:"70%",borderRadius:10,opacity:.5},iconWrapper:{marginBottom:4,alignItems:"center",justifyContent:"center"},iconClamp:{width:b,height:b,alignItems:"center",justifyContent:"center",overflow:"hidden"},label:{fontSize:o.icon.label.fontSize,fontWeight:o.icon.label.fontWeight,letterSpacing:o.icon.label.letterSpacing,fontFamily:o.icon.label.fontFamily,marginTop:o.icon.label.marginTop,color:I.iconLabel},emptySpot:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},emptyDot:{width:o.emptySlot.dotSize,height:o.emptySlot.dotSize,borderRadius:o.emptySlot.dotSize/2,backgroundColor:I.emptyDotBackground,borderWidth:o.emptySlot.borderWidth,borderColor:I.emptyDotBorder}});
1
+ "use strict";import{useMemo as P,useRef as T}from"react";import{StyleSheet as V,Pressable as k,View as r,Text as B,useWindowDimensions as F,Animated as n}from"react-native";import{dialAccessibilityLabel as N}from"./dialA11y.js";import{getDialLayout as Y,getIconPosition as X,getIconStaggerInputRange as Z,DIAL_START_ANGLE as H,DIAL_ICON_SIZE as U,DIAL_ICON_GLYPH_SIZE as b,dialColors as I,dialStyles as i,dialAnimationConfig as $}from"@buoy-gg/floating-tools-core";import{jsx as o,jsxs as q}from"react/jsx-runtime";const p=U;export const DialIcon=({index:u,icon:t,iconsProgress:R,onPress:M,totalIcons:d,active:D})=>{const g=T(new n.Value(1)).current;const{width:S}=F();const l=P(()=>Y({screenWidth:S}),[S]);const j=$?.icons??{pressIn:{scale:.95,damping:15,stiffness:400},pressOut:{scale:1,damping:15,stiffness:400}};const{pressIn:m,pressOut:h}=j;const L=()=>{n.spring(g,{toValue:m.scale,damping:m.damping,stiffness:m.stiffness,useNativeDriver:true}).start()};const _=()=>{n.spring(g,{toValue:h.scale,damping:h.damping,stiffness:h.stiffness,useNativeDriver:true}).start()};const c=P(()=>{const y=X(u,d,l.iconRadius,H);const{x:W,y:v,angle:a}=y;const f=l.iconRadius;const z=Z(u,d);const s=R.interpolate({inputRange:z,outputRange:[0,0,1,1],extrapolate:"clamp"});const C=s.interpolate({inputRange:[0,1],outputRange:[Math.PI*2,0]});const w=s.interpolate({inputRange:[0,1],outputRange:[0,f]});const x=n.add(n.multiply(w,C.interpolate({inputRange:[0,Math.PI*2],outputRange:[Math.cos(a),Math.cos(a+Math.PI*2)]})),s.interpolate({inputRange:[0,1],outputRange:[0,W-f*Math.cos(a+Math.PI*2)]}));const E=n.add(n.multiply(w,C.interpolate({inputRange:[0,Math.PI*2],outputRange:[Math.sin(a),Math.sin(a+Math.PI*2)]})),s.interpolate({inputRange:[0,1],outputRange:[0,v-f*Math.sin(a+Math.PI*2)]}));const G=s.interpolate({inputRange:[0,.3,1],outputRange:[0,.3,1]});return{translateX:x,translateY:E,itemOpacity:G,progressScale:s}},[u,d,R,l]);const A={position:"absolute",left:l.circleRadius-p/2,top:l.circleRadius-p/2,opacity:c.itemOpacity,transform:[{translateX:c.translateX},{translateY:c.translateY},{scale:n.multiply(g,c.progressScale)}]};const O=t.icon===null&&!t.iconComponent;return o(n.View,{style:[e.view,A,!D&&e.hidden],children:O?o(r,{style:e.emptySpot,children:o(r,{style:e.emptyDot})}):q(k,{onPress:()=>M(t),onPressIn:L,onPressOut:_,style:e.pressable,testID:t.id?`buoy-dial-${t.id}`:void 0,accessibilityLabel:N(t.id,t.name),accessibilityRole:"button",children:[o(r,{style:[e.iconGradientBg,{backgroundColor:"rgba(0, 0, 0, 0.2)"}]}),o(r,{style:[e.iconInnerGlow,{backgroundColor:"rgba(255, 255, 255, 0.02)"}]}),o(r,{style:e.iconWrapper,children:t.iconComponent?(()=>{const y=t.iconComponent;return o(y,{slot:"dial",size:b})})():o(r,{style:e.iconClamp,children:t.icon})}),o(B,{style:e.label,numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.7,children:t.name.toUpperCase()})]})})};const e=V.create({view:{width:p,height:p,justifyContent:"center",alignItems:"center"},hidden:{display:"none"},pressable:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center",padding:4,backgroundColor:"transparent"},iconGradientBg:{position:"absolute",width:"85%",height:"85%",borderRadius:12,opacity:.3},iconInnerGlow:{position:"absolute",width:"70%",height:"70%",borderRadius:10,opacity:.5},iconWrapper:{marginBottom:4,alignItems:"center",justifyContent:"center"},iconClamp:{width:b,height:b,alignItems:"center",justifyContent:"center",overflow:"hidden"},label:{fontSize:i.icon.label.fontSize,fontWeight:i.icon.label.fontWeight,letterSpacing:i.icon.label.letterSpacing,fontFamily:i.icon.label.fontFamily,marginTop:i.icon.label.marginTop,color:I.iconLabel},emptySpot:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},emptyDot:{width:i.emptySlot.dotSize,height:i.emptySlot.dotSize,borderRadius:i.emptySlot.dotSize/2,backgroundColor:I.emptyDotBackground,borderWidth:i.emptySlot.borderWidth,borderColor:I.emptyDotBorder}});
@@ -7,4 +7,4 @@
7
7
  0%, 100% { transform: translateY(0); }
8
8
  50% { transform: translateY(-8px); }
9
9
  }
10
- `;document.head.appendChild(o);f=true}const i=e.accent;export function OnboardingTooltip({title:o,message:m,onDismiss:u,showArrow:b=true}){const[n,y]=l(false);const[a,r]=l(false);g(()=>{A();const x=requestAnimationFrame(()=>y(true));return()=>cancelAnimationFrame(x)},[]);const s={fontFamily:c,textTransform:"uppercase"};return t("div",{style:{position:"fixed",left:"50%",bottom:O(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:p("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[t("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),p("div",{style:{position:"relative",maxWidth:280,backgroundColor:e.dialBackground,borderRadius:16,border:`1px solid ${e.dialBorder}`,padding:20,boxShadow:`0 0 20px ${d(e.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[t("span",{style:{...s,fontSize:16,fontWeight:900,letterSpacing:1,color:i,textAlign:"center"},children:o}),t("span",{style:{fontFamily:c,fontSize:13,lineHeight:"20px",color:e.centerText,textAlign:"center"},children:m}),t("button",{onClick:u,onMouseDown:()=>r(true),onMouseUp:()=>r(false),onMouseLeave:()=>r(false),style:{...s,marginTop:8,borderRadius:8,border:"none",backgroundColor:i,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:a?.7:1,transform:a?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),b&&t("div",{style:{position:"absolute",left:"50%",bottom:h,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${F}px solid ${i}`,filter:`drop-shadow(0 0 10px ${d(e.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}
10
+ `;document.head.appendChild(o);f=true}const i=e.accent;export function OnboardingTooltip({title:o,message:m,onDismiss:u,showArrow:b=true}){const[n,y]=l(false);const[a,r]=l(false);g(()=>{A();const x=requestAnimationFrame(()=>y(true));return()=>cancelAnimationFrame(x)},[]);const s={fontFamily:c,textTransform:"uppercase"};return t("div",{style:{position:"fixed",left:"50%",bottom:O(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:p("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[t("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),p("div",{style:{position:"relative",maxWidth:280,backgroundColor:e.dialBackground,borderRadius:16,border:`1px solid ${e.dialBorder}`,padding:20,boxShadow:`0 0 20px ${d(e.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[t("span",{style:{...s,fontSize:16,fontWeight:900,letterSpacing:1,color:i,textAlign:"center"},children:o}),t("span",{style:{fontFamily:c,fontSize:13,lineHeight:"20px",color:e.centerText,textAlign:"center"},children:m}),t("button",{onClick:u,onPointerDown:()=>r(true),onPointerUp:()=>r(false),onPointerLeave:()=>r(false),onPointerCancel:()=>r(false),style:{...s,marginTop:8,borderRadius:8,border:"none",backgroundColor:i,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:a?.7:1,transform:a?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),b&&t("div",{style:{position:"absolute",left:"50%",bottom:h,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${F}px solid ${i}`,filter:`drop-shadow(0 0 10px ${d(e.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}
@@ -0,0 +1 @@
1
+ "use strict";const s={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};export function dialAccessibilityLabel(e,t){if(e&&s[e])return s[e];return t}
@@ -1 +1 @@
1
- "use strict";export{FloatingDevTools}from"./floatingMenu/FloatingDevTools.web.js";export{createWebTool}from"./utils/createWebTool.js";export{clearReleaseOptIn}from"./releaseOptIn.js";export{FloatingTools,UserStatus,Divider}from"./floatingMenu/floatingTools.web.js";export{DialMenu}from"./floatingMenu/dial/DialDevTools.web.js";export{SettingsModal}from"./floatingMenu/DevToolsSettingsModal.web.js";export{AppHostProvider,AppOverlay,useAppHost}from"./floatingMenu/AppHost.web.js";export{autoDiscoverWebPresets,autoDiscoverWithCustom,getToolsBySlot,getEnabledTools,defaultToolPresets}from"./utils/autoDiscoverPresets.web.js";export{useSettings,useFloatingTools,getToolLabel,getToolDescription,getToolColor,settingsColors,settingsStyles,dialColors,dialStyles}from"@buoy-gg/floating-tools-react";export{createWebTools}from"./utils/createWebTools.js";export*from"./toolkit.js";export{useToolHost,useToolHeader}from"./floatingMenu/ToolHost.js";export{DevToolsVisibilityProvider,useDevToolsVisibility}from"./floatingMenu/DevToolsVisibilityContext.js";export{appSyncAdapter}from"./floatingMenu/sync/appSyncAdapter.js";
1
+ "use strict";export{FloatingDevTools}from"./floatingMenu/FloatingDevTools.web.js";export{createWebTool}from"./utils/createWebTool.js";export{clearReleaseOptIn}from"./releaseOptIn.js";export{isBuoyHoldingBackButton}from"./floatingMenu/capacitorBackButton.js";export{FloatingTools,UserStatus,Divider}from"./floatingMenu/floatingTools.web.js";export{DialMenu}from"./floatingMenu/dial/DialDevTools.web.js";export{SettingsModal}from"./floatingMenu/DevToolsSettingsModal.web.js";export{AppHostProvider,AppOverlay,useAppHost}from"./floatingMenu/AppHost.web.js";export{autoDiscoverWebPresets,autoDiscoverWithCustom,getToolsBySlot,getEnabledTools,defaultToolPresets}from"./utils/autoDiscoverPresets.web.js";export{useSettings,useFloatingTools,getToolLabel,getToolDescription,getToolColor,settingsColors,settingsStyles,dialColors,dialStyles}from"@buoy-gg/floating-tools-react";export{createWebTools}from"./utils/createWebTools.js";export*from"./toolkit.js";export{useToolHost,useToolHeader}from"./floatingMenu/ToolHost.js";export{DevToolsVisibilityProvider,useDevToolsVisibility}from"./floatingMenu/DevToolsVisibilityContext.js";export{appSyncAdapter}from"./floatingMenu/sync/appSyncAdapter.js";export{LicenseManager}from"@buoy-gg/license";
@@ -1 +1 @@
1
- "use strict";export const SDK_VERSION="7.0.55";
1
+ "use strict";export const SDK_VERSION="7.0.57";
@@ -0,0 +1,4 @@
1
+ export declare function BuoySignIn({ needsPlan }: {
2
+ needsPlan?: boolean;
3
+ }): import("react").JSX.Element;
4
+ //# sourceMappingURL=BuoyCodeSignIn.d.ts.map
@@ -1,4 +1,2 @@
1
- export declare function BuoySignIn({ needsPlan }: {
2
- needsPlan?: boolean;
3
- }): import("react").JSX.Element;
1
+ export { BuoySignIn } from "./BuoyCodeSignIn";
4
2
  //# sourceMappingURL=BuoySignIn.d.ts.map