@buoy-gg/core 7.0.50 → 7.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/floatingMenu/BuoySignIn.js +1 -0
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/floatingMenu/BuoySignIn.js +1 -0
- package/lib/module/floatingMenu/FloatingDevTools.js +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/floatingMenu/BuoySignIn.d.ts +4 -0
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts +14 -1
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/BuoySignIn.d.ts +4 -0
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts +14 -1
- package/lib/typescript/module/version.d.ts +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.BuoySignIn=BuoySignIn;var _react=require("react");var _reactNative=require("react-native");var license=_interopRequireWildcard(require("@buoy-gg/license"));var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(r,t){if("function"==typeof WeakMap)var n=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(e,a){if(!a&&e&&e.__esModule)return e;var i,s,c={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return c;if(i=a?o:n){if(i.has(e))return i.get(e);i.set(e,c)}for(const l in e)"default"!==l&&{}.hasOwnProperty.call(e,l)&&((s=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,l))&&(s.get||s.set)?i(c,l,s):c[l]=e[l]);return c})(r,t)}function getSession(){try{return license.SessionManager}catch{return void 0}}const shortUrl=r=>r.replace(/^https?:\/\//,"");function useSessionState(){const[r,t]=(0,_react.useState)(()=>getSession()?.getStatus().state??"signed_out");(0,_react.useEffect)(()=>{const n=getSession();if(!n)return;const o=()=>t(n.getStatus().state);o();return n.subscribe(o)},[]);return r}function BuoySignIn({needsPlan:r=false}){const[t,n]=(0,_react.useState)(false);const o=useSessionState();return(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"box-none",style:styles.root,children:[(0,_jsxRuntime.jsx)(_sharedUi.AccountSetupButton,{expanded:t,onPress:()=>n(true)}),t?(0,_jsxRuntime.jsx)(_reactNative.Modal,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>n(false),children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,accessibilityViewIsModal:true,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:_reactNative.StyleSheet.absoluteFill,onPress:()=>n(false),accessible:false}),r&&o==="active"?(0,_jsxRuntime.jsx)(NeedsPlanCard,{onClose:()=>n(false)}):(0,_jsxRuntime.jsx)(CodeCard,{onClose:()=>n(false)})]})}):null]})}function Header({onClose:r}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.brand,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.brandDot}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.wordmark,children:"BUOY"})]}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:r,style:styles.close,testID:"buoy-signin-close",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.closeText,children:"\u2715"})})]})}function CodeCard({onClose:r}){const[t,n]=(0,_react.useState)({kind:"starting"});const o=(0,_react.useRef)(null);const e=(0,_react.useCallback)(()=>{o.current?.abort();const a=getSession();if(!a?.signInWithCode){n({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}const i=new AbortController;o.current=i;n({kind:"starting"});a.signInWithCode(s=>n({kind:"waiting",prompt:s}),{signal:i.signal}).then(()=>{if(!i.signal.aborted)r()}).catch(s=>{if(i.signal.aborted)return;n({kind:"error",message:s instanceof Error?s.message:"Sign-in did not work. Try again."})})},[r]);(0,_react.useEffect)(()=>{e();return()=>o.current?.abort()},[e]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:"buoy-code-signin",children:[(0,_jsxRuntime.jsx)(Header,{onClose:r}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:"Sign in to Buoy"}),t.kind==="starting"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.center,children:(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{color:_sharedUi.night.color.accent})}):null,t.kind==="waiting"?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.body,children:"Scan this with your phone's camera."}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.qr,testID:"buoy-signin-qr",children:(0,_jsxRuntime.jsx)(_sharedUi.QrCodeView,{value:t.prompt.verificationUriComplete,size:196})}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.body,children:["Or go to ",(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.strong,children:shortUrl(t.prompt.verificationUri)})," and type:"]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.code,selectable:true,testID:"buoy-signin-code",children:t.prompt.userCode}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.waiting,children:[(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,t.kind==="error"?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.body,testID:"buoy-signin-error",children:t.message}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",onPress:e,style:({pressed:a})=>[styles.primary,a&&styles.primaryPressed],testID:"buoy-signin-retry",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.primaryText,children:"Get a new code"})})]}):null]})}function NeedsPlanCard({onClose:r}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:"buoy-signin-needs-plan",children:[(0,_jsxRuntime.jsx)(Header,{onClose:r}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:"You're signed in"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.body,children:"Buoy in this build needs a Pro or Business plan."}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",onPress:()=>void getSession()?.signOut(),style:({pressed:t})=>[styles.primary,t&&styles.primaryPressed],testID:"buoy-signout",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.primaryText,children:"Sign out"})})]})}const styles=_reactNative.StyleSheet.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:_sharedUi.night.color.accent},wordmark:{color:_sharedUi.night.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:_sharedUi.night.color.textSecondary,fontSize:14},title:{color:_sharedUi.night.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:_sharedUi.night.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:_sharedUi.night.color.text,fontWeight:"600"},muted:{color:_sharedUi.night.color.textSecondary,fontSize:13},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,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:_sharedUi.night.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:_sharedUi.night.color.accentPressed},primaryText:{color:_sharedUi.night.color.onAccent,fontSize:15,fontWeight:"600"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FloatingDevTools=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _AppHost=require("./AppHost");var _FloatingMenu=require("./FloatingMenu.js");var _ToolOpenerBridge=require("./ToolOpenerBridge.js");var _autoDiscoverPresets=require("./autoDiscoverPresets.js");var _installPing=require("../telemetry/installPing.js");var _Buoy=require("../Buoy.js");var _AppIcon=require("./AppIcon");var _DevToolsVisibilityContext=require("./DevToolsVisibilityContext.js");var _optionalRequire=require("./optionalRequire.js");var _MinimizedToolsContext=require("./MinimizedToolsContext.js");var _defaultConfig=require("./defaultConfig.js");var _DefaultConfigContext=require("./DefaultConfigContext.js");var _license=require("@buoy-gg/license");var _autoExternalSync=require("./autoExternalSync.js");var _externalSyncGate=require("./externalSyncGate.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(n
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FloatingDevTools=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _AppHost=require("./AppHost");var _FloatingMenu=require("./FloatingMenu.js");var _ToolOpenerBridge=require("./ToolOpenerBridge.js");var _autoDiscoverPresets=require("./autoDiscoverPresets.js");var _installPing=require("../telemetry/installPing.js");var _Buoy=require("../Buoy.js");var _AppIcon=require("./AppIcon");var _DevToolsVisibilityContext=require("./DevToolsVisibilityContext.js");var _optionalRequire=require("./optionalRequire.js");var _MinimizedToolsContext=require("./MinimizedToolsContext.js");var _defaultConfig=require("./defaultConfig.js");var _DefaultConfigContext=require("./DefaultConfigContext.js");var _license=_interopRequireWildcard(require("@buoy-gg/license"));var licenseModule=_license;var _BuoySignIn=require("./BuoySignIn");var _autoExternalSync=require("./autoExternalSync.js");var _externalSyncGate=require("./externalSyncGate.js");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(t,n){if("function"==typeof WeakMap)var s=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(r,x){if(!x&&r&&r.__esModule)return r;var l,u,g={__proto__:null,default:r};if(null===r||"object"!=typeof r&&"function"!=typeof r)return g;if(l=x?a:s){if(l.has(r))return l.get(r);l.set(r,g)}for(const i in r)"default"!==i&&{}.hasOwnProperty.call(r,i)&&((u=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,i))&&(u.get||u.set)?l(g,i,u):g[i]=r[i]);return g})(t,n)}let warnedReleaseTransport=null;function warnReleaseTransportOnce(t){if(!t||t===warnedReleaseTransport)return;warnedReleaseTransport=t;console.warn(t)}function resolveSignInAppId(t){if(t&&typeof t==="object"&&t.appId)return t.appId;try{const{Platform:n}=require("react-native");const s=require("expo-constants");const a=(s?.default??s)?.expoConfig;const r=n.OS==="android"?a?.android?.package:a?.ios?.bundleIdentifier;if(typeof r==="string"&&r)return r}catch{}try{const n=require("expo-application");const s=(n?.default??n)?.applicationId;if(typeof s==="string"&&s)return s}catch{}return null}const FloatingDevTools=({apps:t,requiredEnvVars:n,requiredStorageKeys:s,askBuoy:a,children:r,disableHints:x=false,defaultFloatingTools:l,defaultDialTools:u,requireLicense:g,licenseKey:i,zustandStores:q,environment:U,externalSync:b=true,headless:O=false,signIn:j,...D})=>{const N=U??(0,_sharedUi.normalizeEnvironment)(process.env.NODE_ENV??"dev");const{isLicensed:h}=(0,_license.useProAccess)();const{licenseKey:_,isInitialized:C,tier:m,access:c}=(0,_license.useLicense)();const G=i===void 0||(0,_license.sameLicenseKey)(i,_);const E=G&&c.status==="admitted";(0,_react.useEffect)(()=>{if(!C||c.status==="initializing")return;void(0,_installPing.sendInstallPing)({tier:c.status==="admitted"?m:"locked",enabled:(0,_Buoy.isTelemetryEnabled)()})},[C,c.status,m]);const R=j?resolveSignInAppId(j):null;(0,_react.useEffect)(()=>{if(!R)return;const e=licenseModule.SessionManager;if(!e)return;e.configure({audience:`app:${R}`});void e.load().catch(()=>{})},[R]);(0,_react.useEffect)(()=>{void _license.LicenseManager.configure(i).catch(()=>{})},[i]);(0,_react.useEffect)(()=>{if(E)(0,_sharedUi.startSettingsSync)()},[E]);(0,_react.useEffect)(()=>{if(!q||c.status==="locked")return;try{const{watchStores:e}=require("@buoy-gg/zustand");return e(q)}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/zustand",e)}},[q,c.status]);const J=(0,_react.useMemo)(()=>{if(u){return(0,_defaultConfig.validateDialConfig)(u)}return u},[u]);const M=(0,_react.useMemo)(()=>{const e=[];if(n&&n.length>0){try{const{createEnvTool:o,createEnvVarConfig:P}=require("@buoy-gg/env");e.push(o({requiredEnvVars:P(n)}))}catch(o){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/env",o)}}if(s&&s.length>0){try{const{createStorageTool:o}=require("@buoy-gg/storage");e.push(o({requiredStorageKeys:s}))}catch(o){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/storage",o)}}if(a){try{const{createAskBuoyTool:o}=require("@buoy-gg/ask-buoy");e.push(o(a))}catch(o){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/ask-buoy",o)}}return e},[n,s,a]);const T=(0,_react.useMemo)(()=>{if(!t&&M.length===0)return void 0;return[...t||[],...M]},[t,M]);const f=(0,_react.useMemo)(()=>T?(0,_autoDiscoverPresets.autoDiscoverPresetsWithCustom)(T):(0,_autoDiscoverPresets.autoDiscoverPresets)(),[T]);const A=(0,_react.useMemo)(()=>f.filter(e=>e.sync),[f]);const k=(0,_react.useMemo)(()=>{try{const{DebugBordersStandaloneOverlay:e}=require("@buoy-gg/debug-borders");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/debug-borders",e);return null}},[]);const F=(0,_react.useMemo)(()=>{try{const{HighlightUpdatesOverlay:e}=require("@buoy-gg/highlight-updates");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/highlight-updates",e);return null}},[]);const w=(0,_react.useMemo)(()=>{try{const{ImageOverlayStandalone:e}=require("@buoy-gg/image-overlay");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/image-overlay",e);return null}},[]);const z=(0,_react.useMemo)(()=>{try{const{PerfMonitorOverlay:e}=require("@buoy-gg/perf-monitor");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/perf-monitor",e);return null}},[]);const B=(0,_react.useMemo)(()=>{try{const{JsTopHudOverlay:e}=require("@buoy-gg/js-top");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/js-top",e);return null}},[]);const p=(0,_react.useMemo)(()=>{try{const{RouteTracker:e}=require("@buoy-gg/route-events");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/route-events",e);return null}},[]);const y=(0,_react.useMemo)(()=>{try{const{ReactQueryTracker:e}=require("@buoy-gg/react-query");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/react-query",e);return null}},[]);const H=(0,_react.useMemo)(()=>{try{const{ImpersonateOverlay:e}=require("@buoy-gg/impersonate");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/impersonate",e);return null}},[]);const L=(0,_react.useMemo)(()=>{try{const{ScenariosOverlay:e}=require("@buoy-gg/scenarios");return e}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/scenarios",e);return null}},[]);const d=(0,_react.useMemo)(()=>{try{const{ReduxAutoInstrument:e}=require("@buoy-gg/redux");return e??null}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/redux",e);return null}},[]);const v=(0,_react.useMemo)(()=>{try{const{ConsoleRoot:e}=require("@buoy-gg/console");return e??null}catch(e){(0,_optionalRequire.reportOptionalRequireError)("@buoy-gg/console",e);return null}},[]);const Q=(0,_react.useCallback)(e=>{const o=f.find(P=>P.id===e);if(!o)return null;return(0,_AppIcon.renderAppIcon)(o.icon,{slot:"dial",size:20,color:o.color})},[f]);const S=typeof __DEV__!=="undefined"&&__DEV__;if(!S&&!h){return j&&!O?(0,_jsxRuntime.jsx)(_BuoySignIn.BuoySignIn,{needsPlan:true}):null}const V=(0,_externalSyncGate.shouldMountExternalSync)({isDevelopment:S,isLicensed:h,externalSync:b,isAvailable:(0,_autoExternalSync.isExternalSyncAvailable)()});const I=(0,_externalSyncGate.externalSyncOptions)(b);if(!S&&I?.enableInRelease){warnReleaseTransportOnce((0,_externalSyncGate.releaseTransportProblem)(I.socketURL,I))}const W=(0,_jsxRuntime.jsx)(_autoExternalSync.ToolRegistryPublisher,{requiredEnvVars:n,customApps:A});if(!E){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[c.status==="initializing"&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[d&&(0,_jsxRuntime.jsx)(d,{}),v&&(0,_jsxRuntime.jsx)(v,{}),p&&(0,_jsxRuntime.jsx)(p,{}),y&&(0,_jsxRuntime.jsx)(y,{})]}),!O&&(j?(0,_jsxRuntime.jsx)(_BuoySignIn.BuoySignIn,{}):(0,_jsxRuntime.jsx)(_sharedUi.AccountSetup,{}))]})}if(O){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[d&&(0,_jsxRuntime.jsx)(d,{}),v&&(0,_jsxRuntime.jsx)(v,{}),p&&(0,_jsxRuntime.jsx)(p,{}),y&&(0,_jsxRuntime.jsx)(y,{}),W,V&&(0,_jsxRuntime.jsx)(_autoExternalSync.AutoExternalSync,{options:(0,_externalSyncGate.externalSyncOptions)(b),requiredEnvVars:n,isPro:h,tier:m,licenseKey:_,customApps:A})]})}return(0,_jsxRuntime.jsx)(_DefaultConfigContext.DefaultConfigProvider,{defaultFloatingTools:l,defaultDialTools:J,children:(0,_jsxRuntime.jsx)(_sharedUi.HintsProvider,{disableHints:x,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,pointerEvents:"box-none",__buoyDevToolsRoot:true,children:(0,_jsxRuntime.jsxs)(_DevToolsVisibilityContext.DevToolsVisibilityProvider,{children:[w&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:_reactNative.StyleSheet.absoluteFill,pointerEvents:"box-none",collapsable:false,children:(0,_jsxRuntime.jsx)(w,{})}),(0,_jsxRuntime.jsx)(_AppHost.AppHostProvider,{children:(0,_jsxRuntime.jsxs)(_MinimizedToolsContext.MinimizedToolsProvider,{getToolIcon:Q,children:[(0,_jsxRuntime.jsx)(_FloatingMenu.FloatingMenu,{...D,apps:f,environment:N}),D.hidden?null:(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_AppHost.AppOverlay,{}),(0,_jsxRuntime.jsx)(_sharedUi.FloatingToolHost,{})]}),(0,_jsxRuntime.jsx)(_ToolOpenerBridge.ToolOpenerBridge,{})]})}),r,k&&(0,_jsxRuntime.jsx)(k,{}),F&&(0,_jsxRuntime.jsx)(F,{}),z&&(0,_jsxRuntime.jsx)(z,{}),B&&(0,_jsxRuntime.jsx)(B,{}),H&&(0,_jsxRuntime.jsx)(H,{}),L&&(0,_jsxRuntime.jsx)(L,{}),d&&(0,_jsxRuntime.jsx)(d,{}),v&&(0,_jsxRuntime.jsx)(v,{}),p&&(0,_jsxRuntime.jsx)(p,{}),y&&(0,_jsxRuntime.jsx)(y,{}),W,V&&(0,_jsxRuntime.jsx)(_autoExternalSync.AutoExternalSync,{options:(0,_externalSyncGate.externalSyncOptions)(b),requiredEnvVars:n,isPro:h,tier:m,licenseKey:_,customApps:A})]})})})})};exports.FloatingDevTools=FloatingDevTools;const styles=_reactNative.StyleSheet.create({container:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9999}});
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.51";
|
|
@@ -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{FloatingToolHost as
|
|
1
|
+
"use strict";import{FloatingToolHost as se}from"@buoy-gg/shared-ui";import{AccountSetup as ce,startSettingsSync as ue}from"@buoy-gg/shared-ui";import Ve,{useMemo as t,useCallback as ae,useEffect as v}from"react";import{View as $,StyleSheet as G}from"react-native";import{AppHostProvider as le}from"./AppHost";import{FloatingMenu as ge}from"./FloatingMenu.js";import{AppOverlay as ye}from"./AppHost";import{ToolOpenerBridge as pe}from"./ToolOpenerBridge.js";import{autoDiscoverPresets as de,autoDiscoverPresetsWithCustom as me}from"./autoDiscoverPresets.js";import{sendInstallPing as fe}from"../telemetry/installPing.js";import{isTelemetryEnabled as ve}from"../Buoy.js";import{renderAppIcon as be}from"./AppIcon";import{DevToolsVisibilityProvider as he}from"./DevToolsVisibilityContext.js";import{reportOptionalRequireError as n}from"./optionalRequire.js";import{HintsProvider as Oe,normalizeEnvironment as Te}from"@buoy-gg/shared-ui";import{MinimizedToolsProvider as Ae}from"./MinimizedToolsContext.js";import{validateDialConfig as qe}from"./defaultConfig.js";import{DefaultConfigProvider as Re}from"./DefaultConfigContext.js";import{LicenseManager as Ie,useProAccess as xe,useLicense as Ee,sameLicenseKey as _e}from"@buoy-gg/license";import*as Pe from"@buoy-gg/license";import{BuoySignIn as X}from"./BuoySignIn";import{AutoExternalSync as Y,ToolRegistryPublisher as ke,isExternalSyncAvailable as De}from"./autoExternalSync.js";import{externalSyncOptions as j,releaseTransportProblem as Se,shouldMountExternalSync as Me}from"./externalSyncGate.js";import{jsx as r,Fragment as R,jsxs as d}from"react/jsx-runtime";let Z=null;function ze(i){if(!i||i===Z)return;Z=i;console.warn(i)}function Ce(i){if(i&&typeof i==="object"&&i.appId)return i.appId;try{const{Platform:s}=require("react-native");const c=require("expo-constants");const a=(c?.default??c)?.expoConfig;const m=s.OS==="android"?a?.android?.package:a?.ios?.bundleIdentifier;if(typeof m==="string"&&m)return m}catch{}try{const s=require("expo-application");const c=(s?.default??s)?.applicationId;if(typeof c==="string"&&c)return c}catch{}return null}export const FloatingDevTools=({apps:i,requiredEnvVars:s,requiredStorageKeys:c,askBuoy:a,children:m,disableHints:K=false,defaultFloatingTools:ee,defaultDialTools:b,requireLicense:Fe,licenseKey:h,zustandStores:I,environment:re,externalSync:O=true,headless:x=false,signIn:T,...F})=>{const te=re??Te(process.env.NODE_ENV??"dev");const{isLicensed:A}=xe();const{licenseKey:E,isInitialized:H,tier:q,access:u}=Ee();const oe=h===void 0||_e(h,E);const _=oe&&u.status==="admitted";v(()=>{if(!H||u.status==="initializing")return;void fe({tier:u.status==="admitted"?q:"locked",enabled:ve()})},[H,u.status,q]);const P=T?Ce(T):null;v(()=>{if(!P)return;const e=Pe.SessionManager;if(!e)return;e.configure({audience:`app:${P}`});void e.load().catch(()=>{})},[P]);v(()=>{void Ie.configure(h).catch(()=>{})},[h]);v(()=>{if(_)ue()},[_]);v(()=>{if(!I||u.status==="locked")return;try{const{watchStores:e}=require("@buoy-gg/zustand");return e(I)}catch(e){n("@buoy-gg/zustand",e)}},[I,u.status]);const ne=t(()=>{if(b){return qe(b)}return b},[b]);const k=t(()=>{const e=[];if(s&&s.length>0){try{const{createEnvTool:o,createEnvVarConfig:C}=require("@buoy-gg/env");e.push(o({requiredEnvVars:C(s)}))}catch(o){n("@buoy-gg/env",o)}}if(c&&c.length>0){try{const{createStorageTool:o}=require("@buoy-gg/storage");e.push(o({requiredStorageKeys:c}))}catch(o){n("@buoy-gg/storage",o)}}if(a){try{const{createAskBuoyTool:o}=require("@buoy-gg/ask-buoy");e.push(o(a))}catch(o){n("@buoy-gg/ask-buoy",o)}}return e},[s,c,a]);const D=t(()=>{if(!i&&k.length===0)return void 0;return[...i||[],...k]},[i,k]);const f=t(()=>D?me(D):de(),[D]);const S=t(()=>f.filter(e=>e.sync),[f]);const L=t(()=>{try{const{DebugBordersStandaloneOverlay:e}=require("@buoy-gg/debug-borders");return e}catch(e){n("@buoy-gg/debug-borders",e);return null}},[]);const w=t(()=>{try{const{HighlightUpdatesOverlay:e}=require("@buoy-gg/highlight-updates");return e}catch(e){n("@buoy-gg/highlight-updates",e);return null}},[]);const V=t(()=>{try{const{ImageOverlayStandalone:e}=require("@buoy-gg/image-overlay");return e}catch(e){n("@buoy-gg/image-overlay",e);return null}},[]);const B=t(()=>{try{const{PerfMonitorOverlay:e}=require("@buoy-gg/perf-monitor");return e}catch(e){n("@buoy-gg/perf-monitor",e);return null}},[]);const U=t(()=>{try{const{JsTopHudOverlay:e}=require("@buoy-gg/js-top");return e}catch(e){n("@buoy-gg/js-top",e);return null}},[]);const l=t(()=>{try{const{RouteTracker:e}=require("@buoy-gg/route-events");return e}catch(e){n("@buoy-gg/route-events",e);return null}},[]);const g=t(()=>{try{const{ReactQueryTracker:e}=require("@buoy-gg/react-query");return e}catch(e){n("@buoy-gg/react-query",e);return null}},[]);const J=t(()=>{try{const{ImpersonateOverlay:e}=require("@buoy-gg/impersonate");return e}catch(e){n("@buoy-gg/impersonate",e);return null}},[]);const N=t(()=>{try{const{ScenariosOverlay:e}=require("@buoy-gg/scenarios");return e}catch(e){n("@buoy-gg/scenarios",e);return null}},[]);const y=t(()=>{try{const{ReduxAutoInstrument:e}=require("@buoy-gg/redux");return e??null}catch(e){n("@buoy-gg/redux",e);return null}},[]);const p=t(()=>{try{const{ConsoleRoot:e}=require("@buoy-gg/console");return e??null}catch(e){n("@buoy-gg/console",e);return null}},[]);const ie=ae(e=>{const o=f.find(C=>C.id===e);if(!o)return null;return be(o.icon,{slot:"dial",size:20,color:o.color})},[f]);const M=typeof __DEV__!=="undefined"&&__DEV__;if(!M&&!A){return T&&!x?r(X,{needsPlan:true}):null}const Q=Me({isDevelopment:M,isLicensed:A,externalSync:O,isAvailable:De()});const z=j(O);if(!M&&z?.enableInRelease){ze(Se(z.socketURL,z))}const W=r(ke,{requiredEnvVars:s,customApps:S});if(!_){return d(R,{children:[u.status==="initializing"&&d(R,{children:[y&&r(y,{}),p&&r(p,{}),l&&r(l,{}),g&&r(g,{})]}),!x&&(T?r(X,{}):r(ce,{}))]})}if(x){return d(R,{children:[y&&r(y,{}),p&&r(p,{}),l&&r(l,{}),g&&r(g,{}),W,Q&&r(Y,{options:j(O),requiredEnvVars:s,isPro:A,tier:q,licenseKey:E,customApps:S})]})}return r(Re,{defaultFloatingTools:ee,defaultDialTools:ne,children:r(Oe,{disableHints:K,children:r($,{style:je.container,pointerEvents:"box-none",__buoyDevToolsRoot:true,children:d(he,{children:[V&&r($,{style:G.absoluteFill,pointerEvents:"box-none",collapsable:false,children:r(V,{})}),r(le,{children:d(Ae,{getToolIcon:ie,children:[r(ge,{...F,apps:f,environment:te}),F.hidden?null:d(R,{children:[r(ye,{}),r(se,{})]}),r(pe,{})]})}),m,L&&r(L,{}),w&&r(w,{}),B&&r(B,{}),U&&r(U,{}),J&&r(J,{}),N&&r(N,{}),y&&r(y,{}),p&&r(p,{}),l&&r(l,{}),g&&r(g,{}),W,Q&&r(Y,{options:j(O),requiredEnvVars:s,isPro:A,tier:q,licenseKey:E,customApps:S})]})})})})};const je=G.create({container:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9999}});
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const SDK_VERSION="7.0.
|
|
1
|
+
"use strict";export const SDK_VERSION="7.0.51";
|
|
@@ -303,6 +303,19 @@ export interface FloatingDevToolsProps extends Omit<FloatingMenuProps, "apps"> {
|
|
|
303
303
|
* @default false
|
|
304
304
|
*/
|
|
305
305
|
headless?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Show "Sign in to Buoy" when Buoy isn't open: a QR code and a short code
|
|
308
|
+
* for buoy.gg/activate. Someone signed in to buoy.gg allows it there. Use it
|
|
309
|
+
* for test and live builds, where no key is in the app.
|
|
310
|
+
*
|
|
311
|
+
* The app id comes from your Expo config (iOS bundle id or Android package),
|
|
312
|
+
* or pass it: `signIn={{ appId: "com.acme.shop" }}`. Add `app:` plus that id
|
|
313
|
+
* at buoy.gg/dashboard/sites. Only render FloatingDevTools for your own
|
|
314
|
+
* admins and testers.
|
|
315
|
+
*/
|
|
316
|
+
signIn?: boolean | {
|
|
317
|
+
appId?: string;
|
|
318
|
+
};
|
|
306
319
|
}
|
|
307
320
|
/**
|
|
308
321
|
* Unified floating development tools component with automatic preset discovery.
|
|
@@ -358,5 +371,5 @@ export interface FloatingDevToolsProps extends Omit<FloatingMenuProps, "apps"> {
|
|
|
358
371
|
*
|
|
359
372
|
* @param props - FloatingDevTools props
|
|
360
373
|
*/
|
|
361
|
-
export declare const FloatingDevTools: ({ apps, requiredEnvVars, requiredStorageKeys, askBuoy, children, disableHints, defaultFloatingTools, defaultDialTools, requireLicense: _requireLicense, licenseKey: licenseKeyProp, zustandStores, environment, externalSync, headless, ...props }: FloatingDevToolsProps) => React.JSX.Element | null;
|
|
374
|
+
export declare const FloatingDevTools: ({ apps, requiredEnvVars, requiredStorageKeys, askBuoy, children, disableHints, defaultFloatingTools, defaultDialTools, requireLicense: _requireLicense, licenseKey: licenseKeyProp, zustandStores, environment, externalSync, headless, signIn, ...props }: FloatingDevToolsProps) => React.JSX.Element | null;
|
|
362
375
|
//# sourceMappingURL=FloatingDevTools.d.ts.map
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* Drift is prevented by a test that fails when this disagrees with
|
|
10
10
|
* package.json, so a version bump that forgets this file cannot ship.
|
|
11
11
|
*/
|
|
12
|
-
export declare const SDK_VERSION = "7.0.
|
|
12
|
+
export declare const SDK_VERSION = "7.0.51";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -303,6 +303,19 @@ export interface FloatingDevToolsProps extends Omit<FloatingMenuProps, "apps"> {
|
|
|
303
303
|
* @default false
|
|
304
304
|
*/
|
|
305
305
|
headless?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Show "Sign in to Buoy" when Buoy isn't open: a QR code and a short code
|
|
308
|
+
* for buoy.gg/activate. Someone signed in to buoy.gg allows it there. Use it
|
|
309
|
+
* for test and live builds, where no key is in the app.
|
|
310
|
+
*
|
|
311
|
+
* The app id comes from your Expo config (iOS bundle id or Android package),
|
|
312
|
+
* or pass it: `signIn={{ appId: "com.acme.shop" }}`. Add `app:` plus that id
|
|
313
|
+
* at buoy.gg/dashboard/sites. Only render FloatingDevTools for your own
|
|
314
|
+
* admins and testers.
|
|
315
|
+
*/
|
|
316
|
+
signIn?: boolean | {
|
|
317
|
+
appId?: string;
|
|
318
|
+
};
|
|
306
319
|
}
|
|
307
320
|
/**
|
|
308
321
|
* Unified floating development tools component with automatic preset discovery.
|
|
@@ -358,5 +371,5 @@ export interface FloatingDevToolsProps extends Omit<FloatingMenuProps, "apps"> {
|
|
|
358
371
|
*
|
|
359
372
|
* @param props - FloatingDevTools props
|
|
360
373
|
*/
|
|
361
|
-
export declare const FloatingDevTools: ({ apps, requiredEnvVars, requiredStorageKeys, askBuoy, children, disableHints, defaultFloatingTools, defaultDialTools, requireLicense: _requireLicense, licenseKey: licenseKeyProp, zustandStores, environment, externalSync, headless, ...props }: FloatingDevToolsProps) => React.JSX.Element | null;
|
|
374
|
+
export declare const FloatingDevTools: ({ apps, requiredEnvVars, requiredStorageKeys, askBuoy, children, disableHints, defaultFloatingTools, defaultDialTools, requireLicense: _requireLicense, licenseKey: licenseKeyProp, zustandStores, environment, externalSync, headless, signIn, ...props }: FloatingDevToolsProps) => React.JSX.Element | null;
|
|
362
375
|
//# sourceMappingURL=FloatingDevTools.d.ts.map
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* Drift is prevented by a test that fails when this disagrees with
|
|
10
10
|
* package.json, so a version bump that forgets this file cannot ship.
|
|
11
11
|
*/
|
|
12
|
-
export declare const SDK_VERSION = "7.0.
|
|
12
|
+
export declare const SDK_VERSION = "7.0.51";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.51",
|
|
4
4
|
"description": "Floating developer menu and account setup for React Native. Add tool packages and configure Desktop or MCP connections separately.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"react-devtools-core": "6.1.5",
|
|
64
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
65
|
-
"@buoy-gg/license": "^7.0.
|
|
66
|
-
"@buoy-gg/floating-tools-react": "^7.0.
|
|
67
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
64
|
+
"@buoy-gg/floating-tools-core": "^7.0.51",
|
|
65
|
+
"@buoy-gg/license": "^7.0.51",
|
|
66
|
+
"@buoy-gg/floating-tools-react": "^7.0.51",
|
|
67
|
+
"@buoy-gg/shared-ui": "^7.0.51"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "*"
|