@buoy-gg/shared-ui 7.0.78 → 7.0.80
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/JsModal.js +1 -1
- package/lib/commonjs/bugCase/appInfo.js +1 -0
- package/lib/commonjs/bugCase/appInfo.web.js +1 -0
- package/lib/commonjs/bugCase/capture.js +1 -1
- package/lib/commonjs/bugCase/format.js +2 -2
- package/lib/commonjs/bugCase/index.js +1 -1
- package/lib/commonjs/bugCase/lock.js +1 -1
- package/lib/commonjs/bugCase/media.js +1 -0
- package/lib/commonjs/bugCase/recorder.js +1 -1
- package/lib/commonjs/bugCase/scrub.js +1 -1
- package/lib/commonjs/bugCase/steps.js +1 -1
- package/lib/commonjs/bugCase/teamKey.js +1 -0
- package/lib/commonjs/bugCase/validate.js +1 -0
- package/lib/commonjs/clipboard/autoDetectClipboard.js +1 -1
- package/lib/commonjs/clipboard/clipboard-impl.js +1 -1
- package/lib/commonjs/clipboard/clipboard-impl.web.js +1 -1
- package/lib/commonjs/clipboard/index.js +1 -1
- package/lib/commonjs/dataViewer/LiveExplorer.js +1 -1
- package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +1 -1
- package/lib/commonjs/dataViewer/flattenTree.js +1 -0
- package/lib/commonjs/dataViewer/liveEntries.js +1 -0
- package/lib/commonjs/icons/index.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/license/BuoyUpgradeSheet.js +1 -1
- package/lib/commonjs/license/index.js +1 -1
- package/lib/commonjs/sync/keyedArrays.js +1 -1
- package/lib/commonjs/sync/valuePath.js +1 -1
- package/lib/commonjs/ui/components/DynamicFilterView.js +1 -1
- package/lib/commonjs/ui/components/EntityFilterView.js +1 -1
- package/lib/commonjs/ui/components/WindowControls.js +1 -1
- package/lib/commonjs/ui/floating/FloatingTool.js +1 -1
- package/lib/commonjs/ui/listPresets.js +1 -1
- package/lib/commonjs/utils/fiberRootAnchor.js +1 -0
- package/lib/commonjs/utils/index.js +1 -1
- package/lib/commonjs/utils/loadOptionalModule.js +1 -1
- package/lib/commonjs/utils/loadToolModule.js +1 -1
- package/lib/commonjs/utils/minimalSuperJSON.js +1 -1
- package/lib/commonjs/utils/persistentStorage.js +1 -1
- package/lib/commonjs/utils/persistentStorage.web.js +1 -1
- package/lib/commonjs/utils/reloadPlatform.js +1 -1
- package/lib/commonjs/utils/snapshotProviderKit.js +1 -1
- package/lib/module/JsModal.js +1 -1
- package/lib/module/bugCase/appInfo.js +1 -0
- package/lib/module/bugCase/appInfo.web.js +1 -0
- package/lib/module/bugCase/capture.js +1 -1
- package/lib/module/bugCase/format.js +2 -2
- package/lib/module/bugCase/index.js +1 -1
- package/lib/module/bugCase/lock.js +1 -1
- package/lib/module/bugCase/media.js +1 -0
- package/lib/module/bugCase/recorder.js +1 -1
- package/lib/module/bugCase/scrub.js +1 -1
- package/lib/module/bugCase/steps.js +1 -1
- package/lib/module/bugCase/teamKey.js +1 -0
- package/lib/module/bugCase/validate.js +1 -0
- package/lib/module/clipboard/autoDetectClipboard.js +1 -1
- package/lib/module/clipboard/clipboard-impl.js +1 -1
- package/lib/module/clipboard/clipboard-impl.web.js +1 -1
- package/lib/module/clipboard/index.js +1 -1
- package/lib/module/dataViewer/LiveExplorer.js +1 -1
- package/lib/module/dataViewer/VirtualizedDataExplorer.js +1 -1
- package/lib/module/dataViewer/flattenTree.js +1 -0
- package/lib/module/dataViewer/liveEntries.js +1 -0
- package/lib/module/icons/index.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/license/BuoyUpgradeSheet.js +1 -1
- package/lib/module/license/index.js +1 -1
- package/lib/module/sync/keyedArrays.js +1 -1
- package/lib/module/sync/valuePath.js +1 -1
- package/lib/module/ui/components/DynamicFilterView.js +1 -1
- package/lib/module/ui/components/EntityFilterView.js +1 -1
- package/lib/module/ui/components/WindowControls.js +1 -1
- package/lib/module/ui/floating/FloatingTool.js +1 -1
- package/lib/module/ui/listPresets.js +1 -1
- package/lib/module/utils/fiberRootAnchor.js +1 -0
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/loadOptionalModule.js +1 -1
- package/lib/module/utils/loadToolModule.js +1 -1
- package/lib/module/utils/minimalSuperJSON.js +1 -1
- package/lib/module/utils/persistentStorage.js +1 -1
- package/lib/module/utils/persistentStorage.web.js +1 -1
- package/lib/module/utils/reloadPlatform.js +1 -1
- package/lib/module/utils/snapshotProviderKit.js +1 -1
- package/lib/typescript/commonjs/JsModal.d.ts +3 -4
- package/lib/typescript/commonjs/JsModal.web.d.ts +2 -0
- package/lib/typescript/commonjs/bugCase/appInfo.d.ts +17 -0
- package/lib/typescript/commonjs/bugCase/appInfo.web.d.ts +14 -0
- package/lib/typescript/commonjs/bugCase/format.d.ts +2 -1
- package/lib/typescript/commonjs/bugCase/index.d.ts +7 -0
- package/lib/typescript/commonjs/bugCase/lock.d.ts +13 -0
- package/lib/typescript/commonjs/bugCase/media.d.ts +90 -0
- package/lib/typescript/commonjs/bugCase/recorder.d.ts +1 -0
- package/lib/typescript/commonjs/bugCase/scrub.d.ts +2 -2
- package/lib/typescript/commonjs/bugCase/steps.d.ts +10 -0
- package/lib/typescript/commonjs/bugCase/teamKey.d.ts +185 -0
- package/lib/typescript/commonjs/bugCase/types.d.ts +10 -0
- package/lib/typescript/commonjs/bugCase/validate.d.ts +14 -0
- package/lib/typescript/commonjs/clipboard/autoDetectClipboard.d.ts +1 -1
- package/lib/typescript/commonjs/clipboard/clipboard-impl.d.ts +6 -0
- package/lib/typescript/commonjs/clipboard/clipboard-impl.web.d.ts +2 -0
- package/lib/typescript/commonjs/clipboard/index.d.ts +1 -1
- package/lib/typescript/commonjs/dataViewer/flattenTree.d.ts +35 -0
- package/lib/typescript/commonjs/dataViewer/liveEntries.d.ts +19 -0
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts +3 -2
- package/lib/typescript/commonjs/license/BuoyUpgradeSheet.d.ts +8 -0
- package/lib/typescript/commonjs/license/index.d.ts +1 -1
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts +6 -1
- package/lib/typescript/commonjs/ui/floating/FloatingTool.d.ts +6 -1
- package/lib/typescript/commonjs/ui/listPresets.d.ts +2 -2
- package/lib/typescript/commonjs/utils/fiberRootAnchor.d.ts +19 -0
- package/lib/typescript/commonjs/utils/index.d.ts +2 -1
- package/lib/typescript/commonjs/utils/minimalSuperJSON.d.ts +4 -2
- package/lib/typescript/commonjs/utils/persistentStorage.d.ts +19 -0
- package/lib/typescript/commonjs/utils/persistentStorage.web.d.ts +17 -0
- package/lib/typescript/module/JsModal.d.ts +3 -4
- package/lib/typescript/module/JsModal.web.d.ts +2 -0
- package/lib/typescript/module/bugCase/appInfo.d.ts +17 -0
- package/lib/typescript/module/bugCase/appInfo.web.d.ts +14 -0
- package/lib/typescript/module/bugCase/format.d.ts +2 -1
- package/lib/typescript/module/bugCase/index.d.ts +7 -0
- package/lib/typescript/module/bugCase/lock.d.ts +13 -0
- package/lib/typescript/module/bugCase/media.d.ts +90 -0
- package/lib/typescript/module/bugCase/recorder.d.ts +1 -0
- package/lib/typescript/module/bugCase/scrub.d.ts +2 -2
- package/lib/typescript/module/bugCase/steps.d.ts +10 -0
- package/lib/typescript/module/bugCase/teamKey.d.ts +185 -0
- package/lib/typescript/module/bugCase/types.d.ts +10 -0
- package/lib/typescript/module/bugCase/validate.d.ts +14 -0
- package/lib/typescript/module/clipboard/autoDetectClipboard.d.ts +1 -1
- package/lib/typescript/module/clipboard/clipboard-impl.d.ts +6 -0
- package/lib/typescript/module/clipboard/clipboard-impl.web.d.ts +2 -0
- package/lib/typescript/module/clipboard/index.d.ts +1 -1
- package/lib/typescript/module/dataViewer/flattenTree.d.ts +35 -0
- package/lib/typescript/module/dataViewer/liveEntries.d.ts +19 -0
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts +3 -2
- package/lib/typescript/module/license/BuoyUpgradeSheet.d.ts +8 -0
- package/lib/typescript/module/license/index.d.ts +1 -1
- package/lib/typescript/module/sync/keyedArrays.d.ts +6 -1
- package/lib/typescript/module/ui/floating/FloatingTool.d.ts +6 -1
- package/lib/typescript/module/ui/listPresets.d.ts +2 -2
- package/lib/typescript/module/utils/fiberRootAnchor.d.ts +19 -0
- package/lib/typescript/module/utils/index.d.ts +2 -1
- package/lib/typescript/module/utils/minimalSuperJSON.d.ts +4 -2
- package/lib/typescript/module/utils/persistentStorage.d.ts +19 -0
- package/lib/typescript/module/utils/persistentStorage.web.d.ts +17 -0
- package/lib/web/chunks/chunk-36A4T5PL.mjs +1 -0
- package/lib/web/chunks/{chunk-XUYN4NOF.mjs → chunk-5UII72AQ.mjs} +1 -1
- package/lib/web/chunks/chunk-A3N3WVKC.mjs +1 -0
- package/lib/web/chunks/chunk-BPL65J3F.mjs +1 -0
- package/lib/web/chunks/chunk-EY7GXWGI.mjs +1 -1
- package/lib/web/chunks/chunk-IE2U5SN2.mjs +15 -0
- package/lib/web/chunks/chunk-IEAXJZCR.mjs +6 -0
- package/lib/web/chunks/chunk-OF3VWR6K.mjs +2 -2
- package/lib/web/chunks/{chunk-OVTASJUJ.mjs → chunk-SUG6TLF5.mjs} +1 -1
- package/lib/web/chunks/chunk-SXWOOYFL.mjs +1 -0
- package/lib/web/chunks/chunk-T44OT3CI.mjs +6 -0
- package/lib/web/chunks/{chunk-OQB3GW44.mjs → chunk-UVVRCZX5.mjs} +1 -1
- package/lib/web/chunks/chunk-Y7FM4WZ7.mjs +6 -0
- package/lib/web/chunks/persistentStorage.web-BFPYMY5C.mjs +1 -0
- package/lib/web/dataViewer.mjs +2 -2
- package/lib/web/history.mjs +1 -1
- package/lib/web/hooks.mjs +1 -1
- package/lib/web/index.mjs +12 -6
- package/lib/web/ui.mjs +1 -1
- package/lib/web/utils.mjs +1 -1
- package/package.json +5 -5
- package/scripts/detect-clipboard.js +18 -2
- package/lib/web/chunks/chunk-BMITMQVB.mjs +0 -6
- package/lib/web/chunks/chunk-DJD42EPL.mjs +0 -1
- package/lib/web/chunks/chunk-GN75GBYZ.mjs +0 -1
- package/lib/web/chunks/chunk-GTRVOJUH.mjs +0 -1
- package/lib/web/chunks/chunk-HE5ONCAL.mjs +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as B,useMemo as re,useCallback as U,useRef as _,useEffect as te,memo as oe}from"react";import{Text as j,TouchableOpacity as ie,View as u,StyleSheet as ue,FlatList as pe}from"react-native";import{displayValue as Me}from"../utils/displayValue.js";import{gameUIColors as a}from"../ui/gameUI/index.js";import{night as ye}from"../ui/night/nightTheme.js";import{CopyButton as De}from"../ui/components/CopyButton.js";import{ChevronRight as Re}from"../icons/index.js";import{IndentGuidesOverlay as he}from"./IndentGuidesOverlay.js";import{monoFont as se}from"../ui/fonts.js";import{jsx as i,jsxs as T,Fragment as ke}from"react/jsx-runtime";const ge={top:10,bottom:10,left:10,right:10};const z=24;const Pe=24;const ee=50;const ne=15;const je=500;const Ze=30;const Le=300;const ae=16;const me=Array.from({length:ne+1},(e,l)=>ue.create({container:{marginLeft:l*ae}}).container);const Ae=new Map([["string",a.dataTypes.string],["number",a.dataTypes.number],["bigint",a.optional],["boolean",a.dataTypes.boolean],["null",a.dataTypes.null],["undefined",a.dataTypes.undefined],["function",a.dataTypes.function],["symbol",a.critical],["date",a.critical],["error",a.error],["array",a.dataTypes.array],["object",a.dataTypes.object],["map",a.info],["set",a.success],["circular",a.warning]]);const o=ue.create({container:{backgroundColor:ye.color.bg,borderRadius:8,borderWidth:1,borderColor:ye.color.border},header:{flexDirection:"column",paddingHorizontal:16,paddingVertical:12},headerRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},title:{color:a.primary,fontSize:14,fontWeight:"500"},description:{color:a.secondary,fontSize:12,marginTop:2},typeLegend:{flexDirection:"row",flexWrap:"wrap",gap:6,marginTop:8,paddingTop:8,borderTopWidth:1,borderTopColor:a.primary+"14"},typeBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},typeColor:{width:8,height:8,borderRadius:4,marginRight:4},typeName:{fontSize:10,fontWeight:"500",color:a.secondary},itemContainer:{minHeight:z,backgroundColor:"transparent",position:"relative",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:0,paddingRight:16,paddingVertical:2,minHeight:24},itemTouchablePressed:{backgroundColor:a.primary+"0A"},itemSelected:{backgroundColor:a.primary+"14"},expanderContainer:{width:16,alignItems:"center",justifyContent:"center",marginTop:4},expanderIcon:{width:12,height:12},labelContainer:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelContainerVertical:{flex:1,flexDirection:"column",paddingLeft:2,paddingVertical:2},labelContainerVerticalRow:{flexDirection:"row",alignItems:"center",marginBottom:2},labelText:{color:a.primary,fontSize:12,fontWeight:"500",fontFamily:se,marginRight:8,flexShrink:1},labelTextTruncated:{color:a.primary,fontSize:12,fontWeight:"500",fontFamily:se,flexShrink:1},valueText:{fontSize:12,fontFamily:se,flex:1,color:a.primaryLight},loadingContainer:{padding:16,alignItems:"center"},loadingText:{color:a.secondary,fontSize:12},noDataContainer:{padding:16,alignItems:"center"},noDataText:{color:a.secondary,fontSize:12},listContent:{paddingBottom:8},headerTouchable:{flex:1,flexDirection:"row",alignItems:"center"},expanderMargin:{marginLeft:8}});function le(e){return{path:e.path.slice(1),value:e.value,label:e.key}}function ce(e,l,d=0){if(d>=l)return d;let h=d+1;if(Array.isArray(e)){for(const w of e){if(h>=l)return h;h=ce(w,l,h)}}else if(e!==null&&typeof e==="object"){for(const w of Object.values(e)){if(h>=l)return h;h=ce(w,l,h)}}return h}const _e=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(e instanceof Date)return"date";if(e instanceof Error)return"error";if(e instanceof Map)return"map";if(e instanceof Set)return"set";if(e instanceof RegExp)return"regexp";if(typeof e==="function")return"function";if(typeof e==="symbol")return"symbol";if(typeof e==="bigint")return"bigint";if(typeof e==="object")return"object";return typeof e};const Ve=(e,l)=>{if(e===null)return 0;switch(l){case"array":return Array.isArray(e)?e.length:0;case"object":return typeof e==="object"&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof RegExp)&&!(e instanceof Map)&&!(e instanceof Set)?Object.keys(e).length:0;case"map":return e instanceof Map?e.size:0;case"set":return e instanceof Set?e.size:0;default:return 0}};const He=(e,l)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(l){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:return Me(e)}};const be=e=>{return Ae.get(e)||a.dataTypes.array};const xe=({expanded:e,onPress:l})=>{return i(ie,{"sentry-label":"ignore devtools data explorer expander",style:o.expanderContainer,onPress:l,hitSlop:ge,children:i(u,{style:o.expanderIcon,children:i(Re,{size:12,color:a.secondary,strokeWidth:2,style:{transform:[{rotate:e?"90deg":"0deg"}]}})})})};xe.displayName="Expander";const Te=oe(xe);const Se=({visibleTypes:e})=>{const l=Array.from(new Set(e)).slice(0,8);return i(u,{style:o.typeLegend,children:l.map(d=>{const h=be(d);return T(u,{style:[o.typeBadge,{backgroundColor:`${h}10`,borderColor:`${h}30`}],children:[i(u,{style:[o.typeColor,{backgroundColor:h}]}),i(j,{style:o.typeName,children:d})]},d)})})};Se.displayName="TypeLegend";const ze=oe(Se);const Oe=(e,l=10,d=false)=>{const[h,w]=B([]);const V=_(new Map);const Q=U(()=>{const t=new Set(["root"]);if(d&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((m,s)=>{t.add(`root.${s}`)})}else{Object.keys(e).forEach(m=>{t.add(`root.${m}`)})}}return t},[d,e]);const[L,O]=B(()=>Q());const[$,A]=B(false);const I=_(new WeakSet);const k=_(false);const N=_(0);const W=_(0);const c=_(void 0);const C=U((t,m,s,g="root",n=0,M,x=[],S=0,P=1,E=[])=>{if(n>Math.min(l,ne))return[];const p=[...x,g];const f=p.join(".");const b=_e(t);const F=["object","array","map","set"].includes(b)&&t!==null;const J=F?Ve(t,b):0;const H=Math.min(J,je);if(t&&typeof t==="object"){if(s.has(t)){return[{id:f,key:g,value:"[Circular Reference]",valueType:"circular",depth:n,isExpandable:false,isExpanded:false,parentId:M,hasChildren:false,childCount:0,path:p,type:"circular",isLastChild:S===P-1,parentHasMoreSiblings:[...E],siblingIndex:S,totalSiblings:P}]}s.add(t)}const r={id:f,key:g,value:t,valueType:b,depth:n,isExpandable:F,isExpanded:m.has(f),parentId:M,hasChildren:H>0,childCount:H,path:p,type:F?"expandable":b,isLastChild:S===P-1,parentHasMoreSiblings:[...E],siblingIndex:S,totalSiblings:P};const y=[r];if(F&&m.has(f)&&n<Math.min(l,ne)){try{let D=[];switch(b){case"array":D=Array.isArray(t)?t.map((R,G)=>[G.toString(),R]):[];break;case"object":D=typeof t==="object"&&t!==null&&!(t instanceof Date)&&!(t instanceof Error)&&!(t instanceof RegExp)&&!(t instanceof Map)&&!(t instanceof Set)?Object.entries(t):[];break;case"map":D=t instanceof Map?Array.from(t.entries()).map(([R,G])=>[String(R),G]):[];break;case"set":D=t instanceof Set?Array.from(t.values()).map((R,G)=>[G.toString(),R]):[];break}const v=D.slice(0,H);const Ce=v.length;const de=[...E];if(n>0){de[n-1]=!r.isLastChild}for(let R=0;R<v.length;R+=ee){const G=v.slice(R,R+ee);let fe=R;for(const[we,Ie]of G){y.push(...C(Ie,m,s,we,n+1,f,p,fe,Ce,de));fe++}if(R>0&&R%(ee*2)===0){break}}}catch(D){console.error("[Buoy]",D)}}return y},[l]);te(()=>{if(c.current&&(c.current.type==="expand"||c.current.type==="collapse")){if($){A(false);k.current=false}c.current=void 0;return}if(k.current){return}let t;const m=++N.current;const s=()=>N.current===m;k.current=true;A(true);const g=async()=>{t=setTimeout(()=>{if(k.current&&s()){A(false);k.current=false}},5e3);await new Promise(n=>setTimeout(()=>n(),10));if(!s()){return}try{I.current=new WeakSet;W.current=Date.now();const n=C(e,L,I.current,"root",0,void 0,[],0,1,[]);const M=new Map;n.forEach((x,S)=>{M.set(x.id,{item:x,index:S})});V.current=M;if(t)clearTimeout(t);if(s()){w(n);A(false);k.current=false}}catch(n){console.error("[Buoy]",n);if(t)clearTimeout(t);if(s()){w([]);V.current=new Map;A(false);k.current=false}}};g();return()=>{k.current=false;if(t)clearTimeout(t)}},[e,L,C,l]);const Y=U((t,m)=>{A(false);k.current=false;w(s=>{const g=V.current.get(t);if(!g){return s}const{item:n,index:M}=g;if(m&&n.isExpandable&&n.hasChildren){const x=[...s];const S=new WeakSet;if(n.value&&typeof n.value==="object"){S.add(n.value)}const P=[];try{let f=[];const b=n.valueType;switch(b){case"array":f=Array.isArray(n.value)?n.value.map((r,y)=>[y.toString(),r]):[];break;case"object":f=typeof n.value==="object"&&n.value!==null&&!(n.value instanceof Date)&&!(n.value instanceof Error)&&!(n.value instanceof RegExp)&&!(n.value instanceof Map)&&!(n.value instanceof Set)?Object.entries(n.value):[];break;case"map":f=n.value instanceof Map?Array.from(n.value.entries()).map(([r,y])=>[String(r),y]):[];break;case"set":f=n.value instanceof Set?Array.from(n.value.values()).map((r,y)=>[y.toString(),r]):[];break}const F=f.length;const J=n.parentHasMoreSiblings||[];const H=[...J];if(n.depth>0){H[n.depth-1]=!n.isLastChild}f.forEach(([r,y],D)=>{const v=C(y,new Set,S,r,n.depth+1,t,n.path,D,F,H);P.push(...v)})}catch(f){console.error("[Buoy]",f)}const E=P;if(E.length>0){}x[M]={...n,isExpanded:true};x.splice(M+1,0,...E);const p=new Map;x.forEach((f,b)=>{p.set(f.id,{item:f,index:b})});V.current=p;return x}else if(!m){const x=new Set;const S=(p,f)=>{s.forEach(b=>{if(b.parentId===p||b.id.startsWith(p+".")&&b.depth>f){x.add(b.id);if(b.hasChildren){S(b.id,b.depth)}}})};S(t,n.depth);const P=s.map(p=>{if(p.id===t){return{...p,isExpanded:false}}return p}).filter(p=>!x.has(p.id));const E=new Map;P.forEach((p,f)=>{E.set(p.id,{item:p,index:f})});V.current=E;return P}return s})},[C]);const X=U(t=>{O(m=>{const s=new Set(m);const g=!s.has(t);if(g){s.add(t)}else{s.delete(t)}c.current={type:g?"expand":"collapse",itemId:t};Y(t,g);return s})},[Y]);const K=ce(e,ee,0)<ee;const q=re(()=>{if(!K)return null;return C(e,L,new WeakSet,"root",0,void 0,[],0,1,[])},[K,e,L,C]);const Z=U(t=>{if(t.length===0)return;O(m=>{if(t.every(g=>m.has(g)))return m;const s=new Set(m);for(const g of t)s.add(g);return s})},[]);return{flatData:q??h,isProcessing:q?false:$,toggleExpanded:X,revealPath:Z}};const Ee=({item:e,onToggleExpanded:l,index:d,onSelect:h,isSelected:w,selectable:V,onRequestInlineEdit:Q,isInlineEditing:L,inlineEditor:O,testIDPrefix:$})=>{const[A,I]=B(false);const[k,N]=B(false);const W=V===true;const c=_(0);const C=e.path.slice(1);const Y=me[Math.min(e.depth,ne)]||me[0];const X=be(e.valueType);const K=false;const q=()=>{if(W){const s=Date.now();const g=s-c.current<Le;c.current=s;if(g&&!e.isExpandable&&Q){Q(e);return}h(e);return}if(e.isExpandable){l(e.id)}h(e)};const Z=()=>{if(e.isExpandable){l(e.id)}h(e)};const t=()=>{};const m=e.key;return T(u,{style:[o.itemContainer,Y],children:[T(ie,{"sentry-label":"ignore devtools data explorer item",testID:`${$}-${e.id}`,accessibilityLabel:`${e.key}: ${e.valueType}`,style:[o.itemTouchable,A&&o.itemTouchablePressed,W&&w&&o.itemSelected,K&&{minHeight:Pe,paddingVertical:2}],onPress:q,onPressIn:()=>I(true),onPressOut:()=>I(false),activeOpacity:e.isExpandable||W?.7:1,disabled:!e.isExpandable&&!W,children:[e.isExpandable?i(Te,{expanded:e.isExpanded,onPress:Z}):i(u,{style:o.expanderContainer}),T(u,{style:o.labelContainer,children:[T(j,{style:o.labelText,numberOfLines:1,children:[e.key,":"]}),L&&O?O:e.isExpandable?T(j,{style:[o.valueText,{color:a.secondary}],numberOfLines:1,children:[e.valueType," (",e.childCount," ",e.childCount===1?"item":"items",")"]}):i(j,{style:[o.valueText,{color:X}],numberOfLines:1,children:He(e.value,e.valueType)})]})]}),e.value!==void 0?i(De,{value:e.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})};Ee.displayName="VirtualizedItem";const Ne=oe(Ee);export const VirtualizedDataExplorer=({title:e,description:l,data:d,maxDepth:h=10,rawMode:w=false,initialExpanded:V=false,disableCopy:Q=false,onSelectionChange:L,onRequestInlineEdit:O,inlineEditPath:$,renderInlineEditor:A,selectPath:I,testIDPrefix:k="buoy-tree-row"})=>{const[N,W]=B(w);const{flatData:c,isProcessing:C,toggleExpanded:Y,revealPath:X}=Oe(d,h,V);const K=_(null);const[q,Z]=B({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/z)-1))});const t=_({itemVisiblePercentThreshold:1});const m=_(({viewableItems:r})=>{const y=r.map(D=>D.index).filter(D=>typeof D==="number");if(y.length){Z({start:Math.min(...y),end:Math.max(...y)})}}).current;te(()=>{Z({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/z)-1))})},[c.length]);const s=re(()=>{const r=new Set;for(const y of c){r.add(y.valueType);if(r.size>=8)break}return Array.from(r)},[c]);const g=()=>{W(!N)};const[n,M]=B(null);const x=re(()=>n==null?void 0:c.find(r=>r.id===n),[c,n]);const S=x?.depth;te(()=>{if(!L)return;L(x?le(x):null)},[x,L]);const P=U(r=>{M(y=>y===r.id?null:r.id)},[]);const E=I===void 0?void 0:I===null?"\0null":I.join(".");const p=_(E);te(()=>{if(E===p.current)return;p.current=E;if(E===void 0)return;if(I==null){M(null);return}const r=["root"];for(const y of I.slice(0,-1)){r.push(`${r[r.length-1]}.${y}`)}X(r);M(["root",...I].join("."))},[E,I,X]);const f=U(r=>{M(r.id);O?.(le(r))},[O]);const b=({item:r,index:y})=>i(Ne,{item:r,index:y,onToggleExpanded:Y,onSelect:P,isSelected:x?.id===r.id,selectable:L!=null,onRequestInlineEdit:f,isInlineEditing:$!=null&&$.join(".")===r.path.slice(1).join("."),inlineEditor:A?A(le(r)):null,testIDPrefix:k});const F=z;const J=r=>r.id;const H=d!==null&&d!==void 0&&(typeof d==="string"?d.length>0:typeof d==="number"||typeof d==="boolean"?true:Array.isArray(d)?d.length>0:typeof d==="object"?Object.keys(d).length>0:false);if(w){if(!H){return i(u,{style:{flex:1,justifyContent:"center",alignItems:"center",padding:20},children:i(j,{style:o.noDataText,children:"No data available"})})}return i(u,{style:{minHeight:C?40:c.length*z},children:C?i(u,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:T(j,{style:o.loadingText,children:["Processing data... (raw mode, isProcessing=",String(C),")"]})}):T(u,{style:{position:"relative",height:c.length*z},children:[i(he,{items:c,visibleRange:{start:0,end:Math.max(0,c.length-1)},itemHeight:z,indentWidth:ae,activeDepth:S}),i(pe,{keyboardShouldPersistTaps:"handled",ref:K,"sentry-label":"ignore devtools data explorer list",data:c,renderItem:b,keyExtractor:J,showsVerticalScrollIndicator:true,contentContainerStyle:o.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})]})})}if(!H){return T(u,{style:o.container,children:[i(u,{style:o.header,children:i(u,{style:o.headerRow,children:T(u,{style:{flex:1},children:[i(j,{style:o.title,children:e}),l&&i(j,{style:o.description,children:l})]})})}),i(u,{style:o.noDataContainer,children:i(j,{style:o.noDataText,children:"No data available"})})]})}return T(u,{style:o.container,children:[T(u,{style:o.header,children:[i(u,{style:o.headerRow,children:T(ie,{"sentry-label":"ignore devtools data explorer header toggle",onPress:g,hitSlop:ge,style:o.headerTouchable,children:[T(u,{style:{flex:1},children:[i(j,{style:o.title,children:e}),l&&i(j,{style:o.description,children:l})]}),i(u,{style:o.expanderMargin,children:i(Te,{expanded:N,onPress:g})})]})}),N&&s.length>0&&!w&&i(ze,{visibleTypes:s})]}),N&&i(ke,{children:C?i(u,{style:o.loadingContainer,children:T(j,{style:o.loadingText,children:["Processing data... (isProcessing=",String(C),")"]})}):T(u,{style:{height:c.length*z,position:"relative"},children:[i(he,{items:c,visibleRange:q,itemHeight:z,indentWidth:ae,activeDepth:S}),i(pe,{keyboardShouldPersistTaps:"handled",ref:K,"sentry-label":"ignore devtools data explorer collapsed list",data:c,renderItem:b,keyExtractor:J,showsVerticalScrollIndicator:true,contentContainerStyle:o.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,onViewableItemsChanged:m,viewabilityConfig:t.current})]})})]})};
|
|
1
|
+
"use strict";import{useState as O,useMemo as Z,useCallback as A,useRef as k,useEffect as X,memo as J}from"react";import{Text as P,TouchableOpacity as Q,View as f,StyleSheet as ie,FlatList as se}from"react-native";import{displayValue as be}from"../utils/displayValue.js";import{gameUIColors as o}from"../ui/gameUI/index.js";import{night as ae}from"../ui/night/nightTheme.js";import{CopyButton as xe}from"../ui/components/CopyButton.js";import{ChevronRight as Te}from"../icons/index.js";import{IndentGuidesOverlay as le}from"./IndentGuidesOverlay.js";import{monoFont as ee}from"../ui/fonts.js";import{flattenTree as Se,getChildEntries as we,MAX_DEPTH_LIMIT as ce}from"./flattenTree.js";import{jsx as n,jsxs as m,Fragment as Ce}from"react/jsx-runtime";const de={top:10,bottom:10,left:10,right:10};const j=24;const Ee=24;const fe=50;const $e=30;const Ie=300;const te=16;const ue=Array.from({length:ce+1},(e,l)=>ie.create({container:{marginLeft:l*te}}).container);const De=new Map([["string",o.dataTypes.string],["number",o.dataTypes.number],["bigint",o.optional],["boolean",o.dataTypes.boolean],["null",o.dataTypes.null],["undefined",o.dataTypes.undefined],["function",o.dataTypes.function],["symbol",o.critical],["date",o.critical],["error",o.error],["array",o.dataTypes.array],["object",o.dataTypes.object],["map",o.info],["set",o.success],["circular",o.warning]]);const t=ie.create({container:{backgroundColor:ae.color.bg,borderRadius:8,borderWidth:1,borderColor:ae.color.border},header:{flexDirection:"column",paddingHorizontal:16,paddingVertical:12},headerRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},title:{color:o.primary,fontSize:14,fontWeight:"500"},description:{color:o.secondary,fontSize:12,marginTop:2},typeLegend:{flexDirection:"row",flexWrap:"wrap",gap:6,marginTop:8,paddingTop:8,borderTopWidth:1,borderTopColor:o.primary+"14"},typeBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},typeColor:{width:8,height:8,borderRadius:4,marginRight:4},typeName:{fontSize:10,fontWeight:"500",color:o.secondary},itemContainer:{minHeight:j,backgroundColor:"transparent",position:"relative",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:0,paddingRight:16,paddingVertical:2,minHeight:24},itemTouchablePressed:{backgroundColor:o.primary+"0A"},itemSelected:{backgroundColor:o.primary+"14"},expanderContainer:{width:16,alignItems:"center",justifyContent:"center",marginTop:4},expanderIcon:{width:12,height:12},labelContainer:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelContainerVertical:{flex:1,flexDirection:"column",paddingLeft:2,paddingVertical:2},labelContainerVerticalRow:{flexDirection:"row",alignItems:"center",marginBottom:2},labelText:{color:o.primary,fontSize:12,fontWeight:"500",fontFamily:ee,marginRight:8,flexShrink:1},labelTextTruncated:{color:o.primary,fontSize:12,fontWeight:"500",fontFamily:ee,flexShrink:1},valueText:{fontSize:12,fontFamily:ee,flex:1,color:o.primaryLight},loadingContainer:{padding:16,alignItems:"center"},loadingText:{color:o.secondary,fontSize:12},noDataContainer:{padding:16,alignItems:"center"},noDataText:{color:o.secondary,fontSize:12},listContent:{paddingBottom:8},headerTouchable:{flex:1,flexDirection:"row",alignItems:"center"},expanderMargin:{marginLeft:8}});function ne(e){return{path:e.path.slice(1),value:e.value,label:e.key}}function re(e,l,d=0){if(d>=l)return d;let u=d+1;if(Array.isArray(e)){for(const x of e){if(u>=l)return u;u=re(x,l,u)}}else if(e!==null&&typeof e==="object"){for(const x of Object.values(e)){if(u>=l)return u;u=re(x,l,u)}}return u}const Re=(e,l)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(l){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:return be(e)}};const pe=e=>{return De.get(e)||o.dataTypes.array};const he=({expanded:e,onPress:l})=>{return n(Q,{"sentry-label":"ignore devtools data explorer expander",style:t.expanderContainer,onPress:l,hitSlop:de,children:n(f,{style:t.expanderIcon,children:n(Te,{size:12,color:o.secondary,strokeWidth:2,style:{transform:[{rotate:e?"90deg":"0deg"}]}})})})};he.displayName="Expander";const ye=J(he);const ge=({visibleTypes:e})=>{const l=Array.from(new Set(e)).slice(0,8);return n(f,{style:t.typeLegend,children:l.map(d=>{const u=pe(d);return m(f,{style:[t.typeBadge,{backgroundColor:`${u}10`,borderColor:`${u}30`}],children:[n(f,{style:[t.typeColor,{backgroundColor:u}]}),n(P,{style:t.typeName,children:d})]},d)})})};ge.displayName="TypeLegend";const Pe=J(ge);const Me=(e,l=10,d=false)=>{const[u,x]=O([]);const _=k(new Map);const G=A(()=>{const r=new Set(["root"]);if(d&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((h,i)=>{r.add(`root.${i}`)})}else{Object.keys(e).forEach(h=>{r.add(`root.${h}`)})}}return r},[d,e]);const[M,V]=O(()=>G());const[N,L]=O(false);const T=k(new WeakSet);const I=k(false);const v=k(0);const z=k(0);const c=k(void 0);const S=A((r,h,i,p="root",s=0,D,y=[],R=0,H=1,w=[])=>Se(r,h,i,l,p,s,D,y,R,H,w),[l]);X(()=>{if(c.current&&(c.current.type==="expand"||c.current.type==="collapse")){if(N){L(false);I.current=false}c.current=void 0;return}if(I.current){return}let r;const h=++v.current;const i=()=>v.current===h;I.current=true;L(true);const p=async()=>{r=setTimeout(()=>{if(I.current&&i()){L(false);I.current=false}},5e3);await new Promise(s=>setTimeout(()=>s(),10));if(!i()){return}try{T.current=new WeakSet;z.current=Date.now();const s=S(e,M,T.current,"root",0,void 0,[],0,1,[]);const D=new Map;s.forEach((y,R)=>{D.set(y.id,{item:y,index:R})});_.current=D;if(r)clearTimeout(r);if(i()){x(s);L(false);I.current=false}}catch(s){console.error("[Buoy]",s);if(r)clearTimeout(r);if(i()){x([]);_.current=new Map;L(false);I.current=false}}};p();return()=>{I.current=false;if(r)clearTimeout(r)}},[e,M,S,l]);const $=A((r,h)=>{L(false);I.current=false;x(i=>{const p=_.current.get(r);if(!p){return i}const{item:s,index:D}=p;if(h&&s.isExpandable&&s.hasChildren){const y=[...i];const R=new WeakSet;if(s.value&&typeof s.value==="object"){R.add(s.value)}const H=[];try{const C=we(s.value,s.valueType);const b=C.length;const oe=s.parentHasMoreSiblings||[];const U=[...oe];if(s.depth>0){U[s.depth-1]=!s.isLastChild}C.forEach(([q,a],E)=>{const Y=S(a,new Set,R,q,s.depth+1,r,s.path,E,b,U);H.push(...Y)})}catch(C){console.error("[Buoy]",C)}const w=H;if(w.length>0){}y[D]={...s,isExpanded:true};y.splice(D+1,0,...w);const g=new Map;y.forEach((C,b)=>{g.set(C.id,{item:C,index:b})});_.current=g;return y}else if(!h){const y=new Set;const R=(g,C)=>{i.forEach(b=>{if(b.parentId===g||b.id.startsWith(g+".")&&b.depth>C){y.add(b.id);if(b.hasChildren){R(b.id,b.depth)}}})};R(r,s.depth);const H=i.map(g=>{if(g.id===r){return{...g,isExpanded:false}}return g}).filter(g=>!y.has(g.id));const w=new Map;H.forEach((g,C)=>{w.set(g.id,{item:g,index:C})});_.current=w;return H}return i})},[S]);const B=A(r=>{V(h=>{const i=new Set(h);const p=!i.has(r);if(p){i.add(r)}else{i.delete(r)}c.current={type:p?"expand":"collapse",itemId:r};$(r,p);return i})},[$]);const W=re(e,fe,0)<fe;const F=Z(()=>{if(!W)return null;return S(e,M,new WeakSet,"root",0,void 0,[],0,1,[])},[W,e,M,S]);const K=A(r=>{if(r.length===0)return;V(h=>{if(r.every(p=>h.has(p)))return h;const i=new Set(h);for(const p of r)i.add(p);return i})},[]);return{flatData:F??u,isProcessing:F?false:N,toggleExpanded:B,revealPath:K}};const me=({item:e,onToggleExpanded:l,index:d,onSelect:u,isSelected:x,selectable:_,onRequestInlineEdit:G,isInlineEditing:M,inlineEditor:V,testIDPrefix:N})=>{const[L,T]=O(false);const[I,v]=O(false);const z=_===true;const c=k(0);const S=e.path.slice(1);const $=ue[Math.min(e.depth,ce)]||ue[0];const B=pe(e.valueType);const W=false;const F=()=>{if(z){const i=Date.now();const p=i-c.current<Ie;c.current=i;if(p&&!e.isExpandable&&G){G(e);return}u(e);return}if(e.isExpandable){l(e.id)}u(e)};const K=()=>{if(e.isExpandable){l(e.id)}u(e)};const r=()=>{};const h=e.key;return m(f,{style:[t.itemContainer,$],children:[m(Q,{"sentry-label":"ignore devtools data explorer item",testID:`${N}-${e.id}`,accessibilityLabel:`${e.key}: ${e.valueType}`,style:[t.itemTouchable,L&&t.itemTouchablePressed,z&&x&&t.itemSelected,W&&{minHeight:Ee,paddingVertical:2}],onPress:F,onPressIn:()=>T(true),onPressOut:()=>T(false),activeOpacity:e.isExpandable||z?.7:1,disabled:!e.isExpandable&&!z,children:[e.isExpandable?n(ye,{expanded:e.isExpanded,onPress:K}):n(f,{style:t.expanderContainer}),m(f,{style:t.labelContainer,children:[m(P,{style:t.labelText,numberOfLines:1,children:[e.key,":"]}),M&&V?V:e.isExpandable?m(P,{style:[t.valueText,{color:o.secondary}],numberOfLines:1,children:[e.valueType," (",e.childCount," ",e.childCount===1?"item":"items",")"]}):n(P,{style:[t.valueText,{color:B}],numberOfLines:1,children:Re(e.value,e.valueType)})]})]}),e.value!==void 0?n(xe,{value:e.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})};me.displayName="VirtualizedItem";const Le=J(me);export const VirtualizedDataExplorer=({title:e,description:l,data:d,maxDepth:u=10,rawMode:x=false,initialExpanded:_=false,disableCopy:G=false,onSelectionChange:M,onRequestInlineEdit:V,inlineEditPath:N,renderInlineEditor:L,selectPath:T,testIDPrefix:I="buoy-tree-row"})=>{const[v,z]=O(x);const{flatData:c,isProcessing:S,toggleExpanded:$,revealPath:B}=Me(d,u,_);const W=k(null);const[F,K]=O({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/j)-1))});const r=k({itemVisiblePercentThreshold:1});const h=k(({viewableItems:a})=>{const E=a.map(Y=>Y.index).filter(Y=>typeof Y==="number");if(E.length){K({start:Math.min(...E),end:Math.max(...E)})}}).current;X(()=>{K({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/j)-1))})},[c.length]);const i=Z(()=>{const a=new Set;for(const E of c){a.add(E.valueType);if(a.size>=8)break}return Array.from(a)},[c]);const p=()=>{z(!v)};const[s,D]=O(null);const y=Z(()=>s==null?void 0:c.find(a=>a.id===s),[c,s]);const R=y?.depth;X(()=>{if(!M)return;M(y?ne(y):null)},[y,M]);const H=A(a=>{D(E=>E===a.id?null:a.id)},[]);const w=T===void 0?void 0:T===null?"\0null":T.join(".");const g=k(w);X(()=>{if(w===g.current)return;g.current=w;if(w===void 0)return;if(T==null){D(null);return}const a=["root"];for(const E of T.slice(0,-1)){a.push(`${a[a.length-1]}.${E}`)}B(a);D(["root",...T].join("."))},[w,T,B]);const C=A(a=>{D(a.id);V?.(ne(a))},[V]);const b=({item:a,index:E})=>n(Le,{item:a,index:E,onToggleExpanded:$,onSelect:H,isSelected:y?.id===a.id,selectable:M!=null,onRequestInlineEdit:C,isInlineEditing:N!=null&&N.join(".")===a.path.slice(1).join("."),inlineEditor:L?L(ne(a)):null,testIDPrefix:I});const oe=j;const U=a=>a.id;const q=d!==null&&d!==void 0&&(typeof d==="string"?d.length>0:typeof d==="number"||typeof d==="boolean"?true:Array.isArray(d)?d.length>0:typeof d==="object"?Object.keys(d).length>0:false);if(x){if(!q){return n(f,{style:{flex:1,justifyContent:"center",alignItems:"center",padding:20},children:n(P,{style:t.noDataText,children:"No data available"})})}return n(f,{style:{minHeight:S?40:c.length*j},children:S?n(f,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:m(P,{style:t.loadingText,children:["Processing data... (raw mode, isProcessing=",String(S),")"]})}):m(f,{style:{position:"relative",height:c.length*j},children:[n(le,{items:c,visibleRange:{start:0,end:Math.max(0,c.length-1)},itemHeight:j,indentWidth:te,activeDepth:R}),n(se,{keyboardShouldPersistTaps:"handled",ref:W,"sentry-label":"ignore devtools data explorer list",data:c,renderItem:b,keyExtractor:U,showsVerticalScrollIndicator:true,contentContainerStyle:t.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})]})})}if(!q){return m(f,{style:t.container,children:[n(f,{style:t.header,children:n(f,{style:t.headerRow,children:m(f,{style:{flex:1},children:[n(P,{style:t.title,children:e}),l&&n(P,{style:t.description,children:l})]})})}),n(f,{style:t.noDataContainer,children:n(P,{style:t.noDataText,children:"No data available"})})]})}return m(f,{style:t.container,children:[m(f,{style:t.header,children:[n(f,{style:t.headerRow,children:m(Q,{"sentry-label":"ignore devtools data explorer header toggle",onPress:p,hitSlop:de,style:t.headerTouchable,children:[m(f,{style:{flex:1},children:[n(P,{style:t.title,children:e}),l&&n(P,{style:t.description,children:l})]}),n(f,{style:t.expanderMargin,children:n(ye,{expanded:v,onPress:p})})]})}),v&&i.length>0&&!x&&n(Pe,{visibleTypes:i})]}),v&&n(Ce,{children:S?n(f,{style:t.loadingContainer,children:m(P,{style:t.loadingText,children:["Processing data... (isProcessing=",String(S),")"]})}):m(f,{style:{height:c.length*j,position:"relative"},children:[n(le,{items:c,visibleRange:F,itemHeight:j,indentWidth:te,activeDepth:R}),n(se,{keyboardShouldPersistTaps:"handled",ref:W,"sentry-label":"ignore devtools data explorer collapsed list",data:c,renderItem:b,keyExtractor:U,showsVerticalScrollIndicator:true,contentContainerStyle:t.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,onViewableItemsChanged:h,viewabilityConfig:r.current})]})})]})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const MAX_DEPTH_LIMIT=15;const C=t=>typeof t==="object"&&t!==null&&!(t instanceof Date)&&!(t instanceof Error)&&!(t instanceof RegExp)&&!(t instanceof Map)&&!(t instanceof Set);export const getValueType=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(Array.isArray(t))return"array";if(t instanceof Date)return"date";if(t instanceof Error)return"error";if(t instanceof Map)return"map";if(t instanceof Set)return"set";if(t instanceof RegExp)return"regexp";if(typeof t==="function")return"function";if(typeof t==="symbol")return"symbol";if(typeof t==="bigint")return"bigint";if(typeof t==="object")return"object";return typeof t};export const getValueCount=(t,e)=>{if(t===null)return 0;switch(e){case"array":return Array.isArray(t)?t.length:0;case"object":return C(t)?Object.keys(t).length:0;case"map":return t instanceof Map?t.size:0;case"set":return t instanceof Set?t.size:0;default:return 0}};export const getChildEntries=(t,e)=>{switch(e){case"array":return Array.isArray(t)?t.map((r,n)=>[n.toString(),r]):[];case"object":return C(t)?Object.entries(t):[];case"map":return t instanceof Map?Array.from(t.entries()).map(([r,n])=>[String(r),n]):[];case"set":return t instanceof Set?Array.from(t.values()).map((r,n)=>[n.toString(),r]):[];default:return[]}};export function flattenTree(t,e,r,n,h="root",s=0,d,g=[],c=0,f=1,u=[]){if(s>Math.min(n,MAX_DEPTH_LIMIT))return[];const a=[...g,h];const o=a.join(".");const i=getValueType(t);const p=["object","array","map","set"].includes(i)&&t!==null;const m=p?getValueCount(t,i):0;if(t&&typeof t==="object"){if(r.has(t)){return[{id:o,key:h,value:"[Circular Reference]",valueType:"circular",depth:s,isExpandable:false,isExpanded:false,parentId:d,hasChildren:false,childCount:0,path:a,type:"circular",isLastChild:c===f-1,parentHasMoreSiblings:[...u],siblingIndex:c,totalSiblings:f}]}r.add(t)}const b={id:o,key:h,value:t,valueType:i,depth:s,isExpandable:p,isExpanded:e.has(o),parentId:d,hasChildren:m>0,childCount:m,path:a,type:p?"expandable":i,isLastChild:c===f-1,parentHasMoreSiblings:[...u],siblingIndex:c,totalSiblings:f};const j=[b];if(p&&e.has(o)&&s<Math.min(n,MAX_DEPTH_LIMIT)){try{const y=getChildEntries(t,i);const A=y.length;const E=[...u];if(s>0){E[s-1]=!b.isLastChild}y.forEach(([M,x],T)=>{const L=flattenTree(x,e,r,n,M,s+1,o,a,T,A,E);for(const P of L)j.push(P)})}catch(y){console.error("[Buoy]",y)}}return j}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const LIVE_PAGE_SIZE=100;export function getLiveSubEntries(t){if(t===null||t===void 0||typeof t!=="object"){return[]}if(Array.isArray(t)){return t.map((n,r)=>({label:r.toString(),value:n}))}if(t instanceof Map){return Array.from(t.entries()).map(([n,r])=>({label:String(n),value:r}))}if(t instanceof Set){return Array.from(t).map((n,r)=>({label:r.toString(),value:n}))}return Object.entries(t).map(([n,r])=>({label:n,value:r}))}export function livePageRange(t,n,r=LIVE_PAGE_SIZE){const e=t*r;const i=Math.min(n,e+r)-1;return`[${e}...${i}]`}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export*from"./primitives/index.js";export{NetworkIcon,NETWORK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvIcon,ENV_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ConsoleIcon,CONSOLE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{TimeMachineIcon,TIME_MACHINE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImagesIcon,IMAGES_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{AssetsIcon,ASSETS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImpersonateIcon,IMPERSONATE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImageOverlayIcon,IMAGE_OVERLAY_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ZustandIcon,ZUSTAND_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{JotaiIcon,JOTAI_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvLaptopIcon,LaptopIcon}from"./EnvLaptopIcon.js";export{ReactQueryIcon}from"./ReactQueryIcon.js";export{SentryBugIcon}from"./SentryBugIcon.js";export{StorageStackIcon}from"./StorageStackIcon.js";export{WifiCircuitIcon}from"./WifiCircuitIcon.js";export{RouteMapIcon,RouteIcon,NavigationIcon}from"./RouteMapIcon.js";export{StackPulseIcon,RenderPulseIcon,HighlightUpdatesIcon}from"./StackPulseIcon.js";export{RenderCountIcon}from"./RenderCountIcon.js";export{BenchmarkIcon as BenchmarkLegacyIcon}from"./BenchmarkIcon.js";export{IconBackground}from"./IconBackground.js";export*from"./lucide-icons.js";export{ActivityGlyph as Activity,AlertCircleGlyph as AlertCircle,AlertTriangleGlyph as AlertTriangle,BookmarkGlyph as Bookmark,BoxGlyph as Box,BugGlyph as Bug,CheckCircleGlyph as CheckCircle,CheckGlyph as Check,ChevronDownGlyph as ChevronDown,ChevronLeftGlyph as ChevronLeft,ChevronRightGlyph as ChevronRight,ChevronUpGlyph as ChevronUp,ClockGlyph as Clock,CopyGlyph as Copy,DatabaseGlyph as Database,DockBottomGlyph as DockBottom,DownloadGlyph as Download,Edit3Glyph as Edit3,EyeOffGlyph as EyeOff,EyeGlyph as Eye,FileJsonGlyph as FileJson,FileTextGlyph as FileText,FilmGlyph as Film,FilterGlyph as Filter,FlaskConicalGlyph as FlaskConical,FloatWindowGlyph as FloatWindow,GitBranchGlyph as GitBranch,GlobeGlyph as Globe,HashGlyph as Hash,HomeGlyph as Home,ImageGlyph as Image,InfoGlyph as Info,KeyGlyph as Key,LayersGlyph as Layers,LinkGlyph as Link,LockGlyph as Lock,MinusGlyph as Minus,MusicGlyph as Music,NavigationGlyph as Navigation,PaletteGlyph as Palette,PauseGlyph as Pause,PlayGlyph as Play,PlusGlyph as Plus,PowerGlyph as Power,RefreshCwGlyph as RefreshCw,SearchGlyph as Search,ServerGlyph as Server,SettingsGlyph as Settings,SettingsSolidIcon as SettingsSolid,ShieldGlyph as Shield,Trash2Glyph as Trash2,Trash2Glyph as Trash,UnlockGlyph as Unlock,UploadGlyph as Upload,UserGlyph as User,WifiGlyph as Wifi,XCircleGlyph as XCircle,XGlyph as X,ZapGlyph as Zap}from"@buoy-gg/floating-tools-core";export{SentryIcon,EventsIcon,RoutesIcon,RoutePinIcon,RoutePathIcon,RouteDotIcon,RouteTwoPinsIcon,CameraIcon,HighlightIcon,ReduxIcon,StorageIcon,AskBuoyIcon,HighlighterIcon,QueryIcon,ScenariosIcon}from"@buoy-gg/floating-tools-core";export{WifiIcon as WifiBifIcon,BenchmarkIcon,BENCHMARK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{NotificationsIcon,NOTIFICATIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ClockToolIcon,CLOCK_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{PermissionsIcon,PERMISSIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LifecycleToolIcon,LIFECYCLE_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LocationToolIcon,LOCATION_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";
|
|
1
|
+
"use strict";export*from"./primitives/index.js";export{NetworkIcon,NETWORK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvIcon,ENV_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ConsoleIcon,CONSOLE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{TimeMachineIcon,TIME_MACHINE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImagesIcon,IMAGES_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{AssetsIcon,ASSETS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImpersonateIcon,IMPERSONATE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImageOverlayIcon,IMAGE_OVERLAY_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ZustandIcon,ZUSTAND_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{JotaiIcon,JOTAI_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvLaptopIcon,LaptopIcon}from"./EnvLaptopIcon.js";export{ReactQueryIcon}from"./ReactQueryIcon.js";export{SentryBugIcon}from"./SentryBugIcon.js";export{StorageStackIcon}from"./StorageStackIcon.js";export{WifiCircuitIcon}from"./WifiCircuitIcon.js";export{RouteMapIcon,RouteIcon,NavigationIcon}from"./RouteMapIcon.js";export{StackPulseIcon,RenderPulseIcon,HighlightUpdatesIcon}from"./StackPulseIcon.js";export{RenderCountIcon}from"./RenderCountIcon.js";export{BenchmarkIcon as BenchmarkLegacyIcon}from"./BenchmarkIcon.js";export{IconBackground}from"./IconBackground.js";export*from"./lucide-icons.js";export{ActivityGlyph as Activity,AlertCircleGlyph as AlertCircle,AlertTriangleGlyph as AlertTriangle,BookmarkGlyph as Bookmark,BoxGlyph as Box,BugGlyph as Bug,CheckCircleGlyph as CheckCircle,CheckGlyph as Check,ChevronDownGlyph as ChevronDown,ChevronLeftGlyph as ChevronLeft,ChevronRightGlyph as ChevronRight,ChevronUpGlyph as ChevronUp,ClockGlyph as Clock,CopyGlyph as Copy,DatabaseGlyph as Database,DockBottomGlyph as DockBottom,DownloadGlyph as Download,Edit3Glyph as Edit3,EyeOffGlyph as EyeOff,EyeGlyph as Eye,FileJsonGlyph as FileJson,FileTextGlyph as FileText,FilmGlyph as Film,FilterGlyph as Filter,FlaskConicalGlyph as FlaskConical,FloatWindowGlyph as FloatWindow,GitBranchGlyph as GitBranch,GlobeGlyph as Globe,HashGlyph as Hash,HomeGlyph as Home,ImageGlyph as Image,InfoGlyph as Info,KeyGlyph as Key,LayersGlyph as Layers,LinkGlyph as Link,LockGlyph as Lock,MinusGlyph as Minus,MusicGlyph as Music,NavigationGlyph as Navigation,PaletteGlyph as Palette,PauseGlyph as Pause,PlayGlyph as Play,PlusGlyph as Plus,PowerGlyph as Power,RefreshCwGlyph as RefreshCw,SearchGlyph as Search,ServerGlyph as Server,SettingsGlyph as Settings,SettingsSolidIcon as SettingsSolid,ShieldGlyph as Shield,Trash2Glyph as Trash2,Trash2Glyph as Trash,UnlockGlyph as Unlock,UploadGlyph as Upload,UserGlyph as User,WifiGlyph as Wifi,XCircleGlyph as XCircle,XGlyph as X,ZapGlyph as Zap}from"@buoy-gg/floating-tools-core";export{SentryIcon,EventsIcon,RoutesIcon,RoutePinIcon,RoutePathIcon,RouteDotIcon,RouteTwoPinsIcon,CameraIcon,HighlightIcon,ReduxIcon,StorageIcon,AskBuoyIcon,HighlighterIcon,QueryIcon,ScenariosIcon}from"@buoy-gg/floating-tools-core";export{WifiIcon as WifiBifIcon,BenchmarkIcon,BENCHMARK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{NotificationsIcon,NOTIFICATIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ClockToolIcon,CLOCK_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{PermissionsIcon,PERMISSIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LifecycleToolIcon,LIFECYCLE_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LocationToolIcon,LOCATION_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{OtaInspectorIcon,OTA_INSPECTOR_ICON_COLOR}from"@buoy-gg/floating-tools-core";
|
package/lib/module/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export*from"./ui/index.js";export*from"./stores/index.js";export*from"./bugCase/index.js";export*from"./sync/keyedArrays.js";export*from"./sync/valueShape.js";export*from"./sync/valuePath.js";export*from"./sync/typedEdit.js";export*from"./sync/wireBudget.js";export*from"./sync/wireForm.js";export*from"./sync/toolSyncAdapter.js";export{startSettingsSync,SettingsSync,PERSONAL_SETTING_KEYS,TEAM_SETTING_KEYS,onSettingsApplied,syncSettingsNow}from"./sync/settingsSync.js";export*from"./tools/defineTool.js";export*from"./sync/toolActionRegistry.js";export*from"./sync/toolUiBridge.js";export*from"./sync/toolScreenHeader.js";export{absoluteFill,displayValue,parseDisplayValue,getSafeAreaInsets,persistentStorage,isUsingPersistentStorage,getStorageBackendType,safeStringify,getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize,parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath,loadOptionalModule,getCachedOptionalModule,setRenderCaptureProvider,getRenderCaptureProvider,registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders,superJsonSerialize,superJsonDeserialize,realNow,getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener,reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS,getDevServerOrigin,Subscribable,subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange,useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./utils/index.js";export*from"./utils/toolModules.js";export{subscribeStorageWrites}from"./utils/storageWrites.js";export{registerBrowserRouter,browserRouter,subscribeBrowserNavigation}from"./utils/browserNavigation.js";export{PREVIEW_ITEM_RENDER_BYTE_LIMIT,createRestoreScope,emptyRestoreResult,failedRestore,skippedRestore,classifyPreviewItem,wontApply,unionKeys}from"./utils/snapshotProviderKit.js";export{entityColor,formatValuePreview,shallowDiffSummary}from"./utils/stateTools.js";export*from"./utils/formatting/index.js";export*from"./utils/time/index.js";export{isPlainObject as isPlainObjectUtil}from"./utils/typeHelpers.js";export*from"./icons/index.js";export*from"./clipboard/index.js";export*from"./logger/index.js";export*from"./settings/index.js";export*from"./storage/index.js";export{useSafeAreaInsets,useFilterManager,usePersistedState,resetPersistedStateCache,useChangeLog,useSubscribedValue,useEventStoreEvents,useDeviceInfo,getDeviceInfo,logDeviceInfo}from"./hooks/index.js";export{JsModal}from"./JsModal";export{night,NIGHT_LABEL_TRACKING}from"./ui/night/nightTheme.js";export{QrCodeView}from"./ui/qr/QrCodeView.js";export{NightSectionLabel,NightFootnote,NightCard,NightSeparator,NightRows,NightSwitch,NightChip,NightButton,NightSegmented,NightBadge}from"./ui/night/primitives.js";export{gameUIColors,buoyColors}from"./ui/gameUI/constants/gameUIColors.js";export{refreshGameUIColors}from"./ui/gameUI/constants/gameUIColors.js";export{macOSColors}from"./ui/gameUI/constants/macOSDesignSystemColors.js";export{dialColors}from"./ui/gameUI/constants/gameUIColors.js";export{EnvironmentIndicator}from"./env/EnvironmentIndicator";export{EnvironmentSelector}from"./env/EnvironmentSelector.js";export{EnvironmentSelectorInline}from"./env/EnvironmentSelectorInline";export{normalizeEnvironment}from"./types/types.js";export{HintsProvider,useHintsDisabled,useHintsContext}from"./context/index.js";export*from"./history/index.js";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,useSignInState,ProBadge,ProUpgradeModal,FreeAccountPrompt,LOGIN_COMMAND,getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy,TIER_LIMITS,useLimit,resolveEffectiveTier}from"./license/index.js";export{getAccountAccess,hasAccountAccess,assertAccountAccess,subscribeAccountAccess,getUseAccountAccess,retryAccountAccess,isProNow,getTeamCredential}from"./license/licenseModule.js";export{setBuoyAppId,getBuoyAppId}from"./utils/appIdentity.js";export{guardToolAdapter}from"./sync/toolActionRegistry.js";export{AccountSetup}from"./license/AccountSetup";export{AccountSetupButton}from"./license/AccountSetupContent.js";
|
|
1
|
+
"use strict";export*from"./ui/index.js";export*from"./stores/index.js";export*from"./bugCase/index.js";export*from"./sync/keyedArrays.js";export*from"./sync/valueShape.js";export*from"./sync/valuePath.js";export*from"./sync/typedEdit.js";export*from"./sync/wireBudget.js";export*from"./sync/wireForm.js";export*from"./sync/toolSyncAdapter.js";export{startSettingsSync,SettingsSync,PERSONAL_SETTING_KEYS,TEAM_SETTING_KEYS,onSettingsApplied,syncSettingsNow}from"./sync/settingsSync.js";export*from"./tools/defineTool.js";export*from"./sync/toolActionRegistry.js";export*from"./sync/toolUiBridge.js";export*from"./sync/toolScreenHeader.js";export{absoluteFill,displayValue,parseDisplayValue,getSafeAreaInsets,persistentStorage,setItemChecked,getItemChecked,storageIsMemoryOnly,isUsingPersistentStorage,getStorageBackendType,safeStringify,getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize,parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath,loadOptionalModule,getCachedOptionalModule,setRenderCaptureProvider,getRenderCaptureProvider,registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders,superJsonSerialize,superJsonDeserialize,realNow,getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener,reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS,getDevServerOrigin,Subscribable,subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange,useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./utils/index.js";export*from"./utils/toolModules.js";export{subscribeStorageWrites}from"./utils/storageWrites.js";export{FiberRootAnchor,getAnchoredFiberRoots}from"./utils/fiberRootAnchor.js";export{registerBrowserRouter,browserRouter,subscribeBrowserNavigation}from"./utils/browserNavigation.js";export{PREVIEW_ITEM_RENDER_BYTE_LIMIT,createRestoreScope,emptyRestoreResult,failedRestore,skippedRestore,classifyPreviewItem,wontApply,unionKeys}from"./utils/snapshotProviderKit.js";export{entityColor,formatValuePreview,shallowDiffSummary}from"./utils/stateTools.js";export*from"./utils/formatting/index.js";export*from"./utils/time/index.js";export{isPlainObject as isPlainObjectUtil}from"./utils/typeHelpers.js";export*from"./icons/index.js";export*from"./clipboard/index.js";export*from"./logger/index.js";export*from"./settings/index.js";export*from"./storage/index.js";export{useSafeAreaInsets,useFilterManager,usePersistedState,resetPersistedStateCache,useChangeLog,useSubscribedValue,useEventStoreEvents,useDeviceInfo,getDeviceInfo,logDeviceInfo}from"./hooks/index.js";export{JsModal}from"./JsModal";export{night,NIGHT_LABEL_TRACKING}from"./ui/night/nightTheme.js";export{QrCodeView}from"./ui/qr/QrCodeView.js";export{NightSectionLabel,NightFootnote,NightCard,NightSeparator,NightRows,NightSwitch,NightChip,NightButton,NightSegmented,NightBadge}from"./ui/night/primitives.js";export{gameUIColors,buoyColors}from"./ui/gameUI/constants/gameUIColors.js";export{refreshGameUIColors}from"./ui/gameUI/constants/gameUIColors.js";export{macOSColors}from"./ui/gameUI/constants/macOSDesignSystemColors.js";export{dialColors}from"./ui/gameUI/constants/gameUIColors.js";export{EnvironmentIndicator}from"./env/EnvironmentIndicator";export{EnvironmentSelector}from"./env/EnvironmentSelector.js";export{EnvironmentSelectorInline}from"./env/EnvironmentSelectorInline";export{normalizeEnvironment}from"./types/types.js";export{HintsProvider,useHintsDisabled,useHintsContext}from"./context/index.js";export*from"./history/index.js";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,BuoyGetProCard,useSignInState,ProBadge,ProUpgradeModal,FreeAccountPrompt,LOGIN_COMMAND,getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy,TIER_LIMITS,useLimit,resolveEffectiveTier}from"./license/index.js";export{getAccountAccess,hasAccountAccess,assertAccountAccess,subscribeAccountAccess,getUseAccountAccess,retryAccountAccess,isProNow,getTeamCredential}from"./license/licenseModule.js";export{setBuoyAppId,getBuoyAppId}from"./utils/appIdentity.js";export{guardToolAdapter}from"./sync/toolActionRegistry.js";export{AccountSetup}from"./license/AccountSetup";export{AccountSetupButton}from"./license/AccountSetupContent.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback as P,useEffect as S,useRef as x,useState as m}from"react";import{ActivityIndicator as k,Modal as
|
|
1
|
+
"use strict";import{useCallback as P,useEffect as S,useRef as x,useState as m}from"react";import{ActivityIndicator as k,Modal as B,Pressable as g,StyleSheet as T,Text as r,View as a}from"react-native";import{monoFont as j}from"../ui/fonts.js";import{night as o}from"../ui/night/nightTheme.js";import{QrCodeView as D}from"../ui/qr/QrCodeView.js";import{getSignInSession as I,isProNow as v,retryAccountAccess as A}from"./licenseModule.js";import{PRICING_URL as R,isWeb as H,openPricing as F}from"./openPricing.js";import{jsx as t,jsxs as l,Fragment as z}from"react/jsx-runtime";const W=n=>n.replace(/^https?:\/\//,"");export function useSignInState(){const[n,i]=m(()=>I()?.getStatus().state??"signed_out");S(()=>{const d=I();if(!d)return;const s=()=>i(d.getStatus().state);s();return d.subscribe(s)},[]);return n}function w({onClose:n}){return l(a,{style:e.header,children:[l(a,{style:e.brand,children:[t(a,{style:e.brandDot}),t(r,{style:e.wordmark,children:"BUOY"})]}),t(g,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:n,style:e.close,testID:"buoy-signin-close",children:t(r,{style:e.closeText,children:"\u2715"})})]})}export function BuoySignInCard({onClose:n,onNotConfigured:i,footer:d}){const[s,c]=m({kind:"starting"});const y=x(null);const b=x(n);const u=x(i);b.current=n;u.current=i;const C=P(()=>{y.current?.abort();const f=I();if(!f?.signInWithCode){if(u.current)return u.current();c({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}const p=new AbortController;y.current=p;c({kind:"starting"});f.signInWithCode(h=>c({kind:"waiting",prompt:h}),{signal:p.signal}).then(()=>{if(!p.signal.aborted)b.current()}).catch(h=>{if(p.signal.aborted)return;if(h?.code==="not_configured"&&u.current){u.current();return}c({kind:"error",message:h instanceof Error?h.message:"Sign-in did not work. Try again."})})},[]);S(()=>{C();return()=>y.current?.abort()},[C]);return l(a,{style:e.card,testID:"buoy-code-signin",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"Sign in to Buoy"}),s.kind==="starting"?t(a,{style:e.center,children:t(k,{color:o.color.accent})}):null,s.kind==="waiting"?l(z,{children:[t(r,{style:e.body,children:"Scan this with your phone's camera."}),t(a,{style:e.qr,testID:"buoy-signin-qr",children:t(D,{value:s.prompt.verificationUriComplete,size:196})}),l(r,{style:e.body,children:["Or go to"," ",t(r,{style:e.strong,children:W(s.prompt.verificationUri)})," ","and type:"]}),t(r,{style:e.code,selectable:true,testID:"buoy-signin-code",children:s.prompt.userCode}),l(a,{style:e.waiting,children:[t(k,{size:"small",color:o.color.textSecondary}),t(r,{style:e.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,s.kind==="error"?l(z,{children:[t(r,{style:e.body,testID:"buoy-signin-error",children:s.message}),t(g,{accessibilityRole:"button",onPress:C,style:({pressed:f})=>[e.primary,f&&e.primaryPressed],testID:"buoy-signin-retry",children:t(r,{style:e.primaryText,children:"Get a new code"})})]}):null,d]})}export function BuoyNeedsPlanCard({onClose:n}){return l(a,{style:e.card,testID:"buoy-signin-needs-plan",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"You're signed in"}),t(r,{style:e.body,children:"Buoy in this build needs a Pro or Business plan."}),t(g,{accessibilityRole:"button",onPress:()=>void I()?.signOut(),style:({pressed:i})=>[e.primary,i&&e.primaryPressed],testID:"buoy-signout",children:t(r,{style:e.primaryText,children:"Sign out"})})]})}export function BuoyGetProCard({onClose:n}){const[i,d]=m(false);const[s,c]=m(null);const y=x(true);S(()=>()=>{y.current=false},[]);const b=P(async()=>{d(true);c(null);try{await A()}catch{}if(!y.current)return;d(false);if(v())n();else c("Still on Free. If you just paid, wait a minute and try again.")},[n]);return l(a,{style:e.card,testID:"buoy-get-pro",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"Get Buoy Pro"}),t(r,{style:e.body,children:"This needs Pro. Scan to see the plans."}),t(a,{style:e.qr,testID:"buoy-get-pro-qr",children:t(D,{value:R,size:196})}),l(r,{style:e.body,children:["Or go to ",t(r,{style:e.strong,children:W(R)})]}),t(g,{accessibilityRole:"link",onPress:()=>F(),style:({pressed:u})=>[e.primary,u&&e.primaryPressed],testID:"buoy-get-pro-open",children:t(r,{style:e.primaryText,children:"Open buoy.gg"})}),t(g,{accessibilityRole:"button",accessibilityState:{disabled:i,busy:i},disabled:i,onPress:b,style:({pressed:u})=>[e.secondary,u&&e.secondaryPressed],testID:"buoy-get-pro-check",children:i?t(k,{size:"small",color:o.color.textSecondary}):t(r,{style:e.secondaryText,children:"I have Pro. Check again."})}),s?t(r,{accessibilityRole:"alert",style:e.note,children:s}):null]})}export function BuoyUpgradeSheet({visible:n,onClose:i}){const d=useSignInState();const[s,c]=m(false);S(()=>{if(!n)c(false)},[n]);if(!n)return null;const y=s||H||d==="active";return t(B,{visible:true,transparent:true,animationType:"fade",onRequestClose:i,children:l(a,{style:e.overlay,accessibilityViewIsModal:true,children:[t(g,{style:T.absoluteFill,onPress:i,accessible:false}),y?t(BuoyGetProCard,{onClose:i}):t(BuoySignInCard,{onClose:i,onNotConfigured:()=>c(true),footer:t(g,{accessibilityRole:"button",onPress:()=>c(true),style:e.footerLink,testID:"buoy-signin-see-plans",children:l(r,{style:e.muted,children:["No Pro plan yet? ",t(r,{style:e.link,children:"See plans"})]})})})]})})}const e=T.create({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:o.color.accent},wordmark:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:o.color.textSecondary,fontSize:14},title:{color:o.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:o.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:o.color.text,fontWeight:"600"},muted:{color:o.color.textSecondary,fontSize:13},link:{color:o.color.accent,fontWeight:"600"},note:{color:o.color.textSecondary,fontSize:13,lineHeight:18,marginTop:12,textAlign:"center"},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:o.color.text,fontFamily:j,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},footerLink:{alignItems:"center",marginTop:20,minHeight:32,justifyContent:"center"},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:o.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:o.color.accentPressed},primaryText:{color:o.color.onAccent,fontSize:15,fontWeight:"600"},secondary:{marginTop:10,minHeight:44,borderRadius:12,borderWidth:1,borderColor:"#303437",alignItems:"center",justifyContent:"center"},secondaryPressed:{backgroundColor:"#1A1D1F"},secondaryText:{color:o.color.text,fontSize:15,fontWeight:"600"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,ProBadge,ProUpgradeModal}from"./FeatureGate.js";export{BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,useSignInState}from"./BuoyUpgradeSheet.js";export{FreeAccountPrompt,LOGIN_COMMAND}from"./FreeAccountPrompt.js";export{getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy}from"./licenseModule.js";export{TIER_LIMITS,useLimit,resolveEffectiveTier}from"./tierLimits.js";
|
|
1
|
+
"use strict";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,ProBadge,ProUpgradeModal}from"./FeatureGate.js";export{BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,BuoyGetProCard,useSignInState}from"./BuoyUpgradeSheet.js";export{FreeAccountPrompt,LOGIN_COMMAND}from"./FreeAccountPrompt.js";export{getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy}from"./licenseModule.js";export{TIER_LIMITS,useLimit,resolveEffectiveTier}from"./tierLimits.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const c=e=>typeof e==="object"&&e!==null&&!Array.isArray(e);const $=["id","lineId","key","uuid","_id","slug","name"];export function identityField(e,r=[]){if(!e.length||!e.every(c))return void 0;const i=e[0];const t=[...$,...Object.keys(i).filter(o=>/(Id|_id|ID)$/.test(o))];const s=t.filter((o,d)=>{if(t.indexOf(o)!==d||!(o in i))return false;const f=e.map(a=>a[o]);if(!f.every(a=>typeof a==="string"||typeof a==="number"))return false;return new Set(f.map(String)).size===f.length});const n=o=>e.some(d=>r.includes(String(d[o])));return s.find(n)??s[0]}function p(e,r,i,t){const s=t[r];if(typeof s==="string"||typeof s==="number"){if(String(s)!==i){return{ok:false,error:`The new item is addressed as \`${i}\` but carries \`${r}\`: ${JSON.stringify(s)}. Use the same value for both \u2014 address it by the id it carries.`}}return{ok:true,value:s}}const n=e.every(o=>typeof o[r]==="number");if(n&&i.trim()!==""&&String(Number(i))===i){return{ok:true,value:Number(i)}}return{ok:true,value:i}}export function expandKeyedArrays(e,r,i="",t=[]){if(Array.isArray(e)&&c(r)){const s=Object.keys(r);const n=identityField(e,s);if(!n){if(!s.length)return{patch:r,notes:t};const l=i||"(root)";return{patch:r,notes:t,error:`\`${l}\` is a list whose items have no unique id field, so the key \`${s[0]}\` can't name a row. Address the row by its position instead, with a path like \`${i}[0].field\`.`}}const o=new Map(e.map(l=>[String(l[n]),l]));const d=e.slice();let f=0;let a=0;let g=0;for(const[l,y]of Object.entries(r)){const b=d.findIndex(u=>String(u[n])===l);if(y===null){if(b===-1)return{patch:r,notes:t};d.splice(b,1);f++}else if(b===-1){if(!c(y))return{patch:r,notes:t};const u=p(e,n,l,y);if(!u.ok){return{patch:r,notes:t,error:u.error}}d.push({...y,[n]:u.value});g++}else{const u=expandKeyedArrays(o.get(l),y,`${i}[${l}]`,t);if(u.error)return{patch:r,notes:t,error:u.error};const m=d[b];d[b]=c(m)&&c(u.patch)?{...m,...u.patch}:u.patch;a++}}t.push(`${i||"(root)"}: addressed by \`${n}\` \u2014 ${a} changed, ${g} added, ${f} removed, ${d.length} item(s) remain`);return{patch:d,notes:t}}if(c(e)&&c(r)){const s={};for(const[n,o]of Object.entries(r)){const d=i?`${i}.${n}`:n;if(!(n in e)){s[n]=o;continue}const f=expandKeyedArrays(e[n],o,d,t);if(f.error)return{patch:r,notes:t,error:f.error};s[n]=f.patch}return{patch:s,notes:t}}return{patch:r,notes:t}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{identityField as
|
|
1
|
+
"use strict";import{identityField as b}from"./keyedArrays.js";const c=r=>typeof r==="object"&&r!==null&&!Array.isArray(r);function w(r,s,n=2e3){const e=[{node:r,path:""}];let f=0;while(e.length&&f<n){const{node:i,path:d}=e.shift();f++;if(Array.isArray(i)){i.slice(0,20).forEach((t,l)=>e.push({node:t,path:`${d}[${l}]`}))}else if(c(i)){for(const[t,l]of Object.entries(i)){const o=d?`${d}.${t}`:t;if(t===s)return o;if(c(l)||Array.isArray(l))e.push({node:l,path:o})}}}return void 0}function A(r,s,n,e,f){const i=w(r,f??n);const d=e.slice(0,12).join(", ")||"(no fields)";return i?`No field "${n}" at "${s}" \u2014 did you mean path "${i}"? "${s}" has: ${d}.`:`No field "${n}" at "${s}". It has: ${d}.`}function p(r,s){let n=r;for(const e of s.split(".")){if(!c(n))return void 0;n=n[e]}return n}export function parsePath(r){if(!r.trim())return void 0;const s=[];let n=0;while(n<r.length){if(r[n]==="."){n++;continue}if(r[n]==="["){const i=r.indexOf("]",n);if(i===-1)return void 0;const d=r.slice(n+1,i);if(/^\d+$/.test(d))s.push({kind:"index",index:Number(d)});else{const t=d.indexOf("=");if(t<=0)return void 0;s.push({kind:"match",field:d.slice(0,t).trim(),value:d.slice(t+1).trim()})}n=i+1;continue}let e=n;while(e<r.length&&r[e]!=="."&&r[e]!=="[")e++;const f=r.slice(n,e);if(!f)return void 0;s.push({kind:"key",key:f});n=e}return s.length?s:void 0}export function readPath(r,s){const n=parsePath(s);if(!n)return{ok:false,error:`Could not read the path "${s}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};let e=r;const f=[];for(const i of n){if(e===null||e===void 0){return{ok:false,error:`"${f.join(".")||"(root)"}" is ${e===null?"null":"not set"}, so there is nothing at "${s}".`}}if(i.kind==="key"){if(!c(e))return{ok:false,error:`"${f.join(".")||"(root)"}" is not an object, so it has no field "${i.key}".`};if(!(i.key in e)){const d=n[n.length-1];return{ok:false,error:A(r,f.join(".")||"(root)",i.key,Object.keys(e),d?.kind==="key"?d.key:void 0)}}e=e[i.key];f.push(i.key)}else if(i.kind==="index"){if(!Array.isArray(e))return{ok:false,error:`"${f.join(".")||"(root)"}" is not a list, so [${i.index}] means nothing.`};e=e[i.index];f.push(`[${i.index}]`)}else{if(!Array.isArray(e))return{ok:false,error:`"${f.join(".")||"(root)"}" is not a list, so [${i.field}=${i.value}] means nothing.`};const d=e.find(t=>c(t)&&String(p(t,i.field))===i.value);if(d===void 0)return{ok:false,error:`No item with ${i.field}="${i.value}" in "${f.join(".")||"(root)"}".`};e=d;f.push(`[${i.field}=${i.value}]`)}}return{ok:true,value:e}}export function patchFromPath(r,s,n){const e=parsePath(s);if(!e)return{ok:false,error:`Could not read the path "${s}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};if(e[0]?.kind!=="key"&&!Array.isArray(r))return{ok:false,error:`A path must start with a field name, not a list index \u2014 "${s}" does not say which list.`};const f=(t,l)=>{if(l>=e.length)return{ok:true,patch:n};const o=e[l];if(o.kind==="key"){if(c(t)&&!(o.key in t)&&l+1<e.length){const j=e[e.length-1];return{ok:false,error:A(r,y(e,l),o.key,Object.keys(t),j?.kind==="key"?j.key:void 0)}}const h=c(t)?t[o.key]:void 0;const g=f(h,l+1);return g.ok?{ok:true,patch:{[o.key]:g.patch}}:g}if(!Array.isArray(t)){return{ok:false,error:`"${y(e,l)}" is not a list, so "${s}" cannot be resolved. Read it first \u2014 \`shape\` on the read says what each field holds.`}}const u=o.kind==="index"?o.index:t.findIndex(h=>c(h)&&String(p(h,o.field))===o.value);const a=u>=0?t[u]:void 0;const $=o.kind==="index"?u<0||u>=t.length:u<0;if($){return{ok:false,error:o.kind==="index"?`"${y(e,l)}" has ${t.length} item(s), so there is nothing at [${o.index}].`:`No item with ${o.field}="${o.value}" in "${y(e,l)}".`}}if(!c(a)){if(l<e.length-1){return{ok:false,error:`"${y(e,l)}[${o.kind==="index"?o.index:`${o.field}=${o.value}`}]" holds ${a===null?"null":typeof a}, not an object, so "${s}" cannot go any deeper. Set the item itself.`}}const h=t.slice();h[u]=n;return{ok:true,patch:h}}const k=f(a,l+1);if(!k.ok)return k;const x=b(t);if(x)return{ok:true,patch:{[String(a[x])]:k.patch}};const m=t.slice();m[u]=i(a,l+1);return{ok:true,patch:m}};const i=(t,l)=>{if(l>=e.length)return n;const o=e[l];if(o.kind==="key"){const k=c(t)?t:{};return{...k,[o.key]:i(k[o.key],l+1)}}const u=t;const a=o.kind==="index"?o.index:u.findIndex(k=>c(k)&&String(p(k,o.field))===o.value);const $=u.slice();$[a]=i(u[a],l+1);return $};const d=f(r,0);if(!d.ok)return d;return{ok:true,patch:d.patch}}function y(r,s){return r.slice(0,s).map(n=>n.kind==="key"?n.key:n.kind==="index"?`[${n.index}]`:`[${n.field}=${n.value}]`).join(".").replace(/\.\[/g,"[")||"(root)"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{View as c,Text as a,TouchableOpacity as F,StyleSheet as U,ScrollView as w}from"react-native";import{useEffect as X,useState as Y}from"react";import{Filter as A,Plus as v,Copy as J,Eye as Q,Info as ee}from"../../icons/index.js";import{SectionHeader as d}from"./SectionHeader.js";import{FilterList as H,AddFilterInput as W,AddFilterButton as E}from"./FilterComponents.js";import{useFilterManager as R}from"../../hooks/useFilterManager.js";import{buoyColors as i}from"../gameUI/constants/gameUIColors.js";import{night as o}from"../night/nightTheme.js";import{monoFont as f}from"../fonts.js";import{jsx as e,jsxs as n,Fragment as D}from"react/jsx-runtime";export function DynamicFilterView({sections:k=[],filterSummarySection:m,addFilterSection:T,includeOnlySection:s,availableItemsSection:x,howItWorksSection:g,previewSection:b,onFilterChange:L,onPatternToggle:V,onPatternAdd:z,activePatterns:h=new Set,renderPatternMeta:P,tabs:y,activeTab:j,onTabChange:B}){const u=R(h);const p=R(s?.patterns||new Set);const[K,M]=Y(y?.[0]?.id||"");const C=j||K;X(()=>{if(h.size!==u.filters.size||!Array.from(h).every(t=>u.filters.has(t))){}},[h,u.filters]);const N=()=>{if(u.newFilter.trim()&&z){z(u.newFilter.trim());u.addFilter(u.newFilter)}};const O=()=>{if(p.newFilter.trim()&&s?.onPatternAdd){s.onPatternAdd(p.newFilter.trim());p.addFilter(p.newFilter)}};const I=x?.items?.filter(t=>{return!Array.from(h).some(l=>t.includes(l))})||[];const $=()=>{if(!y||y.length===0)return null;return e(c,{style:r.tabContainer,children:y.map(t=>n(F,{onPress:()=>{if(B)B(t.id);else M(t.id)},style:[r.tabButton,C===t.id?r.tabButtonActive:r.tabButtonInactive],children:[t.icon&&e(t.icon,{size:14,color:C===t.id?i.primary:o.color.textTertiary}),e(a,{style:[r.tabButtonText,C===t.id?r.tabButtonTextActive:r.tabButtonTextInactive],children:t.label}),t.count!==void 0&&t.count>0&&e(c,{style:r.tabBadge,children:e(a,{style:r.tabBadgeText,children:t.count})})]},t.id))})};const Z=t=>{if(t.type==="custom"&&t.renderCustom){return t.renderCustom()}if(t.type==="patterns"){return null}if(!t.data||t.data.length===0)return null;return n(c,{style:r.section,children:[n(d,{children:[t.icon&&e(d.Icon,{icon:t.icon,color:t.color||i.primary,size:12}),e(d.Title,{children:t.title})]}),t.description&&e(a,{style:r.sectionDescription,children:t.description}),e(c,{style:r.filterGrid,children:t.data.map(l=>{const S=l.count!==void 0;const q=S&&l.count===0;const G=t.type!=="method"||l.icon;return n(F,{testID:`buoy-filter-option-${l.id}`,accessibilityRole:"button",accessibilityLabel:String(l.label??l.id),style:[r.filterCard,l.isActive&&r.activeFilterCard],onPress:()=>L?.(l.id,l.value),children:[l.icon?e(l.icon,{size:24,color:l.color,style:r.filterIcon}):t.type==="method"?e(c,{style:[r.methodBadgeCompact,{backgroundColor:`${l.color}20`}],children:e(a,{style:[r.methodTextCompact,{color:l.color}],numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.8,children:l.label})}):null,S&&e(a,{style:[q?r.filterCountZero:r.filterCountActive],children:l.count}),G&&e(a,{style:r.filterLabelCompact,children:l.label}),l.description&&e(a,{style:r.filterDescriptionBottom,children:l.description})]},l.id)})})]},t.id)};const _=()=>{if(y&&C){const t=y.find(l=>l.id===C);if(t?.content){return t.content()}}return n(D,{children:[m?.enabled&&(m.includePatterns?.size||m.excludePatterns?.size)?n(c,{style:r.filterSummarySection,children:[n(c,{style:r.filterSummaryHeader,children:[e(ee,{size:14,color:i.warning}),e(a,{style:r.filterSummaryTitle,children:"Filters Active"})]}),n(a,{style:r.filterSummaryText,children:["Showing ",m.filteredCount," of ",m.totalCount," queries",m.includePatterns?.size?n(a,{style:r.filterSummaryInclude,children:[" ","\u2022 Including: ",Array.from(m.includePatterns).join(", ")]}):null,m.excludePatterns?.size?n(a,{style:r.filterSummaryExclude,children:[" ","\u2022 Excluding: ",Array.from(m.excludePatterns).join(", ")]}):null]})]}):null,k.map(Z),s?.enabled&&n(c,{style:r.includeOnlySection,children:[n(d,{children:[e(d.Icon,{icon:s.icon||Q,color:i.success,size:12}),e(d.Title,{children:s.title||"INCLUDE ONLY FILTERS"}),s.patterns.size>0&&e(d.Badge,{count:s.patterns.size,color:i.success})]}),s.description&&e(a,{style:r.includeOnlyDescription,children:s.description}),e(c,{style:r.includeOnlyInputWrapper,children:!p.showAddInput?e(E,{onPress:()=>p.setShowAddInput(true),color:i.success,label:"Add include pattern",testID:"buoy-filter-include-add-open"}):e(W,{value:p.newFilter,onChange:p.setNewFilter,onSubmit:O,onCancel:()=>{p.setShowAddInput(false);p.setNewFilter("")},placeholder:s.placeholder||"Enter pattern to include...",color:i.success,testID:"buoy-filter-include-input"})}),s.patterns.size>0&&e(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-include-scroll",style:r.includeOnlyFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(H,{filters:s.patterns,onRemoveFilter:s.onPatternToggle,color:i.success,renderItemMeta:s.renderPatternMeta})})]}),T?.enabled&&n(c,{style:r.excludeFiltersSection,children:[n(d,{children:[e(d.Icon,{icon:A,color:i.primary,size:12}),e(d.Title,{children:T.title||"EXCLUDE FILTERS"}),h.size>0&&e(d.Badge,{count:h.size,color:i.primary})]}),e(a,{style:r.excludeFiltersDescription,children:"Hide queries matching these patterns from the list."}),e(c,{style:r.excludeFiltersInputWrapper,children:!u.showAddInput?e(E,{onPress:()=>u.setShowAddInput(true),color:i.primary,label:"Add exclude pattern"}):n(D,{children:[T.renderExtra?.(),e(W,{value:u.newFilter,onChange:u.setNewFilter,onSubmit:N,onCancel:()=>{u.setShowAddInput(false);u.setNewFilter("")},placeholder:T.placeholder||"Enter pattern to exclude...",color:i.primary})]})}),h.size>0&&e(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-active-scroll",style:r.excludeFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(H,{filters:h,onRemoveFilter:V,color:i.primary,renderItemMeta:P})})]}),x?.enabled&&n(c,{style:r.availableKeysSection,children:[n(d,{children:[e(d.Icon,{icon:x.icon||v,color:i.primary,size:12}),e(d.Title,{children:x.title||"AVAILABLE ITEMS"}),e(d.Badge,{count:I.length,color:i.primary})]}),e(w,{style:r.availableKeysScroll,horizontal:false,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,scrollEnabled:true,children:I.length>0?I.map(t=>n(F,{onPress:()=>{if(z){z(t);u.addFilter(t)}},style:r.availableKeyItem,"sentry-label":"ignore-touchable-opacity",testID:`buoy-filter-available-${t}`,accessibilityRole:"button",accessibilityLabel:`Add filter ${t}`,children:[e(a,{style:r.availableKeyText,numberOfLines:1,children:t}),e(v,{size:12,color:i.primary})]},t)):e(a,{style:r.emptyStateText,children:x.emptyMessage||"No items available"})})]}),g?.enabled&&n(c,{style:r.howItWorksSection,children:[n(d,{children:[e(d.Icon,{icon:g.icon||A,color:o.color.textSecondary,size:12}),e(d.Title,{children:g.title||"HOW FILTERS WORK"})]}),e(a,{style:r.howItWorksText,children:g.description||"Filters help you focus on relevant data by hiding unwanted items."}),g.examples&&g.examples.length>0&&n(c,{style:r.examplesContainer,children:[e(a,{style:r.examplesTitle,children:"EXAMPLES:"}),g.examples.map((t,l)=>e(a,{style:r.exampleItem,children:t},l))]})]}),b?.enabled&&n(c,{style:r.previewSection,children:[n(d,{children:[e(d.Icon,{icon:b.icon||J,color:i.primary,size:12}),e(d.Title,{children:b.title||"PREVIEW"}),b.headerActions&&e(d.Actions,{children:b.headerActions()})]}),e(c,{style:r.previewContent,children:b.content()})]})]})};return n(c,{style:r.container,children:[$(),e(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-scroll",style:r.content,contentContainerStyle:r.scrollContent,showsVerticalScrollIndicator:false,"sentry-label":"ignore-scrollview",children:_()})]})}const r=U.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24},tabContainer:{flexDirection:"row",paddingHorizontal:16,paddingVertical:12,gap:8,backgroundColor:o.color.surface,borderBottomWidth:1,borderBottomColor:o.color.border},tabButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1},tabButtonActive:{backgroundColor:i.primary+"20",borderColor:i.primary,borderWidth:2},tabButtonInactive:{backgroundColor:o.color.surfaceElevated,borderColor:o.color.border},tabButtonText:{fontSize:11,fontWeight:"600",letterSpacing:.5},tabButtonTextActive:{color:i.primary},tabButtonTextInactive:{color:o.color.textTertiary},tabBadge:{backgroundColor:i.primary+"40",paddingHorizontal:6,paddingVertical:1,borderRadius:8,minWidth:18,alignItems:"center"},tabBadgeText:{fontSize:9,color:i.primary,fontWeight:"700"},section:{marginBottom:8},filterInputWrapper:{marginBottom:4},filterGrid:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:8},filterCard:{backgroundColor:o.color.surface,borderRadius:12,paddingHorizontal:8,paddingVertical:10,flexDirection:"column",alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:o.color.border,width:72,minHeight:68},activeFilterCard:{backgroundColor:i.primary+"33",borderColor:i.primary,borderWidth:2,shadowColor:i.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:8,elevation:4},filterIcon:{marginBottom:0},filterCountActive:{fontSize:14,fontWeight:"700",color:o.color.text,fontFamily:f,marginTop:3,marginBottom:1,textShadowColor:"rgba(0, 0, 0, 0.2)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterCountZero:{fontSize:11,fontWeight:"500",color:o.color.textTertiary,fontFamily:f,marginTop:3,marginBottom:1},filterLabelCompact:{fontSize:10,color:o.color.text,fontWeight:"600",textAlign:"center",textTransform:"capitalize",textShadowColor:"rgba(0, 0, 0, 0.3)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterDescriptionBottom:{fontSize:8,color:o.color.textTertiary,textAlign:"center",marginTop:2,lineHeight:11},sectionDescription:{fontSize:10,color:o.color.textSecondary,marginTop:4,marginBottom:4,lineHeight:14},methodBadgeCompact:{paddingHorizontal:8,paddingVertical:4,borderRadius:5,minWidth:48,maxWidth:60,alignItems:"center",justifyContent:"center"},methodTextCompact:{fontSize:13,fontWeight:"700",letterSpacing:.3,fontFamily:f},activeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},activeFiltersContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,maxHeight:200},includeOnlySection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},includeOnlyDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},includeOnlyInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},includeOnlyFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},excludeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},excludeFiltersDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},excludeFiltersInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},excludeFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},filterSummarySection:{backgroundColor:i.warning+"15",borderRadius:8,borderWidth:1,borderColor:i.warning+"40",padding:12,marginBottom:12},filterSummaryHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:6},filterSummaryTitle:{fontSize:12,fontWeight:"600",color:i.warning},filterSummaryText:{fontSize:11,color:o.color.text,lineHeight:16},filterSummaryInclude:{color:i.success,fontWeight:"500"},filterSummaryExclude:{color:i.primary,fontWeight:"500"},emptyStateText:{fontSize:11,color:o.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:12},availableKeysSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},availableKeysScroll:{maxHeight:150,paddingHorizontal:16,paddingTop:8,paddingBottom:16},availableKeyItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:o.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:o.color.border,marginBottom:8},availableKeyText:{flex:1,fontSize:11,color:o.color.text,fontFamily:f,marginRight:8},howItWorksSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},howItWorksText:{fontSize:11,color:o.color.textSecondary,lineHeight:16,marginBottom:12,marginTop:8,paddingHorizontal:16,fontFamily:f},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:o.color.border},examplesTitle:{fontSize:10,fontWeight:"600",color:o.color.textTertiary,fontFamily:f,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:o.color.textTertiary,fontFamily:f,lineHeight:16},previewSection:{backgroundColor:o.color.surfaceElevated,borderRadius:16,borderWidth:1,borderColor:o.color.fillTertiary,marginTop:16,overflow:"hidden"},previewContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,backgroundColor:o.color.bg,marginHorizontal:12,marginBottom:12,borderRadius:8,borderWidth:1,borderColor:o.color.border}});
|
|
1
|
+
"use strict";import{View as c,Text as a,TouchableOpacity as A,StyleSheet as ce,ScrollView as F,Keyboard as W,Platform as se}from"react-native";import{useEffect as H,useRef as S,useState as ue}from"react";import{Filter as N,Plus as O,Copy as me,Eye as pe,Info as he}from"../../icons/index.js";import{SectionHeader as d}from"./SectionHeader.js";import{FilterList as _,AddFilterInput as $,AddFilterButton as Y}from"./FilterComponents.js";import{useFilterManager as Z}from"../../hooks/useFilterManager.js";import{buoyColors as i}from"../gameUI/constants/gameUIColors.js";import{night as o}from"../night/nightTheme.js";import{monoFont as f}from"../fonts.js";import{jsx as e,jsxs as n,Fragment as q}from"react/jsx-runtime";export function DynamicFilterView({sections:G=[],filterSummarySection:p,addFilterSection:C,includeOnlySection:s,availableItemsSection:x,howItWorksSection:g,previewSection:b,onFilterChange:U,onPatternToggle:X,onPatternAdd:w,activePatterns:h=new Set,renderPatternMeta:J,tabs:y,activeTab:Q,onTabChange:R}){const u=Z(h);const m=Z(s?.patterns||new Set);const[ee,re]=ue(y?.[0]?.id||"");const T=Q||ee;const E=S(null);const D=S(0);const k=S(null);const L=S(null);const V=m.showAddInput;const P=u.showAddInput;const j=r=>{if(!r||se.OS!=="ios")return()=>{};let l;const z=()=>{const K=W.metrics()?.screenY;if(K==null)return;r.measureInWindow((ge,de,fe,ae)=>{const M=de+ae-(K-16);if(M<=0)return;E.current?.scrollTo({y:D.current+M,animated:true})})};const I=()=>{clearTimeout(l);l=setTimeout(z,300)};if(W.isVisible())I();const v=W.addListener("keyboardDidShow",I);return()=>{clearTimeout(l);v.remove()}};H(()=>V?j(k.current):void 0,[V]);H(()=>P?j(L.current):void 0,[P]);H(()=>{if(h.size!==u.filters.size||!Array.from(h).every(r=>u.filters.has(r))){}},[h,u.filters]);const te=()=>{if(u.newFilter.trim()&&w){w(u.newFilter.trim());u.addFilter(u.newFilter)}};const oe=()=>{if(m.newFilter.trim()&&s?.onPatternAdd){s.onPatternAdd(m.newFilter.trim());m.addFilter(m.newFilter)}};const B=x?.items?.filter(r=>{return!Array.from(h).some(l=>r.includes(l))})||[];const le=()=>{if(!y||y.length===0)return null;return e(c,{style:t.tabContainer,children:y.map(r=>n(A,{onPress:()=>{if(R)R(r.id);else re(r.id)},style:[t.tabButton,T===r.id?t.tabButtonActive:t.tabButtonInactive],children:[r.icon&&e(r.icon,{size:14,color:T===r.id?i.primary:o.color.textTertiary}),e(a,{style:[t.tabButtonText,T===r.id?t.tabButtonTextActive:t.tabButtonTextInactive],children:r.label}),r.count!==void 0&&r.count>0&&e(c,{style:t.tabBadge,children:e(a,{style:t.tabBadgeText,children:r.count})})]},r.id))})};const ie=r=>{if(r.type==="custom"&&r.renderCustom){return r.renderCustom()}if(r.type==="patterns"){return null}if(!r.data||r.data.length===0)return null;return n(c,{style:t.section,children:[n(d,{children:[r.icon&&e(d.Icon,{icon:r.icon,color:r.color||i.primary,size:12}),e(d.Title,{children:r.title})]}),r.description&&e(a,{style:t.sectionDescription,children:r.description}),e(c,{style:t.filterGrid,children:r.data.map(l=>{const z=l.count!==void 0;const I=z&&l.count===0;const v=r.type!=="method"||l.icon;return n(A,{testID:`buoy-filter-option-${l.id}`,accessibilityRole:"button",accessibilityLabel:String(l.label??l.id),style:[t.filterCard,l.isActive&&t.activeFilterCard],onPress:()=>U?.(l.id,l.value),children:[l.icon?e(l.icon,{size:24,color:l.color,style:t.filterIcon}):r.type==="method"?e(c,{style:[t.methodBadgeCompact,{backgroundColor:`${l.color}20`}],children:e(a,{style:[t.methodTextCompact,{color:l.color}],numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.8,children:l.label})}):null,z&&e(a,{style:[I?t.filterCountZero:t.filterCountActive],children:l.count}),v&&e(a,{style:t.filterLabelCompact,children:l.label}),l.description&&e(a,{style:t.filterDescriptionBottom,children:l.description})]},l.id)})})]},r.id)};const ne=()=>{if(y&&T){const r=y.find(l=>l.id===T);if(r?.content){return r.content()}}return n(q,{children:[p?.enabled&&(p.includePatterns?.size||p.excludePatterns?.size)?n(c,{style:t.filterSummarySection,children:[n(c,{style:t.filterSummaryHeader,children:[e(he,{size:14,color:i.warning}),e(a,{style:t.filterSummaryTitle,children:"Filters Active"})]}),n(a,{style:t.filterSummaryText,children:["Showing ",p.filteredCount," of ",p.totalCount," queries",p.includePatterns?.size?n(a,{style:t.filterSummaryInclude,children:[" ","\u2022 Including: ",Array.from(p.includePatterns).join(", ")]}):null,p.excludePatterns?.size?n(a,{style:t.filterSummaryExclude,children:[" ","\u2022 Excluding: ",Array.from(p.excludePatterns).join(", ")]}):null]})]}):null,G.map(ie),s?.enabled&&n(c,{style:t.includeOnlySection,children:[n(d,{children:[e(d.Icon,{icon:s.icon||pe,color:i.success,size:12}),e(d.Title,{children:s.title||"INCLUDE ONLY FILTERS"}),s.patterns.size>0&&e(d.Badge,{count:s.patterns.size,color:i.success})]}),s.description&&e(a,{style:t.includeOnlyDescription,children:s.description}),e(c,{ref:k,style:t.includeOnlyInputWrapper,children:!m.showAddInput?e(Y,{onPress:()=>m.setShowAddInput(true),color:i.success,label:"Add include pattern",testID:"buoy-filter-include-add-open"}):e($,{value:m.newFilter,onChange:m.setNewFilter,onSubmit:oe,onCancel:()=>{m.setShowAddInput(false);m.setNewFilter("")},placeholder:s.placeholder||"Enter pattern to include...",color:i.success,testID:"buoy-filter-include-input"})}),s.patterns.size>0&&e(F,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-include-scroll",style:t.includeOnlyFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(_,{filters:s.patterns,onRemoveFilter:s.onPatternToggle,color:i.success,renderItemMeta:s.renderPatternMeta})})]}),C?.enabled&&n(c,{style:t.excludeFiltersSection,children:[n(d,{children:[e(d.Icon,{icon:N,color:i.primary,size:12}),e(d.Title,{children:C.title||"EXCLUDE FILTERS"}),h.size>0&&e(d.Badge,{count:h.size,color:i.primary})]}),e(a,{style:t.excludeFiltersDescription,children:"Hide queries matching these patterns from the list."}),e(c,{ref:L,style:t.excludeFiltersInputWrapper,children:!u.showAddInput?e(Y,{onPress:()=>u.setShowAddInput(true),color:i.primary,label:"Add exclude pattern"}):n(q,{children:[C.renderExtra?.(),e($,{value:u.newFilter,onChange:u.setNewFilter,onSubmit:te,onCancel:()=>{u.setShowAddInput(false);u.setNewFilter("")},placeholder:C.placeholder||"Enter pattern to exclude...",color:i.primary})]})}),h.size>0&&e(F,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-active-scroll",style:t.excludeFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(_,{filters:h,onRemoveFilter:X,color:i.primary,renderItemMeta:J})})]}),x?.enabled&&n(c,{style:t.availableKeysSection,children:[n(d,{children:[e(d.Icon,{icon:x.icon||O,color:i.primary,size:12}),e(d.Title,{children:x.title||"AVAILABLE ITEMS"}),e(d.Badge,{count:B.length,color:i.primary})]}),e(F,{keyboardShouldPersistTaps:"handled",style:t.availableKeysScroll,horizontal:false,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,scrollEnabled:true,children:B.length>0?B.map(r=>n(A,{onPress:()=>{if(w){w(r);u.addFilter(r)}},style:t.availableKeyItem,"sentry-label":"ignore-touchable-opacity",testID:`buoy-filter-available-${r}`,accessibilityRole:"button",accessibilityLabel:`Add filter ${r}`,children:[e(a,{style:t.availableKeyText,numberOfLines:1,children:r}),e(O,{size:12,color:i.primary})]},r)):e(a,{style:t.emptyStateText,children:x.emptyMessage||"No items available"})})]}),g?.enabled&&n(c,{style:t.howItWorksSection,children:[n(d,{children:[e(d.Icon,{icon:g.icon||N,color:o.color.textSecondary,size:12}),e(d.Title,{children:g.title||"HOW FILTERS WORK"})]}),e(a,{style:t.howItWorksText,children:g.description||"Filters help you focus on relevant data by hiding unwanted items."}),g.examples&&g.examples.length>0&&n(c,{style:t.examplesContainer,children:[e(a,{style:t.examplesTitle,children:"EXAMPLES:"}),g.examples.map((r,l)=>e(a,{style:t.exampleItem,children:r},l))]})]}),b?.enabled&&n(c,{style:t.previewSection,children:[n(d,{children:[e(d.Icon,{icon:b.icon||me,color:i.primary,size:12}),e(d.Title,{children:b.title||"PREVIEW"}),b.headerActions&&e(d.Actions,{children:b.headerActions()})]}),e(c,{style:t.previewContent,children:b.content()})]})]})};return n(c,{style:t.container,children:[le(),e(F,{ref:E,onScroll:r=>{D.current=r.nativeEvent.contentOffset.y},scrollEventThrottle:32,keyboardShouldPersistTaps:"handled",testID:"buoy-filter-scroll",style:t.content,contentContainerStyle:t.scrollContent,showsVerticalScrollIndicator:false,"sentry-label":"ignore-scrollview",children:ne()})]})}const t=ce.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24},tabContainer:{flexDirection:"row",paddingHorizontal:16,paddingVertical:12,gap:8,backgroundColor:o.color.surface,borderBottomWidth:1,borderBottomColor:o.color.border},tabButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1},tabButtonActive:{backgroundColor:i.primary+"20",borderColor:i.primary,borderWidth:2},tabButtonInactive:{backgroundColor:o.color.surfaceElevated,borderColor:o.color.border},tabButtonText:{fontSize:11,fontWeight:"600",letterSpacing:.5},tabButtonTextActive:{color:i.primary},tabButtonTextInactive:{color:o.color.textTertiary},tabBadge:{backgroundColor:i.primary+"40",paddingHorizontal:6,paddingVertical:1,borderRadius:8,minWidth:18,alignItems:"center"},tabBadgeText:{fontSize:9,color:i.primary,fontWeight:"700"},section:{marginBottom:8},filterInputWrapper:{marginBottom:4},filterGrid:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:8},filterCard:{backgroundColor:o.color.surface,borderRadius:12,paddingHorizontal:8,paddingVertical:10,flexDirection:"column",alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:o.color.border,width:72,minHeight:68},activeFilterCard:{backgroundColor:i.primary+"33",borderColor:i.primary,borderWidth:2,shadowColor:i.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:8,elevation:4},filterIcon:{marginBottom:0},filterCountActive:{fontSize:14,fontWeight:"700",color:o.color.text,fontFamily:f,marginTop:3,marginBottom:1,textShadowColor:"rgba(0, 0, 0, 0.2)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterCountZero:{fontSize:11,fontWeight:"500",color:o.color.textTertiary,fontFamily:f,marginTop:3,marginBottom:1},filterLabelCompact:{fontSize:10,color:o.color.text,fontWeight:"600",textAlign:"center",textTransform:"capitalize",textShadowColor:"rgba(0, 0, 0, 0.3)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterDescriptionBottom:{fontSize:8,color:o.color.textTertiary,textAlign:"center",marginTop:2,lineHeight:11},sectionDescription:{fontSize:10,color:o.color.textSecondary,marginTop:4,marginBottom:4,lineHeight:14},methodBadgeCompact:{paddingHorizontal:8,paddingVertical:4,borderRadius:5,minWidth:48,maxWidth:60,alignItems:"center",justifyContent:"center"},methodTextCompact:{fontSize:13,fontWeight:"700",letterSpacing:.3,fontFamily:f},activeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},activeFiltersContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,maxHeight:200},includeOnlySection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},includeOnlyDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},includeOnlyInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},includeOnlyFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},excludeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},excludeFiltersDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},excludeFiltersInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},excludeFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},filterSummarySection:{backgroundColor:i.warning+"15",borderRadius:8,borderWidth:1,borderColor:i.warning+"40",padding:12,marginBottom:12},filterSummaryHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:6},filterSummaryTitle:{fontSize:12,fontWeight:"600",color:i.warning},filterSummaryText:{fontSize:11,color:o.color.text,lineHeight:16},filterSummaryInclude:{color:i.success,fontWeight:"500"},filterSummaryExclude:{color:i.primary,fontWeight:"500"},emptyStateText:{fontSize:11,color:o.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:12},availableKeysSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},availableKeysScroll:{maxHeight:150,paddingHorizontal:16,paddingTop:8,paddingBottom:16},availableKeyItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:o.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:o.color.border,marginBottom:8},availableKeyText:{flex:1,fontSize:11,color:o.color.text,fontFamily:f,marginRight:8},howItWorksSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},howItWorksText:{fontSize:11,color:o.color.textSecondary,lineHeight:16,marginBottom:12,marginTop:8,paddingHorizontal:16,fontFamily:f},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:o.color.border},examplesTitle:{fontSize:10,fontWeight:"600",color:o.color.textTertiary,fontFamily:f,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:o.color.textTertiary,fontFamily:f,lineHeight:16},previewSection:{backgroundColor:o.color.surfaceElevated,borderRadius:16,borderWidth:1,borderColor:o.color.fillTertiary,marginTop:16,overflow:"hidden"},previewContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,backgroundColor:o.color.bg,marginHorizontal:12,marginBottom:12,borderRadius:8,borderWidth:1,borderColor:o.color.border}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as w}from"react";import{ScrollView as z,StyleSheet as W,Text as p,TouchableOpacity as L,View as s}from"react-native";import{Filter as I,X as k}from"../../icons/index.js";import{night as t}from"../night/nightTheme.js";import{SectionHeader as n}from"./SectionHeader.js";import{AddFilterButton as B,AddFilterInput as V}from"./FilterComponents.js";import{monoFont as h}from"../fonts.js";import{jsxs as l,jsx as r}from"react/jsx-runtime";function A(d,a){return Array.from(a).some(m=>d.name.toLowerCase().includes(m.toLowerCase()))}function v(d,a){const m=a.find(u=>u.name.toLowerCase()===d.toLowerCase());return m?m.color:null}export function EntityFilterView({entities:d,ignoredPatterns:a,onTogglePattern:m,onAddPattern:u,entityNoun:T,entitySingular:y,entityKey:f,testIDPrefix:c,slug:S,howItWorks:H,examples:R,addPlaceholder:E,emptyMessage:x}){const[$,b]=w(false);const[C,g]=w("");const F=()=>{const e=C.trim();if(e){u(e);g("");b(false)}};return l(z,{
|
|
1
|
+
"use strict";import{useState as w}from"react";import{ScrollView as z,StyleSheet as W,Text as p,TouchableOpacity as L,View as s}from"react-native";import{Filter as I,X as k}from"../../icons/index.js";import{night as t}from"../night/nightTheme.js";import{SectionHeader as n}from"./SectionHeader.js";import{AddFilterButton as B,AddFilterInput as V}from"./FilterComponents.js";import{monoFont as h}from"../fonts.js";import{jsxs as l,jsx as r}from"react/jsx-runtime";function A(d,a){return Array.from(a).some(m=>d.name.toLowerCase().includes(m.toLowerCase()))}function v(d,a){const m=a.find(u=>u.name.toLowerCase()===d.toLowerCase());return m?m.color:null}export function EntityFilterView({entities:d,ignoredPatterns:a,onTogglePattern:m,onAddPattern:u,entityNoun:T,entitySingular:y,entityKey:f,testIDPrefix:c,slug:S,howItWorks:H,examples:R,addPlaceholder:E,emptyMessage:x}){const[$,b]=w(false);const[C,g]=w("");const F=()=>{const e=C.trim();if(e){u(e);g("");b(false)}};return l(z,{style:o.container,contentContainerStyle:o.scrollContent,showsVerticalScrollIndicator:false,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",testID:`${c}-filters-scroll`,children:[d.length===0&&x?l(s,{style:o.section,children:[r(n,{children:l(n.Title,{children:["REGISTERED ",T]})}),r(p,{style:o.emptyText,testID:`${c}-filters-${f}s-empty`,children:x})]}):null,d.length>0&&l(s,{style:o.section,children:[l(n,{children:[l(n.Title,{children:["REGISTERED ",T]}),r(n.Badge,{count:d.length,color:t.color.accent,testID:`${c}-filters-${f}-count`})]}),r(z,{keyboardShouldPersistTaps:"handled",style:o.entityList,contentContainerStyle:o.entityListContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,testID:`${c}-filters-${f}-list`,children:d.map(e=>{const i=A(e,a);return l(L,{style:[o.entityRow,i&&o.entityRowHidden],onPress:()=>u(e.name),disabled:i,testID:`${c}-filters-${f}-${S(e.name)}`,accessibilityRole:"button",accessibilityLabel:`Hide ${e.name}`,accessibilityState:{disabled:i},children:[r(s,{style:[o.dot,{backgroundColor:i?t.color.textTertiary:e.color}]}),r(p,{style:[o.entityText,i?o.entityTextHidden:{color:e.color}],numberOfLines:1,children:e.name}),i?r(p,{style:o.hiddenLabel,children:"hidden"}):r(p,{style:[o.addLabel,{color:e.color+"99"}],children:"+ hide"})]},e.name)})})]}),l(s,{style:o.section,children:[l(n,{children:[r(n.Icon,{icon:I,color:t.color.accent,size:12}),l(n.Title,{children:[y.toUpperCase()," NAME FILTERS"]}),a.size>0&&r(n.Badge,{count:a.size,color:t.color.accent,testID:`${c}-filters-count`})]}),r(s,{style:o.addInputWrapper,children:!$?r(B,{onPress:()=>b(true),color:t.color.accent,label:`Add ${y} name pattern`,testID:`${c}-filters-add-open`}):r(V,{value:C,onChange:g,onSubmit:F,onCancel:()=>{b(false);g("")},placeholder:E??`Enter ${y} name pattern to hide...`,color:t.color.accent,testID:`${c}-filters-add-input`})}),a.size>0&&r(s,{style:o.patternList,children:Array.from(a).map(e=>{const i=v(e,d);return l(L,{style:o.patternRow,onPress:()=>m(e),activeOpacity:.8,testID:`${c}-filters-chip-${S(e)}`,accessibilityRole:"button",accessibilityLabel:`Remove filter ${e}`,children:[i?r(s,{style:[o.dot,{backgroundColor:i}]}):null,r(p,{style:[o.patternText,i?{color:i}:null],numberOfLines:1,children:e}),r(k,{size:12,color:t.color.accent+"80"})]},e)})})]}),l(s,{style:o.section,children:[l(n,{children:[r(n.Icon,{icon:I,color:t.color.textSecondary,size:12}),r(n.Title,{children:"HOW EVENT FILTERS WORK"})]}),r(p,{style:o.howItWorksText,children:H}),l(s,{style:o.examplesContainer,children:[r(p,{style:o.examplesTitle,children:"EXAMPLES:"}),R.map(e=>r(p,{style:o.exampleItem,children:e},e))]})]})]})}const o=W.create({container:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24,gap:16},section:{backgroundColor:t.color.surface,borderRadius:16,borderWidth:1,borderColor:t.color.border,overflow:"hidden"},entityList:{maxHeight:180},entityListContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,gap:10},entityRow:{flexDirection:"row",alignItems:"center",gap:10,paddingVertical:10,paddingHorizontal:12,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border},entityRowHidden:{opacity:.45},dot:{width:7,height:7,borderRadius:3.5},entityText:{flex:1,fontSize:12,fontWeight:"600",fontFamily:h},entityTextHidden:{color:t.color.textTertiary,textDecorationLine:"line-through"},hiddenLabel:{fontSize:10,fontWeight:"500",color:t.color.textTertiary,fontFamily:h},addLabel:{fontSize:10,fontWeight:"600",fontFamily:h},addInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},patternList:{paddingHorizontal:16,paddingBottom:16,gap:8},patternRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border,gap:8},patternText:{flex:1,fontSize:12,fontFamily:h,color:t.color.text},emptyText:{fontSize:11,color:t.color.textTertiary,paddingHorizontal:16,paddingTop:8,paddingBottom:16,fontFamily:h},howItWorksText:{fontSize:11,color:t.color.textSecondary,lineHeight:16,marginTop:8,paddingHorizontal:16,fontFamily:h},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:t.color.border,marginTop:12},examplesTitle:{fontSize:10,fontWeight:"600",color:t.color.textTertiary,fontFamily:h,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:t.color.textTertiary,fontFamily:h,lineHeight:16}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as F,useRef as W,useCallback as C,useEffect as j}from"react";import{View as d,TouchableOpacity as s,StyleSheet as V,Animated as f,Platform as U}from"react-native";import{X as A,Minus as I,DockBottom as P,FloatWindow as R}from"../../icons/index.js";import{buoyColors as N}from"../gameUI/constants/gameUIColors.js";import{night as e}from"../night/nightTheme.js";import{expandableWindowControlsSupported as
|
|
1
|
+
"use strict";import{useState as F,useRef as W,useCallback as C,useEffect as j}from"react";import{View as d,TouchableOpacity as s,StyleSheet as V,Animated as f,Platform as U,Keyboard as X}from"react-native";import{X as A,Minus as I,DockBottom as P,FloatWindow as R}from"../../icons/index.js";import{buoyColors as N}from"../gameUI/constants/gameUIColors.js";import{night as e}from"../night/nightTheme.js";import{expandableWindowControlsSupported as Z,isExpandableWindowControlsEnabled as G}from"./windowControlsSetting.js";import{jsx as t,jsxs as w,Fragment as H}from"react/jsx-runtime";export{setExpandableWindowControls}from"./windowControlsSetting.js";const u={close:"#FF5F57",minimize:"#FEBC2E",toggleMode:"#28C840"};const B=12;const K=8;const g=8;const x=36;const q=12;const z=16;const b=8;const J=3e3;export function WindowControls({onClose:p,onMinimize:i,onToggleMode:r,mode:l,variant:D="night",defaultExpanded:h}){const n=l==="floating"?P:R;const E=l==="floating"?"Dock to bottom sheet":"Make floating window";if(!G()||!Z(U.OS==="web")){return w(d,{style:o.container,children:[i&&t(s,{onPress:i,style:[o.dot,o.minimizeDot],activeOpacity:.8,accessibilityLabel:"Minimize modal",accessibilityRole:"button",children:t(I,{size:g,color:"#7A5A00",strokeWidth:1.5})}),r&&t(s,{onPress:r,style:[o.dot,o.expandDot],activeOpacity:.8,accessibilityLabel:E,accessibilityRole:"button",children:t(n,{size:g,color:"#004A1A",strokeWidth:1.5})}),t(s,{onPress:p,style:[o.dot,o.closeDot],activeOpacity:.8,accessibilityLabel:"Close modal",testID:"tool-window-close",accessibilityRole:"button",children:t(A,{size:g,color:"#4A0000",strokeWidth:1.5})})]})}return t(Q,{onClose:p,onMinimize:i,onToggleMode:r,mode:l,variant:D,defaultExpanded:h})}function Q({onClose:p,onMinimize:i,onToggleMode:r,mode:l,variant:D="night",defaultExpanded:h=false}){const n=D==="night";const[E,O]=F(h);const a=W(new f.Value(h?1:0)).current;const m=W(null);const S=l==="floating"?P:R;const T=l==="floating"?"Dock to bottom sheet":"Make floating window";const c=C(()=>{if(m.current){clearTimeout(m.current);m.current=null}},[]);const y=C(()=>{c();f.spring(a,{toValue:0,tension:200,friction:20,useNativeDriver:false}).start(()=>{O(false)})},[a,c]);const _=C(()=>{X.dismiss();O(true);f.spring(a,{toValue:1,tension:180,friction:18,useNativeDriver:false}).start();c();m.current=setTimeout(y,J)},[a,y,c]);j(()=>{return c},[c]);const k=C(M=>{y();M()},[y]);const v=a.interpolate({inputRange:[0,1],outputRange:[.3,1]});const L=a.interpolate({inputRange:[0,.5,1],outputRange:[0,.8,1]});return w(H,{children:[t(s,{onPress:_,activeOpacity:.7,accessibilityLabel:"Open window controls",testID:"tool-window-controls",accessibilityRole:"button",style:o.trigger,hitSlop:{top:8,bottom:8,left:8,right:8},children:w(d,{style:o.container,children:[i&&t(d,{style:[o.dot,o.minimizeDot],children:t(I,{size:g,color:"#7A5A00",strokeWidth:1.5})}),r&&t(d,{style:[o.dot,o.expandDot],children:t(S,{size:g,color:"#004A1A",strokeWidth:1.5})}),t(d,{style:[o.dot,o.closeDot],children:t(A,{size:g,color:"#4A0000",strokeWidth:1.5})})]})}),E&&t(f.View,{style:[o.expandedPanelInline,{transform:[{scale:v}],opacity:L}],children:w(d,{style:[o.expandedContainer,n&&o.nightExpandedContainer],children:[i&&t(s,{onPress:()=>k(i),style:[o.expandedButton,n?o.nightMinimizeButton:o.minimizeButtonExpanded],activeOpacity:.7,accessibilityLabel:"Minimize modal",testID:"tool-window-minimize",accessibilityRole:"button",children:t(I,{size:z,color:n?e.color.warning:"#7A5A00",strokeWidth:2})}),r&&t(s,{onPress:()=>k(r),style:[o.expandedButton,n?o.nightToggleButton:o.expandButtonExpanded],activeOpacity:.7,accessibilityLabel:T,testID:"tool-window-mode",accessibilityRole:"button",children:t(S,{size:z,color:n?e.color.accent:"#004A1A",strokeWidth:2})}),t(s,{onPress:()=>k(p),style:[o.expandedButton,n?o.nightCloseButton:o.closeButtonExpanded],activeOpacity:.7,accessibilityLabel:"Close modal",testID:"tool-window-close",accessibilityRole:"button",children:t(A,{size:z,color:n?e.color.danger:"#4A0000",strokeWidth:2})})]})})]})}const o=V.create({trigger:{padding:2},container:{flexDirection:"row",alignItems:"center",gap:K},dot:{width:B,height:B,borderRadius:B/2,alignItems:"center",justifyContent:"center"},closeDot:{backgroundColor:u.close},minimizeDot:{backgroundColor:u.minimize},expandDot:{backgroundColor:u.toggleMode},expandedPanelInline:{position:"absolute",top:-b,right:-b,zIndex:9999},expandedContainer:{flexDirection:"row",alignItems:"center",gap:q,backgroundColor:N.card,borderRadius:(x+b*2)/2,paddingHorizontal:b,paddingVertical:b,borderWidth:1,borderColor:N.border,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.4,shadowRadius:12,elevation:30},expandedButton:{width:x,height:x,borderRadius:x/2,alignItems:"center",justifyContent:"center"},closeButtonExpanded:{backgroundColor:u.close},minimizeButtonExpanded:{backgroundColor:u.minimize},expandButtonExpanded:{backgroundColor:u.toggleMode},nightExpandedContainer:{backgroundColor:e.color.surface,borderColor:e.color.border},nightMinimizeButton:{backgroundColor:e.color.warningSoft,borderWidth:1,borderColor:e.color.warning+"59"},nightToggleButton:{backgroundColor:e.color.accentSoft,borderWidth:1,borderColor:e.color.accentBorderStrong},nightCloseButton:{backgroundColor:e.color.dangerSoft,borderWidth:1,borderColor:e.color.danger+"59"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useEffect as T,useMemo as mt,useRef as L,useState as F,useContext as Ot,createContext as At,useCallback as X,Children as gt}from"react";import{Animated as N,Dimensions as ct,useWindowDimensions as Et,View as Y,Text as yt,TouchableOpacity as Xt}from"react-native";import{night as W}from"../night/nightTheme.js";import{DraggableHeader as xt}from"../components/DraggableHeader.js";import{EnvironmentSelectorInline as Nt}from"../../env/EnvironmentSelectorInline";import{GripVerticalIcon as Yt}from"../components/GripVerticalIcon.js";import{buoyColors as V}from"../gameUI/constants/gameUIColors.js";import{getSafeAreaInsets as bt,persistentStorage as ot}from"../../utils/index.js";import{useSafeAreaInsets as Wt}from"../../hooks/index.js";import{calculateTargetPosition as zt}from"./onboardingConstants";import{getUserStatusConfig as Ht,filterValidChildren as Ut,floatingToolsColors as pt}from"@buoy-gg/floating-tools-core";import{jsx as R,jsxs as k}from"react/jsx-runtime";const it={BUBBLE_POSITION_X:"@react_buoy_bubble_position_x",BUBBLE_POSITION_Y:"@react_buoy_bubble_position_y"};const $=32;const y=20;const Ft=150;const C=u=>u.__getValue();function $t({animatedPosition:u,bubbleWidth:_=100,bubbleHeight:g=32,enabled:a=true,visibleHandleWidth:v=32,listenersSuspended:z=false,defaultPlacement:H="top",onPositionLoaded:Q,storageKey:p}){const[U,I]=F(false);const D=L(void 0);const x=L(true);T(()=>{x.current=true;return()=>{x.current=false;if(D.current){clearTimeout(D.current);D.current=void 0}}},[]);const O=X(async(c,m)=>{if(!a)return;if(!x.current)return;const{width:t}=ct.get("window");if(t<=0||c<0||m<0)return;try{await Promise.all([ot.setItem(p?`${p}:x`:it.BUBBLE_POSITION_X,c.toString()),ot.setItem(p?`${p}:y`:it.BUBBLE_POSITION_Y,m.toString())])}catch(o){}},[a,p]);const j=X((c,m)=>{if(!x.current)return;if(D.current)clearTimeout(D.current);D.current=setTimeout(()=>{if(x.current){O(c,m)}},500)},[O]);const G=X(async()=>{if(!a)return null;try{const[c,m]=await Promise.all([ot.getItem(p?`${p}:x`:it.BUBBLE_POSITION_X),ot.getItem(p?`${p}:y`:it.BUBBLE_POSITION_Y)]);if(c!==null&&m!==null){const t=parseFloat(c);const o=parseFloat(m);if(!Number.isNaN(t)&&!Number.isNaN(o)){return{x:t,y:o}}}}catch(c){}return null},[a,p]);const P=X(c=>{const{width:m,height:t}=ct.get("window");const o=bt();if(m<=0||t<=0){return{...c,isValid:false}}const A=o.left;const e=m-v;const E=o.top+y;const l=t-g-o.bottom;const d={x:Math.max(A,Math.min(c.x,e)),y:Math.max(E,Math.min(c.y,l)),isValid:true};return d},[v,g]);T(()=>{if(!a||U)return;let c=false;const m=async()=>{const t=await G();if(c||!x.current)return;const{width:o,height:A}=ct.get("window");const e=bt();if(o<=0||A<=0){setTimeout(()=>{if(x.current&&!c){m()}},100);return}let E;let l=false;if(t){const d=P(t);if(!d.isValid){setTimeout(()=>{if(x.current&&!c){m()}},100);return}const Z=Math.abs(t.x-d.x)>5||Math.abs(t.y-d.y)>5;if(Z){await O(d.x,d.y)}E={x:d.x,y:d.y};l=d.x>=o-v-5}else{const d=H==="bottom"?Math.max(e.top+y,A-g-e.bottom-y):Math.max(e.top+y,Math.min(100,A-g-e.bottom));E={x:o-_-y,y:d}}if(c||!x.current)return;u.setValue(E);I(true);Q?.(E,l)};m();return()=>{c=true}},[a,U,u,G,P,O,_,g,v,Q]);T(()=>{if(!a||!U||z)return;const c=u.addListener(m=>{j(m.x,m.y)});return()=>{u.removeListener(c);if(D.current){clearTimeout(D.current);D.current=void 0}}},[a,U,z,u,j]);return{savePosition:O,isInitialized:U}}export function Divider(){const u={width:1,height:12,backgroundColor:V.textMuted+"66",flexShrink:0};return R(Y,{style:u})}const jt={success:"#20C997",warning:"#FFA94D",error:"#EF4444",muted:V.textMuted,secondary:V.textSecondary,info:"#20C997",primary:"#20C997",optional:V.textSecondary};function kt(u){return Ht(u,jt)}const wt=At({isDragging:false});export function UserStatus({userRole:u,onPress:_}){const{isDragging:g}=Ot(wt);const a=kt(u);const v={flexDirection:"row",alignItems:"center",paddingVertical:6,paddingHorizontal:8,flexShrink:0};const z={width:6,height:6,borderRadius:3,backgroundColor:a.dotColor,marginRight:4};const H={fontSize:10,fontWeight:"500",color:a.textColor,letterSpacing:.3};if(!_){return k(Y,{style:v,accessibilityLabel:`User status: ${a.label}`,children:[R(Y,{style:z}),R(yt,{style:H,children:a.label})]})}return k(Xt,{accessibilityRole:"button",accessibilityLabel:"Open Dev Tools Menu",testID:"open-dev-tools-button",onPress:_,hitSlop:{top:10,bottom:10,left:0,right:10},disabled:g,activeOpacity:.85,style:v,children:[R(Y,{style:z}),R(yt,{style:H,children:a.label})]})}function Gt(u){const _=Ut(u);const g=[];_.forEach((a,v)=>{g.push(a);if(v<_.length-1)g.push(R(Divider,{},`divider-${v}`))});return g}export function FloatingTool({id:u,suspendPointerEvents:_=false,revealToken:g,variant:a="bubble",dragFromSurface:v=false,accessibilityLabel:z="Move dev tools bubble",minimizedStack:H,hasMinimizedStack:Q=false,accessory:p,handleAdornment:U,enablePositionPersistence:I=true,defaultPlacement:D="top",pushToSide:x=false,centerOnboarding:O=false,children:j,environment:G,availableEnvironments:P,onEnvironmentSwitch:c,showEnvironmentSelector:m=false}){const t=L(new N.ValueXY).current;const[o,A]=F(false);const[e,E]=F({width:100,height:32});const[l,d]=F(false);const[Z,St]=F(0);const[vt,It]=F(false);const f=L(null);const K=L(false);const q=L(false);const ut=L(x);const J=L(null);const[tt,Dt]=F(false);const h=Wt();const{width:i,height:S}=Et();const Mt=X((n,r)=>{if(r){d(true)}},[]);const{savePosition:w,isInitialized:B}=$t({animatedPosition:t,bubbleWidth:e.width,bubbleHeight:e.height,enabled:I,visibleHandleWidth:$,listenersSuspended:o,defaultPlacement:D,onPositionLoaded:Mt,storageKey:u?`@buoy/floating-tool/${u}`:void 0});T(()=>{if(I&&!B)return;if(!ut.current&&x){q.current=false}ut.current=x;if(x&&!l&&!o&&!q.current){const n=C(t.x);const r=C(t.y);f.current={x:n,y:r};const s=i-$;K.current=true;d(true);N.timing(t,{toValue:{x:s,y:r},duration:200,useNativeDriver:false}).start(()=>{w(s,r)})}else if(!x&&l&&K.current){if(f.current){const{x:n,y:r}=f.current;K.current=false;q.current=false;d(false);N.timing(t,{toValue:{x:n,y:r},duration:200,useNativeDriver:false}).start(()=>{w(n,r)})}}},[I,B,x,l,o,i,t,w]);T(()=>{if(!B||tt)return;const n=setTimeout(()=>{J.current=e.width;Dt(true);if(!l&&!o){const r=C(t.x);const s=i-e.width-y;if(r>s){const b=Math.max(h.left,s);const M=C(t.y);t.setValue({x:b,y:M});w(b,M)}}},Ft);return()=>clearTimeout(n)},[B,tt,e.width]);T(()=>{if(!B)return;if(!tt)return;if(J.current===null)return;if(o){J.current=e.width;return}const n=J.current;const r=e.width;const s=r-n;if(Math.abs(s)<2){return}J.current=r;if(l){if(f.current){const Vt=f.current.x-s;f.current.x=Math.max(h.left,Math.min(Vt,i-r-y))}return}const b=C(t.x);const M=C(t.y);const et=b-s;const rt=Math.max(h.left,Math.min(et,i-$));if(Math.abs(rt-b)>1){N.timing(t,{toValue:{x:rt,y:M},duration:150,useNativeDriver:false}).start(()=>{w(rt,M);if(f.current){f.current.x=rt}})}},[e.width,B,tt,o,l,t,i,h.left,w]);T(()=>{if(!I){if(O){const n=zt();const r=(i-e.width)/2;const s=S-e.height-n;t.setValue({x:r,y:s})}else{const n=D==="bottom"?Math.max(h.top+y,S-e.height-h.bottom-y):Math.max(h.top+y,Math.min(100,S-e.height-h.bottom));t.setValue({x:i-e.width-y,y:n})}}},[I,O,t,e.width,e.height,h.top,h.bottom,i,S]);const nt=X(()=>{const n=C(t.x);const r=C(t.y);const s=n>i-e.width/2;if(l||s){let b;let M;if(f.current&&f.current.x<i-e.width/2){b=f.current.x;M=f.current.y}else{b=i-e.width-y;M=r}K.current=false;q.current=true;d(false);N.timing(t,{toValue:{x:b,y:M},duration:200,useNativeDriver:false}).start(()=>{w(b,M)})}else{f.current={x:n,y:r};q.current=false;const b=i-$;d(true);N.timing(t,{toValue:{x:b,y:r},duration:200,useNativeDriver:false}).start(()=>{w(b,r)})}},[t,l,e.width,w,i]);const lt=X(()=>{A(true)},[]);const dt=X(n=>{let{x:r,y:s}=n;const b=r+e.width/2;const M=b>i;if(M){const et=i-$;d(true);if(f.current){f.current.y=s}else{f.current={x:i-e.width-y,y:s}}N.timing(t,{toValue:{x:et,y:s},duration:200,useNativeDriver:false}).start(()=>{w(et,s)})}else{if(l&&r<i-$-10){d(false)}if(r<i-e.width/2){f.current={x:r,y:s}}w(r,s)}A(false)},[t,e.width,l,w,i]);const st=L({width:i,height:S});T(()=>{if(I&&!B)return;if(st.current.width===i&&st.current.height===S)return;st.current={width:i,height:S};const n=s=>({x:Math.max(h.left,Math.min(s.x,i-e.width-y)),y:Math.max(h.top+y,Math.min(s.y,S-e.height-h.bottom))});const r=n({x:C(t.x),y:C(t.y)});if(l)r.x=i-$;if(f.current)f.current=n(f.current);t.stopAnimation();t.setValue(r);void w(r.x,r.y)},[i,S,B,I,e,h,l,t,w]);const ft=Boolean(p);T(()=>{if(!ft)return;const n=({y:s})=>It(s+e.height+Z>S-h.bottom);n({y:C(t.y)});const r=t.addListener(n);return()=>t.removeListener(r)},[t,e.height,Z,S,h.bottom,ft]);const Rt=mt(()=>({position:"absolute",zIndex:1001,transform:t.getTranslateTransform()}),[t]);const ht=L(void 0);T(()=>{if(I&&!B)return;if(ht.current===g)return;ht.current=g;if(g!==void 0&&g>0&&l)nt()},[g,B,I,l,nt]);const at=Q;const Bt={flexDirection:"row",alignItems:"center",backgroundColor:V.card,borderTopLeftRadius:at?0:6,borderTopRightRadius:6,borderBottomLeftRadius:6,borderBottomRightRadius:6,borderLeftWidth:o?2:1,borderRightWidth:o?2:1,borderBottomWidth:o?2:1,borderTopWidth:o?2:at?0:1,borderColor:o?pt.dragActive:V.textMuted+"66",overflow:"visible",elevation:8,shadowColor:o?pt.dragActive+"99":"#000",shadowOffset:{width:0,height:o?6:4},shadowOpacity:o?.6:.3,shadowRadius:o?12:8,...a==="strip"?{borderRadius:W.radius.card,borderTopLeftRadius:W.radius.card,borderTopRightRadius:W.radius.card,borderBottomLeftRadius:W.radius.card,borderBottomRightRadius:W.radius.card,minHeight:48,backgroundColor:W.color.surface,borderColor:o?W.color.accentBorderStrong:W.color.separator,shadowOpacity:.24,shadowRadius:16}:{}};const Ct={paddingHorizontal:6,paddingVertical:6,backgroundColor:V.textMuted+"1A",alignItems:"center",justifyContent:"center",width:32,...a==="strip"?{minHeight:48}:{},borderRightWidth:1,borderRightColor:V.textMuted+"66",borderTopLeftRadius:at?0:void 0,...a==="strip"?{backgroundColor:"transparent",borderRightWidth:0}:{}};const _t={flexDirection:"row",alignItems:"center",gap:6,paddingRight:8};const Tt=mt(()=>a==="strip"?gt.toArray(j):Gt(gt.toArray(j)),[j,a]);const Lt=32;if(I&&!B){return null}return R(N.View,{pointerEvents:_?"none":"box-none",testID:u??"buoy-floating-tool",style:Rt,children:k(Y,{style:{overflow:"visible"},children:[H&&R(Y,{style:{position:"absolute",bottom:"100%",left:0,width:Lt,overflow:"visible",zIndex:1001},children:H}),k(xt,{position:t,enabled:v,claimOnMove:false,onDragStart:lt,onDragEnd:dt,containerBounds:{width:i,height:S},elementSize:e,minPosition:{x:h.left,y:h.top+y},maxOverflowX:e.width,hitSlop:{top:10,bottom:10,left:10,right:10},style:Bt,onLayout:n=>{const{width:r,height:s}=n.nativeEvent.layout;E({width:r,height:s})},children:[k(xt,{position:t,testID:u?`${u}-grip`:"buoy-floating-grip",accessibilityLabel:z,onDragStart:lt,onDragEnd:dt,onTap:nt,containerBounds:{width:i,height:S},elementSize:e,minPosition:{x:h.left,y:h.top+y},style:Ct,enabled:true,maxOverflowX:e.width,children:[R(Yt,{size:a==="strip"?20:12,color:V.textSecondary+"CC"}),U]}),R(wt.Provider,{value:{isDragging:o},children:k(Y,{style:_t,children:[m&&G&&P&&c&&R(Nt,{currentEnvironment:G,availableEnvironments:P,onSelect:c}),Tt]})})]}),!l&&p&&R(Y,{onLayout:n=>St(n.nativeEvent.layout.height),style:{position:"absolute",...vt?{bottom:"100%"}:{top:"100%"},left:0,width:"100%",zIndex:1002},children:p})]})})}export function getBubbleAnchorPosition(){return null}
|
|
1
|
+
"use strict";import{useEffect as _,useMemo as pt,useRef as V,useState as N,useContext as Xt,createContext as Yt,useCallback as W,Children as bt}from"react";import{Animated as z,Dimensions as dt,useWindowDimensions as Nt,View as H,Text as wt,TouchableOpacity as Wt}from"react-native";import{night as U}from"../night/nightTheme.js";import{DraggableHeader as St}from"../components/DraggableHeader.js";import{EnvironmentSelectorInline as zt}from"../../env/EnvironmentSelectorInline";import{GripVerticalIcon as Ht}from"../components/GripVerticalIcon.js";import{buoyColors as A}from"../gameUI/constants/gameUIColors.js";import{getSafeAreaInsets as vt,persistentStorage as it}from"../../utils/index.js";import{useSafeAreaInsets as Ut}from"../../hooks/index.js";import{calculateTargetPosition as Ft}from"./onboardingConstants";import{getUserStatusConfig as $t,filterValidChildren as jt,floatingToolsColors as It}from"@buoy-gg/floating-tools-core";import{jsx as R,jsxs as J}from"react/jsx-runtime";const st={BUBBLE_POSITION_X:"@react_buoy_bubble_position_x",BUBBLE_POSITION_Y:"@react_buoy_bubble_position_y"};const G=32;const d=20;const kt=150;const S=f=>f.__getValue();function Gt({animatedPosition:f,bubbleWidth:T=100,bubbleHeight:x=32,enabled:u=true,visibleHandleWidth:M=32,listenersSuspended:F=false,skipAutoSaveRef:E,defaultPlacement:at="top",bottomClearance:Q=0,onPositionLoaded:nt,storageKey:h}){const[B,$]=N(false);const y=V(void 0);const D=V(true);_(()=>{D.current=true;return()=>{D.current=false;if(y.current){clearTimeout(y.current);y.current=void 0}}},[]);const C=W(async(l,t)=>{if(!u)return;if(!D.current)return;const{width:o}=dt.get("window");if(o<=0||l<0||t<0)return;try{await Promise.all([it.setItem(h?`${h}:x`:st.BUBBLE_POSITION_X,l.toString()),it.setItem(h?`${h}:y`:st.BUBBLE_POSITION_Y,t.toString())])}catch(v){}},[u,h]);const Z=W((l,t)=>{if(!D.current)return;if(y.current)clearTimeout(y.current);y.current=setTimeout(()=>{if(D.current){C(l,t)}},500)},[C]);const K=W(async()=>{if(!u)return null;try{const[l,t]=await Promise.all([it.getItem(h?`${h}:x`:st.BUBBLE_POSITION_X),it.getItem(h?`${h}:y`:st.BUBBLE_POSITION_Y)]);if(l!==null&&t!==null){const o=parseFloat(l);const v=parseFloat(t);if(!Number.isNaN(o)&&!Number.isNaN(v)){return{x:o,y:v}}}}catch(l){}return null},[u,h]);const tt=W(l=>{const{width:t,height:o}=dt.get("window");const v=vt();if(t<=0||o<=0){return{...l,isValid:false}}const e=v.left;const X=t-M;const L=v.top+d;const P=o-x-v.bottom;const n={x:Math.max(e,Math.min(l.x,X)),y:Math.max(L,Math.min(l.y,P)),isValid:true};return n},[M,x]);_(()=>{if(!u||B)return;let l=false;const t=async()=>{const o=await K();if(l||!D.current)return;const{width:v,height:e}=dt.get("window");const X=vt();if(v<=0||e<=0){setTimeout(()=>{if(D.current&&!l){t()}},100);return}let L;let P=false;if(o){const n=tt(o);if(!n.isValid){setTimeout(()=>{if(D.current&&!l){t()}},100);return}const O=Math.abs(o.x-n.x)>5||Math.abs(o.y-n.y)>5;if(O){await C(n.x,n.y)}L={x:n.x,y:n.y};P=n.x>=v-M-5}else{const n=at==="bottom"?Math.max(X.top+d,e-x-X.bottom-d-Q):Math.max(X.top+d,Math.min(100,e-x-X.bottom));L={x:v-T-d,y:n}}if(l||!D.current)return;f.setValue(L);$(true);nt?.(L,P)};t();return()=>{l=true}},[u,B,f,K,tt,C,T,x,M,nt]);_(()=>{if(!u||!B||F)return;const l=f.addListener(t=>{if(E?.current)return;Z(t.x,t.y)});return()=>{f.removeListener(l);if(y.current){clearTimeout(y.current);y.current=void 0}}},[u,B,F,E,f,Z]);return{savePosition:C,isInitialized:B}}export function Divider(){const f={width:1,height:12,backgroundColor:A.textMuted+"66",flexShrink:0};return R(H,{style:f})}const Pt={success:"#20C997",warning:"#FFA94D",error:"#EF4444",muted:A.textMuted,secondary:A.textSecondary,info:"#20C997",primary:"#20C997",optional:A.textSecondary};function qt(f){return $t(f,Pt)}const Mt=Yt({isDragging:false});export function UserStatus({userRole:f,onPress:T}){const{isDragging:x}=Xt(Mt);const u=qt(f);const M={flexDirection:"row",alignItems:"center",paddingVertical:6,paddingHorizontal:8,flexShrink:0};const F={width:6,height:6,borderRadius:3,backgroundColor:u.dotColor,marginRight:4};const E={fontSize:10,fontWeight:"500",color:u.textColor,letterSpacing:.3};if(!T){return J(H,{style:M,accessibilityLabel:`User status: ${u.label}`,children:[R(H,{style:F}),R(wt,{style:E,children:u.label})]})}return J(Wt,{accessibilityRole:"button",accessibilityLabel:"Open Dev Tools Menu",testID:"open-dev-tools-button",onPress:T,hitSlop:{top:10,bottom:10,left:0,right:10},disabled:x,activeOpacity:.85,style:M,children:[R(H,{style:F}),R(wt,{style:E,children:u.label})]})}function Jt(f){const T=jt(f);const x=[];T.forEach((u,M)=>{x.push(u);if(M<T.length-1)x.push(R(Divider,{},`divider-${M}`))});return x}export function FloatingTool({id:f,suspendPointerEvents:T=false,revealToken:x,variant:u="bubble",dragFromSurface:M=false,accessibilityLabel:F="Move dev tools bubble",minimizedStack:E,hasMinimizedStack:at=false,accessory:Q,handleAdornment:nt,enablePositionPersistence:h=true,defaultPlacement:B="top",bottomClearance:$=0,pushToSide:y=false,centerOnboarding:D=false,children:C,environment:Z,availableEnvironments:K,onEnvironmentSwitch:tt,showEnvironmentSelector:l=false}){const t=V(new z.ValueXY).current;const[o,v]=N(false);const[e,X]=N({width:100,height:32});const[L,P]=N(false);const[n,O]=N(false);const[ft,Dt]=N(0);const[Rt,Bt]=N(false);const g=V(null);const Y=V(false);const et=V(false);const ht=V(y);const rt=V(null);const[q,_t]=N(false);const c=Ut();const{width:a,height:p}=Nt();const Tt=W((i,r)=>{if(r){O(true)}},[]);const{savePosition:b,isInitialized:I}=Gt({animatedPosition:t,bubbleWidth:e.width,bubbleHeight:e.height,enabled:h,visibleHandleWidth:G,listenersSuspended:o,skipAutoSaveRef:Y,defaultPlacement:B,bottomClearance:$,onPositionLoaded:Tt,storageKey:f?`@buoy/floating-tool/${f}`:void 0});_(()=>{if(h&&!I)return;if(!ht.current&&y){et.current=false}ht.current=y;if(y&&!n&&!o&&!et.current){const i=S(t.x);const r=S(t.y);g.current={x:i,y:r};const s=a-G;Y.current=true;O(true);z.timing(t,{toValue:{x:s,y:r},duration:200,useNativeDriver:false}).start()}else if(!y&&n&&Y.current){if(g.current){const{x:i,y:r}=g.current;Y.current=false;et.current=false;O(false);z.timing(t,{toValue:{x:i,y:r},duration:200,useNativeDriver:false}).start(()=>{b(i,r)})}}},[h,I,y,n,o,a,t,b]);_(()=>{if(!I||q)return;const i=setTimeout(()=>{rt.current=e.width;_t(true);if(!n&&!o){const r=S(t.x);const s=a-e.width-d;if(r>s){const m=Math.max(c.left,s);const w=S(t.y);t.setValue({x:m,y:w});b(m,w)}}},kt);return()=>clearTimeout(i)},[I,q,e.width]);_(()=>{if(!I||!q||n||o)return;const i=S(t.y);const r=p-e.height-c.bottom-d-(B==="bottom"?$:0);if(i<=r)return;const s=S(t.x);const m=Math.max(c.top+d,r);t.setValue({x:s,y:m});b(s,m)},[I,q,n,o,e.height,p,c.top,c.bottom,$,B]);_(()=>{if(!I)return;if(!q)return;if(rt.current===null)return;if(o){rt.current=e.width;return}const i=rt.current;const r=e.width;const s=r-i;if(Math.abs(s)<2){return}rt.current=r;if(n){if(g.current){const ot=g.current.x-s;g.current.x=Math.max(c.left,Math.min(ot,a-r-d))}return}const m=S(t.x);const w=S(t.y);const j=m-s;const k=Math.max(c.left,Math.min(j,a-G));if(Math.abs(k-m)>1){z.timing(t,{toValue:{x:k,y:w},duration:150,useNativeDriver:false}).start(()=>{b(k,w);if(g.current){g.current.x=k}})}},[e.width,I,q,o,n,t,a,c.left,b]);_(()=>{if(!h){if(D){const i=Ft();const r=(a-e.width)/2;const s=p-e.height-i;t.setValue({x:r,y:s})}else{const i=B==="bottom"?Math.max(c.top+d,p-e.height-c.bottom-d-$):Math.max(c.top+d,Math.min(100,p-e.height-c.bottom));t.setValue({x:a-e.width-d,y:i})}}},[h,D,t,e.width,e.height,c.top,c.bottom,a,p]);const ct=W(()=>{const i=S(t.x);const r=S(t.y);const s=i>a-e.width/2;if(n||s){let m;let w;if(g.current&&g.current.x<a-e.width/2){m=g.current.x;w=g.current.y}else{m=a-e.width-d;w=r}Y.current=false;et.current=true;O(false);z.timing(t,{toValue:{x:m,y:w},duration:200,useNativeDriver:false}).start(()=>{b(m,w)})}else{g.current={x:i,y:r};et.current=false;const m=a-G;O(true);z.timing(t,{toValue:{x:m,y:r},duration:200,useNativeDriver:false}).start(()=>{b(m,r)})}},[t,n,e.width,b,a]);const mt=W(()=>{v(true)},[]);const gt=W(i=>{let{x:r,y:s}=i;const m=r+e.width/2;const w=m>a;if(w){const j=a-G;O(true);if(g.current){g.current.y=s}else{g.current={x:a-e.width-d,y:s}}z.timing(t,{toValue:{x:j,y:s},duration:200,useNativeDriver:false}).start(()=>{b(j,s)})}else{if(n&&r<a-G-10){O(false);Y.current=false}if(r<a-e.width/2){g.current={x:r,y:s}}b(r,s)}v(false)},[t,e.width,n,b,a]);const ut=V({width:a,height:p});_(()=>{if(h&&!I)return;if(ut.current.width===a&&ut.current.height===p)return;ut.current={width:a,height:p};const i=s=>({x:Math.max(c.left,Math.min(s.x,a-e.width-d)),y:Math.max(c.top+d,Math.min(s.y,p-e.height-c.bottom))});const r=i({x:S(t.x),y:S(t.y)});if(n)r.x=a-G;if(g.current)g.current=i(g.current);t.stopAnimation();t.setValue(r);if(Y.current)return;void b(r.x,r.y)},[a,p,I,h,e,c,n,t,b]);const xt=Boolean(Q);_(()=>{if(!xt)return;const i=({y:s})=>Bt(s+e.height+ft>p-c.bottom);i({y:S(t.y)});const r=t.addListener(i);return()=>t.removeListener(r)},[t,e.height,ft,p,c.bottom,xt]);const Lt=pt(()=>({position:"absolute",zIndex:1001,opacity:L?1:0,transform:t.getTranslateTransform()}),[t,L]);const yt=V(void 0);_(()=>{if(h&&!I)return;if(yt.current===x)return;yt.current=x;if(x!==void 0&&x>0&&n)ct()},[x,I,h,n,ct]);const lt=at;const Vt={flexDirection:"row",alignItems:"center",backgroundColor:A.card,borderTopLeftRadius:lt?0:6,borderTopRightRadius:6,borderBottomLeftRadius:6,borderBottomRightRadius:6,borderLeftWidth:o?2:1,borderRightWidth:o?2:1,borderBottomWidth:o?2:1,borderTopWidth:o?2:lt?0:1,borderColor:o?It.dragActive:A.textMuted+"66",overflow:"visible",elevation:8,shadowColor:o?It.dragActive+"99":"#000",shadowOffset:{width:0,height:o?6:4},shadowOpacity:o?.6:.3,shadowRadius:o?12:8,...u==="strip"?{borderRadius:U.radius.card,borderTopLeftRadius:U.radius.card,borderTopRightRadius:U.radius.card,borderBottomLeftRadius:U.radius.card,borderBottomRightRadius:U.radius.card,minHeight:48,backgroundColor:U.color.surface,borderColor:o?U.color.accentBorderStrong:U.color.separator,shadowOpacity:.24,shadowRadius:16}:{}};const Ct={paddingHorizontal:6,paddingVertical:6,backgroundColor:A.textMuted+"1A",alignItems:"center",justifyContent:"center",width:32,...u==="strip"?{minHeight:48}:{},borderRightWidth:1,borderRightColor:A.textMuted+"66",borderTopLeftRadius:lt?0:void 0,...u==="strip"?{backgroundColor:"transparent",borderRightWidth:0}:{}};const Ot={flexDirection:"row",alignItems:"center",gap:6,paddingRight:8};const At=pt(()=>u==="strip"?bt.toArray(C):Jt(bt.toArray(C)),[C,u]);const Et=32;if(h&&!I){return null}return R(z.View,{pointerEvents:T?"none":"box-none",testID:f??"buoy-floating-tool",style:Lt,children:J(H,{style:{overflow:"visible"},children:[E&&R(H,{style:{position:"absolute",bottom:"100%",left:0,width:Et,overflow:"visible",zIndex:1001},children:E}),J(St,{position:t,enabled:M,claimOnMove:false,onDragStart:mt,onDragEnd:gt,containerBounds:{width:a,height:p},elementSize:e,minPosition:{x:c.left,y:c.top+d},maxOverflowX:e.width,hitSlop:{top:10,bottom:10,left:10,right:10},style:Vt,onLayout:i=>{const{width:r,height:s}=i.nativeEvent.layout;X({width:r,height:s});if(L)return;P(true);if(n||o||Y.current)return;const m=S(t.x);const w=S(t.y);const j=a-r-d;const k=p-s-c.bottom-d-(B==="bottom"?$:0);if(m<=j&&w<=k)return;const ot={x:Math.max(c.left,Math.min(m,j)),y:Math.max(c.top+d,Math.min(w,k))};t.setValue(ot);b(ot.x,ot.y)},children:[J(St,{position:t,testID:f?`${f}-grip`:"buoy-floating-grip",accessibilityLabel:F,onDragStart:mt,onDragEnd:gt,onTap:ct,containerBounds:{width:a,height:p},elementSize:e,minPosition:{x:c.left,y:c.top+d},style:Ct,enabled:true,maxOverflowX:e.width,children:[R(Ht,{size:u==="strip"?20:12,color:A.textSecondary+"CC"}),nt]}),R(Mt.Provider,{value:{isDragging:o},children:J(H,{style:Ot,children:[l&&Z&&K&&tt&&R(zt,{currentEnvironment:Z,availableEnvironments:K,onSelect:tt}),At]})})]}),!n&&Q&&R(H,{onLayout:i=>Dt(i.nativeEvent.layout.height),style:{position:"absolute",...Rt?{bottom:"100%"}:{top:"100%"},left:0,width:"100%",zIndex:1002},children:Q})]})})}export function getBubbleAnchorPosition(){return null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const CLIP_OFFSCREEN_CELLS=!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E);export const EVENT_LIST_PRESET={initialNumToRender:12,maxToRenderPerBatch:8,windowSize:5,updateCellsBatchingPeriod:50,removeClippedSubviews:CLIP_OFFSCREEN_CELLS};export const LOG_LIST_PRESET={initialNumToRender:30,maxToRenderPerBatch:30,windowSize:21,removeClippedSubviews:CLIP_OFFSCREEN_CELLS};
|
|
1
|
+
"use strict";import{Platform as o}from"react-native";export const CLIP_OFFSCREEN_CELLS=!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E);const e={keyboardShouldPersistTaps:"handled",keyboardDismissMode:o.OS==="web"?"none":"on-drag"};export const EVENT_LIST_PRESET={initialNumToRender:12,maxToRenderPerBatch:8,windowSize:5,updateCellsBatchingPeriod:50,removeClippedSubviews:CLIP_OFFSCREEN_CELLS,...e};export const LOG_LIST_PRESET={initialNumToRender:30,maxToRenderPerBatch:30,windowSize:21,removeClippedSubviews:CLIP_OFFSCREEN_CELLS,...e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{Component as s}from"react";const c="__buoyFiberRootAnchors";const i=3;function o(){const e=globalThis;return e[c]??=new Set}export class FiberRootAnchor extends s{componentDidMount(){o().add(this)}componentWillUnmount(){o().delete(this)}render(){return null}}export function getAnchoredFiberRoots(){const e=new Set;for(const r of o()){let t=r._reactInternals;for(let n=0;t&&n<1e4;n++){if(t.tag===i&&!t.return){if(t.stateNode?.current)e.add(t.stateNode);break}t=t.return}}return[...e]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{absoluteFill}from"./absoluteFill.js";export{displayValue,parseDisplayValue}from"./displayValue.js";export{getSafeAreaInsets}from"./getSafeAreaInsets";export{persistentStorage,isUsingPersistentStorage,getStorageBackendType}from"./persistentStorage";export{safeStringify}from"./safeStringify.js";export{getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize}from"./typeHelpers.js";export{parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath}from"./valueFormatting.js";export{loadOptionalModule,getCachedOptionalModule}from"./loadOptionalModule.js";export{setRenderCaptureProvider,getRenderCaptureProvider}from"./renderCaptureRegistry.js";export{registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders}from"./stateSnapshotRegistry.js";export{serialize as superJsonSerialize,deserialize as superJsonDeserialize,dropAnnotations as superJsonDropAnnotations}from"./minimalSuperJSON.js";export{reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS}from"./reloadApp.js";export{getDevServerOrigin}from"./devServer";export{realNow}from"./realNow.js";export{getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener}from"./realAppState.js";export{Subscribable}from"./subscribable.js";export{subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange}from"./subscriberCountNotifier.js";export{useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./safeExpoRouter";export{getBrowserStorage,subscribeToBrowserStorage}from"./browserAsyncStorage.js";export{browserRouter,getBrowserHref,getBrowserRouteURL,registerBrowserRouter,subscribeBrowserNavigation}from"./browserNavigation.js";export{isDOMElement,getDOMControlProps,getDOMFiber,getDOMNodeHandle,getDOMPublicInstance,resolveDOMEventEmitter}from"./domRuntime.js";export{registerToolModules,getRegisteredToolModule,getToolModuleVersion}from"./toolModules.js";export{loadToolModule}from"./loadToolModule";
|
|
1
|
+
"use strict";export{absoluteFill}from"./absoluteFill.js";export{displayValue,parseDisplayValue}from"./displayValue.js";export{getSafeAreaInsets}from"./getSafeAreaInsets";export{persistentStorage,setItemChecked,getItemChecked,storageIsMemoryOnly,isUsingPersistentStorage,getStorageBackendType}from"./persistentStorage";export{safeStringify}from"./safeStringify.js";export{getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize}from"./typeHelpers.js";export{parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath}from"./valueFormatting.js";export{loadOptionalModule,getCachedOptionalModule}from"./loadOptionalModule.js";export{setRenderCaptureProvider,getRenderCaptureProvider}from"./renderCaptureRegistry.js";export{registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders}from"./stateSnapshotRegistry.js";export{serialize as superJsonSerialize,deserialize as superJsonDeserialize,dropAnnotations as superJsonDropAnnotations}from"./minimalSuperJSON.js";export{reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS}from"./reloadApp.js";export{getDevServerOrigin}from"./devServer";export{realNow}from"./realNow.js";export{getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener}from"./realAppState.js";export{Subscribable}from"./subscribable.js";export{subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange}from"./subscriberCountNotifier.js";export{useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./safeExpoRouter";export{getBrowserStorage,subscribeToBrowserStorage}from"./browserAsyncStorage.js";export{browserRouter,getBrowserHref,getBrowserRouteURL,registerBrowserRouter,subscribeBrowserNavigation}from"./browserNavigation.js";export{isDOMElement,getDOMControlProps,getDOMFiber,getDOMNodeHandle,getDOMPublicInstance,resolveDOMEventEmitter}from"./domRuntime.js";export{registerToolModules,getRegisteredToolModule,getToolModuleVersion}from"./toolModules.js";export{loadToolModule}from"./loadToolModule";export{FiberRootAnchor,getAnchoredFiberRoots}from"./fiberRootAnchor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s={log:()=>{},warn:()=>{},error:(...
|
|
1
|
+
"use strict";const s={log:()=>{},warn:()=>{},error:(...n)=>{console.error("[Buoy]","[optional-module]",...n)}};const t=new Map;const i=new Map;const d=new Set;export async function loadOptionalModule(n,r={}){if(t.has(n)){return t.get(n)}const e={...s,...r.logger??{}};if(!i.has(n)){i.set(n,(async()=>{try{const a=await w(n,r);const u=a?.default??a;t.set(n,u);e.log("Loaded optional module",n);return u}catch(a){e.log("Optional module unavailable",n,a);t.set(n,null);return null}})())}const o=await i.get(n);i.delete(n);if(!o&&r.warnOnceKey&&!d.has(r.warnOnceKey)){d.add(r.warnOnceKey);e.warn(r.warningMessage??`Module '${n}' not found.`)}return o}let l;let c;function f(){if(l===void 0){try{l=new Function("moduleName","return import(moduleName);")}catch{l=null}}return l}function g(){if(c===void 0){try{c=new Function("return typeof require === 'function' ? require : undefined;")()??null}catch{c=null}}return c}async function w(n,r){if(r.loader){return await Promise.resolve(r.loader())}const e=f();if(e){return e(n)}const o=g();if(o){return o(n)}throw new Error(`No dynamic loader available for optional module '${n}'.`)}export function getCachedOptionalModule(n){if(!t.has(n)){return null}return t.get(n)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{getRegisteredToolModule as g}from"./toolModules.js";export function loadToolModule(e){const r=g(e);if(r)return r;try{switch(e){case"@buoy-gg/license":return require("@buoy-gg/license");case"@buoy-gg/storage":return require("@buoy-gg/storage");case"@buoy-gg/network":return require("@buoy-gg/network");case"@buoy-gg/redux":return require("@buoy-gg/redux");case"@buoy-gg/zustand":return require("@buoy-gg/zustand");case"@buoy-gg/jotai":return require("@buoy-gg/jotai");case"@buoy-gg/react-query":return require("@buoy-gg/react-query");case"@buoy-gg/route-events":return require("@buoy-gg/route-events");case"@buoy-gg/highlight-updates":return require("@buoy-gg/highlight-updates");case"@buoy-gg/core":return require("@buoy-gg/core");case"@buoy-gg/events":return require("@buoy-gg/events");case"@buoy-gg/clock":return require("@buoy-gg/clock");case"@buoy-gg/shared-ui":return require("../index");case"@buoy-gg/shared-ui/dataViewer":return require("../dataViewer");default:throw new Error(`Unknown tool module: ${e}`)}}catch(u){throw u}}
|
|
1
|
+
"use strict";import{getRegisteredToolModule as g}from"./toolModules.js";export function loadToolModule(e){const r=g(e);if(r)return r;try{switch(e){case"@buoy-gg/license":return require("@buoy-gg/license");case"@buoy-gg/storage":return require("@buoy-gg/storage");case"@buoy-gg/network":return require("@buoy-gg/network");case"@buoy-gg/redux":return require("@buoy-gg/redux");case"@buoy-gg/zustand":return require("@buoy-gg/zustand");case"@buoy-gg/jotai":return require("@buoy-gg/jotai");case"@buoy-gg/react-query":return require("@buoy-gg/react-query");case"@buoy-gg/route-events":return require("@buoy-gg/route-events");case"@buoy-gg/highlight-updates":return require("@buoy-gg/highlight-updates");case"@buoy-gg/core":return require("@buoy-gg/core");case"@buoy-gg/events":return require("@buoy-gg/events");case"@buoy-gg/memory-leaks":return require("@buoy-gg/memory-leaks");case"@buoy-gg/clock":return require("@buoy-gg/clock");case"@buoy-gg/shared-ui":return require("../index");case"@buoy-gg/shared-ui/dataViewer":return require("../dataViewer");default:throw new Error(`Unknown tool module: ${e}`)}}catch(u){throw u}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const T=n=>typeof n==="undefined";const h=n=>{if(typeof n!=="object"||n===null)return false;if(n===Object.prototype)return false;if(Object.getPrototypeOf(n)===null)return true;return Object.getPrototypeOf(n)===Object.prototype};const A=n=>Array.isArray(n);const B=n=>typeof n==="boolean"||n===null||typeof n==="undefined"||typeof n==="number"||typeof n==="string"||typeof n==="symbol";const L=n=>n instanceof Date&&!isNaN(n.valueOf());const w=n=>n instanceof Error;const C=n=>n instanceof RegExp;const O=n=>n instanceof Set;const k=n=>n instanceof Map;const M=n=>typeof n==="bigint";const j=n=>typeof n==="number"&&isNaN(n);const $=n=>n===Infinity||n===-Infinity;const F=n=>n===0&&1/n===-Infinity;const Y=n=>n instanceof URL;const E=n=>ArrayBuffer.isView(n)&&!(n instanceof DataView);function u(n,t){if(!n)throw new Error(`This ${t} value has the wrong shape.`)}const N={Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray};const R=[{isApplicable:T,annotation:"undefined",transform:()=>null,untransform:()=>void 0},{isApplicable:M,annotation:"bigint",transform:n=>n.toString(),untransform:n=>{u(typeof n==="string"||typeof n==="number","bigint");if(typeof BigInt!=="undefined"){return BigInt(n)}console.error("[Buoy]","BigInt is not supported in this environment");return n}},{isApplicable:L,annotation:"Date",transform:n=>n.toISOString(),untransform:n=>{u(typeof n==="string"||typeof n==="number","Date");const t=new Date(n);u(!Number.isNaN(t.getTime()),"Date");return t}},{isApplicable:w,annotation:"Error",transform:n=>({name:n.name,message:n.message,stack:n.stack,cause:"cause"in n?n.cause:void 0}),untransform:n=>{u(!!n&&typeof n==="object"&&!Array.isArray(n),"Error");const t=new Error(typeof n.message==="string"?n.message:"");if(typeof n.name==="string")t.name=n.name;if(typeof n.stack==="string")t.stack=n.stack;if(n.cause!==void 0){t.cause=n.cause}return t}},{isApplicable:C,annotation:"regexp",transform:n=>""+n,untransform:n=>{u(typeof n==="string","regexp");const t=n.slice(1,n.lastIndexOf("/"));const r=n.slice(n.lastIndexOf("/")+1);return new RegExp(t,r)}},{isApplicable:O,annotation:"set",transform:n=>[...n.values()],untransform:n=>{u(Array.isArray(n),"set");return new Set(n)}},{isApplicable:k,annotation:"map",transform:n=>[...n.entries()],untransform:n=>{u(Array.isArray(n)&&n.every(t=>Array.isArray(t)&&t.length===2),"map");return new Map(n)}},{isApplicable:n=>j(n)||$(n),annotation:"number",transform:n=>{if(j(n))return"NaN";return n>0?"Infinity":"-Infinity"},untransform:n=>{u(typeof n==="string","number");return Number(n)}},{isApplicable:F,annotation:"number",transform:()=>"-0",untransform:()=>-0},{isApplicable:Y,annotation:"URL",transform:n=>n.toString(),untransform:n=>{u(typeof n==="string","URL");return new URL(n)}},{isApplicable:E,annotation:n=>["typed-array",n.constructor.name],transform:n=>[...n],untransform:(n,t)=>{u(Array.isArray(n),"typed-array");const r=Array.isArray(t)?t[1]:"Uint8Array";const e=typeof r==="string"&&Object.prototype.hasOwnProperty.call(N,r)?N[r]:void 0;if(!e){throw new Error(`Unknown typed array: ${r}`)}return new e(n)}}];function b(n){for(const t of R){if(t.isApplicable(n)){const r=typeof t.annotation==="function"?t.annotation(n):t.annotation;return{value:t.transform(n),type:r}}}return void 0}function S(n,t){for(const r of R){const e=typeof r.annotation==="function"?Array.isArray(t)&&t[0]==="typed-array"&&r.isApplicable===E:r.annotation===t;if(e){return r.untransform(n,t)}}throw new Error(`Unknown transformation: ${t}`)}const U=n=>h(n)||A(n)||k(n)||O(n)||w(n);function d(n){return n.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function x(n,t=[],r=[]){const e=B(n);if(!e&&!U(n)){const s=b(n);return s?{transformedValue:s.value,annotations:{[t.map(String).map(d).join(".")]:s.type}}:{transformedValue:n}}if(!e&&r.indexOf(n)!==-1){return{transformedValue:null}}if(!U(n)){const s=b(n);return s?{transformedValue:s.value,annotations:t.length>0?{[t.map(String).map(d).join(".")]:s.type}:{"":s.type}}:{transformedValue:n}}const o=b(n);const i=o?.value??n;const f=A(i)?[]:{};const a={};if(o){const s=t.length>0?t.map(String).map(d).join("."):"";a[s]=o.type}const c=A(i)?i.map((s,y)=>[y,s]):Object.entries(i);for(const[s,y]of c){const l=String(s);if(l==="__proto__"||l==="constructor"||l==="prototype"){throw new Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`)}const g=x(y,[...t,s],[...r,n]);f[s]=g.transformedValue;if(g.annotations){Object.assign(a,g.annotations)}}return{transformedValue:f,annotations:Object.keys(a).length>0?a:void 0}}function I(n){if(n==="")return[];const t=[];let r="";for(let e=0;e<n.length;e++){const o=n.charAt(e);if(o==="\\"){const i=n.charAt(e+1);if(i==="\\"){r+="\\";e++;continue}else if(i==="."){r+=".";e++;continue}}if(o==="."){t.push(r);r="";continue}r+=o}t.push(r);return t}function p(n){if(Array.isArray(n))return n.map(p);if(h(n)){const t={};for(const r of Object.keys(n)){Object.defineProperty(t,r,{value:p(n[r]),enumerable:true,writable:true,configurable:true})}return t}return n}const V=new Set(["__proto__","constructor","prototype"]);function D(n){return n.every(t=>typeof t==="number"||!V.has(t))}function m(n,t){return n!==null&&typeof n==="object"&&Object.prototype.hasOwnProperty.call(n,t)}function z(n,t,r){if(t.length===0||!D(t)){return false}let e=n;for(let i=0;i<t.length-1;i++){if(!m(e,t[i]))return false;e=e[t[i]]}const o=t[t.length-1];if(!m(e,o))return false;e[o]=r;return true}function _(n,t){let r=n;for(const e of t){if(!m(r,e)||typeof e==="string"&&V.has(e))return void 0;r=r[e]}return r}function P(n,t){if(!D(t))return false;let r=n;for(const e of t){if(!m(r,e))return false;r=r[e]}return true}export function serialize(n){const t=x(n);const r={json:t.transformedValue};if(t.annotations){r.meta={values:t.annotations}}return r}export function deserialize(n,t={}){const{json:r,meta:e}=n;if(!e?.values){return p(r)}let o=p(r);const i=Object.entries(e.values).map(([f,a])=>({pathString:f,type:a,path:I(f)})).sort((f,a)=>a.path.length-f.path.length);for(const{type:f,path:a}of i){try{if(a.length===0){o=S(o,f)}else{if(!P(o,a))continue;const c=_(o,a);const s=S(c,f);z(o,a,s)}}catch(c){if(!t.skipBadAnnotations)throw c}}return o}export function dropAnnotations(n,t){const r=n.meta?.values;if(!r)return n;const e={};for(const[o,i]of Object.entries(r)){let f;try{const a=I(o);if(a.length>0&&!P(n.json,a))continue;f=_(n.json,a)}catch{continue}if(!t(f,i))e[o]=i}return Object.keys(e).length?{json:n.json,meta:{values:e}}:{json:n.json}}
|