@buoy-gg/highlight-updates 7.0.63 → 7.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/README.md +9 -0
  2. package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -1
  3. package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +1 -1
  4. package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1
  5. package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +2 -2
  6. package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -1
  7. package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +4 -4
  8. package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -1
  9. package/lib/commonjs/highlight-updates/utils/namedComposite.js +1 -1
  10. package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -1
  11. package/lib/module/highlight-updates/utils/CommitProfiler.js +1 -1
  12. package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1
  13. package/lib/module/highlight-updates/utils/PerformanceLogger.js +2 -2
  14. package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -1
  15. package/lib/module/highlight-updates/utils/RenderCauseDetector.js +4 -4
  16. package/lib/module/highlight-updates/utils/RenderTracker.js +1 -1
  17. package/lib/module/highlight-updates/utils/namedComposite.js +1 -1
  18. package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts +12 -0
  19. package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts +3 -0
  20. package/lib/typescript/highlight-updates/utils/namedComposite.d.ts +1 -0
  21. package/lib/web/index.mjs +28 -28
  22. package/package.json +6 -6
@@ -1 +1 @@
1
- "use strict";import Le,{useState as l,useEffect as g,useRef as T,useCallback as s}from"react";import{View as D,Text as Oe,StyleSheet as Ue,Platform as je}from"react-native";import{Power as Je,JsModal as Me,devToolsStorageKeys as x,persistentStorage as V,night as F,TickProvider as ye,windowDragProps as Ke}from"@buoy-gg/shared-ui";import{useIsPro as We}from"@buoy-gg/license";import c from"../utils/HighlightUpdatesController";import{RenderTracker as o}from"../utils/RenderTracker";import{RenderDetailView as qe}from"./RenderDetailView";import{EventStepperFooter as Ge}from"@buoy-gg/shared-ui";import{HighlightFilterView as Qe}from"./HighlightFilterView";import{IsolatedRenderList as Xe}from"./IsolatedRenderList";import{MainListHeader as Ye,FilterViewHeader as Ze,DetailViewHeader as $e,CopySettingsViewHeader as et}from"./ModalHeaderContent";import{RenderHistoryViewer as tt,RenderHistoryFooter as nt}from"./RenderHistoryViewer";import{RendersCopySettingsView as rt}from"./RendersCopySettingsView";import{jsx as i,jsxs as J,Fragment as st}from"react/jsx-runtime";const ot=Le.memo(function a(){return J(D,{testID:"buoy-highlight-disabled-banner",style:b.disabledBanner,children:[i(Je,{size:14,color:F.color.warning}),i(Oe,{testID:"buoy-highlight-disabled-text",style:b.disabledText,children:"Render tracking is disabled"})]})});export function HighlightUpdatesModal({visible:a,onClose:xe,onBack:M,onMinimize:we,enableSharedModalDimensions:Ce=false,initialNativeTag:k,onInitialNativeTagHandled:K,onRenderSelect:H,inline:Fe=false}){const I=We();const[v,be]=l(false);const[W,Ie]=l(()=>c.getFrozen());const[q,G]=l(()=>o.getStats().totalComponents>0);const[r,f]=l(null);const[p,y]=l(0);const[A,z]=l(false);const[N,Q]=l(false);const[ve,Re]=l([]);const[B,Pe]=l("filters");const[w,X]=l("details");const[Y,_]=l(0);const[m,De]=l("");const[R,E]=l(false);const Z=T(null);const C=T([]);const $=T(o.getFilters());const[L,ee]=l(()=>{const e=o.getFilters();return e.includePatterns.length+e.excludePatterns.length});const[d,te]=l(()=>o.getFilters());const[O,ne]=l(()=>o.getSettings());const re=T(false);const U=T(false);const P=T(false);g(()=>{if(!a||re.current)return;re.current=true},[a]);g(()=>{if(!a||U.current)return;const e=async()=>{try{const t=await V.getItem(x.highlightUpdates.filters());if(t){const n=JSON.parse(t);const u={includeTestID:new Set(n.includeTestID||[]),includeNativeID:new Set(n.includeNativeID||[]),includeViewType:new Set(n.includeViewType||[]),includeComponent:new Set(n.includeComponent||[]),excludeTestID:new Set(n.excludeTestID||[]),excludeNativeID:new Set(n.excludeNativeID||[]),excludeViewType:new Set(n.excludeViewType||[]),excludeComponent:new Set(n.excludeComponent||[]),includePatterns:n.includePatterns||[],excludePatterns:n.excludePatterns||[]};o.setFilters(u);const h=o.getFilters();$.current=h;te(h);ee(h.includePatterns.length+h.excludePatterns.length)}U.current=true}catch(t){}};e()},[a]);g(()=>{if(!U.current)return;const e=async()=>{try{const t={includeTestID:Array.from(d.includeTestID),includeNativeID:Array.from(d.includeNativeID),includeViewType:Array.from(d.includeViewType),includeComponent:Array.from(d.includeComponent),excludeTestID:Array.from(d.excludeTestID),excludeNativeID:Array.from(d.excludeNativeID),excludeViewType:Array.from(d.excludeViewType),excludeComponent:Array.from(d.excludeComponent),includePatterns:d.includePatterns,excludePatterns:d.excludePatterns};await V.setItem(x.highlightUpdates.filters(),JSON.stringify(t))}catch(t){}};e()},[d]);g(()=>{if(!a||P.current)return;const e=async()=>{try{const t=await V.getItem(x.highlightUpdates.settings());if(t){const n=JSON.parse(t);const{performanceLogging:u,excludeDevTools:h,...S}=n;o.setSettings(S);ne(o.getSettings())}P.current=true}catch(t){P.current=true}};e()},[a]);g(()=>{if(!P.current)return;const e=async()=>{try{const{performanceLogging:t,excludeDevTools:n,...u}=O;await V.setItem(x.highlightUpdates.settings(),JSON.stringify(u))}catch(t){}};e()},[O]);g(()=>{const e=o.subscribeToState(t=>{be(t.isTracking)});return()=>{e()}},[]);g(()=>{const e=c.subscribeToFreeze(t=>{Ie(t)});return()=>{e()}},[]);g(()=>{if(R){requestAnimationFrame(()=>{Z.current?.focus()})}},[R]);g(()=>{if(!a){c.setSpotlight(null)}},[a]);g(()=>{if(a&&k!=null){const e=o.getRender(String(k));if(e){f(e);y(0);z(false);c.setSpotlight(e.nativeTag)}K?.()}},[a,k,K]);const se=s(()=>{if(!c.isInitialized()){c.initialize()}c.toggle()},[]);const oe=s(()=>{c.toggleFreeze()},[]);const ie=s(()=>{c.clearRenderCounts();G(false)},[]);const le=s(()=>{Re(o.getFilteredRenders(m));Q(true)},[m]);const ae=s(()=>{Q(false)},[]);const ce=s(e=>{De(e)},[]);const Ve=s((e,t,n)=>{f(e);y(t);X("details");_(0);C.current=n;c.setSpotlight(e.nativeTag)},[]);g(()=>{if(!r)return;const e=String(r.nativeTag);return o.subscribe(()=>{const t=o.getRender(e);if(t)f({...t})})},[r?.nativeTag]);const de=T(null);g(()=>{if(!H||!r)return;if(de.current===r.nativeTag)return;de.current=r.nativeTag;H(r)},[r,H]);const ke=s(e=>{C.current=e},[]);const ge=s(()=>{f(null);y(0);if(m)E(true);c.setSpotlight(null)},[m]);const He=s(()=>{const e=C.current;if(p>0){const t=p-1;const n=e[t];if(n){f(n);y(t);c.setSpotlight(n.nativeTag)}}},[p]);const Ae=s(()=>{const e=C.current;if(p<e.length-1){const t=p+1;const n=e[t];if(n){f(n);y(t);c.setSpotlight(n.nativeTag)}}},[p]);const ue=s(()=>{z(false)},[]);const he=s(()=>{z(true)},[]);const fe=s(()=>{E(true)},[]);const pe=s(()=>{E(false)},[]);const j=s(e=>{o.setFilters(e);const t=o.getFilters();$.current=t;te(t);ee(t.includePatterns.length+t.excludePatterns.length)},[]);const ze=s((e,t)=>{const n=o.getFilters();const u={};if(t==="include"){const h=n.includePatterns.some(S=>S.type===e.type&&S.value===e.value);if(!h){u.includePatterns=[...n.includePatterns,e]}}else{const h=n.excludePatterns.some(S=>S.type===e.type&&S.value===e.value);if(!h){u.excludePatterns=[...n.excludePatterns,e]}}if(Object.keys(u).length>0){j(u);f(null);y(0);c.setSpotlight(null)}},[j]);const Ne=s(e=>{o.setSettings(e);ne(o.getSettings())},[]);const Be=s(e=>{G(e.totalComponents>0)},[]);const me=s(()=>{if(N){return i(et,{onBack:ae})}if(A){return i(Ze,{onBack:ue,activeTab:B,onTabChange:Pe,activeFilterCount:L})}if(r){return i($e,{onBack:ge,activeTab:w,onTabChange:X,hasHistory:(r.renderHistory?.length??0)>0})}return i(Ye,{onBack:M,isSearchActive:R,searchText:m,onSearchChange:ce,onSearchToggle:fe,onSearchClose:pe,onFilterToggle:he,onToggleTracking:se,onToggleFreeze:oe,onClear:ie,onOpenCopySettings:le,isTracking:v,isFrozen:W,activeFilterCount:L,hasRenders:q,searchInputRef:Z})},[N,A,r,M,R,m,v,W,L,q,B,w,ue,ge,ae,ce,fe,pe,he,se,oe,ie,le]);const _e=Ce?x.modal.root():x.highlightUpdates.modal();if(!a)return null;const Ee=C.current.length;const Se=r?w==="details"?i(Ge,{currentIndex:p,totalItems:Ee,onPrevious:He,onNext:Ae,itemLabel:"Component",subtitle:r.componentName||r.displayName||r.viewType}):i(nt,{render:r,selectedEventIndex:Y,onEventIndexChange:_,isPro:I}):null;const Te=i(D,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:b.container,children:N?i(rt,{renders:ve}):r?w==="details"?i(qe,{render:r,disableInternalFooter:true,onAddFilter:ze,isPro:I}):i(tt,{render:r,disableInternalFooter:true,selectedEventIndex:Y,onEventIndexChange:_,isPro:I}):A?i(Qe,{filters:d,onFilterChange:j,settings:O,onSettingsChange:Ne,availableProps:o.getAvailableProps(),activeTab:B}):J(st,{children:[!v&&i(ot,{}),i(Xe,{searchText:m,filters:d,onSelectRender:Ve,onStatsChange:Be,onRendersChange:ke,isTracking:v,isPro:I})]})});if(Fe){return i(ye,{children:J(D,{style:b.inlineRoot,children:[i(D,{style:b.inlineHeader,...Ke,children:me()}),Te,Se]})})}return i(ye,{children:i(Me,{visible:a,onClose:xe,onMinimize:we,persistenceKey:_e,header:{showToggleButton:true,customContent:me()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:je.OS==="web",styles:{},footer:Se,footerHeight:r?w==="details"?68:(r.renderHistory?.length??0)>1?68:0:0,children:Te})})}export function HighlightToolView(a={}){return i(HighlightUpdatesModal,{...a,inline:true,visible:true,onClose:()=>{}})}const b=Ue.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:F.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:F.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:F.color.warning+"20"},disabledText:{color:F.color.warning,fontSize:11,flex:1}});export default HighlightUpdatesModal;
1
+ "use strict";import Oe,{useState as l,useEffect as g,useRef as y,useCallback as o}from"react";import{View as D,Text as Te,StyleSheet as Ue,Platform as je}from"react-native";import{Power as Je,JsModal as Me,devToolsStorageKeys as x,persistentStorage as V,night as w,TickProvider as xe,windowDragProps as Ke}from"@buoy-gg/shared-ui";import{useIsPro as We}from"@buoy-gg/license";import c from"../utils/HighlightUpdatesController";import{RenderTracker as i}from"../utils/RenderTracker";import{RenderDetailView as qe}from"./RenderDetailView";import{EventStepperFooter as Ge}from"@buoy-gg/shared-ui";import{HighlightFilterView as Qe}from"./HighlightFilterView";import{IsolatedRenderList as Xe}from"./IsolatedRenderList";import{MainListHeader as Ye,FilterViewHeader as Ze,DetailViewHeader as $e,CopySettingsViewHeader as et}from"./ModalHeaderContent";import{RenderHistoryViewer as tt,RenderHistoryFooter as nt}from"./RenderHistoryViewer";import{RendersCopySettingsView as rt}from"./RendersCopySettingsView";import{jsx as s,jsxs as J,Fragment as st}from"react/jsx-runtime";const ot=Oe.memo(function a(){return J(D,{testID:"buoy-highlight-disabled-banner",style:b.disabledBanner,children:[s(Je,{size:14,color:w.color.warning}),s(Te,{testID:"buoy-highlight-disabled-text",style:b.disabledText,children:"Render tracking is disabled"})]})});export function HighlightUpdatesModal({visible:a,onClose:we,onBack:M,onMinimize:Ce,enableSharedModalDimensions:Fe=false,initialNativeTag:k,onInitialNativeTagHandled:K,onRenderSelect:H,inline:be=false}){const I=We();const[v,Ie]=l(false);const[W,ve]=l(()=>c.getFrozen());const[q,G]=l(()=>i.getStats().totalComponents>0);const[r,f]=l(null);const[p,T]=l(0);const[A,z]=l(false);const[N,Q]=l(false);const[Re,Pe]=l([]);const[B,De]=l("filters");const[C,X]=l("details");const[Y,_]=l(0);const[m,Ve]=l("");const[R,E]=l(false);const Z=y(null);const F=y([]);const $=y(i.getFilters());const[L,ee]=l(()=>{const e=i.getFilters();return e.includePatterns.length+e.excludePatterns.length});const[d,te]=l(()=>i.getFilters());const[O,ne]=l(()=>i.getSettings());const re=y(false);const U=y(false);const P=y(false);g(()=>{if(!a||re.current)return;re.current=true},[a]);g(()=>{if(!a||U.current)return;const e=async()=>{try{const t=await V.getItem(x.highlightUpdates.filters());if(t){const n=JSON.parse(t);const u={includeTestID:new Set(n.includeTestID||[]),includeNativeID:new Set(n.includeNativeID||[]),includeViewType:new Set(n.includeViewType||[]),includeComponent:new Set(n.includeComponent||[]),excludeTestID:new Set(n.excludeTestID||[]),excludeNativeID:new Set(n.excludeNativeID||[]),excludeViewType:new Set(n.excludeViewType||[]),excludeComponent:new Set(n.excludeComponent||[]),includePatterns:n.includePatterns||[],excludePatterns:n.excludePatterns||[]};i.setFilters(u);const h=i.getFilters();$.current=h;te(h);ee(h.includePatterns.length+h.excludePatterns.length)}U.current=true}catch(t){}};e()},[a]);g(()=>{if(!U.current)return;const e=async()=>{try{const t={includeTestID:Array.from(d.includeTestID),includeNativeID:Array.from(d.includeNativeID),includeViewType:Array.from(d.includeViewType),includeComponent:Array.from(d.includeComponent),excludeTestID:Array.from(d.excludeTestID),excludeNativeID:Array.from(d.excludeNativeID),excludeViewType:Array.from(d.excludeViewType),excludeComponent:Array.from(d.excludeComponent),includePatterns:d.includePatterns,excludePatterns:d.excludePatterns};await V.setItem(x.highlightUpdates.filters(),JSON.stringify(t))}catch(t){}};e()},[d]);g(()=>{if(!a||P.current)return;const e=async()=>{try{const t=await V.getItem(x.highlightUpdates.settings());if(t){const n=JSON.parse(t);const{performanceLogging:u,excludeDevTools:h,...S}=n;i.setSettings(S);ne(i.getSettings())}P.current=true}catch(t){P.current=true}};e()},[a]);g(()=>{if(!P.current)return;const e=async()=>{try{const{performanceLogging:t,excludeDevTools:n,...u}=O;await V.setItem(x.highlightUpdates.settings(),JSON.stringify(u))}catch(t){}};e()},[O]);g(()=>{const e=i.subscribeToState(t=>{Ie(t.isTracking)});return()=>{e()}},[]);g(()=>{const e=c.subscribeToFreeze(t=>{ve(t)});return()=>{e()}},[]);g(()=>{if(R){requestAnimationFrame(()=>{Z.current?.focus()})}},[R]);g(()=>{if(!a){c.setSpotlight(null)}},[a]);g(()=>{if(a&&k!=null){const e=i.getRender(String(k));if(e){f(e);T(0);z(false);c.setSpotlight(e.nativeTag)}K?.()}},[a,k,K]);const se=o(()=>{if(!c.isInitialized()){c.initialize()}c.toggle()},[]);const oe=o(()=>{c.toggleFreeze()},[]);const ie=o(()=>{c.clearRenderCounts();G(false)},[]);const le=o(()=>{Pe(i.getFilteredRenders(m));Q(true)},[m]);const ae=o(()=>{Q(false)},[]);const ce=o(e=>{Ve(e)},[]);const ke=o((e,t,n)=>{f(e);T(t);X("details");_(0);F.current=n;c.setSpotlight(e.nativeTag)},[]);g(()=>{if(!r)return;const e=String(r.nativeTag);return i.subscribe(()=>{const t=i.getRender(e);if(t)f({...t})})},[r?.nativeTag]);const de=y(null);g(()=>{if(!H||!r)return;if(de.current===r.nativeTag)return;de.current=r.nativeTag;H(r)},[r,H]);const He=o(e=>{F.current=e},[]);const ge=o(()=>{f(null);T(0);if(m)E(true);c.setSpotlight(null)},[m]);const Ae=o(()=>{const e=F.current;if(p>0){const t=p-1;const n=e[t];if(n){f(n);T(t);c.setSpotlight(n.nativeTag)}}},[p]);const ze=o(()=>{const e=F.current;if(p<e.length-1){const t=p+1;const n=e[t];if(n){f(n);T(t);c.setSpotlight(n.nativeTag)}}},[p]);const ue=o(()=>{z(false)},[]);const he=o(()=>{z(true)},[]);const fe=o(()=>{E(true)},[]);const pe=o(()=>{E(false)},[]);const j=o(e=>{i.setFilters(e);const t=i.getFilters();$.current=t;te(t);ee(t.includePatterns.length+t.excludePatterns.length)},[]);const Ne=o((e,t)=>{const n=i.getFilters();const u={};if(t==="include"){const h=n.includePatterns.some(S=>S.type===e.type&&S.value===e.value);if(!h){u.includePatterns=[...n.includePatterns,e]}}else{const h=n.excludePatterns.some(S=>S.type===e.type&&S.value===e.value);if(!h){u.excludePatterns=[...n.excludePatterns,e]}}if(Object.keys(u).length>0){j(u);f(null);T(0);c.setSpotlight(null)}},[j]);const Be=o(e=>{i.setSettings(e);ne(i.getSettings())},[]);const _e=o(e=>{G(e.totalComponents>0)},[]);const me=o(()=>{if(N){return s(et,{onBack:ae})}if(A){return s(Ze,{onBack:ue,activeTab:B,onTabChange:De,activeFilterCount:L})}if(r){return s($e,{onBack:ge,activeTab:C,onTabChange:X,hasHistory:(r.renderHistory?.length??0)>0})}return s(Ye,{onBack:M,isSearchActive:R,searchText:m,onSearchChange:ce,onSearchToggle:fe,onSearchClose:pe,onFilterToggle:he,onToggleTracking:se,onToggleFreeze:oe,onClear:ie,onOpenCopySettings:le,isTracking:v,isFrozen:W,activeFilterCount:L,hasRenders:q,searchInputRef:Z})},[N,A,r,M,R,m,v,W,L,q,B,C,ue,ge,ae,ce,fe,pe,he,se,oe,ie,le]);const Ee=Fe?x.modal.root():x.highlightUpdates.modal();if(!a)return null;const Le=F.current.length;const Se=r?C==="details"?s(Ge,{currentIndex:p,totalItems:Le,onPrevious:Ae,onNext:ze,itemLabel:"Component",subtitle:r.componentName||r.displayName||r.viewType}):s(nt,{render:r,selectedEventIndex:Y,onEventIndexChange:_,isPro:I}):null;const ye=s(D,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:b.container,children:N?s(rt,{renders:Re}):r?C==="details"?s(qe,{render:r,disableInternalFooter:true,onAddFilter:Ne,isPro:I}):s(tt,{render:r,disableInternalFooter:true,selectedEventIndex:Y,onEventIndexChange:_,isPro:I}):A?s(Qe,{filters:d,onFilterChange:j,settings:O,onSettingsChange:Be,availableProps:i.getAvailableProps(),activeTab:B}):J(st,{children:[c.getRenderSourceStatus()==="unavailable"?s(Te,{style:{color:w.color.warning,padding:16},children:"Not in this app"}):!v&&s(ot,{}),s(Xe,{searchText:m,filters:d,onSelectRender:ke,onStatsChange:_e,onRendersChange:He,isTracking:v,isPro:I})]})});if(be){return s(xe,{children:J(D,{style:b.inlineRoot,children:[s(D,{style:b.inlineHeader,...Ke,children:me()}),ye,Se]})})}return s(xe,{children:s(Me,{visible:a,onClose:we,onMinimize:Ce,persistenceKey:Ee,header:{showToggleButton:true,customContent:me()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:je.OS==="web",styles:{},footer:Se,footerHeight:r?C==="details"?68:(r.renderHistory?.length??0)>1?68:0:0,children:ye})})}export function HighlightToolView(a={}){return s(HighlightUpdatesModal,{...a,inline:true,visible:true,onClose:()=>{}})}const b=Ue.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:w.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:w.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:w.color.warning+"20"},disabledText:{color:w.color.warning,fontSize:11,flex:1}});export default HighlightUpdatesModal;
@@ -1 +1 @@
1
- "use strict";import{isDevToolsComponentName as I,isRenderLoopUnsafeName as x}from"./devtoolsComponentNames";import{ownStateChanged as B}from"./ownStateChanged";const k=0;const O=1;const b=11;const w=14;const N=15;const m=1;const K=1e4;const L=300;const H=20;let E=false;let p=false;let C=false;let d=false;let h=0;let u=0;let g=0;let c={};let f=new Map;function F(){if(typeof global==="undefined")return null;return global.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}function P(e){const t=e.flags??e.effectTag;return typeof t==="number"?t:0}function T(e){return e===k||e===O||e===b||e===w||e===N}function _(e){const t=e.type;try{switch(e.tag){case k:case O:return t?.displayName||t?.name||"Anonymous";case b:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case w:case N:{const s=t?.type??e.elementType?.type;return t?.displayName||s?.displayName||s?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}function X(e){const t=e.actualDuration;if(typeof t!=="number")return null;let s=t;for(let n=e.child;n!=null;n=n.sibling){if(typeof n.actualDuration==="number")s-=n.actualDuration}return s>0?s:0}const U=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]);const D=["Animated(","Pressability","Virtualized","CellRenderer"];function v(e){if(U.has(e))return true;for(let t=0;t<D.length;t++){if(e.startsWith(D[t]))return true}return false}const V=40;const j=5;function G(e,t){if(Object.is(e,t))return true;const s=typeof e;if(s!==typeof t)return false;if(s==="function")return true;if(e===null||t===null||s!=="object")return false;const n=Array.isArray(e);if(n!==Array.isArray(t))return false;if(n){if(e.length!==t.length)return false;for(let a=0;a<e.length;a++)if(!Object.is(e[a],t[a]))return false;return true}const r=Object.keys(e);const i=Object.keys(t);if(r.length!==i.length)return false;for(let a=0;a<r.length;a++){const o=r[a];if(!Object.prototype.hasOwnProperty.call(t,o))return false;if(!Object.is(e[o],t[o]))return false}return true}function q(e,t){const s=e.alternate;if(!s)return{cause:"mount"};const n=e.memoizedProps;const r=s.memoizedProps;if(n!==r&&n&&r){let i=false;let a=false;let o;const l=Object.keys(n);const W=l.length<V?l.length:V;for(let M=0;M<W;M++){const A=l[M];const S=r[A];const R=n[A];if(Object.is(S,R))continue;i=true;if(t){if(!o)o=[];if(o.length<j)o.push(A)}if(!G(S,R)){a=true;if(!t)break}}if(!a&&Object.keys(r).length!==l.length){i=true;a=true}if(i){return{cause:a?"props":"propsUnstable",changedKeys:o}}}if(B(s,e))return{cause:"hooks"};return{cause:"parent"}}function Y(e){for(let t=e.return;t!=null;t=t.return){if(!T(t.tag))continue;if((P(t)&m)===0)continue;const s=_(t);if(v(s))continue;return s}return void 0}function J(e,t){const s=_(e);const n=X(e);if(n!==null)C=true;const r=n??0;u+=1;g+=r;const{cause:i,changedKeys:a}=q(e,d);c[i]=(c[i]??0)+1;if(v(s))return;let o=f.get(s);if(!o){if(f.size>=L)return;o={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}};f.set(s,o)}o.renders+=1;o.totalSelfMs+=r;if(r>o.maxSelfMs)o.maxSelfMs=r;o.causes[i]=(o.causes[i]??0)+1;if(d){if(a){if(!o.changedProps)o.changedProps=new Set;for(let l=0;l<a.length;l++){if(o.changedProps.size>=j)break;o.changedProps.add(a[l])}}if(t&&!o.parentName)o.parentName=t}}function Q(e){const t=e?.current;if(!t)return;const s=u;let n=0;let r=t;while(r!=null){n+=1;if(n>K)break;let i=false;const a=T(r.tag);if(r.memoizedProps?.__buoyDevToolsRoot){i=true}else if(a){const o=_(r);if(x(o)){i=true}else if(I(o)){}else if((P(r)&m)!==0){J(r,d?Y(r):void 0)}}if(!i){const o=r.subtreeFlags;const l=typeof o==="number"&&(o&m)===0&&(P(r)&m)===0;if(!l&&r.child!=null){r=r.child;continue}}while(r!=null){if(r===t)return z(s);if(r.sibling!=null){r=r.sibling;break}r=r.return}}z(s)}function z(e){if(u>e)h+=1}function Z(){if(E)return true;const e=F();if(!e)return false;const t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(s,n,...r){if(p){try{Q(n)}catch{}}return typeof t==="function"?t.call(e,s,n,...r):void 0};E=true;return true}function $(){if(typeof __DEV__!=="undefined"&&!__DEV__)return false;const e=F();return Boolean(e&&e.renderers&&e.renderers.size>0)}function ee(){return p}function te(e){if(!Z())return;f=new Map;C=false;d=e?.detail===true;h=0;u=0;g=0;c={};p=true}function ne(){if(!p&&u===0&&f.size===0)return null;p=false;const e=Array.from(f.entries()).sort((s,n)=>{const r=n[1].totalSelfMs-s[1].totalSelfMs;return r!==0?r:n[1].renders-s[1].renders}).slice(0,H).map(([s,n])=>({name:s,renders:n.renders,totalMs:y(n.totalSelfMs),maxMs:y(n.maxSelfMs),avgMs:n.renders>0?y(n.totalSelfMs/n.renders):0,causes:n.causes,...n.changedProps&&n.changedProps.size>0?{changedProps:Array.from(n.changedProps)}:null,...n.parentName?{parentName:n.parentName}:null}));const t={totalCommits:h,totalRenders:u,capturedDurations:C,totalRenderMs:y(g),wastedRenders:(c.parent??0)+(c.propsUnstable??0),causes:c,topComponents:e};f=new Map;h=0;u=0;g=0;c={};return t}function y(e){return Math.round(e*100)/100}export const CommitProfiler={isSupported:$,isCapturing:ee,startCapture:te,stopCapture:ne};
1
+ "use strict";import{isDevToolsComponentName as I,isRenderLoopUnsafeName as x}from"./devtoolsComponentNames";import{ownStateChanged as B}from"./ownStateChanged";const k=0;const O=1;const b=11;const w=14;const N=15;const d=1;const K=1e4;const L=300;const H=20;let E=false;let p=false;let A=false;let m=false;let h=0;let u=0;let g=0;let c={};let f=new Map;function F(){if(typeof global==="undefined")return null;return global.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}function C(e){const t=e.flags??e.effectTag;return typeof t==="number"?t:0}function T(e){return e===k||e===O||e===b||e===w||e===N}function _(e){const t=e.type;try{switch(e.tag){case k:case O:return t?.displayName||t?.name||"Anonymous";case b:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case w:case N:{const s=t?.type??e.elementType?.type;return t?.displayName||s?.displayName||s?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}function X(e){const t=e.actualDuration;if(typeof t!=="number")return null;let s=t;for(let r=e.child;r!=null;r=r.sibling){if(typeof r.actualDuration==="number")s-=r.actualDuration}return s>0?s:0}const U=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]);const D=["Animated(","Pressability","Virtualized","CellRenderer"];function v(e){if(U.has(e))return true;for(let t=0;t<D.length;t++){if(e.startsWith(D[t]))return true}return false}const z=40;const V=5;function G(e,t){if(Object.is(e,t))return true;const s=typeof e;if(s!==typeof t)return false;if(s==="function")return true;if(e===null||t===null||s!=="object")return false;const r=Array.isArray(e);if(r!==Array.isArray(t))return false;if(r){if(e.length!==t.length)return false;for(let a=0;a<e.length;a++)if(!Object.is(e[a],t[a]))return false;return true}const n=Object.keys(e);const i=Object.keys(t);if(n.length!==i.length)return false;for(let a=0;a<n.length;a++){const o=n[a];if(!Object.prototype.hasOwnProperty.call(t,o))return false;if(!Object.is(e[o],t[o]))return false}return true}function q(e,t){const s=e.alternate;if(!s)return{cause:"mount"};const r=e.memoizedProps;const n=s.memoizedProps;if(r!==n&&r&&n){let i=false;let a=false;let o;const l=Object.keys(r);const W=l.length<z?l.length:z;for(let M=0;M<W;M++){const P=l[M];const S=n[P];const R=r[P];if(Object.is(S,R))continue;i=true;if(t){if(!o)o=[];if(o.length<V)o.push(P)}if(!G(S,R)){a=true;if(!t)break}}if(!a&&Object.keys(n).length!==l.length){i=true;a=true}if(i){return{cause:a?"props":"propsUnstable",changedKeys:o}}}if(B(s,e))return{cause:"hooks"};return{cause:"parent"}}function Y(e){for(let t=e.return;t!=null;t=t.return){if(!T(t.tag))continue;if((C(t)&d)===0)continue;const s=_(t);if(v(s))continue;return s}return void 0}function J(e,t){const s=_(e);const r=X(e);if(r!==null)A=true;const n=r??0;u+=1;g+=n;const{cause:i,changedKeys:a}=q(e,m);c[i]=(c[i]??0)+1;if(v(s))return;let o=f.get(s);if(!o){if(f.size>=L)return;o={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}};f.set(s,o)}o.renders+=1;o.totalSelfMs+=n;if(n>o.maxSelfMs)o.maxSelfMs=n;o.causes[i]=(o.causes[i]??0)+1;if(m){if(a){if(!o.changedProps)o.changedProps=new Set;for(let l=0;l<a.length;l++){if(o.changedProps.size>=V)break;o.changedProps.add(a[l])}}if(t&&!o.parentName)o.parentName=t}}function Q(e){const t=e?.current;if(!t)return;const s=u;let r=0;let n=t;while(n!=null){r+=1;if(r>K)break;let i=false;const a=T(n.tag);if(n.memoizedProps?.__buoyDevToolsRoot||n.memoizedProps?.["data-buoy-root"]!==void 0){i=true}else if(a){const o=_(n);if(x(o)){i=true}else if(I(o)){}else if((C(n)&d)!==0){J(n,m?Y(n):void 0)}}if(!i){const o=n.subtreeFlags;const l=typeof o==="number"&&(o&d)===0&&(C(n)&d)===0;if(!l&&n.child!=null){n=n.child;continue}}while(n!=null){if(n===t)return j(s);if(n.sibling!=null){n=n.sibling;break}n=n.return}}j(s)}function j(e){if(u>e)h+=1}function Z(){if(E)return true;const e=F();if(!e)return false;const t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(s,r,...n){if(p){try{Q(r)}catch{}}return typeof t==="function"?t.call(e,s,r,...n):void 0};E=true;return true}function $(){if(typeof __DEV__!=="undefined"&&!__DEV__)return false;const e=F();return Boolean(e&&e.renderers&&e.renderers.size>0)}function ee(){return p}function te(e){if(!Z())return;f=new Map;A=false;m=e?.detail===true;h=0;u=0;g=0;c={};p=true}function ne(){if(!p&&u===0&&f.size===0)return null;p=false;const e=Array.from(f.entries()).sort((s,r)=>{const n=r[1].totalSelfMs-s[1].totalSelfMs;return n!==0?n:r[1].renders-s[1].renders}).slice(0,H).map(([s,r])=>({name:s,renders:r.renders,totalMs:y(r.totalSelfMs),maxMs:y(r.maxSelfMs),avgMs:r.renders>0?y(r.totalSelfMs/r.renders):0,causes:r.causes,...r.changedProps&&r.changedProps.size>0?{changedProps:Array.from(r.changedProps)}:null,...r.parentName?{parentName:r.parentName}:null}));const t={totalCommits:h,totalRenders:u,capturedDurations:A,totalRenderMs:y(g),wastedRenders:(c.parent??0)+(c.propsUnstable??0),causes:c,topComponents:e};f=new Map;h=0;u=0;g=0;c={};return t}function y(e){return Math.round(e*100)/100}export const CommitProfiler={isSupported:$,isCapturing:ee,startCapture:te,stopCapture:ne};
@@ -1 +1 @@
1
- "use strict";import{getDOMFiber as W,getDOMNodeHandle as Ne,getDOMPublicInstance as Oe,isDOMElement as ae}from"@buoy-gg/shared-ui/utils";"use strict";import{installProfilerInterceptor as Le,uninstallProfilerInterceptor as Re,setComparisonCallback as He}from"./ProfilerInterceptor";import{findNodeHandle as oe,UIManager as Ve,Dimensions as ze,PixelRatio as se}from"react-native";import{RenderTracker as v}from"./RenderTracker";import{describeScreen as xe}from"./screenElements";import{scoreTapMatch as Ue}from"./tapMatch";import{PerformanceLogger as le,markEventReceived as Ae}from"./PerformanceLogger";import{detectRenderCause as ce,clearRenderCauseState as Fe}from"./RenderCauseDetector";import{notifySubscriberCountChange as ue}from"@buoy-gg/shared-ui";import{HIGHLIGHT_OVERLAY_COMPONENTS as Me,HIGHLIGHT_OVERLAY_PREFIXES as Ge,OTHER_DEV_TOOLS_COMPONENTS as Be,OTHER_DEV_TOOLS_EXACT as $e,OTHER_DEV_TOOLS_PREFIXES as je,isCapturingBuoyToolRenders as We,isPerfMonitorComponentName as Ke}from"./devtoolsComponentNames";let w=false;let V=false;let L=false;let N=false;let y=null;let O=null;let A=null;let z=null;let fe=false;let k=false;const F=new Set;const K=new Set;const q=new Map;const X=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"];const qe=false;function f(e,n){if(!qe)return;if(n!==void 0){console.log(`[HighlightUpdates] ${e}`,n)}else{console.log(`[HighlightUpdates] ${e}`)}}function M(e){const n=Oe(e);if(n)return n;if(!e)return null;const i=e;if(i.canonical?.publicInstance){return i.canonical.publicInstance}if(i.canonical&&typeof i.canonical.measure==="function"){return i.canonical}if(typeof i.measure==="function"){return i}return null}function R(e){const n=Ne(e);if(n!==null)return n;if(e==null)return null;const i=e;if(i.__nativeTag!=null)return i.__nativeTag;if(i._nativeTag!=null)return i._nativeTag;if(i.nativeTag!=null)return i.nativeTag;if(i.canonical){if(i.canonical.__nativeTag!=null)return i.canonical.__nativeTag;if(i.canonical._nativeTag!=null)return i.canonical._nativeTag;if(i.canonical.nativeTag!=null)return i.canonical.nativeTag}return null}function Y(e){const n=e;const i={viewType:"Unknown"};if(n?.canonical?.viewConfig?.uiViewClassName){i.viewType=n.canonical.viewConfig.uiViewClassName}else if(n?.viewConfig?.uiViewClassName){i.viewType=n.viewConfig.uiViewClassName}else if(ae(n)){i.viewType=n.tagName.toLowerCase()}const o=n?.canonical?.internalInstanceHandle||n?._internalInstanceHandle||n?._internalFiberInstanceHandleDEV||W(n);const r=n?.canonical?.currentProps;const a=n?.canonical?.pendingProps;const t=o?.pendingProps;const c=o?.memoizedProps;i.testID=r?.testID||a?.testID||t?.testID||c?.testID||t?.["data-testid"]||c?.["data-testid"]||void 0;i.nativeID=r?.nativeID||a?.nativeID||t?.nativeID||c?.nativeID||t?.id||c?.id||void 0;i.accessibilityLabel=r?.accessibilityLabel||a?.accessibilityLabel||t?.accessibilityLabel||c?.accessibilityLabel||t?.["aria-label"]||c?.["aria-label"]||void 0;i.componentName=nn(o)||void 0;return i}function Gn(e){const n=e;const i=M(e);const o=R(e)||R(i);const r={nativeTag:o??"unknown",type:n?.canonical?"Fabric":"Legacy",hasMeasure:typeof i?.measure==="function"};if(n){r.stateNodeKeys=Object.keys(n).slice(0,20);if(n.node){r.nodeKeys=Object.keys(n.node).slice(0,20)}if(n.viewConfig){r.viewConfig={uiViewClassName:n.viewConfig.uiViewClassName,validAttributes:n.viewConfig.validAttributes?Object.keys(n.viewConfig.validAttributes).slice(0,10):void 0}}if(n.canonical){const a=n.canonical;r.canonicalKeys=Object.keys(a).slice(0,20);if(a.viewConfig){r.canonicalViewConfig={uiViewClassName:a.viewConfig.uiViewClassName}}if(a.nativeTag!=null){r.canonicalNativeTag=a.nativeTag}if(a.internalInstanceHandle){const t=a.internalInstanceHandle;r.fiberKeys=Object.keys(t).slice(0,30);if(t.type){r.fiberType=typeof t.type==="function"?t.type.name||t.type.displayName||"function":t.type}if(t.elementType){r.fiberElementType=typeof t.elementType==="function"?t.elementType.name||t.elementType.displayName||"function":t.elementType}if(t._debugOwner){const c=t._debugOwner;r.fiberDebugOwner=c.type?.name||c.type?.displayName||c.elementType?.name||"unknown"}if(t._debugSource){r.fiberDebugSource=t._debugSource}if(t.tag!=null){r.fiberTag=t.tag}if(t.pendingProps){if(t.pendingProps.nativeID)r.fiberPendingNativeID=t.pendingProps.nativeID;if(t.pendingProps.testID)r.fiberPendingTestID=t.pendingProps.testID}if(t.memoizedProps){if(t.memoizedProps.nativeID)r.fiberMemoizedNativeID=t.memoizedProps.nativeID;if(t.memoizedProps.testID)r.fiberMemoizedTestID=t.memoizedProps.testID}}if(a.publicInstance){const t=a.publicInstance;r.publicInstanceKeys=Object.keys(t).slice(0,20);if(t.nativeID!=null)r.nativeID=t.nativeID;if(t._nativeID!=null)r._nativeID=t._nativeID;if(t.props){r.publicInstanceProps=Object.keys(t.props).slice(0,15);if(t.props.nativeID)r.propsNativeID=t.props.nativeID;if(t.props.testID)r.propsTestID=t.props.testID;if(t.props.accessibilityLabel)r.accessibilityLabel=t.props.accessibilityLabel}}if(a.currentProps){r.currentPropsKeys=Object.keys(a.currentProps).slice(0,15);if(a.currentProps.nativeID!=null)r.currentPropsNativeID=a.currentProps.nativeID;if(a.currentProps.testID!=null)r.currentPropsTestID=a.currentProps.testID;if(a.currentProps.accessibilityLabel!=null)r.currentPropsAccessLabel=a.currentProps.accessibilityLabel}if(a.pendingProps){r.pendingPropsKeys=Object.keys(a.pendingProps).slice(0,15);if(a.pendingProps.nativeID!=null)r.pendingPropsNativeID=a.pendingProps.nativeID;if(a.pendingProps.testID!=null)r.pendingPropsTestID=a.pendingProps.testID}}if(n._debugOwner){const a=n._debugOwner;r.debugOwnerType=a.type?.name||a.type?.displayName||typeof a.type}if(n._debugSource){r.debugSource=n._debugSource}}return r}const de=false;let Xe=false;let Z=null;const Bn=350;const ge=new Set;function $n(e){if(e==null)return false;return ge.has(e)}const Ye=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]);const Ze=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]);const H=new Map;const pe=500;function Je(){H.clear()}function me(e){if(!e)return false;if(Ye.has(e))return true;if(e.startsWith("__highlight_"))return true;return false}function be(e){if(!e)return false;if(Ze.has(e))return true;const n=e.charCodeAt(0);if(n===95){if(e.startsWith("__rn_buoy__"))return true}if(n===108&&e.startsWith("logbox")){return true}return false}function he(e){if(!e)return null;const n=e.type;if(n){if(typeof n==="string")return n;if(n.name)return n.name;if(n.displayName)return n.displayName}const i=e.elementType;if(i){if(i.name)return i.name;if(i.displayName)return i.displayName}return null}const Qe=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function en(e){if(!e)return true;if(Qe.has(e))return true;if(e==="Unknown"||e==="Component")return true;if(e.startsWith("Animated"))return true;return false}function nn(e){if(!e)return null;let n=e._debugOwner||e.return;let i=0;let o=null;while(n&&i<30){const r=he(n);if(r&&typeof n.type!=="string"){if(!o){o=r}if(!en(r)){return r}}n=n.return;i++}return o}function tn(e){const n=e;const i=n?.canonical?.internalInstanceHandle||n?._internalInstanceHandle||n?._internalFiberInstanceHandleDEV||W(n);const o=R(e)||R(n?.canonical?.publicInstance);const r=We();const a=!r&&v.getSettings().excludeDevTools;if(a&&ae(e)&&e.closest("[data-buoy-root]"))return true;if(o!=null&&a){const p=H.get(o);if(p!==void 0){return p}}let t=false;const c=i?.pendingProps?.nativeID||i?.memoizedProps?.nativeID||n?.canonical?.currentProps?.nativeID||null;if(me(c)){t=true}else if(a&&be(c)){t=true}if(!t&&i){let p=i;let h=0;while(p&&h<30){const s=he(p);if(s){if(Me.has(s)){t=true;break}for(const g of Ge){if(s.startsWith(g)){t=true;break}}if(t)break;if(r&&Ke(s)){t=true;break}if(a){if(Be.has(s)||$e.has(s)){t=true;break}for(const g of je){if(s.startsWith(g)){t=true;break}}if(t)break}}const d=p.pendingProps?.nativeID||p.memoizedProps?.nativeID;if(me(d)){t=true;break}if(a&&be(d)){t=true;break}p=p.return;h++}}if(t&&o!=null&&a){if(H.size>=pe){const p=Array.from(H.keys());for(let h=0;h<pe/2;h++){H.delete(p[h])}}H.set(o,t)}return t}function rn(e){const n=Math.min(e-1,X.length-1);return X[Math.max(0,n)]}function an(e){if(e.size===0){return}if(!w&&!L){return}const n=v.getState();if(n.isPaused){return}if(le.isEnabled()){Ae()}const i=v.getBatchSize();const o=le.startBatch(e.size,i);const r=[];let a=0;let t=0;const c=v.hasActiveFilters();for(const s of e){if(s&&typeof s==="object"){try{if(tn(s)){a++;continue}const d=M(s);const g=R(s)||R(d);if(g==null){continue}const T=Y(s);if(c&&!v.passesFilters(T)){t++;continue}const P=v.getSettings().showRenderCount;let m;let u;if(P){const l=q.get(g)||0;m=l+1;q.set(g,m);u=rn(m)}else{m=0;u=X[0]}r.push({node:s,color:u,count:m})}catch{}}}o.markFilteringComplete(a+t,r.length);if(r.length===0){o.finish();return}if(de){console.log(`[HighlightUpdates] ${r.length} component(s) re-rendered`)}const p=v.getRenderEventCallbackCount()>0;if(!O&&!p){if(de){console.log(`[HighlightUpdates] No highlightCallback and no event callbacks - skipping render`)}fe=false;return}o.markMeasurementStart();const h=r.slice(0,i*4).map(({node:s,color:d,count:g})=>new Promise(T=>{let P=false;const m=b=>{if(P)return;P=true;clearTimeout(u);T(b)};const u=setTimeout(()=>m({rect:null,stateNode:s,color:d,count:g}),500);const l=M(s);const E=R(s)||R(l);if(E==null){m({rect:null,stateNode:s,color:d,count:g});return}const I=(b,D,_,S,ie,re)=>{if(ie==null||re==null||_==null||S==null){m({rect:null,stateNode:s,color:d,count:g});return}m({rect:{id:E,x:ie,y:re,width:_,height:S,color:d,count:g},stateNode:s,color:d,count:g})};if(!l){const b=s.node;const D=globalThis.nativeFabricUIManager;if(b&&D?.measure){try{D.measure(b,I)}catch(_){m({rect:null,stateNode:s,color:d,count:g})}return}m({rect:null,stateNode:s,color:d,count:g});return}try{l.measure(I)}catch(b){m({rect:null,stateNode:s,color:d,count:g})}}));Promise.all(h).then(s=>{const d=s.filter(T=>T.rect!==null);const g=d.map(T=>T.rect);o.markMeasurementComplete(d.length,s.length-d.length);if(g.length>0&&O&&w&&!V){O(g)}setTimeout(()=>{try{for(const u of d){if(u.rect)on(u.rect.id,u.stateNode)}}catch(u){f("registerTrackedNode batch failed",u)}const T=v.getSettings();const P=T.trackRenderCauses&&T.showRenderCount;let m=null;if(P){m=new Set;for(const{rect:u}of d){if(u){m.add(u.id)}}}if(w){v.startBatch();for(const{rect:u,stateNode:l,color:E,count:I}of d){if(u){const b=Y(l);let D;if(P&&m){const _=l;const S=J(_);D=ce(u.id,S,m,T.debugLogLevel)}v.trackRender({nativeTag:u.id,viewType:b.viewType,testID:b.testID,nativeID:b.nativeID,accessibilityLabel:b.accessibilityLabel,componentName:b.componentName,measurements:{x:u.x,y:u.y,width:u.width,height:u.height},color:E,count:I,renderCause:D})}}v.endBatch()}else{for(const{rect:u,stateNode:l,color:E,count:I}of d){if(u){const b=Y(l);let D;if(P&&m){const _=l;const S=J(_);D=ce(u.id,S,m,T.debugLogLevel)}v.emitRenderEvent({nativeTag:u.id,viewType:b.viewType,testID:b.testID,nativeID:b.nativeID,accessibilityLabel:b.accessibilityLabel,componentName:b.componentName,measurements:{x:u.x,y:u.y,width:u.width,height:u.height},color:E,count:I,renderCause:D})}}}o.markTrackingComplete();o.markCallbackComplete();o.finish()},0)}).catch(s=>{console.error("[HighlightUpdates] Error in measurement pipeline:",s);o.finish()})}const ye=globalThis.WeakRef;const G=new Map;function on(e,n){if(e==null||n==null||typeof n!=="object"){return}try{G.set(e,ye?new ye(n):{deref:()=>n})}catch{G.set(e,{deref:()=>n})}}function sn(e){const n=G.get(e);const i=n?.deref();if(!i)G.delete(e);return i??null}function ln(e){return new Promise(n=>{try{e.measure((i,o,r,a,t,c)=>{if(t==null||c==null||r==null||a==null){n(null)}else{n({x:t,y:c,width:r,height:a})}})}catch{n(null)}})}function J(e){const n=e;return n?.canonical?.internalInstanceHandle||n?._internalInstanceHandle||n?._internalFiberInstanceHandleDEV||W(n)||null}function cn(e){let n=J(e);let i=0;while(n&&i++<200){const o=n.stateNode;if(o&&typeof o.scrollTo==="function"){const r=typeof o.getNativeScrollRef==="function"&&o.getNativeScrollRef()||null;const a=typeof o.getInnerViewNode==="function"&&o.getInnerViewNode()||typeof o.getScrollableNode==="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:a}}n=n.return}return null}async function un(e,n,i){try{const o=cn(e);if(!o)return false;const r=n;let a=null;const t=c=>new Promise(p=>{let h=false;const s=g=>{if(h)return;h=true;p(g)};const d=setTimeout(()=>s(null),600);try{c(g=>{clearTimeout(d);s(g)})}catch{clearTimeout(d);s(null)}});if(o.nativeRef&&typeof r.measureLayout==="function"){a=await t(c=>r.measureLayout(o.nativeRef,(p,h)=>c(h),()=>c(null)))}if(a==null){const c=oe(n);const p=typeof o.innerNode==="number"?o.innerNode:oe(o.innerNode);if(c!=null&&p!=null){a=await t(h=>Ve.measureLayout(c,p,()=>h(null),(s,d)=>h(d)))}}if(a==null)return false;o.instance.scrollTo({y:Math.max(0,a-i),animated:false});await new Promise(c=>setTimeout(c,80));return true}catch{return false}}function fn(e,n){const i=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)];let o=0;for(const r of i){if(!r)continue;const a=r.toLowerCase();if(a===n)return 3;if(a.startsWith(n))o=Math.max(o,2);else if(a.includes(n))o=Math.max(o,1)}return o}async function dn(e){const n=e.scrollIntoView!==false;const i=typeof e.margin==="number"?e.margin:12;const o=v.getRenders();const r=async()=>{const l=await xe();const E=(e.query??"").trim().toLowerCase();let I;for(const _ of l.elements){if(e.nativeTag!=null&&_.nativeTag===e.nativeTag){I={el:_,score:1e3};break}const S=Ue({nativeTag:_.nativeTag,testID:_.testID,label:_.label,text:_.text,name:_.name,tap:_.tap},{query:E||void 0,nativeTag:e.nativeTag});if(S<=0)continue;if(!I||S>I.score)I={el:_,score:S}}if(!I?.el.frame){return{matched:false,reason:"no-match",candidates:[]}}const b=l.screen;const D=I.el.frame;return{matched:true,live:true,rect:{x:D.x*b.width,y:D.y*b.height,width:D.width*b.width,height:D.height*b.height},scale:se.get(),screen:{width:b.width,height:b.height},nativeTag:I.el.nativeTag??void 0,componentName:I.el.name,testID:I.el.testID}};if(o.length===0)return r();const a=(e.query??"").trim().toLowerCase();const t=a?o.map(l=>({r:l,score:fn(l,a)})).filter(l=>l.score>0).sort((l,E)=>E.score-l.score||E.r.lastRenderTime-l.r.lastRenderTime):[];const c=t.slice(0,8).map(({r:l})=>({nativeTag:l.nativeTag,componentName:l.componentName,testID:l.testID,nativeID:l.nativeID,viewType:l.viewType,renderCount:l.renderCount}));const p=e.nativeTag??(t.length>0?t[0].r.nativeTag:void 0);if(p==null){const l=await r();return l.matched?l:{matched:false,reason:"no-match",candidates:c}}const h=o.find(l=>l.nativeTag===p);let s=null;let d=false;let g=false;const T=sn(p);if(T){const l=M(T);if(l){if(n){g=await un(T,l,i)}s=await ln(l);d=!!s}}if(!s&&h?.measurements){s={...h.measurements}}if(!s){return{matched:false,reason:"no-measurement",nativeTag:p,candidates:c}}const P=se.get();const m=ze.get("window");const u=s.x>=-1&&s.y>=-1&&s.x+s.width<=m.width+1&&s.y+s.height<=m.height+1;return{matched:true,live:d,scrolled:g,inView:u,rect:s,scale:P,screen:{width:m.width,height:m.height},nativeTag:p,componentName:h?.componentName,testID:h?.testID,candidates:c}}function _e(e){if(!y?.rendererInterfaces){f("No rendererInterfaces available");return}let n=0;y.rendererInterfaces.forEach((i,o)=>{if(typeof i.setTraceUpdatesEnabled==="function"){try{i.setTraceUpdatesEnabled(e);n++;f(`Renderer ${o}: setTraceUpdatesEnabled(${e})`)}catch(r){f(`Renderer ${o}: error setting trace updates`,r)}}else{f(`Renderer ${o}: no setTraceUpdatesEnabled method`)}});f(`Set trace updates ${e?"enabled":"disabled"} on ${n} renderer(s)`);if(y.reactDevtoolsAgent?.setTraceUpdatesEnabled){try{y.reactDevtoolsAgent.setTraceUpdatesEnabled(e);f("Also set trace updates on agent")}catch(i){f("Error setting trace updates on agent",i)}}}function Te(){if(!y)return;if(z)return;f("Subscribing to traceUpdates event");if(typeof y.sub==="function"){z=y.sub("traceUpdates",an);f("Subscribed using hook.sub()")}else{f("hook.sub not available, traceUpdates may not work")}_e(true)}function Q(){_e(false);if(z){z();z=null;f("Unsubscribed from traceUpdates event")}}function Ie(e){O=e;f(`Highlight callback ${e?"set":"cleared"}`)}function gn(e){A=e;f(`Badge press callback ${e?"set":"cleared"}`)}function pn(){return A}function mn(e){if(A){A(e)}}let ee=null;let B=null;function bn(e){ee=e;if(e&&B!==null){e(B)}}function hn(e){if(C){C("setSpotlight",{nativeTag:e});return}B=e;if(ee){ee(e)}}let C=null;function yn(e){C=e}function _n(e){if(w!==e.enabled){w=e.enabled;ne()}if(k!==e.frozen){k=e.frozen;j()}}function Tn(){return B}function ne(){K.forEach(e=>{try{e(w)}catch(n){console.error("[HighlightUpdates] Error in state listener:",n)}})}function ve(e){K.add(e);e(w);return()=>{K.delete(e)}}function $(){if(typeof __DEV__!=="undefined"&&!__DEV__){f("Only available in development builds");return false}if(C){return true}if(N){return true}y=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null;if(!y){f("React DevTools hook not found");return false}f("Hook found");f(`Hook has sub: ${typeof y.sub==="function"}`);f(`Hook has on: ${typeof y.on==="function"}`);f(`Hook has emit: ${typeof y.emit==="function"}`);Le();if(y.rendererInterfaces&&y.rendererInterfaces.size>0){N=true;f(`Initialized with ${y.rendererInterfaces.size} renderer(s)`);we();return true}const e=setInterval(()=>{if(y?.rendererInterfaces&&y.rendererInterfaces.size>0){clearInterval(e);N=true;f(`Initialized with ${y.rendererInterfaces.size} renderer(s) (delayed)`);we()}},100);setTimeout(()=>clearInterval(e),1e4);return false}function we(){if(typeof window!=="undefined"){window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:x,disable:U,toggle:De,isEnabled:Ce,setEnabled:ke,subscribe:ve,initialize:$,destroy:Se,isInitialized:()=>N,setHighlightCallback:Ie}}}function x(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!N){$()}if(V){V=false}if(w){return}f("Enabling highlights");if(!L){Te()}v.start();w=true;ne();ue("render")}function U(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!w){return}f("Disabling highlights");Xe=false;fe=false;if(Z){clearTimeout(Z);Z=null}ge.clear();H.clear();Fe();if(k){k=false;j()}if(!L){Q()}v.stop();w=false;ne();ue("render")}function In(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(L){return}if(!N){$()}f("Enabling background tracking");if(!w){Te()}L=true}function vn(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!L){return}f("Disabling background tracking");L=false;if(!w){Q()}}function wn(){return L}function De(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(C){C("toggle");return}if(w){U()}else{x()}}function Dn(){if(C){C("clearRenderCounts");return}q.clear();v.clear();f("Cleared render counts")}function Ce(){return w}function ke(e){if(C){C("setEnabled",{enabled:e});return}if(e)x();else U()}function te(e){if(V===e)return;V=e;if(e&&O){O([])}}function Cn(){return V}function kn(e){if(C){C("setSilentTracking",{enabled:e});return}if(e){x();te(true)}else{te(false);U()}}function En(){return N}function j(){F.forEach(e=>{try{e(k)}catch(n){console.error("[HighlightUpdates] Error in freeze listener:",n)}})}function Pn(e){F.add(e);e(k);return()=>{F.delete(e)}}function Ee(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(k)return;k=true;f("Freeze mode enabled");j()}function Pe(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!k)return;k=false;f("Freeze mode disabled");if(O){O([])}j()}function Sn(){if(C){C("toggleFreeze");return}if(k){Pe()}else{Ee()}}function Nn(){return k}function Se(){if(!N)return;Q();Re();He(null);k=false;F.clear();w=false;y=null;O=null;N=false;if(typeof window!=="undefined"){delete window.__HIGHLIGHT_UPDATES_CONTROLLER__}f("Destroyed")}const On={subscribe:ve,enable:x,disable:U,toggle:De,isEnabled:Ce,setEnabled:ke,initialize:$,destroy:Se,isInitialized:En,setHighlightCallback:Ie,clearRenderCounts:Dn,freeze:Ee,unfreeze:Pe,toggleFreeze:Sn,getFrozen:Nn,subscribeToFreeze:Pn,setBadgePressCallback:gn,getBadgePressCallback:pn,handleBadgePress:mn,setSpotlightCallback:bn,setSpotlight:hn,getSpotlight:Tn,clearDevToolsCache:Je,enableBackgroundTracking:In,disableBackgroundTracking:vn,isBackgroundTrackingEnabled:wn,setRemoteHandler:yn,replaceRemoteState:_n,locateComponent:dn,setHighlightsSuppressed:te,getHighlightsSuppressed:Cn,setSilentTracking:kn};export default On;
1
+ "use strict";import{getDOMFiber as K,getDOMNodeHandle as se,getDOMPublicInstance as Ve,isDOMElement as le}from"@buoy-gg/shared-ui/utils";"use strict";import{installProfilerInterceptor as ze,uninstallProfilerInterceptor as xe,setComparisonCallback as Ae}from"./ProfilerInterceptor";import{findNodeHandle as ce,UIManager as Ue,Dimensions as Fe,PixelRatio as ue}from"react-native";import{RenderTracker as y}from"./RenderTracker";import{describeScreen as Me}from"./screenElements";import{scoreTapMatch as Be}from"./tapMatch";import{PerformanceLogger as fe,markEventReceived as Ge}from"./PerformanceLogger";import{detectRenderCause as de,clearRenderCauseState as $e}from"./RenderCauseDetector";import{notifySubscriberCountChange as ge}from"@buoy-gg/shared-ui";import{HIGHLIGHT_OVERLAY_COMPONENTS as je,HIGHLIGHT_OVERLAY_PREFIXES as We,OTHER_DEV_TOOLS_COMPONENTS as Ke,OTHER_DEV_TOOLS_EXACT as qe,OTHER_DEV_TOOLS_PREFIXES as Xe,isCapturingBuoyToolRenders as Ye,isPerfMonitorComponentName as Ze}from"./devtoolsComponentNames";let v=false;let V=false;let O=false;let k=false;let T=null;let R=null;let B=null;let U=null;let pe=false;let E=false;const G=new Set;const q=new Set;const X=new Map;const Y=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"];const Je=false;function g(e,n){if(!Je)return;if(n!==void 0){console.log("[Buoy]",`[HighlightUpdates] ${e}`,n)}else{console.log("[Buoy]",`[HighlightUpdates] ${e}`)}}function $(e){const n=Ve(e);if(n)return n;if(!e)return null;const i=e;if(i.canonical?.publicInstance){return i.canonical.publicInstance}if(i.canonical&&typeof i.canonical.measure==="function"){return i.canonical}if(typeof i.measure==="function"){return i}return null}function L(e){const n=se(e);if(n!==null)return n;if(e==null)return null;const i=e;if(i.__nativeTag!=null)return i.__nativeTag;if(i._nativeTag!=null)return i._nativeTag;if(i.nativeTag!=null)return i.nativeTag;if(i.canonical){if(i.canonical.__nativeTag!=null)return i.canonical.__nativeTag;if(i.canonical._nativeTag!=null)return i.canonical._nativeTag;if(i.canonical.nativeTag!=null)return i.canonical.nativeTag}return null}function Z(e){const n=e;const i={viewType:"Unknown"};if(n?.canonical?.viewConfig?.uiViewClassName){i.viewType=n.canonical.viewConfig.uiViewClassName}else if(n?.viewConfig?.uiViewClassName){i.viewType=n.viewConfig.uiViewClassName}else if(le(n)){i.viewType=n.tagName.toLowerCase()}const o=n?.canonical?.internalInstanceHandle||n?._internalInstanceHandle||n?._internalFiberInstanceHandleDEV||K(n);const r=n?.canonical?.currentProps;const a=n?.canonical?.pendingProps;const t=o?.pendingProps;const c=o?.memoizedProps;i.testID=r?.testID||a?.testID||t?.testID||c?.testID||t?.["data-testid"]||c?.["data-testid"]||void 0;i.nativeID=r?.nativeID||a?.nativeID||t?.nativeID||c?.nativeID||t?.id||c?.id||void 0;i.accessibilityLabel=r?.accessibilityLabel||a?.accessibilityLabel||t?.accessibilityLabel||c?.accessibilityLabel||t?.["aria-label"]||c?.["aria-label"]||void 0;i.componentName=on(o)||void 0;return i}function jn(e){const n=e;const i=$(e);const o=L(e)||L(i);const r={nativeTag:o??"unknown",type:n?.canonical?"Fabric":"Legacy",hasMeasure:typeof i?.measure==="function"};if(n){r.stateNodeKeys=Object.keys(n).slice(0,20);if(n.node){r.nodeKeys=Object.keys(n.node).slice(0,20)}if(n.viewConfig){r.viewConfig={uiViewClassName:n.viewConfig.uiViewClassName,validAttributes:n.viewConfig.validAttributes?Object.keys(n.viewConfig.validAttributes).slice(0,10):void 0}}if(n.canonical){const a=n.canonical;r.canonicalKeys=Object.keys(a).slice(0,20);if(a.viewConfig){r.canonicalViewConfig={uiViewClassName:a.viewConfig.uiViewClassName}}if(a.nativeTag!=null){r.canonicalNativeTag=a.nativeTag}if(a.internalInstanceHandle){const t=a.internalInstanceHandle;r.fiberKeys=Object.keys(t).slice(0,30);if(t.type){r.fiberType=typeof t.type==="function"?t.type.name||t.type.displayName||"function":t.type}if(t.elementType){r.fiberElementType=typeof t.elementType==="function"?t.elementType.name||t.elementType.displayName||"function":t.elementType}if(t._debugOwner){const c=t._debugOwner;r.fiberDebugOwner=c.type?.name||c.type?.displayName||c.elementType?.name||"unknown"}if(t._debugSource){r.fiberDebugSource=t._debugSource}if(t.tag!=null){r.fiberTag=t.tag}if(t.pendingProps){if(t.pendingProps.nativeID)r.fiberPendingNativeID=t.pendingProps.nativeID;if(t.pendingProps.testID)r.fiberPendingTestID=t.pendingProps.testID}if(t.memoizedProps){if(t.memoizedProps.nativeID)r.fiberMemoizedNativeID=t.memoizedProps.nativeID;if(t.memoizedProps.testID)r.fiberMemoizedTestID=t.memoizedProps.testID}}if(a.publicInstance){const t=a.publicInstance;r.publicInstanceKeys=Object.keys(t).slice(0,20);if(t.nativeID!=null)r.nativeID=t.nativeID;if(t._nativeID!=null)r._nativeID=t._nativeID;if(t.props){r.publicInstanceProps=Object.keys(t.props).slice(0,15);if(t.props.nativeID)r.propsNativeID=t.props.nativeID;if(t.props.testID)r.propsTestID=t.props.testID;if(t.props.accessibilityLabel)r.accessibilityLabel=t.props.accessibilityLabel}}if(a.currentProps){r.currentPropsKeys=Object.keys(a.currentProps).slice(0,15);if(a.currentProps.nativeID!=null)r.currentPropsNativeID=a.currentProps.nativeID;if(a.currentProps.testID!=null)r.currentPropsTestID=a.currentProps.testID;if(a.currentProps.accessibilityLabel!=null)r.currentPropsAccessLabel=a.currentProps.accessibilityLabel}if(a.pendingProps){r.pendingPropsKeys=Object.keys(a.pendingProps).slice(0,15);if(a.pendingProps.nativeID!=null)r.pendingPropsNativeID=a.pendingProps.nativeID;if(a.pendingProps.testID!=null)r.pendingPropsTestID=a.pendingProps.testID}}if(n._debugOwner){const a=n._debugOwner;r.debugOwnerType=a.type?.name||a.type?.displayName||typeof a.type}if(n._debugSource){r.debugSource=n._debugSource}}return r}const me=false;let Qe=false;let J=null;const Wn=350;const be=new Set;function Kn(e){if(e==null)return false;return be.has(e)}const en=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]);const nn=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]);const z=new Map;const he=500;function tn(){z.clear()}function ye(e){if(!e)return false;if(en.has(e))return true;if(e.startsWith("__highlight_"))return true;return false}function _e(e){if(!e)return false;if(nn.has(e))return true;const n=e.charCodeAt(0);if(n===95){if(e.startsWith("__rn_buoy__"))return true}if(n===108&&e.startsWith("logbox")){return true}return false}function Te(e){if(!e)return null;const n=e.type;if(n){if(typeof n==="string")return n;if(n.displayName)return n.displayName;if(n.name)return n.name}const i=e.elementType;if(i){if(i.displayName)return i.displayName;if(i.name)return i.name}return null}const rn=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function an(e){if(!e)return true;if(rn.has(e))return true;if(e==="Unknown"||e==="Component")return true;if(e.startsWith("Animated"))return true;return false}function on(e){if(!e)return null;let n=e._debugOwner||e.return;let i=0;let o=null;while(n&&i<30){const r=Te(n);if(r&&typeof n.type!=="string"){if(!o){o=r}if(!an(r)){return r}}n=n.return;i++}return o}function sn(e){const n=e;const i=n?.canonical?.internalInstanceHandle||n?._internalInstanceHandle||n?._internalFiberInstanceHandleDEV||K(n);const o=L(e)||L(n?.canonical?.publicInstance);const r=Ye();const a=!r&&y.getSettings().excludeDevTools;if(a&&le(e)&&e.closest("[data-buoy-root]"))return true;if(o!=null&&a){const u=z.get(o);if(u!==void 0){return u}}let t=false;const c=i?.pendingProps?.nativeID||i?.memoizedProps?.nativeID||n?.canonical?.currentProps?.nativeID||null;if(ye(c)){t=true}else if(a&&_e(c)){t=true}if(!t&&i){let u=i;let b=0;while(u&&b<30){const s=Te(u);if(s){if(je.has(s)){t=true;break}for(const p of We){if(s.startsWith(p)){t=true;break}}if(t)break;if(r&&Ze(s)){t=true;break}if(a){if(Ke.has(s)||qe.has(s)){t=true;break}for(const p of Xe){if(s.startsWith(p)){t=true;break}}if(t)break}}const d=u.pendingProps?.nativeID||u.memoizedProps?.nativeID;if(ye(d)){t=true;break}if(a&&_e(d)){t=true;break}u=u.return;b++}}if(t&&o!=null&&a){if(z.size>=he){const u=Array.from(z.keys());for(let b=0;b<he/2;b++){z.delete(u[b])}}z.set(o,t)}return t}function Ie(e){const n=Math.min(e-1,Y.length-1);return Y[Math.max(0,n)]}function ln(e){if(e.size===0){return}if(!v&&!O){return}const n=y.getState();if(n.isPaused){return}if(fe.isEnabled()){Ge()}const i=y.getBatchSize();const o=fe.startBatch(e.size,i);const r=[];let a=0;let t=0;const c=y.hasActiveFilters();for(const s of e){if(s&&typeof s==="object"){try{if(sn(s)){a++;continue}const d=$(s);const p=L(s)||L(d);if(p==null){continue}const _=Z(s);if(c&&!y.passesFilters(_)){t++;continue}const S=y.getSettings().showRenderCount;let m;let f;if(S){const l=X.get(p)||0;m=l+1;X.set(p,m);f=Ie(m)}else{m=0;f=Y[0]}r.push({node:s,color:f,count:m})}catch{}}}o.markFilteringComplete(a+t,r.length);if(r.length===0){o.finish();return}if(me){console.log("[Buoy]",`[HighlightUpdates] ${r.length} component(s) re-rendered`)}const u=y.getRenderEventCallbackCount()>0;if(!R&&!u){if(me){console.log("[Buoy]",`[HighlightUpdates] No highlightCallback and no event callbacks - skipping render`)}pe=false;return}o.markMeasurementStart();const b=r.slice(0,i*4).map(({node:s,color:d,count:p})=>new Promise(_=>{let S=false;const m=h=>{if(S)return;S=true;clearTimeout(f);_(h)};const f=setTimeout(()=>m({rect:null,stateNode:s,color:d,count:p}),500);const l=$(s);const P=L(s)||L(l);if(P==null){m({rect:null,stateNode:s,color:d,count:p});return}const w=(h,D,I,N,ae,oe)=>{if(ae==null||oe==null||I==null||N==null){m({rect:null,stateNode:s,color:d,count:p});return}m({rect:{id:P,x:ae,y:oe,width:I,height:N,color:d,count:p},stateNode:s,color:d,count:p})};if(!l){const h=s.node;const D=globalThis.nativeFabricUIManager;if(h&&D?.measure){try{D.measure(h,w)}catch(I){m({rect:null,stateNode:s,color:d,count:p})}return}m({rect:null,stateNode:s,color:d,count:p});return}try{l.measure(w)}catch(h){m({rect:null,stateNode:s,color:d,count:p})}}));Promise.all(b).then(s=>{const d=s.filter(_=>_.rect!==null);const p=d.map(_=>_.rect);o.markMeasurementComplete(d.length,s.length-d.length);if(p.length>0&&R&&v&&!V){R(p)}setTimeout(()=>{try{for(const f of d){if(f.rect)we(f.rect.id,f.stateNode)}}catch(f){g("registerTrackedNode batch failed",f)}const _=y.getSettings();const S=_.trackRenderCauses&&_.showRenderCount;let m=null;if(S){m=new Set;for(const{rect:f}of d){if(f){m.add(f.id)}}}if(v){y.startBatch();for(const{rect:f,stateNode:l,color:P,count:w}of d){if(f){const h=Z(l);let D;if(S&&m){const I=l;const N=Q(I);D=de(f.id,N,m,_.debugLogLevel)}y.trackRender({nativeTag:f.id,viewType:h.viewType,testID:h.testID,nativeID:h.nativeID,accessibilityLabel:h.accessibilityLabel,componentName:h.componentName,measurements:{x:f.x,y:f.y,width:f.width,height:f.height},color:P,count:w,renderCause:D})}}y.endBatch()}else{for(const{rect:f,stateNode:l,color:P,count:w}of d){if(f){const h=Z(l);let D;if(S&&m){const I=l;const N=Q(I);D=de(f.id,N,m,_.debugLogLevel)}y.emitRenderEvent({nativeTag:f.id,viewType:h.viewType,testID:h.testID,nativeID:h.nativeID,accessibilityLabel:h.accessibilityLabel,componentName:h.componentName,measurements:{x:f.x,y:f.y,width:f.width,height:f.height},color:P,count:w,renderCause:D})}}}o.markTrackingComplete();o.markCallbackComplete();o.finish()},0)}).catch(s=>{console.error("[Buoy]","[HighlightUpdates] Error in measurement pipeline:",s);o.finish()})}const ve=globalThis.WeakRef;const x=new Map;function we(e,n){if(e==null||n==null||typeof n!=="object"){return}try{x.set(e,ve?new ve(n):{deref:()=>n})}catch{x.set(e,{deref:()=>n})}}function cn(e){const n=x.get(e);const i=n?.deref();if(!i)x.delete(e);return i??null}function un(e){return new Promise(n=>{try{e.measure((i,o,r,a,t,c)=>{if(t==null||c==null||r==null||a==null){n(null)}else{n({x:t,y:c,width:r,height:a})}})}catch{n(null)}})}function Q(e){const n=e;return n?.canonical?.internalInstanceHandle||n?._internalInstanceHandle||n?._internalFiberInstanceHandleDEV||K(n)||null}function fn(e){let n=Q(e);let i=0;while(n&&i++<200){const o=n.stateNode;if(o&&typeof o.scrollTo==="function"){const r=typeof o.getNativeScrollRef==="function"&&o.getNativeScrollRef()||null;const a=typeof o.getInnerViewNode==="function"&&o.getInnerViewNode()||typeof o.getScrollableNode==="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:a}}n=n.return}return null}async function dn(e,n,i){try{const o=fn(e);if(!o)return false;const r=n;let a=null;const t=c=>new Promise(u=>{let b=false;const s=p=>{if(b)return;b=true;u(p)};const d=setTimeout(()=>s(null),600);try{c(p=>{clearTimeout(d);s(p)})}catch{clearTimeout(d);s(null)}});if(o.nativeRef&&typeof r.measureLayout==="function"){a=await t(c=>r.measureLayout(o.nativeRef,(u,b)=>c(b),()=>c(null)))}if(a==null){const c=ce(n);const u=typeof o.innerNode==="number"?o.innerNode:ce(o.innerNode);if(c!=null&&u!=null){a=await t(b=>Ue.measureLayout(c,u,()=>b(null),(s,d)=>b(d)))}}if(a==null)return false;o.instance.scrollTo({y:Math.max(0,a-i),animated:false});await new Promise(c=>setTimeout(c,80));return true}catch{return false}}function gn(e,n){const i=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)];let o=0;for(const r of i){if(!r)continue;const a=r.toLowerCase();if(a===n)return 3;if(a.startsWith(n))o=Math.max(o,2);else if(a.includes(n))o=Math.max(o,1)}return o}async function pn(e){const n=e.scrollIntoView!==false;const i=typeof e.margin==="number"?e.margin:12;const o=y.getRenders();const r=async()=>{const l=await Me();const P=(e.query??"").trim().toLowerCase();let w;for(const I of l.elements){if(e.nativeTag!=null&&I.nativeTag===e.nativeTag){w={el:I,score:1e3};break}const N=Be({nativeTag:I.nativeTag,testID:I.testID,label:I.label,text:I.text,name:I.name,tap:I.tap},{query:P||void 0,nativeTag:e.nativeTag});if(N<=0)continue;if(!w||N>w.score)w={el:I,score:N}}if(!w?.el.frame){return{matched:false,reason:"no-match",candidates:[]}}const h=l.screen;const D=w.el.frame;return{matched:true,live:true,rect:{x:D.x*h.width,y:D.y*h.height,width:D.width*h.width,height:D.height*h.height},scale:ue.get(),screen:{width:h.width,height:h.height},nativeTag:w.el.nativeTag??void 0,componentName:w.el.name,testID:w.el.testID}};if(o.length===0)return r();const a=(e.query??"").trim().toLowerCase();const t=a?o.map(l=>({r:l,score:gn(l,a)})).filter(l=>l.score>0).sort((l,P)=>P.score-l.score||P.r.lastRenderTime-l.r.lastRenderTime):[];const c=t.slice(0,8).map(({r:l})=>({nativeTag:l.nativeTag,componentName:l.componentName,testID:l.testID,nativeID:l.nativeID,viewType:l.viewType,renderCount:l.renderCount}));const u=e.nativeTag??(t.length>0?t[0].r.nativeTag:void 0);if(u==null){const l=await r();return l.matched?l:{matched:false,reason:"no-match",candidates:c}}const b=o.find(l=>l.nativeTag===u);let s=null;let d=false;let p=false;const _=cn(u);if(_){const l=$(_);if(l){if(n){p=await dn(_,l,i)}s=await un(l);d=!!s}}if(!s&&b?.measurements){s={...b.measurements}}if(!s){return{matched:false,reason:"no-measurement",nativeTag:u,candidates:c}}const S=ue.get();const m=Fe.get("window");const f=s.x>=-1&&s.y>=-1&&s.x+s.width<=m.width+1&&s.y+s.height<=m.height+1;return{matched:true,live:d,scrolled:p,inView:f,rect:s,scale:S,screen:{width:m.width,height:m.height},nativeTag:u,componentName:b?.componentName,testID:b?.testID,candidates:c}}function De(e){if(!T?.rendererInterfaces){g("No rendererInterfaces available");return}let n=0;T.rendererInterfaces.forEach((i,o)=>{if(typeof i.setTraceUpdatesEnabled==="function"){try{i.setTraceUpdatesEnabled(e);n++;g(`Renderer ${o}: setTraceUpdatesEnabled(${e})`)}catch(r){g(`Renderer ${o}: error setting trace updates`,r)}}else{g(`Renderer ${o}: no setTraceUpdatesEnabled method`)}});g(`Set trace updates ${e?"enabled":"disabled"} on ${n} renderer(s)`);if(T.reactDevtoolsAgent?.setTraceUpdatesEnabled){try{T.reactDevtoolsAgent.setTraceUpdatesEnabled(e);g("Also set trace updates on agent")}catch(i){g("Error setting trace updates on agent",i)}}}function Ce(){if(!T)return;if(U)return;g("Subscribing to traceUpdates event");if(typeof T.sub==="function"){U=T.sub("traceUpdates",ln);g("Subscribed using hook.sub()")}else{g("hook.sub not available, traceUpdates may not work")}De(true)}function ee(){De(false);if(U){U();U=null;g("Unsubscribed from traceUpdates event")}}function Se(e){R=e;g(`Highlight callback ${e?"set":"cleared"}`)}function mn(e){B=e;g(`Badge press callback ${e?"set":"cleared"}`)}function bn(){return B}function hn(e){if(B){B(e)}}let ne=null;let j=null;function yn(e){ne=e;if(e&&j!==null){e(j)}}function _n(e){if(C){C("setSpotlight",{nativeTag:e});return}j=e;if(ne){ne(e)}}let C=null;function Tn(e){C=e}function In(e){if(v!==e.enabled){v=e.enabled;te()}if(E!==e.frozen){E=e.frozen;W()}}function vn(){return j}function te(){q.forEach(e=>{try{e(v)}catch(n){console.error("[Buoy]","[HighlightUpdates] Error in state listener:",n)}})}function ke(e){q.add(e);e(v);return()=>{q.delete(e)}}function wn(e){if(typeof __DEV__!=="undefined"&&!__DEV__){return{recordRenders:()=>{},disconnect:()=>{}}}if(H!==void 0||k)throw new Error("Connect the render source before Highlight starts.");H=e;let n=true;const i=new Set;F();return{recordRenders(o){if(!n||!e||!v||y.getState().isPaused)return;const r=[];y.startBatch();try{for(const{host:a,name:t,count:c}of o){if(!a.isConnected)continue;const u=se(a);if(u===null)continue;const b=(y.getRender(String(u))?.renderCount??0)+c;const s=Ie(b);const{x:d,y:p,width:_,height:S}=a.getBoundingClientRect();const m={x:d,y:p,width:_,height:S};y.trackRender({nativeTag:u,viewType:t,componentName:t,isComponent:true,testID:a.getAttribute("data-testid")??void 0,measurements:m,color:s,count:b});we(u,a);i.add(u);if(_>0&&S>0)r.push({id:u,...m,color:s,count:y.getSettings().showRenderCount?b:0})}}finally{y.endBatch()}for(const a of i){if(!y.getRender(String(a))){i.delete(a);x.delete(a)}}if(!V&&r.length)R?.(r)},disconnect(){if(!n)return;n=false;A();R?.([]);Pe();for(const o of i)x.delete(o);i.clear();H=void 0;k=false}}}let H;function Dn(){return H===void 0?void 0:H?"ready":"unavailable"}function F(){if(typeof __DEV__!=="undefined"&&!__DEV__){g("Only available in development builds");return false}if(C){return true}if(k){return true}if(H!==void 0){k=H;ie();return k}T=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null;if(!T){g("React DevTools hook not found");return false}g("Hook found");g(`Hook has sub: ${typeof T.sub==="function"}`);g(`Hook has on: ${typeof T.on==="function"}`);g(`Hook has emit: ${typeof T.emit==="function"}`);ze();if(T.rendererInterfaces&&T.rendererInterfaces.size>0){k=true;g(`Initialized with ${T.rendererInterfaces.size} renderer(s)`);ie();return true}const e=setInterval(()=>{if(T?.rendererInterfaces&&T.rendererInterfaces.size>0){clearInterval(e);k=true;g(`Initialized with ${T.rendererInterfaces.size} renderer(s) (delayed)`);ie()}},100);setTimeout(()=>clearInterval(e),1e4);return false}function ie(){if(typeof window!=="undefined"){window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:M,disable:A,toggle:Ee,isEnabled:Re,setEnabled:Ne,subscribe:ke,initialize:F,destroy:He,isInitialized:()=>k,setHighlightCallback:Se}}}function M(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(H===false)return;if(!k){F()}if(V){V=false}if(v){return}g("Enabling highlights");if(!O){Ce()}y.start();v=true;te();ge("render")}function A(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!v){return}g("Disabling highlights");Qe=false;pe=false;if(J){clearTimeout(J);J=null}be.clear();z.clear();$e();if(E){E=false;W()}if(!O){ee()}y.stop();v=false;te();ge("render")}function Cn(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(O){return}if(!k){F()}g("Enabling background tracking");if(!v){Ce()}O=true}function Sn(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!O){return}g("Disabling background tracking");O=false;if(!v){ee()}}function kn(){return O}function Ee(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(C){C("toggle");return}if(v){A()}else{M()}}function Pe(){if(C){C("clearRenderCounts");return}X.clear();y.clear();g("Cleared render counts")}function Re(){return v}function Ne(e){if(C){C("setEnabled",{enabled:e});return}if(e)M();else A()}function re(e){if(V===e)return;V=e;if(e&&R){R([])}}function En(){return V}function Pn(e){if(C){C("setSilentTracking",{enabled:e});return}if(e){M();re(true)}else{re(false);A()}}function Rn(){return k}function W(){G.forEach(e=>{try{e(E)}catch(n){console.error("[Buoy]","[HighlightUpdates] Error in freeze listener:",n)}})}function Nn(e){G.add(e);e(E);return()=>{G.delete(e)}}function Oe(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(E)return;E=true;g("Freeze mode enabled");W()}function Le(){if(typeof __DEV__!=="undefined"&&!__DEV__)return;if(!E)return;E=false;g("Freeze mode disabled");if(R){R([])}W()}function On(){if(C){C("toggleFreeze");return}if(E){Le()}else{Oe()}}function Ln(){return E}function He(){if(!k)return;ee();xe();Ae(null);E=false;G.clear();v=false;T=null;R=null;k=false;if(typeof window!=="undefined"){delete window.__HIGHLIGHT_UPDATES_CONTROLLER__}g("Destroyed")}const Hn={connectRenderSource:wn,getRenderSourceStatus:Dn,subscribe:ke,enable:M,disable:A,toggle:Ee,isEnabled:Re,setEnabled:Ne,initialize:F,destroy:He,isInitialized:Rn,setHighlightCallback:Se,clearRenderCounts:Pe,freeze:Oe,unfreeze:Le,toggleFreeze:On,getFrozen:Ln,subscribeToFreeze:Nn,setBadgePressCallback:mn,getBadgePressCallback:bn,handleBadgePress:hn,setSpotlightCallback:yn,setSpotlight:_n,getSpotlight:vn,clearDevToolsCache:tn,enableBackgroundTracking:Cn,disableBackgroundTracking:Sn,isBackgroundTrackingEnabled:kn,setRemoteHandler:Tn,replaceRemoteState:In,locateComponent:pn,setHighlightsSuppressed:re,getHighlightsSuppressed:En,setSilentTracking:Pn};export default Hn;
@@ -1,4 +1,4 @@
1
- "use strict";let S=0;let p=null;export function markEventReceived(){S=performance.now();return S}export function markOverlayRendered(f,t){if(S>0&&f>0){S=0}}class b{enabled=false;batchCounter=0;listeners=new Set;rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:Infinity,avgMeasurementTime:0};recentBatches=[];MAX_HISTORY=100;summaryInterval=null;SUMMARY_INTERVAL_MS=1e4;setEnabled(t){const a=this.enabled;this.enabled=t;if(t&&!a){this.resetStats()}else if(!t&&a){this.stopSummaryInterval()}}isEnabled(){return this.enabled}startBatch(t,a){const i=`batch_${++this.batchCounter}`;const h=performance.now();let o=null;let l=null;let r=null;let s=null;let e=null;let n=0;let m=0;let u=0;let T=0;let g;const F={markFilteringComplete:(c,d)=>{o=performance.now();n=c;m=d},markMeasurementStart:()=>{l=performance.now()},markMeasurementComplete:(c,d)=>{r=performance.now();u=c;T=d},markTrackingComplete:()=>{s=performance.now()},markCallbackComplete:()=>{e=performance.now()},setOverlayRenderTime:c=>{g=c},getBatchId:()=>i,finish:()=>{const c=performance.now();const d={batchId:i,timestamp:Date.now(),nodesReceived:t,nodesFiltered:n,nodesToProcess:m,batchSize:a,nodesInBatch:Math.min(m,a),filteringTime:o?o-h:0,measurementTime:l&&r?r-l:0,trackingTime:r&&s?s-r:0,callbackTime:s&&e?e-s:0,totalTime:c-h,measurementSuccessCount:u,measurementFailCount:T,overlayRenderTime:g};if(this.enabled){this.recordMetrics(d)}return d}};return F}recordMetrics(t){this.rollingStats.batchCount++;this.rollingStats.totalNodes+=t.nodesReceived;this.rollingStats.totalFiltered+=t.nodesFiltered;this.rollingStats.totalProcessed+=t.nodesInBatch;this.rollingStats.totalTime+=t.totalTime;this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,t.totalTime);this.rollingStats.minTime=Math.min(this.rollingStats.minTime,t.totalTime);const a=this.rollingStats.avgMeasurementTime;const i=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=a+(t.measurementTime-a)/i;this.recentBatches.push(t);if(this.recentBatches.length>this.MAX_HISTORY){this.recentBatches.shift()}this.notifyListeners(t)}logBatch(t){const{batchId:a,nodesReceived:i,nodesFiltered:h,nodesInBatch:o,batchSize:l,filteringTime:r,measurementTime:s,trackingTime:e,callbackTime:n,totalTime:m,measurementSuccessCount:u,measurementFailCount:T,overlayRenderTime:g}=t;console.log(`[HighlightPerf] ${a} | In:${i} Filt:${h} Proc:${o}/${l} | Filter:${r.toFixed(1)}ms Measure:${s.toFixed(1)}ms Track:${e.toFixed(1)}ms Callback:${n.toFixed(1)}ms | Total:${m.toFixed(1)}ms`+(g?` Render:${g.toFixed(1)}ms`:"")+` | Success:${u} Fail:${T}`);if(m>100){console.warn(`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${m.toFixed(1)}ms - Measurement phase: ${s.toFixed(1)}ms (${(s/m*100).toFixed(0)}%)`)}}logSummary(){if(this.rollingStats.batchCount===0)return;const t=this.rollingStats;const a=t.totalTime/t.batchCount;const i=t.totalNodes/t.batchCount;console.log(`
1
+ "use strict";let S=0;let p=null;export function markEventReceived(){S=performance.now();return S}export function markOverlayRendered(f,t){if(S>0&&f>0){S=0}}class b{enabled=false;batchCounter=0;listeners=new Set;rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:Infinity,avgMeasurementTime:0};recentBatches=[];MAX_HISTORY=100;summaryInterval=null;SUMMARY_INTERVAL_MS=1e4;setEnabled(t){const a=this.enabled;this.enabled=t;if(t&&!a){this.resetStats()}else if(!t&&a){this.stopSummaryInterval()}}isEnabled(){return this.enabled}startBatch(t,a){const i=`batch_${++this.batchCounter}`;const h=performance.now();let o=null;let l=null;let r=null;let s=null;let e=null;let n=0;let m=0;let g=0;let T=0;let u;const F={markFilteringComplete:(c,d)=>{o=performance.now();n=c;m=d},markMeasurementStart:()=>{l=performance.now()},markMeasurementComplete:(c,d)=>{r=performance.now();g=c;T=d},markTrackingComplete:()=>{s=performance.now()},markCallbackComplete:()=>{e=performance.now()},setOverlayRenderTime:c=>{u=c},getBatchId:()=>i,finish:()=>{const c=performance.now();const d={batchId:i,timestamp:Date.now(),nodesReceived:t,nodesFiltered:n,nodesToProcess:m,batchSize:a,nodesInBatch:Math.min(m,a),filteringTime:o?o-h:0,measurementTime:l&&r?r-l:0,trackingTime:r&&s?s-r:0,callbackTime:s&&e?e-s:0,totalTime:c-h,measurementSuccessCount:g,measurementFailCount:T,overlayRenderTime:u};if(this.enabled){this.recordMetrics(d)}return d}};return F}recordMetrics(t){this.rollingStats.batchCount++;this.rollingStats.totalNodes+=t.nodesReceived;this.rollingStats.totalFiltered+=t.nodesFiltered;this.rollingStats.totalProcessed+=t.nodesInBatch;this.rollingStats.totalTime+=t.totalTime;this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,t.totalTime);this.rollingStats.minTime=Math.min(this.rollingStats.minTime,t.totalTime);const a=this.rollingStats.avgMeasurementTime;const i=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=a+(t.measurementTime-a)/i;this.recentBatches.push(t);if(this.recentBatches.length>this.MAX_HISTORY){this.recentBatches.shift()}this.notifyListeners(t)}logBatch(t){const{batchId:a,nodesReceived:i,nodesFiltered:h,nodesInBatch:o,batchSize:l,filteringTime:r,measurementTime:s,trackingTime:e,callbackTime:n,totalTime:m,measurementSuccessCount:g,measurementFailCount:T,overlayRenderTime:u}=t;console.log("[Buoy]",`[HighlightPerf] ${a} | In:${i} Filt:${h} Proc:${o}/${l} | Filter:${r.toFixed(1)}ms Measure:${s.toFixed(1)}ms Track:${e.toFixed(1)}ms Callback:${n.toFixed(1)}ms | Total:${m.toFixed(1)}ms`+(u?` Render:${u.toFixed(1)}ms`:"")+` | Success:${g} Fail:${T}`);if(m>100){console.warn("[Buoy]",`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${m.toFixed(1)}ms - Measurement phase: ${s.toFixed(1)}ms (${(s/m*100).toFixed(0)}%)`)}}logSummary(){if(this.rollingStats.batchCount===0)return;const t=this.rollingStats;const a=t.totalTime/t.batchCount;const i=t.totalNodes/t.batchCount;console.log("[Buoy]",`
2
2
  [HighlightPerf] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 SUMMARY (last ${this.SUMMARY_INTERVAL_MS/1e3}s) \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
3
3
  Batches: ${t.batchCount}
4
4
  Avg nodes/batch: ${i.toFixed(1)} (filtered: ${(t.totalFiltered/t.batchCount).toFixed(1)})
@@ -6,7 +6,7 @@
6
6
  Avg measurement time: ${t.avgMeasurementTime.toFixed(1)}ms
7
7
  Min/Max time: ${t.minTime.toFixed(1)}ms / ${t.maxTime.toFixed(1)}ms
8
8
  \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
9
- `);this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:Infinity,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval();this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){if(this.summaryInterval){clearInterval(this.summaryInterval);this.summaryInterval=null}}subscribe(t){this.listeners.add(t);return()=>{this.listeners.delete(t)}}notifyListeners(t){for(const a of this.listeners){try{a(t)}catch(i){console.error("[HighlightPerf] Error in metrics listener:",i)}}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[];this.resetStats();this.batchCounter=0}generateReport(){const t=this.recentBatches;if(t.length===0){return"No performance data collected yet."}const a=t.reduce((e,n)=>e+n.totalTime,0);const i=a/t.length;const h=t.reduce((e,n)=>e+n.measurementTime,0);const o=h/t.length;const l=t.filter(e=>e.totalTime>100);const r=t.filter(e=>e.totalTime<20);const s=`
9
+ `);this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:Infinity,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval();this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){if(this.summaryInterval){clearInterval(this.summaryInterval);this.summaryInterval=null}}subscribe(t){this.listeners.add(t);return()=>{this.listeners.delete(t)}}notifyListeners(t){for(const a of this.listeners){try{a(t)}catch(i){console.error("[Buoy]","[HighlightPerf] Error in metrics listener:",i)}}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[];this.resetStats();this.batchCounter=0}generateReport(){const t=this.recentBatches;if(t.length===0){return"No performance data collected yet."}const a=t.reduce((e,n)=>e+n.totalTime,0);const i=a/t.length;const h=t.reduce((e,n)=>e+n.measurementTime,0);const o=h/t.length;const l=t.filter(e=>e.totalTime>100);const r=t.filter(e=>e.totalTime<20);const s=`
10
10
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
11
11
  \u2551 HIGHLIGHT UPDATES PERFORMANCE REPORT \u2551
12
12
  \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
@@ -1 +1 @@
1
- "use strict";let a=null;let c=null;let l=false;let s=false;let f=null;function u(n){if(!n)return{type:"null"};const e=n;const t={};if(e.canonical){t.type="Fabric";const o=e.canonical;if(o.publicInstance){const r=o.publicInstance;t.hasMeasure=typeof r.measure==="function";t.nativeTag=r.__nativeTag??r._nativeTag??"unknown"}}else if(typeof e.measure==="function"){t.type="Legacy";t.hasMeasure=true;t.nativeTag=e.__nativeTag??e._nativeTag??e.nativeTag??"unknown"}else{t.type="Unknown";t.keys=Object.keys(e).slice(0,10)}return t}function p(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n||typeof n.emit!=="function"){return}if(a){return}a=n.emit.bind(n);n.emit=function(e,...t){if(e==="traceUpdates"&&s){const o=t[0];if(o.size>0){console.log(`[PROFILER] traceUpdates: ${o.size} nodes`,Array.from(o).map((r,i)=>({index:i,...u(r)})))}if(f){f(o)}}return a(e,...t)}}function g(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;const e=n?.reactDevtoolsAgent;if(!e||typeof e.emit!=="function"){return}if(c){return}c=e.emit.bind(e);e.emit=function(t,...o){if(s&&t==="drawTraceUpdates"){const r=o[0];if(r.length>0){console.log(`[PROFILER] drawTraceUpdates: ${r.length} nodes`,r.map((i,d)=>({index:d,color:i.color,...u(i.node)})))}}return c(t,...o)}}export function logRendererInterfaces(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n?.rendererInterfaces){console.log("[ProfilerInterceptor] No rendererInterfaces available");return}const e=[];n.rendererInterfaces.forEach((t,o)=>{const r=Object.keys(t).filter(i=>typeof t[i]==="function");e.push({id:o,hasSetTraceUpdatesEnabled:typeof t.setTraceUpdatesEnabled==="function",methods:r.slice(0,20)})});console.log(`[ProfilerInterceptor] Found ${n.rendererInterfaces.size} renderer interface(s)`,e)}export function logHookStructure(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n){console.log("[ProfilerInterceptor] No hook available");return}const e={};for(const t in n){const o=n[t];if(typeof o==="function"){e[t]="function"}else if(o instanceof Map){e[t]=`Map(${o.size})`}else if(o instanceof Set){e[t]=`Set(${o.size})`}else if(typeof o==="object"&&o!==null){e[t]="object"}else{e[t]=typeof o}}console.log("[ProfilerInterceptor] Hook structure:",e)}function O(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n?.rendererInterfaces){return}n.rendererInterfaces.forEach(e=>{if(typeof e.setTraceUpdatesEnabled==="function"){try{e.setTraceUpdatesEnabled(true)}catch{}}})}function _(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n?.rendererInterfaces)return;n.rendererInterfaces.forEach(e=>{if(typeof e.setTraceUpdatesEnabled==="function"){try{e.setTraceUpdatesEnabled(false)}catch{}}})}export function setComparisonCallback(n){f=n}export function installProfilerInterceptor(){if(typeof __DEV__!=="undefined"&&!__DEV__){return}if(l){return}p();g();l=true}export function uninstallProfilerInterceptor(){if(!l)return;const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a&&n){n.emit=a;a=null}if(c&&n?.reactDevtoolsAgent){n.reactDevtoolsAgent.emit=c;c=null}_();f=null;l=false}export function isInterceptorInstalled(){return l}export function enableProfilerLogging(){s=true}export function disableProfilerLogging(){s=false}export function isLoggingEnabled(){return s}export default{install:installProfilerInterceptor,uninstall:uninstallProfilerInterceptor,isInstalled:isInterceptorInstalled,setComparisonCallback,enableTracing:O,disableTracing:_,enableLogging:enableProfilerLogging,disableLogging:disableProfilerLogging,isLoggingEnabled};
1
+ "use strict";let a=null;let c=null;let l=false;let s=false;let f=null;function u(n){if(!n)return{type:"null"};const e=n;const t={};if(e.canonical){t.type="Fabric";const o=e.canonical;if(o.publicInstance){const r=o.publicInstance;t.hasMeasure=typeof r.measure==="function";t.nativeTag=r.__nativeTag??r._nativeTag??"unknown"}}else if(typeof e.measure==="function"){t.type="Legacy";t.hasMeasure=true;t.nativeTag=e.__nativeTag??e._nativeTag??e.nativeTag??"unknown"}else{t.type="Unknown";t.keys=Object.keys(e).slice(0,10)}return t}function p(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n||typeof n.emit!=="function"){return}if(a){return}a=n.emit.bind(n);n.emit=function(e,...t){if(e==="traceUpdates"&&s){const o=t[0];if(o.size>0){console.log("[Buoy]",`[PROFILER] traceUpdates: ${o.size} nodes`,Array.from(o).map((r,i)=>({index:i,...u(r)})))}if(f){f(o)}}return a(e,...t)}}function g(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;const e=n?.reactDevtoolsAgent;if(!e||typeof e.emit!=="function"){return}if(c){return}c=e.emit.bind(e);e.emit=function(t,...o){if(s&&t==="drawTraceUpdates"){const r=o[0];if(r.length>0){console.log("[Buoy]",`[PROFILER] drawTraceUpdates: ${r.length} nodes`,r.map((i,d)=>({index:d,color:i.color,...u(i.node)})))}}return c(t,...o)}}export function logRendererInterfaces(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n?.rendererInterfaces){console.log("[Buoy]","[ProfilerInterceptor] No rendererInterfaces available");return}const e=[];n.rendererInterfaces.forEach((t,o)=>{const r=Object.keys(t).filter(i=>typeof t[i]==="function");e.push({id:o,hasSetTraceUpdatesEnabled:typeof t.setTraceUpdatesEnabled==="function",methods:r.slice(0,20)})});console.log("[Buoy]",`[ProfilerInterceptor] Found ${n.rendererInterfaces.size} renderer interface(s)`,e)}export function logHookStructure(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n){console.log("[Buoy]","[ProfilerInterceptor] No hook available");return}const e={};for(const t in n){const o=n[t];if(typeof o==="function"){e[t]="function"}else if(o instanceof Map){e[t]=`Map(${o.size})`}else if(o instanceof Set){e[t]=`Set(${o.size})`}else if(typeof o==="object"&&o!==null){e[t]="object"}else{e[t]=typeof o}}console.log("[Buoy]","[ProfilerInterceptor] Hook structure:",e)}function O(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n?.rendererInterfaces){return}n.rendererInterfaces.forEach(e=>{if(typeof e.setTraceUpdatesEnabled==="function"){try{e.setTraceUpdatesEnabled(true)}catch{}}})}function _(){const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n?.rendererInterfaces)return;n.rendererInterfaces.forEach(e=>{if(typeof e.setTraceUpdatesEnabled==="function"){try{e.setTraceUpdatesEnabled(false)}catch{}}})}export function setComparisonCallback(n){f=n}export function installProfilerInterceptor(){if(typeof __DEV__!=="undefined"&&!__DEV__){return}if(l){return}p();g();l=true}export function uninstallProfilerInterceptor(){if(!l)return;const n=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a&&n){n.emit=a;a=null}if(c&&n?.reactDevtoolsAgent){n.reactDevtoolsAgent.emit=c;c=null}_();f=null;l=false}export function isInterceptorInstalled(){return l}export function enableProfilerLogging(){s=true}export function disableProfilerLogging(){s=false}export function isLoggingEnabled(){return s}export default{install:installProfilerInterceptor,uninstall:uninstallProfilerInterceptor,isInstalled:isInterceptorInstalled,setComparisonCallback,enableTracing:O,disableTracing:_,enableLogging:enableProfilerLogging,disableLogging:disableProfilerLogging,isLoggingEnabled};
@@ -1,5 +1,5 @@
1
- "use strict";import{hookStateChanged as ae}from"./ownStateChanged";const Y={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function ue(e){if(!e)return Y.default;return Y[e]||Y.default}const j=new WeakMap;function G(e){if(!e)return void 0;let t=j.get(e);if(t)return t;if(e.alternate){t=j.get(e.alternate);if(t)return t}return void 0}function fe(e,t){if(!e)return;j.set(e,t);if(e.alternate){j.set(e.alternate,t)}}const $=new Map;const J=500;const de=10;const Q=50;const F=50;const me=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function L(e){if(!e)return true;if(me.has(e))return true;if(e.startsWith("Animated"))return true;return false}function b(e){if(!e)return null;let t=e._debugOwner||e.return;let o=0;let r=null;while(t&&o<30){const n=t.tag;if(n===0||n===1||n===11||n===15){const s=T(t);if(!r){r=t}if(!L(s)){return t}}t=t.return;o++}return r}function T(e){if(!e)return null;const t=e.type;if(t){if(typeof t==="string")return t;if(t.name)return t.name;if(t.displayName)return t.displayName}return null}function pe(e){if(!e||typeof e!=="object"){return"unknown"}if(e.queue!==null&&e.queue!==void 0){return"useState"}const t=e.memoizedState;if(t!==null&&typeof t==="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1){return"useRef"}if(Array.isArray(t)&&t.length===2){const[,o]=t;if(Array.isArray(o)||o===null){if(typeof t[0]==="function"){return"useCallback"}return"useMemo"}}if(t!==null&&typeof t==="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)){return"useEffect"}return"unknown"}function ye(e,t){const o=e?.memoizedState;switch(t){case"useState":case"useReducer":return o;case"useRef":return o?.current;case"useMemo":case"useCallback":return Array.isArray(o)?o[0]:o;case"useEffect":return"[effect]";default:return o}}function H(e){if(!e?.memoizedState)return null;const t=e.memoizedState;if(typeof t!=="object"||t===null){return null}if(!("next"in t)&&!("queue"in t)&&!("memoizedState"in t)){return null}const o=[];let r=t;let n=0;while(r!==null&&n<Q){const s=pe(r);const i=ye(r,s);o.push({index:n,type:s,value:i,rawState:r.memoizedState});r=r.next;n++}return o.length>0?o:null}function ge(e,t){if(!e||!t)return null;const o=[];const r=Math.max(e.length,t.length);for(let n=0;n<r;n++){const s=e[n];const i=t[n];if(!s&&i){o.push({index:n,type:i.type,currentValue:W(i.value,i.type),description:`Hook[${n}] added`});continue}if(s&&!i){o.push({index:n,type:s.type,previousValue:W(s.value,s.type),description:`Hook[${n}] removed`});continue}if(s&&i){if(s.rawState===i.rawState){continue}if(i.type==="useEffect"){continue}if(i.type==="useMemo"||i.type==="useCallback"){continue}if(i.type==="useState"||i.type==="useReducer"||i.type==="useRef"){const a=W(s.value,s.type);const l=W(i.value,i.type);o.push({index:n,type:i.type,previousValue:a,currentValue:l,description:`${a} \u2192 ${l}`})}}}return o.length>0?o:null}function W(e,t){if(t==="useRef"){return O(e)}return O(e)}function O(e){if(e===null)return null;if(e===void 0)return void 0;if(typeof e==="boolean")return e;if(typeof e==="number")return e;if(typeof e==="string"){return e.length>30?e.slice(0,30)+"...":e}if(typeof e==="function"){return`[Function: ${e.name||"anonymous"}]`}if(Array.isArray(e)){return`[Array: ${e.length} items]`}if(typeof e==="object"){const t=Object.keys(e);return`{Object: ${t.length} keys}`}return String(e)}function he(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e;let o=e.alternate;const r=G(e);if(r&&o){const u=H(e);const k=H(o);const g=r.extractedHooks;if(u&&k&&g&&g.length>0){const m=g.find(f=>f.type==="useState");if(m){const f=u.find(d=>d.index===m.index);const S=k.find(d=>d.index===m.index);if(f&&S){const d=f.value===m.value;const p=S.value===m.value;if(d&&!p){t=o;o=e}}}}}const n=H(t);let s=null;let i=null;let a=null;if(o){s=o.memoizedProps;i=o.memoizedState;a=H(o)}else{if(r){s=r.memoizedProps;i=r.memoizedState;a=r.extractedHooks}}fe(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:n});if(s===null){return{cause:"mount",hookChanges:null}}const l=!Z(s,t.memoizedProps);if(l){return{cause:"props",hookChanges:null}}if(ae(i,t.memoizedState,{isClassComponent:t.tag===1})){const u=ge(a,n);return{cause:"state",hookChanges:u}}return{cause:"parent",hookChanges:null}}function Z(e,t){if(e===t)return true;if(!e||!t)return false;if(typeof e!=="object"||typeof t!=="object")return false;const o=Object.keys(e);const r=Object.keys(t);if(o.length!==r.length)return false;for(const n of o){if(e[n]!==t[n])return false}return true}function h(e,t=3){const o=new WeakSet;function r(n,s){if(s>t)return"[MAX_DEPTH]";if(n===null)return null;if(n===void 0)return void 0;if(typeof n==="function")return`[Function: ${n.name||"anonymous"}]`;if(typeof n==="symbol")return`[Symbol: ${n.toString()}]`;if(typeof n!=="object")return n;if(o.has(n))return"[Circular]";o.add(n);if(Array.isArray(n)){return n.slice(0,10).map(l=>r(l,s+1))}const i={};const a=Object.keys(n).slice(0,20);for(const l of a){try{i[l]=r(n[l],s+1)}catch{i[l]="[Error accessing]"}}return i}return r(e,0)}function Oe(e,t,o,r,n,s){const i=T(o)||"Unknown";console.log("\n========================================");console.log("[RN-BUOY DEBUG] RENDER EVENT");console.log("========================================");console.log(`Native Tag: ${e}`);console.log(`Component Name: ${i}`);console.log(`Is First Render: ${!r}`);console.log(`Component Cause Detected: ${s}`);console.log("----------------------------------------");console.log("\n--- NATIVE FIBER (Host Component) ---");console.log("fiber.type:",t?.type);console.log("fiber.tag:",t?.tag);console.log("fiber.memoizedProps (CURRENT):",h(t?.memoizedProps));console.log("fiber.memoizedState:",h(t?.memoizedState));if(r){console.log("PREVIOUS memoizedProps:",h(r.memoizedProps));console.log("PREVIOUS memoizedState:",h(r.memoizedState))}console.log("\n--- COMPONENT FIBER (React Component) ---");if(o){console.log("componentFiber.type:",o?.type?.name||o?.type);console.log("componentFiber.tag:",o?.tag);console.log("componentFiber.memoizedProps:",h(o?.memoizedProps));console.log("componentFiber.memoizedState:",h(o?.memoizedState));console.log("\n--- HOOKS STATE (linked list walk) ---");let l=o?.memoizedState;let u=0;while(l&&u<10){console.log(`Hook[${u}]:`,h({memoizedState:l.memoizedState,baseState:l.baseState,queue:l.queue?"[Queue object]":null}));l=l.next;u++}console.log("\n--- EXTRACTED HOOKS (Phase 3) ---");const k=H(o);if(k){for(const g of k){console.log(`Hook[${g.index}] (${g.type}):`,O(g.value))}}else{console.log("(No hooks extracted)")}}else{console.log("(No component fiber found)")}console.log("\n--- CHILDREN/TEXT CONTENT ---");const a=t?.memoizedProps?.children;console.log("children type:",typeof a);console.log("children value:",h(a));console.log("\n========================================\n")}function D(e){if(e===void 0)return"undefined";const t={0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"};return t[e]||`Unknown(${e})`}function ke(e,t){if(!t.hookChanges||t.hookChanges.length===0){return}for(const o of t.hookChanges){console.log(`[${e||"Unknown"}] ${o.type}[${o.index}]: ${o.previousValue} \u2192 ${o.currentValue}`)}}function Se(e,t,o,r,n){const s=T(o)||"Unknown";const i=typeof t?.type==="string"?t.type:"Unknown";const{cause:a,hookChanges:l}=r;console.log(`[RENDER] ${s} (${i}:${e}) | Cause: ${a.toUpperCase()}`+(n&&n.length>0?` | Props: [${n.join(", ")}]`:""));if(l&&l.length>0){for(const u of l){console.log(` \u2514\u2500 ${u.type}[${u.index}]: ${u.previousValue} \u2192 ${u.currentValue}`)}}}function v(e,t,o,r,n,s,i){const a=T(o)||"Unknown";const l=typeof t?.type==="string"?t.type:"Unknown";console.log(`
2
- [RN-BUOY RENDER DEBUG] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);console.log(`Render #${i} for ${l} (nativeTag: ${e})`);console.log(`Timestamp: ${new Date().toISOString()}`);console.log(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
3
- `);console.log(`NATIVE FIBER (${l}):`);console.log(` type: "${t?.type}"`);console.log(` tag: ${t?.tag} (${D(t?.tag)})`);const u=t?.alternate;const k=u?"alternate":r?"storage":"none";console.log(` Previous values source: ${k}`);const g=t?.memoizedProps?.children;const m=u?.memoizedProps?.children;const f=m!==void 0?m:r?.memoizedProps?.children;const S=f!==void 0?g!==f:false;console.log(` memoizedProps.children: ${O(g)}${S?` (was: ${O(f)})`:f!==void 0?" (unchanged)":" (first render)"}`);const d=t?.memoizedProps?.style;const p=u?.memoizedProps?.style;const E=p!==void 0?p:r?.memoizedProps?.style;const V=E!==void 0?d!==E:false;if(d){console.log(` memoizedProps.style: ${JSON.stringify(h(d,2))}${V?" (REFERENCE CHANGED)":""}`);if(V&&E){const c=q(d,E);console.log(` \u2514\u2500 Values actually changed: ${!c}`)}}console.log(` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);const A=t?.memoizedProps?.testID;const _=t?.memoizedProps?.nativeID;const x=t?.memoizedProps?.accessibilityLabel;if(A)console.log(` testID: "${A}"`);if(_)console.log(` nativeID: "${_}"`);if(x)console.log(` accessibilityLabel: "${x}"`);console.log(` alternate: ${u?"YES":"NO"}`);if(u){console.log(` alternate.memoizedProps.children: ${O(m)}`)}console.log(` Tree structure:`);console.log(` return (parent): ${t?.return?D(t.return.tag):"null"}`);console.log(` child: ${t?.child?D(t.child.tag):"null"}`);console.log(` sibling: ${t?.sibling?D(t.sibling.tag):"null"}`);console.log("");console.log(`COMPONENT FIBER (${a}):`);if(o){console.log(` name: "${a}"`);console.log(` type: ${typeof o.type} (${o.type?.name||o.type?.displayName||"anonymous"})`);console.log(` tag: ${o.tag} (${D(o.tag)})`);console.log(` memoizedProps: ${JSON.stringify(h(o.memoizedProps,2))}`);console.log(` alternate: ${o.alternate?"YES":"NO"}`);if(o.alternate){console.log(` ALTERNATE memoizedProps: ${JSON.stringify(h(o.alternate.memoizedProps,2))}`);const C=!Z(o.alternate.memoizedProps,o.memoizedProps);console.log(` Props changed (vs alternate): ${C?"YES":"NO"}`);console.log(` ALTERNATE memoizedState: ${o.alternate.memoizedState===o.memoizedState?"SAME":"DIFFERENT"}`)}const c=G(o);if(c){console.log(` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(h(c.memoizedProps,2))}`);const C=!Z(c.memoizedProps,o.memoizedProps);console.log(` Props changed (vs WeakMap): ${C?"YES":"NO"}`)}else{console.log(` WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)`)}if(o._debugOwner){const C=T(o._debugOwner);console.log(` _debugOwner: "${C}"`);let N=o._debugOwner;let R=1;while(N&&R<5){const U=T(N);console.log(` \u2514\u2500[${R}] ${U||"unknown"} (tag: ${N.tag})`);N=N._debugOwner;R++}}let y=0;let P=t._debugOwner||t.return;while(P&&P!==o&&y<30){P=P.return;y++}console.log(` Depth from native fiber: ${y}`)}else{console.log(` (No component fiber found - could not walk up tree)`)}console.log("");console.log(`HOOKS:`);if(o?.memoizedState){const c=H(o);const y=o.alternate?H(o.alternate):null;const P=G(o);const C=y||P?.extractedHooks;const N=y?"alternate":P?"WeakMap":"none";if(c&&c.length>0){console.log(` Total hooks: ${c.length}`);console.log(` Previous values source: ${N}`);c.forEach((R,U)=>{const I=C?.[U];const ie=I?I.rawState!==R.rawState:false;const le=I?O(I.value):"N/A";const ce=ie?" \u2190 CHANGED":"";console.log(` [${U}] ${R.type}: ${O(R.value)}${I?` (was: ${le})`:" (first render)"}${ce}`)})}else{console.log(` (Could not extract hooks - memoizedState structure not recognized)`);console.log(` Raw memoizedState type: ${typeof o.memoizedState}`);console.log(` Has 'next' property: ${"next"in(o.memoizedState||{})}`);console.log(` Has 'queue' property: ${"queue"in(o.memoizedState||{})}`)}}else{console.log(` (No memoizedState - class component, no hooks, or not a function component)`)}console.log("");console.log(`RAW HOOKS DATA:`);if(o?.memoizedState&&typeof o.memoizedState==="object"){let c=o.memoizedState;let y=0;while(c&&y<10){console.log(` Hook[${y}]:`);console.log(` memoizedState: ${h(c.memoizedState,2)}`);console.log(` baseState: ${h(c.baseState,2)}`);console.log(` queue: ${c.queue?"[Queue present]":"null"}`);console.log(` next: ${c.next?"[Next hook]":"null"}`);c=c.next;y++}if(y===0){console.log(` (memoizedState is not a hooks linked list)`)}}console.log("");console.log(`DETECTION RESULTS:`);console.log(` Component Cause: ${n.cause.toUpperCase()}`);if(n.hookChanges&&n.hookChanges.length>0){console.log(` Hook Changes Detected:`);n.hookChanges.forEach(c=>{console.log(` [${c.index}] ${c.type}: ${c.previousValue} \u2192 ${c.currentValue}`);if(c.description){console.log(` ${c.description}`)}})}const z=typeof t?.type==="string"?t.type:void 0;const w=ee(r?.memoizedProps,t?.memoizedProps,z);if(w&&w.length>0){console.log(` Native Props Changed: [${w.join(", ")}]`)}else if(r){console.log(` Native Props Changed: (none detected)`)}console.log("");console.log(`BATCH CONTEXT:`);console.log(` Batch size: ${s.size}`);console.log(` All tags in batch: [${Array.from(s).slice(0,20).join(", ")}${s.size>20?"...":""}]`);const M=ne(t);const B=M!==null&&s.has(M);console.log(` Parent nativeTag: ${M??"not found"}`);console.log(` Parent in batch: ${B?"YES":"NO"}`);if(s.size>1){console.log(` Components in same batch:`);let c=t?.return;let y=0;while(c&&y<10){const P=re(c.stateNode);if(P!==null&&s.has(P)){const C=T(c)||c.type;console.log(` [depth ${y}] ${C} (tag: ${P})`)}c=c.return;y++}}console.log(`
1
+ "use strict";import{hookStateChanged as ue}from"./ownStateChanged";const Y={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function ae(e){if(!e)return Y.default;return Y[e]||Y.default}const U=new WeakMap;function G(e){if(!e)return void 0;let t=U.get(e);if(t)return t;if(e.alternate){t=U.get(e.alternate);if(t)return t}return void 0}function fe(e,t){if(!e)return;U.set(e,t);if(e.alternate){U.set(e.alternate,t)}}const $=new Map;const J=500;const de=10;const Q=50;const F=50;const ye=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function L(e){if(!e)return true;if(ye.has(e))return true;if(e.startsWith("Animated"))return true;return false}function b(e){if(!e)return null;let t=e._debugOwner||e.return;let o=0;let r=null;while(t&&o<30){const n=t.tag;if(n===0||n===1||n===11||n===15){const s=C(t);if(!r){r=t}if(!L(s)){return t}}t=t.return;o++}return r}function C(e){if(!e)return null;const t=e.type;if(t){if(typeof t==="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}return null}function me(e){if(!e||typeof e!=="object"){return"unknown"}if(e.queue!==null&&e.queue!==void 0){return"useState"}const t=e.memoizedState;if(t!==null&&typeof t==="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1){return"useRef"}if(Array.isArray(t)&&t.length===2){const[,o]=t;if(Array.isArray(o)||o===null){if(typeof t[0]==="function"){return"useCallback"}return"useMemo"}}if(t!==null&&typeof t==="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)){return"useEffect"}return"unknown"}function pe(e,t){const o=e?.memoizedState;switch(t){case"useState":case"useReducer":return o;case"useRef":return o?.current;case"useMemo":case"useCallback":return Array.isArray(o)?o[0]:o;case"useEffect":return"[effect]";default:return o}}function R(e){if(!e?.memoizedState)return null;const t=e.memoizedState;if(typeof t!=="object"||t===null){return null}if(!("next"in t)&&!("queue"in t)&&!("memoizedState"in t)){return null}const o=[];let r=t;let n=0;while(r!==null&&n<Q){const s=me(r);const i=pe(r,s);o.push({index:n,type:s,value:i,rawState:r.memoizedState});r=r.next;n++}return o.length>0?o:null}function ge(e,t){if(!e||!t)return null;const o=[];const r=Math.max(e.length,t.length);for(let n=0;n<r;n++){const s=e[n];const i=t[n];if(!s&&i){o.push({index:n,type:i.type,currentValue:j(i.value,i.type),description:`Hook[${n}] added`});continue}if(s&&!i){o.push({index:n,type:s.type,previousValue:j(s.value,s.type),description:`Hook[${n}] removed`});continue}if(s&&i){if(s.rawState===i.rawState){continue}if(i.type==="useEffect"){continue}if(i.type==="useMemo"||i.type==="useCallback"){continue}if(i.type==="useState"||i.type==="useReducer"||i.type==="useRef"){const u=j(s.value,s.type);const l=j(i.value,i.type);o.push({index:n,type:i.type,previousValue:u,currentValue:l,description:`${u} \u2192 ${l}`})}}}return o.length>0?o:null}function j(e,t){if(t==="useRef"){return T(e)}return T(e)}function T(e){if(e===null)return null;if(e===void 0)return void 0;if(typeof e==="boolean")return e;if(typeof e==="number")return e;if(typeof e==="string"){return e.length>30?e.slice(0,30)+"...":e}if(typeof e==="function"){return`[Function: ${e.name||"anonymous"}]`}if(Array.isArray(e)){return`[Array: ${e.length} items]`}if(typeof e==="object"){const t=Object.keys(e);return`{Object: ${t.length} keys}`}return String(e)}function he(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e;let o=e.alternate;const r=G(e);if(r&&o){const a=R(e);const k=R(o);const g=r.extractedHooks;if(a&&k&&g&&g.length>0){const y=g.find(f=>f.type==="useState");if(y){const f=a.find(d=>d.index===y.index);const S=k.find(d=>d.index===y.index);if(f&&S){const d=f.value===y.value;const m=S.value===y.value;if(d&&!m){t=o;o=e}}}}}const n=R(t);let s=null;let i=null;let u=null;if(o){s=o.memoizedProps;i=o.memoizedState;u=R(o)}else{if(r){s=r.memoizedProps;i=r.memoizedState;u=r.extractedHooks}}fe(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:n});if(s===null){return{cause:"mount",hookChanges:null}}const l=!Z(s,t.memoizedProps);if(l){return{cause:"props",hookChanges:null}}if(ue(i,t.memoizedState,{isClassComponent:t.tag===1})){const a=ge(u,n);return{cause:"state",hookChanges:a}}return{cause:"parent",hookChanges:null}}function Z(e,t){if(e===t)return true;if(!e||!t)return false;if(typeof e!=="object"||typeof t!=="object")return false;const o=Object.keys(e);const r=Object.keys(t);if(o.length!==r.length)return false;for(const n of o){if(e[n]!==t[n])return false}return true}function h(e,t=3){const o=new WeakSet;function r(n,s){if(s>t)return"[MAX_DEPTH]";if(n===null)return null;if(n===void 0)return void 0;if(typeof n==="function")return`[Function: ${n.name||"anonymous"}]`;if(typeof n==="symbol")return`[Symbol: ${n.toString()}]`;if(typeof n!=="object")return n;if(o.has(n))return"[Circular]";o.add(n);if(Array.isArray(n)){return n.slice(0,10).map(l=>r(l,s+1))}const i={};const u=Object.keys(n).slice(0,20);for(const l of u){try{i[l]=r(n[l],s+1)}catch{i[l]="[Error accessing]"}}return i}return r(e,0)}function Te(e,t,o,r,n,s){const i=C(o)||"Unknown";console.log("[Buoy]","\n========================================");console.log("[Buoy]","[RN-BUOY DEBUG] RENDER EVENT");console.log("[Buoy]","========================================");console.log("[Buoy]",`Native Tag: ${e}`);console.log("[Buoy]",`Component Name: ${i}`);console.log("[Buoy]",`Is First Render: ${!r}`);console.log("[Buoy]",`Component Cause Detected: ${s}`);console.log("[Buoy]","----------------------------------------");console.log("[Buoy]","\n--- NATIVE FIBER (Host Component) ---");console.log("[Buoy]","fiber.type:",t?.type);console.log("[Buoy]","fiber.tag:",t?.tag);console.log("[Buoy]","fiber.memoizedProps (CURRENT):",h(t?.memoizedProps));console.log("[Buoy]","fiber.memoizedState:",h(t?.memoizedState));if(r){console.log("[Buoy]","PREVIOUS memoizedProps:",h(r.memoizedProps));console.log("[Buoy]","PREVIOUS memoizedState:",h(r.memoizedState))}console.log("[Buoy]","\n--- COMPONENT FIBER (React Component) ---");if(o){console.log("[Buoy]","componentFiber.type:",o?.type?.name||o?.type);console.log("[Buoy]","componentFiber.tag:",o?.tag);console.log("[Buoy]","componentFiber.memoizedProps:",h(o?.memoizedProps));console.log("[Buoy]","componentFiber.memoizedState:",h(o?.memoizedState));console.log("[Buoy]","\n--- HOOKS STATE (linked list walk) ---");let l=o?.memoizedState;let a=0;while(l&&a<10){console.log("[Buoy]",`Hook[${a}]:`,h({memoizedState:l.memoizedState,baseState:l.baseState,queue:l.queue?"[Queue object]":null}));l=l.next;a++}console.log("[Buoy]","\n--- EXTRACTED HOOKS (Phase 3) ---");const k=R(o);if(k){for(const g of k){console.log("[Buoy]",`Hook[${g.index}] (${g.type}):`,T(g.value))}}else{console.log("[Buoy]","(No hooks extracted)")}}else{console.log("[Buoy]","(No component fiber found)")}console.log("[Buoy]","\n--- CHILDREN/TEXT CONTENT ---");const u=t?.memoizedProps?.children;console.log("[Buoy]","children type:",typeof u);console.log("[Buoy]","children value:",h(u));console.log("[Buoy]","\n========================================\n")}function I(e){if(e===void 0)return"undefined";const t={0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"};return t[e]||`Unknown(${e})`}function ke(e,t){if(!t.hookChanges||t.hookChanges.length===0){return}for(const o of t.hookChanges){console.log("[Buoy]",`[${e||"Unknown"}] ${o.type}[${o.index}]: ${o.previousValue} \u2192 ${o.currentValue}`)}}function Se(e,t,o,r,n){const s=C(o)||"Unknown";const i=typeof t?.type==="string"?t.type:"Unknown";const{cause:u,hookChanges:l}=r;console.log("[Buoy]",`[RENDER] ${s} (${i}:${e}) | Cause: ${u.toUpperCase()}`+(n&&n.length>0?` | Props: [${n.join(", ")}]`:""));if(l&&l.length>0){for(const a of l){console.log("[Buoy]",` \u2514\u2500 ${a.type}[${a.index}]: ${a.previousValue} \u2192 ${a.currentValue}`)}}}function v(e,t,o,r,n,s,i){const u=C(o)||"Unknown";const l=typeof t?.type==="string"?t.type:"Unknown";console.log("[Buoy]",`
2
+ [RN-BUOY RENDER DEBUG] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);console.log("[Buoy]",`Render #${i} for ${l} (nativeTag: ${e})`);console.log("[Buoy]",`Timestamp: ${new Date().toISOString()}`);console.log("[Buoy]",`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
3
+ `);console.log("[Buoy]",`NATIVE FIBER (${l}):`);console.log("[Buoy]",` type: "${t?.type}"`);console.log("[Buoy]",` tag: ${t?.tag} (${I(t?.tag)})`);const a=t?.alternate;const k=a?"alternate":r?"storage":"none";console.log("[Buoy]",` Previous values source: ${k}`);const g=t?.memoizedProps?.children;const y=a?.memoizedProps?.children;const f=y!==void 0?y:r?.memoizedProps?.children;const S=f!==void 0?g!==f:false;console.log("[Buoy]",` memoizedProps.children: ${T(g)}${S?` (was: ${T(f)})`:f!==void 0?" (unchanged)":" (first render)"}`);const d=t?.memoizedProps?.style;const m=a?.memoizedProps?.style;const P=m!==void 0?m:r?.memoizedProps?.style;const D=P!==void 0?d!==P:false;if(d){console.log("[Buoy]",` memoizedProps.style: ${JSON.stringify(h(d,2))}${D?" (REFERENCE CHANGED)":""}`);if(D&&P){const c=W(d,P);console.log("[Buoy]",` \u2514\u2500 Values actually changed: ${!c}`)}}console.log("[Buoy]",` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);const O=t?.memoizedProps?.testID;const H=t?.memoizedProps?.nativeID;const _=t?.memoizedProps?.accessibilityLabel;if(O)console.log("[Buoy]",` testID: "${O}"`);if(H)console.log("[Buoy]",` nativeID: "${H}"`);if(_)console.log("[Buoy]",` accessibilityLabel: "${_}"`);console.log("[Buoy]",` alternate: ${a?"YES":"NO"}`);if(a){console.log("[Buoy]",` alternate.memoizedProps.children: ${T(y)}`)}console.log("[Buoy]",` Tree structure:`);console.log("[Buoy]",` return (parent): ${t?.return?I(t.return.tag):"null"}`);console.log("[Buoy]",` child: ${t?.child?I(t.child.tag):"null"}`);console.log("[Buoy]",` sibling: ${t?.sibling?I(t.sibling.tag):"null"}`);console.log("[Buoy]","");console.log("[Buoy]",`COMPONENT FIBER (${u}):`);if(o){console.log("[Buoy]",` name: "${u}"`);console.log("[Buoy]",` type: ${typeof o.type} (${o.type?.name||o.type?.displayName||"anonymous"})`);console.log("[Buoy]",` tag: ${o.tag} (${I(o.tag)})`);console.log("[Buoy]",` memoizedProps: ${JSON.stringify(h(o.memoizedProps,2))}`);console.log("[Buoy]",` alternate: ${o.alternate?"YES":"NO"}`);if(o.alternate){console.log("[Buoy]",` ALTERNATE memoizedProps: ${JSON.stringify(h(o.alternate.memoizedProps,2))}`);const E=!Z(o.alternate.memoizedProps,o.memoizedProps);console.log("[Buoy]",` Props changed (vs alternate): ${E?"YES":"NO"}`);console.log("[Buoy]",` ALTERNATE memoizedState: ${o.alternate.memoizedState===o.memoizedState?"SAME":"DIFFERENT"}`)}const c=G(o);if(c){console.log("[Buoy]",` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(h(c.memoizedProps,2))}`);const E=!Z(c.memoizedProps,o.memoizedProps);console.log("[Buoy]",` Props changed (vs WeakMap): ${E?"YES":"NO"}`)}else{console.log("[Buoy]",` WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)`)}if(o._debugOwner){const E=C(o._debugOwner);console.log("[Buoy]",` _debugOwner: "${E}"`);let A=o._debugOwner;let N=1;while(A&&N<5){const V=C(A);console.log("[Buoy]",` \u2514\u2500[${N}] ${V||"unknown"} (tag: ${A.tag})`);A=A._debugOwner;N++}}let p=0;let B=t._debugOwner||t.return;while(B&&B!==o&&p<30){B=B.return;p++}console.log("[Buoy]",` Depth from native fiber: ${p}`)}else{console.log("[Buoy]",` (No component fiber found - could not walk up tree)`)}console.log("[Buoy]","");console.log("[Buoy]",`HOOKS:`);if(o?.memoizedState){const c=R(o);const p=o.alternate?R(o.alternate):null;const B=G(o);const E=p||B?.extractedHooks;const A=p?"alternate":B?"WeakMap":"none";if(c&&c.length>0){console.log("[Buoy]",` Total hooks: ${c.length}`);console.log("[Buoy]",` Previous values source: ${A}`);c.forEach((N,V)=>{const M=E?.[V];const ie=M?M.rawState!==N.rawState:false;const le=M?T(M.value):"N/A";const ce=ie?" \u2190 CHANGED":"";console.log("[Buoy]",` [${V}] ${N.type}: ${T(N.value)}${M?` (was: ${le})`:" (first render)"}${ce}`)})}else{console.log("[Buoy]",` (Could not extract hooks - memoizedState structure not recognized)`);console.log("[Buoy]",` Raw memoizedState type: ${typeof o.memoizedState}`);console.log("[Buoy]",` Has 'next' property: ${"next"in(o.memoizedState||{})}`);console.log("[Buoy]",` Has 'queue' property: ${"queue"in(o.memoizedState||{})}`)}}else{console.log("[Buoy]",` (No memoizedState - class component, no hooks, or not a function component)`)}console.log("[Buoy]","");console.log("[Buoy]",`RAW HOOKS DATA:`);if(o?.memoizedState&&typeof o.memoizedState==="object"){let c=o.memoizedState;let p=0;while(c&&p<10){console.log("[Buoy]",` Hook[${p}]:`);console.log("[Buoy]",` memoizedState: ${h(c.memoizedState,2)}`);console.log("[Buoy]",` baseState: ${h(c.baseState,2)}`);console.log("[Buoy]",` queue: ${c.queue?"[Queue present]":"null"}`);console.log("[Buoy]",` next: ${c.next?"[Next hook]":"null"}`);c=c.next;p++}if(p===0){console.log("[Buoy]",` (memoizedState is not a hooks linked list)`)}}console.log("[Buoy]","");console.log("[Buoy]",`DETECTION RESULTS:`);console.log("[Buoy]",` Component Cause: ${n.cause.toUpperCase()}`);if(n.hookChanges&&n.hookChanges.length>0){console.log("[Buoy]",` Hook Changes Detected:`);n.hookChanges.forEach(c=>{console.log("[Buoy]",` [${c.index}] ${c.type}: ${c.previousValue} \u2192 ${c.currentValue}`);if(c.description){console.log("[Buoy]",` ${c.description}`)}})}const z=typeof t?.type==="string"?t.type:void 0;const x=ee(r?.memoizedProps,t?.memoizedProps,z);if(x&&x.length>0){console.log("[Buoy]",` Native Props Changed: [${x.join(", ")}]`)}else if(r){console.log("[Buoy]",` Native Props Changed: (none detected)`)}console.log("[Buoy]","");console.log("[Buoy]",`BATCH CONTEXT:`);console.log("[Buoy]",` Batch size: ${s.size}`);console.log("[Buoy]",` All tags in batch: [${Array.from(s).slice(0,20).join(", ")}${s.size>20?"...":""}]`);const w=ne(t);const K=w!==null&&s.has(w);console.log("[Buoy]",` Parent nativeTag: ${w??"not found"}`);console.log("[Buoy]",` Parent in batch: ${K?"YES":"NO"}`);if(s.size>1){console.log("[Buoy]",` Components in same batch:`);let c=t?.return;let p=0;while(c&&p<10){const B=re(c.stateNode);if(B!==null&&s.has(B)){const E=C(c)||c.type;console.log("[Buoy]",` [depth ${p}] ${E} (tag: ${B})`)}c=c.return;p++}}console.log("[Buoy]",`
4
4
  \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
5
- `)}export function detectRenderCause(e,t,o,r="off"){const n=Date.now();if(!t){return{type:"unknown",timestamp:n}}let s=t;let i=t.alternate;const a=$.get(e);if(a&&i){const z=a.memoizedProps?.children;const w=t.memoizedProps?.children;const M=i.memoizedProps?.children;const B=t.memoizedProps===a.memoizedProps||z!==void 0&&w===z;const c=i.memoizedProps===a.memoizedProps||z!==void 0&&M===z;if(B&&!c){s=i;i=t;if(r==="all"){console.log(`[RenderCause] Detected fiber swap - using alternate as current`)}}}let l=null;let u=null;if(i){l=i.memoizedProps;u=i.memoizedState}else{if(a){l=a.memoizedProps;u=a.memoizedState}}const k=l!==null?{memoizedProps:l,memoizedState:u,timestamp:n}:void 0;const g={memoizedProps:s.memoizedProps,memoizedState:s.memoizedState,timestamp:n};Ee(e,g);const m=b(s);const f=T(m)||void 0;const S=Pe(s,f)||void 0;const d=he(m);const p=d.cause;const E=d.hookChanges;if(!k){if(r!=="off"){if(r==="minimal"){console.log(`[${f||"Unknown"}] MOUNT`)}else if(r==="verbose"){const z=typeof s?.type==="string"?s.type:"Unknown";console.log(`[RENDER] ${f||"Unknown"} (${z}:${e}) | Cause: MOUNT`)}else if(r==="all"){const z=$.has(e)?$.size:1;v(e,s,m,k,d,o,z)}}return{type:"mount",timestamp:n,componentCause:"mount",componentName:f}}const V=typeof s.type==="string"?s.type:void 0;const A=ee(k.memoizedProps,g.memoizedProps,V);if(r!=="off"){if(r==="minimal"){ke(f,d)}else if(r==="verbose"){Se(e,s,m,d,A)}else if(r==="all"){const z=$.has(e)?$.size:1;v(e,s,m,k,d,o,z)}}if(A&&A.length>0){return{type:"props",changedKeys:A.slice(0,de),timestamp:n,componentCause:p,componentName:f,parentComponentName:S,hookChanges:E||void 0}}const _=ze(k.memoizedState,g.memoizedState);if(_&&_.length>0){return{type:"hooks",hookIndices:_,timestamp:n,componentCause:p,componentName:f,parentComponentName:S,hookChanges:E||void 0}}const x=ne(s);if(x&&o.has(x)){return{type:"parent",timestamp:n,componentCause:p,componentName:f,parentComponentName:S,hookChanges:E||void 0}}if(p==="state"){return{type:"state",timestamp:n,componentCause:p,componentName:f,parentComponentName:S,hookChanges:E||void 0}}if(p==="props"){return{type:"props",timestamp:n,componentCause:p,componentName:f,parentComponentName:S}}if(p==="parent"){return{type:"parent",timestamp:n,componentCause:p,componentName:f,parentComponentName:S}}return{type:"unknown",timestamp:n,componentCause:p,componentName:f,parentComponentName:S}}function ee(e,t,o){if(e===t)return null;if(!e||!t)return null;if(typeof e!=="object"||typeof t!=="object")return null;if(Array.isArray(e)||Array.isArray(t))return null;const r=ue(o);const n=new Set([...Object.keys(e),...Object.keys(t)]);const s=[];for(const i of n){if(i.startsWith("__"))continue;if(r.skip.includes(i))continue;if(i==="children"){if(!r.alwaysTrack.includes("children")){continue}const a=e[i];const l=t[i];if(a!==l){if(te(a)&&te(l)){s.push(`children: ${oe(a)} \u2192 ${oe(l)}`)}else{s.push("children (content)")}}continue}if(e[i]!==t[i]){const a=e[i];const l=t[i];if(i==="style"){if(q(a,l)){s.push(`${i} (ref only)`)}else{s.push(i)}}else if(typeof a==="function"&&typeof l==="function"){s.push(`${i} (fn ref)`)}else{s.push(i)}}}return s.length>0?s:null}function Ae(e){if(e===null||typeof e!=="object")return false;if(Array.isArray(e))return false;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function q(e,t,o=0){if(o>5)return false;if(e===t)return true;if(typeof e!==typeof t)return false;if(typeof e!=="object"||e===null||t===null){return e===t}if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)){if(e.length!==t.length)return false;for(let s=0;s<e.length;s++){if(!q(e[s],t[s],o+1))return false}return true}const r=Object.keys(e);const n=Object.keys(t);if(r.length!==n.length)return false;for(const s of r){if(!n.includes(s))return false;if(!q(e[s],t[s],o+1))return false}return true}function te(e){return e===null||e===void 0||typeof e==="string"||typeof e==="number"||typeof e==="boolean"}function oe(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e==="string"){return e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`}if(typeof e==="number")return String(e);if(typeof e==="boolean")return String(e);return"[object]"}function ze(e,t){if(e===t)return null;if(e==null||t==null)return null;if(typeof e!=="object"||typeof t!=="object"){return null}const o=[];let r=e;let n=t;let s=0;while(n!==null&&s<Q){if(r===null){o.push(s)}else if($e(r,n)){o.push(s)}n=n?.next??null;r=r?.next??null;s++}return o.length>0?o:null}function $e(e,t){if(e===t)return false;if(e.memoizedState!==t.memoizedState){return true}if(e.baseState!==void 0&&e.baseState!==t.baseState){return true}return false}function ne(e){let t=e?.return;let o=0;while(t&&o<F){if(t.stateNode){const r=re(t.stateNode);if(r!=null)return r}t=t.return;o++}return null}function Pe(e,t){if(!e)return null;const o=b(e);if(!o)return null;let r=o.return;let n=0;while(r&&n<F){const s=r.tag;if(s===0||s===1||s===11||s===15){const i=T(r);if(i&&!L(i)&&i!==t){return i}}r=r.return;n++}return null}function re(e){if(!e)return null;if(typeof e.__nativeTag==="number"){return e.__nativeTag}if(typeof e._nativeTag==="number"){return e._nativeTag}if(typeof e.canonical?.__nativeTag==="number"){return e.canonical.__nativeTag}if(typeof e.canonical?.publicInstance?.__nativeTag==="number"){return e.canonical.publicInstance.__nativeTag}return null}function Ee(e,t){if($.size>=J){const o=Array.from($.entries());o.sort((n,s)=>n[1].timestamp-s[1].timestamp);const r=Math.floor(J/4);for(let n=0;n<r;n++){$.delete(o[n][0])}}$.set(e,t)}export function clearRenderCauseState(){$.clear()}export function removeRenderCauseState(e){$.delete(e)}export function getRenderCauseStats(){return{storedStates:$.size,maxStates:J}}const Ce=5;const se=200;const X=20;const K=30;export function safeCloneForHistory(e,t=0,o=new WeakSet){if(e===null||e===void 0)return e;if(typeof e==="boolean"||typeof e==="number")return e;if(typeof e==="string"){return e.length>se?e.slice(0,se)+"...":e}if(typeof e==="function"){return`[Function: ${e.name||"anonymous"}]`}if(typeof e==="symbol"){return`[Symbol: ${e.description||""}]`}if(t>=Ce){if(Array.isArray(e))return`[Array: ${e.length} items]`;if(typeof e==="object"){const r=Object.keys(e);return`[Object: ${r.length} keys]`}return"[...]"}if(typeof e==="object"){if(o.has(e)){return"[Circular]"}o.add(e)}if(Array.isArray(e)){const r=e.slice(0,X).map(n=>safeCloneForHistory(n,t+1,o));if(e.length>X){r.push(`[...${e.length-X} more]`)}return r}if(e instanceof Date){return e.toISOString()}if(e instanceof Error){return`[Error: ${e.message}]`}if(e instanceof RegExp){return e.toString()}if(e instanceof Map){const r={__type:"Map",__size:e.size};let n=0;for(const[s,i]of e){if(n>=K){r[`...${e.size-n} more`]=true;break}const a=typeof s==="string"?s:String(s);r[a]=safeCloneForHistory(i,t+1,o);n++}return r}if(e instanceof Set){return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,X).map(r=>safeCloneForHistory(r,t+1,o))}}if(typeof e==="object"){const r={};const n=Object.keys(e);const s=n.slice(0,K);for(const i of s){if(i.startsWith("__")||i==="children")continue;try{r[i]=safeCloneForHistory(e[i],t+1,o)}catch{r[i]="[Error accessing property]"}}if(n.length>K){r[`...${n.length-K} more keys`]=true}return r}return"[Unknown type]"}export function capturePropsSnapshot(e){if(!e?.memoizedProps)return void 0;return safeCloneForHistory(e.memoizedProps)}export function captureStateSnapshot(e){if(!e?.memoizedState)return void 0;const t=e.memoizedState;if(typeof t==="object"&&t!==null&&"next"in t){const o=[];let r=t;let n=0;while(r&&n<Q){o.push({index:n,memoizedState:safeCloneForHistory(r.memoizedState)});r=r.next;n++}return{__type:"Hooks",hooks:o}}return safeCloneForHistory(t)}
5
+ `)}export function detectRenderCause(e,t,o,r="off"){const n=Date.now();if(!t){return{type:"unknown",timestamp:n}}let s=t;let i=t.alternate;const u=$.get(e);if(u&&i){const z=u.memoizedProps?.children;const x=t.memoizedProps?.children;const w=i.memoizedProps?.children;const K=t.memoizedProps===u.memoizedProps||z!==void 0&&x===z;const c=i.memoizedProps===u.memoizedProps||z!==void 0&&w===z;if(K&&!c){s=i;i=t;if(r==="all"){console.log("[Buoy]",`[RenderCause] Detected fiber swap - using alternate as current`)}}}let l=null;let a=null;if(i){l=i.memoizedProps;a=i.memoizedState}else{if(u){l=u.memoizedProps;a=u.memoizedState}}const k=l!==null?{memoizedProps:l,memoizedState:a,timestamp:n}:void 0;const g={memoizedProps:s.memoizedProps,memoizedState:s.memoizedState,timestamp:n};Pe(e,g);const y=b(s);const f=C(y)||void 0;const S=Be(s,f)||void 0;const d=he(y);const m=d.cause;const P=d.hookChanges;if(!k){if(r!=="off"){if(r==="minimal"){console.log("[Buoy]",`[${f||"Unknown"}] MOUNT`)}else if(r==="verbose"){const z=typeof s?.type==="string"?s.type:"Unknown";console.log("[Buoy]",`[RENDER] ${f||"Unknown"} (${z}:${e}) | Cause: MOUNT`)}else if(r==="all"){const z=$.has(e)?$.size:1;v(e,s,y,k,d,o,z)}}return{type:"mount",timestamp:n,componentCause:"mount",componentName:f}}const D=typeof s.type==="string"?s.type:void 0;const O=ee(k.memoizedProps,g.memoizedProps,D);if(r!=="off"){if(r==="minimal"){ke(f,d)}else if(r==="verbose"){Se(e,s,y,d,O)}else if(r==="all"){const z=$.has(e)?$.size:1;v(e,s,y,k,d,o,z)}}if(O&&O.length>0){return{type:"props",changedKeys:O.slice(0,de),timestamp:n,componentCause:m,componentName:f,parentComponentName:S,hookChanges:P||void 0}}const H=ze(k.memoizedState,g.memoizedState);if(H&&H.length>0){return{type:"hooks",hookIndices:H,timestamp:n,componentCause:m,componentName:f,parentComponentName:S,hookChanges:P||void 0}}const _=ne(s);if(_&&o.has(_)){return{type:"parent",timestamp:n,componentCause:m,componentName:f,parentComponentName:S,hookChanges:P||void 0}}if(m==="state"){return{type:"state",timestamp:n,componentCause:m,componentName:f,parentComponentName:S,hookChanges:P||void 0}}if(m==="props"){return{type:"props",timestamp:n,componentCause:m,componentName:f,parentComponentName:S}}if(m==="parent"){return{type:"parent",timestamp:n,componentCause:m,componentName:f,parentComponentName:S}}return{type:"unknown",timestamp:n,componentCause:m,componentName:f,parentComponentName:S}}function ee(e,t,o){if(e===t)return null;if(!e||!t)return null;if(typeof e!=="object"||typeof t!=="object")return null;if(Array.isArray(e)||Array.isArray(t))return null;const r=ae(o);const n=new Set([...Object.keys(e),...Object.keys(t)]);const s=[];for(const i of n){if(i.startsWith("__"))continue;if(r.skip.includes(i))continue;if(i==="children"){if(!r.alwaysTrack.includes("children")){continue}const u=e[i];const l=t[i];if(u!==l){if(te(u)&&te(l)){s.push(`children: ${oe(u)} \u2192 ${oe(l)}`)}else{s.push("children (content)")}}continue}if(e[i]!==t[i]){const u=e[i];const l=t[i];if(i==="style"){if(W(u,l)){s.push(`${i} (ref only)`)}else{s.push(i)}}else if(typeof u==="function"&&typeof l==="function"){s.push(`${i} (fn ref)`)}else{s.push(i)}}}return s.length>0?s:null}function Oe(e){if(e===null||typeof e!=="object")return false;if(Array.isArray(e))return false;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function W(e,t,o=0){if(o>5)return false;if(e===t)return true;if(typeof e!==typeof t)return false;if(typeof e!=="object"||e===null||t===null){return e===t}if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)){if(e.length!==t.length)return false;for(let s=0;s<e.length;s++){if(!W(e[s],t[s],o+1))return false}return true}const r=Object.keys(e);const n=Object.keys(t);if(r.length!==n.length)return false;for(const s of r){if(!n.includes(s))return false;if(!W(e[s],t[s],o+1))return false}return true}function te(e){return e===null||e===void 0||typeof e==="string"||typeof e==="number"||typeof e==="boolean"}function oe(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e==="string"){return e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`}if(typeof e==="number")return String(e);if(typeof e==="boolean")return String(e);return"[object]"}function ze(e,t){if(e===t)return null;if(e==null||t==null)return null;if(typeof e!=="object"||typeof t!=="object"){return null}const o=[];let r=e;let n=t;let s=0;while(n!==null&&s<Q){if(r===null){o.push(s)}else if($e(r,n)){o.push(s)}n=n?.next??null;r=r?.next??null;s++}return o.length>0?o:null}function $e(e,t){if(e===t)return false;if(e.memoizedState!==t.memoizedState){return true}if(e.baseState!==void 0&&e.baseState!==t.baseState){return true}return false}function ne(e){let t=e?.return;let o=0;while(t&&o<F){if(t.stateNode){const r=re(t.stateNode);if(r!=null)return r}t=t.return;o++}return null}function Be(e,t){if(!e)return null;const o=b(e);if(!o)return null;let r=o.return;let n=0;while(r&&n<F){const s=r.tag;if(s===0||s===1||s===11||s===15){const i=C(r);if(i&&!L(i)&&i!==t){return i}}r=r.return;n++}return null}function re(e){if(!e)return null;if(typeof e.__nativeTag==="number"){return e.__nativeTag}if(typeof e._nativeTag==="number"){return e._nativeTag}if(typeof e.canonical?.__nativeTag==="number"){return e.canonical.__nativeTag}if(typeof e.canonical?.publicInstance?.__nativeTag==="number"){return e.canonical.publicInstance.__nativeTag}return null}function Pe(e,t){if($.size>=J){const o=Array.from($.entries());o.sort((n,s)=>n[1].timestamp-s[1].timestamp);const r=Math.floor(J/4);for(let n=0;n<r;n++){$.delete(o[n][0])}}$.set(e,t)}export function clearRenderCauseState(){$.clear()}export function removeRenderCauseState(e){$.delete(e)}export function getRenderCauseStats(){return{storedStates:$.size,maxStates:J}}const Ee=5;const se=200;const q=20;const X=30;export function safeCloneForHistory(e,t=0,o=new WeakSet){if(e===null||e===void 0)return e;if(typeof e==="boolean"||typeof e==="number")return e;if(typeof e==="string"){return e.length>se?e.slice(0,se)+"...":e}if(typeof e==="function"){return`[Function: ${e.name||"anonymous"}]`}if(typeof e==="symbol"){return`[Symbol: ${e.description||""}]`}if(t>=Ee){if(Array.isArray(e))return`[Array: ${e.length} items]`;if(typeof e==="object"){const r=Object.keys(e);return`[Object: ${r.length} keys]`}return"[...]"}if(typeof e==="object"){if(o.has(e)){return"[Circular]"}o.add(e)}if(Array.isArray(e)){const r=e.slice(0,q).map(n=>safeCloneForHistory(n,t+1,o));if(e.length>q){r.push(`[...${e.length-q} more]`)}return r}if(e instanceof Date){return e.toISOString()}if(e instanceof Error){return`[Error: ${e.message}]`}if(e instanceof RegExp){return e.toString()}if(e instanceof Map){const r={__type:"Map",__size:e.size};let n=0;for(const[s,i]of e){if(n>=X){r[`...${e.size-n} more`]=true;break}const u=typeof s==="string"?s:String(s);r[u]=safeCloneForHistory(i,t+1,o);n++}return r}if(e instanceof Set){return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,q).map(r=>safeCloneForHistory(r,t+1,o))}}if(typeof e==="object"){const r={};const n=Object.keys(e);const s=n.slice(0,X);for(const i of s){if(i.startsWith("__")||i==="children")continue;try{r[i]=safeCloneForHistory(e[i],t+1,o)}catch{r[i]="[Error accessing property]"}}if(n.length>X){r[`...${n.length-X} more keys`]=true}return r}return"[Unknown type]"}export function capturePropsSnapshot(e){if(!e?.memoizedProps)return void 0;return safeCloneForHistory(e.memoizedProps)}export function captureStateSnapshot(e){if(!e?.memoizedState)return void 0;const t=e.memoizedState;if(typeof t==="object"&&t!==null&&"next"in t){const o=[];let r=t;let n=0;while(r&&n<Q){o.push({index:n,memoizedState:safeCloneForHistory(r.memoizedState)});r=r.next;n++}return{__type:"Hooks",hooks:o}}return safeCloneForHistory(t)}
@@ -1 +1 @@
1
- "use strict";import{getComponentDisplayName as o}from"./ViewTypeMapper";import{PerformanceLogger as u}from"./PerformanceLogger";import{isNamedComposite as h}from"./namedComposite";const l=200;const f=150;class m{renders=new Map;listeners=new Set;stateListeners=new Set;settingsListeners=new Set;filterListeners=new Set;renderEventCallbacks=new Set;isTracking=false;isPaused=false;settings={batchSize:f,showRenderCount:true,performanceLogging:false,trackRenderCauses:false,enableRenderHistory:false,maxRenderHistoryPerComponent:20,capturePropsOnRender:false,captureStateOnRender:false,debugLogLevel:"off",excludeDevTools:true,showHostViews:false};isBatchMode=false;batchDirty=false;filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]};trackRender(e){if(this.isPaused)return;const t=String(e.nativeTag);const s=Date.now();const i=this.renders.get(t);if(i){i.renderCount=e.count;i.lastRenderTime=s;i.color=e.color;if(e.measurements){i.measurements=e.measurements}if(e.testID&&!i.testID)i.testID=e.testID;if(e.nativeID&&!i.nativeID)i.nativeID=e.nativeID;if(e.accessibilityLabel&&!i.accessibilityLabel){i.accessibilityLabel=e.accessibilityLabel}if(e.componentName&&!i.componentName){i.componentName=e.componentName}if(e.renderCause){i.lastRenderCause=e.renderCause}if(this.settings.enableRenderHistory){const n=e.renderCause||{type:"unknown",timestamp:s};this.addRenderEvent(i,n,e.capturedProps,e.capturedState)}}else{const n={id:t,nativeTag:e.nativeTag,viewType:e.viewType,displayName:o(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,renderCount:e.count,firstRenderTime:s,lastRenderTime:s,measurements:e.measurements,color:e.color,lastRenderCause:e.renderCause};if(this.settings.enableRenderHistory){n.renderHistory=[];const r=e.renderCause||{type:e.count===1?"mount":"unknown",timestamp:s};this.addRenderEvent(n,r,e.capturedProps,e.capturedState)}this.renders.set(t,n);if(this.renders.size>l){const r=Array.from(this.renders.values()).sort((a,d)=>a.lastRenderTime-d.lastRenderTime);const c=r.slice(0,this.renders.size-l);for(const a of c){this.renders.delete(a.id)}}}if(this.isBatchMode){this.batchDirty=true}else{this.notifyListeners()}}addRenderEvent(e,t,s,i){if(!e.renderHistory){e.renderHistory=[]}const n={id:`${e.nativeTag}-${t.timestamp}`,timestamp:t.timestamp,cause:t,renderNumber:e.renderCount,capturedProps:this.settings.capturePropsOnRender?s:void 0,capturedState:this.settings.captureStateOnRender?i:void 0};e.renderHistory.push(n);const r=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));if(e.renderHistory.length>r){e.renderHistory=e.renderHistory.slice(-r)}this.notifyRenderEventCallbacks(n,e)}notifyRenderEventCallbacks(e,t){this.renderEventCallbacks.forEach(s=>{try{s(e,t)}catch{}})}emitRenderEvent(e){if(this.renderEventCallbacks.size===0)return;const t=Date.now();const s=e.renderCause||{type:"unknown",timestamp:t};const i={id:String(e.nativeTag),nativeTag:e.nativeTag,viewType:e.viewType,displayName:o(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,renderCount:e.count,firstRenderTime:t,lastRenderTime:t,measurements:e.measurements,color:e.color,lastRenderCause:s,renderHistory:[]};const n={id:`${e.nativeTag}-${t}-${e.count}`,timestamp:t,renderNumber:e.count,cause:s,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(n,i)}startBatch(){this.isBatchMode=true;this.batchDirty=false}endBatch(){this.isBatchMode=false;if(this.batchDirty){this.batchDirty=false;this.notifyListeners()}}getRenders(){return Array.from(this.renders.values()).map(e=>({...e}))}passesFilters(e){if(this.filters.includePatterns.length>0){const t=this.matchesAnyPatternForInfo(e,this.filters.includePatterns);if(!t)return false}if(this.filters.excludePatterns.length>0){const t=this.matchesAnyPatternForInfo(e,this.filters.excludePatterns);if(t)return false}if(this.filters.includeViewType.size>0){const t=e.viewType||"";const s=e.displayName||"";if(!this.matchesPattern(t,this.filters.includeViewType)&&!this.matchesPattern(s,this.filters.includeViewType)){return false}}if(this.filters.includeTestID.size>0){if(!e.testID||!this.matchesPattern(e.testID,this.filters.includeTestID)){return false}}if(this.filters.includeNativeID.size>0){if(!e.nativeID||!this.matchesPattern(e.nativeID,this.filters.includeNativeID)){return false}}if(this.filters.includeComponent.size>0){if(!e.componentName||!this.matchesPattern(e.componentName,this.filters.includeComponent)){return false}}if(this.filters.excludeViewType.size>0){const t=e.viewType||"";const s=e.displayName||"";if(this.matchesPattern(t,this.filters.excludeViewType)||this.matchesPattern(s,this.filters.excludeViewType)){return false}}if(this.filters.excludeTestID.size>0){if(e.testID&&this.matchesPattern(e.testID,this.filters.excludeTestID)){return false}}if(this.filters.excludeNativeID.size>0){if(e.nativeID&&this.matchesPattern(e.nativeID,this.filters.excludeNativeID)){return false}}if(this.filters.excludeComponent.size>0){if(e.componentName&&this.matchesPattern(e.componentName,this.filters.excludeComponent)){return false}}return true}matchesAnyPatternForInfo(e,t){for(const s of t){const i=s.value.toLowerCase();switch(s.type){case"any":if(e.viewType.toLowerCase().includes(i)||e.displayName?.toLowerCase().includes(i)||e.testID?.toLowerCase().includes(i)||e.nativeID?.toLowerCase().includes(i)||e.componentName?.toLowerCase().includes(i)||e.accessibilityLabel?.toLowerCase().includes(i)){return true}break;case"viewType":if(e.viewType.toLowerCase().includes(i)||e.displayName?.toLowerCase().includes(i)){return true}break;case"testID":if(e.testID?.toLowerCase().includes(i)){return true}break;case"nativeID":if(e.nativeID?.toLowerCase().includes(i)){return true}break;case"component":if(e.componentName?.toLowerCase().includes(i)){return true}break;case"accessibilityLabel":if(e.accessibilityLabel?.toLowerCase().includes(i)){return true}break}}return false}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(e=""){let t=this.getRenders();if(!this.settings.showHostViews){t=t.filter(h)}if(e.trim()){const s=e.toLowerCase();t=t.filter(i=>{return i.viewType.toLowerCase().includes(s)||i.displayName.toLowerCase().includes(s)||i.testID?.toLowerCase().includes(s)||i.nativeID?.toLowerCase().includes(s)||i.accessibilityLabel?.toLowerCase().includes(s)||i.componentName?.toLowerCase().includes(s)||String(i.nativeTag).includes(s)})}t=t.filter(s=>this.passesFilters(s));if(this.filters.minRenderCount!==void 0){t=t.filter(s=>s.renderCount>=this.filters.minRenderCount)}if(this.filters.maxRenderCount!==void 0){t=t.filter(s=>s.renderCount<=this.filters.maxRenderCount)}return t.sort((s,i)=>i.lastRenderTime-s.lastRenderTime)}matchesPattern(e,t){const s=e.toLowerCase();for(const i of t){const n=i.toLowerCase();if(s.includes(n)){return true}}return false}getRender(e){return this.renders.get(e)}clear(){this.renders.clear();this.notifyListeners()}resetRenderCount(e){const t=this.renders.get(e);if(t){t.renderCount=0;this.notifyListeners()}}start(){this.isTracking=true;this.isPaused=false;this.notifyStateListeners()}stop(){this.isTracking=false;this.isPaused=false;this.notifyStateListeners()}pause(){this.isPaused=true;this.notifyStateListeners()}resume(){this.isPaused=false;this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused;this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(e,t){const s=new Map;for(const[i,n]of this.renders){if(n.renderHistory&&n.renderHistory.length>0){s.set(i,n.renderHistory)}}this.renders=new Map(e.map(i=>{const n=s.get(i.id);const r=n&&!(i.renderHistory&&i.renderHistory.length>0)?{...i,renderHistory:n}:i;return[r.id,r]}));if(t&&(this.isTracking!==t.isTracking||this.isPaused!==t.isPaused)){this.isTracking=t.isTracking;this.isPaused=t.isPaused;this.notifyStateListeners()}this.notifyListeners()}hydrateRender(e){const t=this.renders.get(e.id);this.renders.set(e.id,t?{...t,...e}:e);this.notifyListeners()}getFilters(){return this.filters}setFilters(e){this.filters={...this.filters,...e};this.notifyListeners();this.notifyFilterListeners()}addIncludePattern(e,t){const s=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].add(t);this.notifyListeners()}removeIncludePattern(e,t){const s=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].delete(t);this.notifyListeners()}addExcludePattern(e,t){const s=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].add(t);this.notifyListeners()}removeExcludePattern(e,t){const s=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].delete(t);this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0};this.notifyListeners()}getAvailableProps(){const e=new Set;const t=new Set;const s=new Set;const i=new Set;const n=new Set;for(const r of this.renders.values()){if(r.viewType)e.add(r.viewType);if(r.testID)t.add(r.testID);if(r.nativeID)s.add(r.nativeID);if(r.componentName)i.add(r.componentName);if(r.accessibilityLabel)n.add(r.accessibilityLabel)}return{viewTypes:Array.from(e).sort(),testIDs:Array.from(t).sort(),nativeIDs:Array.from(s).sort(),componentNames:Array.from(i).sort(),accessibilityLabels:Array.from(n).sort()}}getStats(){let e=0;for(const t of this.renders.values()){e+=t.renderCount}return{totalComponents:this.renders.size,totalRenders:e}}subscribe(e){this.listeners.add(e);e(this.getRenders());return()=>{this.listeners.delete(e)}}subscribeToState(e){this.stateListeners.add(e);e(this.getState());return()=>{this.stateListeners.delete(e)}}subscribeToSettings(e){this.settingsListeners.add(e);e(this.settings);return()=>{this.settingsListeners.delete(e)}}subscribeToFilters(e){this.filterListeners.add(e);e(this.filters);return()=>{this.filterListeners.delete(e)}}onRenderEvent(e){this.renderEventCallbacks.add(e);return()=>{this.renderEventCallbacks.delete(e)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(e){const t=this.filters;if(t.includePatterns.length>0){if(!this.matchesAnyPatternForInfo(e,t.includePatterns)){return false}}if(t.excludePatterns.length>0){if(this.matchesAnyPatternForInfo(e,t.excludePatterns)){return false}}const s=t.includeViewType.size>0||t.includeTestID.size>0||t.includeNativeID.size>0||t.includeComponent.size>0;if(s){const i=t.includeViewType.size>0&&t.includeViewType.has(e.viewType)||t.includeTestID.size>0&&e.testID&&t.includeTestID.has(e.testID)||t.includeNativeID.size>0&&e.nativeID&&t.includeNativeID.has(e.nativeID)||t.includeComponent.size>0&&e.componentName&&t.includeComponent.has(e.componentName);if(!i){return false}}if(t.excludeViewType.has(e.viewType))return false;if(e.testID&&t.excludeTestID.has(e.testID))return false;if(e.nativeID&&t.excludeNativeID.has(e.nativeID))return false;if(e.componentName&&t.excludeComponent.has(e.componentName))return false;return true}getSettings(){return{...this.settings}}setSettings(e){if(e.batchSize!==void 0){e.batchSize=Math.max(10,Math.min(500,e.batchSize))}if(e.maxRenderHistoryPerComponent!==void 0){e.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,e.maxRenderHistoryPerComponent))}if(e.enableRenderHistory&&!this.settings.trackRenderCauses){e.trackRenderCauses=true}if(e.trackRenderCauses===false&&this.settings.enableRenderHistory){e.enableRenderHistory=false}this.settings={...this.settings,...e};if(e.performanceLogging!==void 0){u.setEnabled(e.performanceLogging)}this.notifySettingsListeners()}clearAllRenderHistory(){for(const e of this.renders.values()){e.renderHistory=[]}this.notifyListeners()}clearRenderHistory(e){const t=this.renders.get(e);if(t){t.renderHistory=[];this.notifyListeners()}}getRenderHistoryStats(){let e=0;let t=0;for(const s of this.renders.values()){if(s.renderHistory&&s.renderHistory.length>0){e+=s.renderHistory.length;t++}}return{totalEvents:e,componentsWithHistory:t,averageEventsPerComponent:t>0?e/t:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(e){this.setSettings({batchSize:e})}notifyListeners(){const e=this.getRenders();for(const t of this.listeners){try{t(e)}catch(s){console.error("[RenderTracker] Error in listener:",s)}}}notifyStateListeners(){const e=this.getState();for(const t of this.stateListeners){try{t(e)}catch(s){console.error("[RenderTracker] Error in state listener:",s)}}}notifySettingsListeners(){const e=this.getSettings();for(const t of this.settingsListeners){try{t(e)}catch(s){console.error("[RenderTracker] Error in settings listener:",s)}}}notifyFilterListeners(){const e=this.getFilters();for(const t of this.filterListeners){try{t(e)}catch(s){console.error("[RenderTracker] Error in filter listener:",s)}}}}export const RenderTracker=new m;export default RenderTracker;
1
+ "use strict";import{getComponentDisplayName as o}from"./ViewTypeMapper";import{PerformanceLogger as u}from"./PerformanceLogger";import{isNamedComposite as h}from"./namedComposite";const l=200;const f=150;class m{renders=new Map;listeners=new Set;stateListeners=new Set;settingsListeners=new Set;filterListeners=new Set;renderEventCallbacks=new Set;isTracking=false;isPaused=false;settings={batchSize:f,showRenderCount:true,performanceLogging:false,trackRenderCauses:false,enableRenderHistory:false,maxRenderHistoryPerComponent:20,capturePropsOnRender:false,captureStateOnRender:false,debugLogLevel:"off",excludeDevTools:true,showHostViews:false};isBatchMode=false;batchDirty=false;filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]};trackRender(e){if(this.isPaused)return;const t=String(e.nativeTag);const s=Date.now();const i=this.renders.get(t);if(i){i.renderCount=e.count;i.lastRenderTime=s;i.color=e.color;if(e.measurements){i.measurements=e.measurements}if(e.testID&&!i.testID)i.testID=e.testID;if(e.nativeID&&!i.nativeID)i.nativeID=e.nativeID;if(e.accessibilityLabel&&!i.accessibilityLabel){i.accessibilityLabel=e.accessibilityLabel}if(e.componentName&&!i.componentName){i.componentName=e.componentName}if(e.renderCause){i.lastRenderCause=e.renderCause}if(this.settings.enableRenderHistory){const n=e.renderCause||{type:"unknown",timestamp:s};this.addRenderEvent(i,n,e.capturedProps,e.capturedState)}}else{const n={id:t,nativeTag:e.nativeTag,viewType:e.viewType,displayName:o(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,...e.isComponent===void 0?{}:{isComponent:e.isComponent},renderCount:e.count,firstRenderTime:s,lastRenderTime:s,measurements:e.measurements,color:e.color,lastRenderCause:e.renderCause};if(this.settings.enableRenderHistory){n.renderHistory=[];const r=e.renderCause||{type:e.count===1?"mount":"unknown",timestamp:s};this.addRenderEvent(n,r,e.capturedProps,e.capturedState)}this.renders.set(t,n);if(this.renders.size>l){const r=Array.from(this.renders.values()).sort((a,d)=>a.lastRenderTime-d.lastRenderTime);const c=r.slice(0,this.renders.size-l);for(const a of c){this.renders.delete(a.id)}}}if(this.isBatchMode){this.batchDirty=true}else{this.notifyListeners()}}addRenderEvent(e,t,s,i){if(!e.renderHistory){e.renderHistory=[]}const n={id:`${e.nativeTag}-${t.timestamp}`,timestamp:t.timestamp,cause:t,renderNumber:e.renderCount,capturedProps:this.settings.capturePropsOnRender?s:void 0,capturedState:this.settings.captureStateOnRender?i:void 0};e.renderHistory.push(n);const r=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));if(e.renderHistory.length>r){e.renderHistory=e.renderHistory.slice(-r)}this.notifyRenderEventCallbacks(n,e)}notifyRenderEventCallbacks(e,t){this.renderEventCallbacks.forEach(s=>{try{s(e,t)}catch{}})}emitRenderEvent(e){if(this.renderEventCallbacks.size===0)return;const t=Date.now();const s=e.renderCause||{type:"unknown",timestamp:t};const i={id:String(e.nativeTag),nativeTag:e.nativeTag,viewType:e.viewType,displayName:o(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,renderCount:e.count,firstRenderTime:t,lastRenderTime:t,measurements:e.measurements,color:e.color,lastRenderCause:s,renderHistory:[]};const n={id:`${e.nativeTag}-${t}-${e.count}`,timestamp:t,renderNumber:e.count,cause:s,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(n,i)}startBatch(){this.isBatchMode=true;this.batchDirty=false}endBatch(){this.isBatchMode=false;if(this.batchDirty){this.batchDirty=false;this.notifyListeners()}}getRenders(){return Array.from(this.renders.values()).map(e=>({...e}))}passesFilters(e){if(this.filters.includePatterns.length>0){const t=this.matchesAnyPatternForInfo(e,this.filters.includePatterns);if(!t)return false}if(this.filters.excludePatterns.length>0){const t=this.matchesAnyPatternForInfo(e,this.filters.excludePatterns);if(t)return false}if(this.filters.includeViewType.size>0){const t=e.viewType||"";const s=e.displayName||"";if(!this.matchesPattern(t,this.filters.includeViewType)&&!this.matchesPattern(s,this.filters.includeViewType)){return false}}if(this.filters.includeTestID.size>0){if(!e.testID||!this.matchesPattern(e.testID,this.filters.includeTestID)){return false}}if(this.filters.includeNativeID.size>0){if(!e.nativeID||!this.matchesPattern(e.nativeID,this.filters.includeNativeID)){return false}}if(this.filters.includeComponent.size>0){if(!e.componentName||!this.matchesPattern(e.componentName,this.filters.includeComponent)){return false}}if(this.filters.excludeViewType.size>0){const t=e.viewType||"";const s=e.displayName||"";if(this.matchesPattern(t,this.filters.excludeViewType)||this.matchesPattern(s,this.filters.excludeViewType)){return false}}if(this.filters.excludeTestID.size>0){if(e.testID&&this.matchesPattern(e.testID,this.filters.excludeTestID)){return false}}if(this.filters.excludeNativeID.size>0){if(e.nativeID&&this.matchesPattern(e.nativeID,this.filters.excludeNativeID)){return false}}if(this.filters.excludeComponent.size>0){if(e.componentName&&this.matchesPattern(e.componentName,this.filters.excludeComponent)){return false}}return true}matchesAnyPatternForInfo(e,t){for(const s of t){const i=s.value.toLowerCase();switch(s.type){case"any":if(e.viewType.toLowerCase().includes(i)||e.displayName?.toLowerCase().includes(i)||e.testID?.toLowerCase().includes(i)||e.nativeID?.toLowerCase().includes(i)||e.componentName?.toLowerCase().includes(i)||e.accessibilityLabel?.toLowerCase().includes(i)){return true}break;case"viewType":if(e.viewType.toLowerCase().includes(i)||e.displayName?.toLowerCase().includes(i)){return true}break;case"testID":if(e.testID?.toLowerCase().includes(i)){return true}break;case"nativeID":if(e.nativeID?.toLowerCase().includes(i)){return true}break;case"component":if(e.componentName?.toLowerCase().includes(i)){return true}break;case"accessibilityLabel":if(e.accessibilityLabel?.toLowerCase().includes(i)){return true}break}}return false}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(e=""){let t=this.getRenders();if(!this.settings.showHostViews){t=t.filter(h)}if(e.trim()){const s=e.toLowerCase();t=t.filter(i=>{return i.viewType.toLowerCase().includes(s)||i.displayName.toLowerCase().includes(s)||i.testID?.toLowerCase().includes(s)||i.nativeID?.toLowerCase().includes(s)||i.accessibilityLabel?.toLowerCase().includes(s)||i.componentName?.toLowerCase().includes(s)||String(i.nativeTag).includes(s)})}t=t.filter(s=>this.passesFilters(s));if(this.filters.minRenderCount!==void 0){t=t.filter(s=>s.renderCount>=this.filters.minRenderCount)}if(this.filters.maxRenderCount!==void 0){t=t.filter(s=>s.renderCount<=this.filters.maxRenderCount)}return t.sort((s,i)=>i.lastRenderTime-s.lastRenderTime)}matchesPattern(e,t){const s=e.toLowerCase();for(const i of t){const n=i.toLowerCase();if(s.includes(n)){return true}}return false}getRender(e){return this.renders.get(e)}clear(){this.renders.clear();this.notifyListeners()}resetRenderCount(e){const t=this.renders.get(e);if(t){t.renderCount=0;this.notifyListeners()}}start(){this.isTracking=true;this.isPaused=false;this.notifyStateListeners()}stop(){this.isTracking=false;this.isPaused=false;this.notifyStateListeners()}pause(){this.isPaused=true;this.notifyStateListeners()}resume(){this.isPaused=false;this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused;this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(e,t){const s=new Map;for(const[i,n]of this.renders){if(n.renderHistory&&n.renderHistory.length>0){s.set(i,n.renderHistory)}}this.renders=new Map(e.map(i=>{const n=s.get(i.id);const r=n&&!(i.renderHistory&&i.renderHistory.length>0)?{...i,renderHistory:n}:i;return[r.id,r]}));if(t&&(this.isTracking!==t.isTracking||this.isPaused!==t.isPaused)){this.isTracking=t.isTracking;this.isPaused=t.isPaused;this.notifyStateListeners()}this.notifyListeners()}hydrateRender(e){const t=this.renders.get(e.id);this.renders.set(e.id,t?{...t,...e}:e);this.notifyListeners()}getFilters(){return this.filters}setFilters(e){this.filters={...this.filters,...e};this.notifyListeners();this.notifyFilterListeners()}addIncludePattern(e,t){const s=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].add(t);this.notifyListeners()}removeIncludePattern(e,t){const s=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].delete(t);this.notifyListeners()}addExcludePattern(e,t){const s=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].add(t);this.notifyListeners()}removeExcludePattern(e,t){const s=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].delete(t);this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0};this.notifyListeners()}getAvailableProps(){const e=new Set;const t=new Set;const s=new Set;const i=new Set;const n=new Set;for(const r of this.renders.values()){if(r.viewType)e.add(r.viewType);if(r.testID)t.add(r.testID);if(r.nativeID)s.add(r.nativeID);if(r.componentName)i.add(r.componentName);if(r.accessibilityLabel)n.add(r.accessibilityLabel)}return{viewTypes:Array.from(e).sort(),testIDs:Array.from(t).sort(),nativeIDs:Array.from(s).sort(),componentNames:Array.from(i).sort(),accessibilityLabels:Array.from(n).sort()}}getStats(){let e=0;for(const t of this.renders.values()){e+=t.renderCount}return{totalComponents:this.renders.size,totalRenders:e}}subscribe(e){this.listeners.add(e);e(this.getRenders());return()=>{this.listeners.delete(e)}}subscribeToState(e){this.stateListeners.add(e);e(this.getState());return()=>{this.stateListeners.delete(e)}}subscribeToSettings(e){this.settingsListeners.add(e);e(this.settings);return()=>{this.settingsListeners.delete(e)}}subscribeToFilters(e){this.filterListeners.add(e);e(this.filters);return()=>{this.filterListeners.delete(e)}}onRenderEvent(e){this.renderEventCallbacks.add(e);return()=>{this.renderEventCallbacks.delete(e)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(e){const t=this.filters;if(t.includePatterns.length>0){if(!this.matchesAnyPatternForInfo(e,t.includePatterns)){return false}}if(t.excludePatterns.length>0){if(this.matchesAnyPatternForInfo(e,t.excludePatterns)){return false}}const s=t.includeViewType.size>0||t.includeTestID.size>0||t.includeNativeID.size>0||t.includeComponent.size>0;if(s){const i=t.includeViewType.size>0&&t.includeViewType.has(e.viewType)||t.includeTestID.size>0&&e.testID&&t.includeTestID.has(e.testID)||t.includeNativeID.size>0&&e.nativeID&&t.includeNativeID.has(e.nativeID)||t.includeComponent.size>0&&e.componentName&&t.includeComponent.has(e.componentName);if(!i){return false}}if(t.excludeViewType.has(e.viewType))return false;if(e.testID&&t.excludeTestID.has(e.testID))return false;if(e.nativeID&&t.excludeNativeID.has(e.nativeID))return false;if(e.componentName&&t.excludeComponent.has(e.componentName))return false;return true}getSettings(){return{...this.settings}}setSettings(e){if(e.batchSize!==void 0){e.batchSize=Math.max(10,Math.min(500,e.batchSize))}if(e.maxRenderHistoryPerComponent!==void 0){e.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,e.maxRenderHistoryPerComponent))}if(e.enableRenderHistory&&!this.settings.trackRenderCauses){e.trackRenderCauses=true}if(e.trackRenderCauses===false&&this.settings.enableRenderHistory){e.enableRenderHistory=false}this.settings={...this.settings,...e};if(e.performanceLogging!==void 0){u.setEnabled(e.performanceLogging)}this.notifySettingsListeners()}clearAllRenderHistory(){for(const e of this.renders.values()){e.renderHistory=[]}this.notifyListeners()}clearRenderHistory(e){const t=this.renders.get(e);if(t){t.renderHistory=[];this.notifyListeners()}}getRenderHistoryStats(){let e=0;let t=0;for(const s of this.renders.values()){if(s.renderHistory&&s.renderHistory.length>0){e+=s.renderHistory.length;t++}}return{totalEvents:e,componentsWithHistory:t,averageEventsPerComponent:t>0?e/t:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(e){this.setSettings({batchSize:e})}notifyListeners(){const e=this.getRenders();for(const t of this.listeners){try{t(e)}catch(s){console.error("[Buoy]","[RenderTracker] Error in listener:",s)}}}notifyStateListeners(){const e=this.getState();for(const t of this.stateListeners){try{t(e)}catch(s){console.error("[Buoy]","[RenderTracker] Error in state listener:",s)}}}notifySettingsListeners(){const e=this.getSettings();for(const t of this.settingsListeners){try{t(e)}catch(s){console.error("[Buoy]","[RenderTracker] Error in settings listener:",s)}}}notifyFilterListeners(){const e=this.getFilters();for(const t of this.filterListeners){try{t(e)}catch(s){console.error("[Buoy]","[RenderTracker] Error in filter listener:",s)}}}}export const RenderTracker=new m;export default RenderTracker;
@@ -1 +1 @@
1
- "use strict";const i=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]);const n=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);export function isNamedComposite(e){if(e.testID&&e.testID.trim())return true;const t=(e.componentName??"").trim();if(!t)return false;if(i.has(t))return false;if(n.has(t))return false;const r=(e.viewType??"").trim();if(r&&i.has(r)&&t===r)return false;if(/^comp(\s|$)/i.test(t))return false;if(t.startsWith("_"))return false;return true}export function isHostViewName(e){return!!e&&i.has(e)}
1
+ "use strict";const i=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]);const n=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);export function isNamedComposite(e){if(e.isComponent===true)return true;if(e.testID&&e.testID.trim())return true;const t=(e.componentName??"").trim();if(!t)return false;if(i.has(t))return false;if(n.has(t))return false;const r=(e.viewType??"").trim();if(r&&i.has(r)&&t===r)return false;if(/^comp(\s|$)/i.test(t))return false;if(t.startsWith("_"))return false;return true}export function isHostViewName(e){return!!e&&i.has(e)}
@@ -120,6 +120,16 @@ declare function replaceRemoteState(state: {
120
120
  */
121
121
  declare function getSpotlight(): number | null;
122
122
  declare function subscribe(listener: (enabled: boolean) => void): () => void;
123
+ /** A host renderer can feed the same boxes and list without a React hook. */
124
+ declare function connectRenderSource(available: boolean): {
125
+ recordRenders: (renders: Array<{
126
+ host: HTMLElement;
127
+ name: string;
128
+ count: number;
129
+ }>) => void;
130
+ disconnect: () => void;
131
+ };
132
+ declare function getRenderSourceStatus(): "ready" | "unavailable" | undefined;
123
133
  declare function initialize(): boolean;
124
134
  declare function enable(): void;
125
135
  declare function disable(): void;
@@ -182,6 +192,8 @@ declare function toggleFreeze(): void;
182
192
  declare function getFrozen(): boolean;
183
193
  declare function destroy(): void;
184
194
  interface HighlightUpdatesControllerAPI {
195
+ connectRenderSource: typeof connectRenderSource;
196
+ getRenderSourceStatus: typeof getRenderSourceStatus;
185
197
  subscribe: typeof subscribe;
186
198
  enable: typeof enable;
187
199
  disable: typeof disable;
@@ -66,6 +66,8 @@ export interface TrackedRender {
66
66
  nativeID?: string;
67
67
  accessibilityLabel?: string;
68
68
  componentName?: string;
69
+ /** A host renderer has verified that this is an app component. */
70
+ isComponent?: boolean;
69
71
  renderCount: number;
70
72
  firstRenderTime: number;
71
73
  lastRenderTime: number;
@@ -222,6 +224,7 @@ declare class RenderTrackerSingleton {
222
224
  nativeID?: string;
223
225
  accessibilityLabel?: string;
224
226
  componentName?: string;
227
+ isComponent?: boolean;
225
228
  measurements?: {
226
229
  x: number;
227
230
  y: number;
@@ -3,6 +3,7 @@
3
3
  * Named composites are what you actually want when asking "what re-rendered?"
4
4
  */
5
5
  export interface NamedCompositeInput {
6
+ isComponent?: boolean;
6
7
  componentName?: string | null;
7
8
  displayName?: string | null;
8
9
  viewType?: string | null;