@osdk/react-devtools 0.5.0

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 (443) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/build/esm/DevToolsContext.js +19 -0
  3. package/build/esm/DevToolsContext.js.map +1 -0
  4. package/build/esm/components/ActionMetrics.js +89 -0
  5. package/build/esm/components/ActionMetrics.js.map +1 -0
  6. package/build/esm/components/BubbleChart.js +175 -0
  7. package/build/esm/components/BubbleChart.js.map +1 -0
  8. package/build/esm/components/BubbleChart.module.scss.js +6 -0
  9. package/build/esm/components/CacheInspectorTab.js +291 -0
  10. package/build/esm/components/CacheInspectorTab.js.map +1 -0
  11. package/build/esm/components/CacheInspectorTab.module.scss.js +39 -0
  12. package/build/esm/components/CacheMetrics.js +55 -0
  13. package/build/esm/components/CacheMetrics.js.map +1 -0
  14. package/build/esm/components/ComponentCard.js +124 -0
  15. package/build/esm/components/ComponentCard.js.map +1 -0
  16. package/build/esm/components/ComponentCard.module.scss.js +31 -0
  17. package/build/esm/components/ComputeTab.js +175 -0
  18. package/build/esm/components/ComputeTab.js.map +1 -0
  19. package/build/esm/components/CopyableCodeBlock.js +49 -0
  20. package/build/esm/components/CopyableCodeBlock.js.map +1 -0
  21. package/build/esm/components/CopyableCodeBlock.module.scss.js +10 -0
  22. package/build/esm/components/DebuggingTab.js +342 -0
  23. package/build/esm/components/DebuggingTab.js.map +1 -0
  24. package/build/esm/components/DebuggingTab.module.scss.js +18 -0
  25. package/build/esm/components/HookRow.js +180 -0
  26. package/build/esm/components/HookRow.js.map +1 -0
  27. package/build/esm/components/HookRow.module.scss.js +16 -0
  28. package/build/esm/components/ImprovementsTab.js +138 -0
  29. package/build/esm/components/ImprovementsTab.js.map +1 -0
  30. package/build/esm/components/ImprovementsTab.module.scss.js +30 -0
  31. package/build/esm/components/InspectorSelectionHeader.js +65 -0
  32. package/build/esm/components/InspectorSelectionHeader.js.map +1 -0
  33. package/build/esm/components/InterceptTab.js +862 -0
  34. package/build/esm/components/InterceptTab.js.map +1 -0
  35. package/build/esm/components/InterceptTab.module.scss.js +49 -0
  36. package/build/esm/components/IssueCard.js +115 -0
  37. package/build/esm/components/IssueCard.js.map +1 -0
  38. package/build/esm/components/IssueCard.module.scss.js +24 -0
  39. package/build/esm/components/LogEntryCard.js +94 -0
  40. package/build/esm/components/LogEntryCard.js.map +1 -0
  41. package/build/esm/components/LogEntryCard.module.scss.js +19 -0
  42. package/build/esm/components/MockEditor.js +316 -0
  43. package/build/esm/components/MockEditor.js.map +1 -0
  44. package/build/esm/components/MonitorErrorBoundary.js +64 -0
  45. package/build/esm/components/MonitorErrorBoundary.js.map +1 -0
  46. package/build/esm/components/MonitorErrorBoundary.module.scss.js +9 -0
  47. package/build/esm/components/MonitoringPanel.js +434 -0
  48. package/build/esm/components/MonitoringPanel.js.map +1 -0
  49. package/build/esm/components/MonitoringPanel.module.scss.js +81 -0
  50. package/build/esm/components/ObjectLoadingMetrics.js +60 -0
  51. package/build/esm/components/ObjectLoadingMetrics.js.map +1 -0
  52. package/build/esm/components/OsdkAppErrorBoundary.js +68 -0
  53. package/build/esm/components/OsdkAppErrorBoundary.js.map +1 -0
  54. package/build/esm/components/OsdkDevTools.js +40 -0
  55. package/build/esm/components/OsdkDevTools.js.map +1 -0
  56. package/build/esm/components/OverrideEditor.js +197 -0
  57. package/build/esm/components/OverrideEditor.js.map +1 -0
  58. package/build/esm/components/PerformanceTab.js +297 -0
  59. package/build/esm/components/PerformanceTab.js.map +1 -0
  60. package/build/esm/components/PrimitiveSelectionPanel.js +220 -0
  61. package/build/esm/components/PrimitiveSelectionPanel.js.map +1 -0
  62. package/build/esm/components/PrimitiveSelectionPanel.module.scss.js +26 -0
  63. package/build/esm/components/issueTypes.js +2 -0
  64. package/build/esm/components/issueTypes.js.map +1 -0
  65. package/build/esm/components/resolveComponentName.js +57 -0
  66. package/build/esm/components/resolveComponentName.js.map +1 -0
  67. package/build/esm/components/testHelpers.js +312 -0
  68. package/build/esm/components/testHelpers.js.map +1 -0
  69. package/build/esm/css.d.ts +20 -0
  70. package/build/esm/fiber/DegradationNotice.js +193 -0
  71. package/build/esm/fiber/DegradationNotice.js.map +1 -0
  72. package/build/esm/fiber/DevtoolsHook.js +252 -0
  73. package/build/esm/fiber/DevtoolsHook.js.map +1 -0
  74. package/build/esm/fiber/FiberAccess.js +65 -0
  75. package/build/esm/fiber/FiberAccess.js.map +1 -0
  76. package/build/esm/fiber/FiberInspection.js +140 -0
  77. package/build/esm/fiber/FiberInspection.js.map +1 -0
  78. package/build/esm/fiber/FiberTags.js +52 -0
  79. package/build/esm/fiber/FiberTags.js.map +1 -0
  80. package/build/esm/fiber/HookStateInspector.js +254 -0
  81. package/build/esm/fiber/HookStateInspector.js.map +1 -0
  82. package/build/esm/fiber/SafeFiberOperation.js +35 -0
  83. package/build/esm/fiber/SafeFiberOperation.js.map +1 -0
  84. package/build/esm/fiber/capabilities.js +180 -0
  85. package/build/esm/fiber/capabilities.js.map +1 -0
  86. package/build/esm/fiber/traverseFiber.js +129 -0
  87. package/build/esm/fiber/traverseFiber.js.map +1 -0
  88. package/build/esm/fiber/types.js +2 -0
  89. package/build/esm/fiber/types.js.map +1 -0
  90. package/build/esm/fiber/validation.js +155 -0
  91. package/build/esm/fiber/validation.js.map +1 -0
  92. package/build/esm/hooks/createPollingStore.js +81 -0
  93. package/build/esm/hooks/createPollingStore.js.map +1 -0
  94. package/build/esm/hooks/useActiveComponents.js +27 -0
  95. package/build/esm/hooks/useActiveComponents.js.map +1 -0
  96. package/build/esm/hooks/useComponentRegistry.js +25 -0
  97. package/build/esm/hooks/useComponentRegistry.js.map +1 -0
  98. package/build/esm/hooks/useComputeSelectors.js +43 -0
  99. package/build/esm/hooks/useComputeSelectors.js.map +1 -0
  100. package/build/esm/hooks/useConsoleLogs.js +46 -0
  101. package/build/esm/hooks/useConsoleLogs.js.map +1 -0
  102. package/build/esm/hooks/useInspectorSelection.js +93 -0
  103. package/build/esm/hooks/useInspectorSelection.js.map +1 -0
  104. package/build/esm/hooks/useMetrics.js +23 -0
  105. package/build/esm/hooks/useMetrics.js.map +1 -0
  106. package/build/esm/hooks/usePersistedState.js +89 -0
  107. package/build/esm/hooks/usePersistedState.js.map +1 -0
  108. package/build/esm/hooks/useRecommendations.js +123 -0
  109. package/build/esm/hooks/useRecommendations.js.map +1 -0
  110. package/build/esm/hooks/useSharedTick.js +49 -0
  111. package/build/esm/hooks/useSharedTick.js.map +1 -0
  112. package/build/esm/hooks/useTimeElapsed.js +51 -0
  113. package/build/esm/hooks/useTimeElapsed.js.map +1 -0
  114. package/build/esm/hooks/useTrackerSubscription.js +97 -0
  115. package/build/esm/hooks/useTrackerSubscription.js.map +1 -0
  116. package/build/esm/hooks/useUnusedFieldAnalysis.js +99 -0
  117. package/build/esm/hooks/useUnusedFieldAnalysis.js.map +1 -0
  118. package/build/esm/index.js +31 -0
  119. package/build/esm/index.js.map +1 -0
  120. package/build/esm/inspector/ClickToInspectSystem.js +228 -0
  121. package/build/esm/inspector/ClickToInspectSystem.js.map +1 -0
  122. package/build/esm/inspector/components/ComponentLabel.js +175 -0
  123. package/build/esm/inspector/components/ComponentLabel.js.map +1 -0
  124. package/build/esm/inspector/components/ComponentLabel.module.scss.js +12 -0
  125. package/build/esm/inspector/components/InspectorBanner.js +79 -0
  126. package/build/esm/inspector/components/InspectorBanner.js.map +1 -0
  127. package/build/esm/inspector/components/InspectorOverlay.js +149 -0
  128. package/build/esm/inspector/components/InspectorOverlay.js.map +1 -0
  129. package/build/esm/inspector/components/SelectionHighlight.js +74 -0
  130. package/build/esm/inspector/components/SelectionHighlight.js.map +1 -0
  131. package/build/esm/inspector/createClickToInspect.js +21 -0
  132. package/build/esm/inspector/createClickToInspect.js.map +1 -0
  133. package/build/esm/inspector/hooks/useAnimatedBounds.js +167 -0
  134. package/build/esm/inspector/hooks/useAnimatedBounds.js.map +1 -0
  135. package/build/esm/inspector/index.js +40 -0
  136. package/build/esm/inspector/index.js.map +1 -0
  137. package/build/esm/inspector/inspectorController.js +328 -0
  138. package/build/esm/inspector/inspectorController.js.map +1 -0
  139. package/build/esm/inspector/types.js +2 -0
  140. package/build/esm/inspector/types.js.map +1 -0
  141. package/build/esm/inspector/utils/elementBounds.js +72 -0
  142. package/build/esm/inspector/utils/elementBounds.js.map +1 -0
  143. package/build/esm/inspector/utils/interpolation.js +26 -0
  144. package/build/esm/inspector/utils/interpolation.js.map +1 -0
  145. package/build/esm/inspector/utils/labelPositioning.js +62 -0
  146. package/build/esm/inspector/utils/labelPositioning.js.map +1 -0
  147. package/build/esm/mocking/MockCacheKeyGenerator.js +109 -0
  148. package/build/esm/mocking/MockCacheKeyGenerator.js.map +1 -0
  149. package/build/esm/mocking/MockManager.js +281 -0
  150. package/build/esm/mocking/MockManager.js.map +1 -0
  151. package/build/esm/prototyping/PrototypeOverrideStore.js +66 -0
  152. package/build/esm/prototyping/PrototypeOverrideStore.js.map +1 -0
  153. package/build/esm/prototyping/index.js +18 -0
  154. package/build/esm/prototyping/index.js.map +1 -0
  155. package/build/esm/public/vite.js +19 -0
  156. package/build/esm/public/vite.js.map +1 -0
  157. package/build/esm/register.js +41 -0
  158. package/build/esm/register.js.map +1 -0
  159. package/build/esm/scss.d.ts +20 -0
  160. package/build/esm/store/ComputeStore.js +269 -0
  161. package/build/esm/store/ComputeStore.js.map +1 -0
  162. package/build/esm/store/ConsoleLogStore.js +289 -0
  163. package/build/esm/store/ConsoleLogStore.js.map +1 -0
  164. package/build/esm/store/MetricsStore.js +428 -0
  165. package/build/esm/store/MetricsStore.js.map +1 -0
  166. package/build/esm/store/MonitorStore.js +288 -0
  167. package/build/esm/store/MonitorStore.js.map +1 -0
  168. package/build/esm/store/SubscribableStore.js +38 -0
  169. package/build/esm/store/SubscribableStore.js.map +1 -0
  170. package/build/esm/store/WindowErrorStore.js +195 -0
  171. package/build/esm/store/WindowErrorStore.js.map +1 -0
  172. package/build/esm/styles.css +19441 -0
  173. package/build/esm/styles.js +31 -0
  174. package/build/esm/styles.js.map +1 -0
  175. package/build/esm/types/compute.js +2 -0
  176. package/build/esm/types/compute.js.map +1 -0
  177. package/build/esm/types/emissions.js +2 -0
  178. package/build/esm/types/emissions.js.map +1 -0
  179. package/build/esm/types/index.js +23 -0
  180. package/build/esm/types/index.js.map +1 -0
  181. package/build/esm/utils/ActionLifecycleTracker.js +178 -0
  182. package/build/esm/utils/ActionLifecycleTracker.js.map +1 -0
  183. package/build/esm/utils/CacheEfficiencyAnalyzer.js +198 -0
  184. package/build/esm/utils/CacheEfficiencyAnalyzer.js.map +1 -0
  185. package/build/esm/utils/CircularBuffer.js +96 -0
  186. package/build/esm/utils/CircularBuffer.js.map +1 -0
  187. package/build/esm/utils/ComponentContextCapture.js +215 -0
  188. package/build/esm/utils/ComponentContextCapture.js.map +1 -0
  189. package/build/esm/utils/ComponentPrimitiveDiscovery.js +173 -0
  190. package/build/esm/utils/ComponentPrimitiveDiscovery.js.map +1 -0
  191. package/build/esm/utils/ComponentQueryRegistry.js +340 -0
  192. package/build/esm/utils/ComponentQueryRegistry.js.map +1 -0
  193. package/build/esm/utils/ComputeMonitor.js +199 -0
  194. package/build/esm/utils/ComputeMonitor.js.map +1 -0
  195. package/build/esm/utils/EventTimeline.js +130 -0
  196. package/build/esm/utils/EventTimeline.js.map +1 -0
  197. package/build/esm/utils/LinkTraversalTracker.js +116 -0
  198. package/build/esm/utils/LinkTraversalTracker.js.map +1 -0
  199. package/build/esm/utils/MockDataGenerator.js +473 -0
  200. package/build/esm/utils/MockDataGenerator.js.map +1 -0
  201. package/build/esm/utils/ObservableClientMonitor.js +768 -0
  202. package/build/esm/utils/ObservableClientMonitor.js.map +1 -0
  203. package/build/esm/utils/PerformanceRecommendationEngine.js +185 -0
  204. package/build/esm/utils/PerformanceRecommendationEngine.js.map +1 -0
  205. package/build/esm/utils/PropertyAccessTracker.js +238 -0
  206. package/build/esm/utils/PropertyAccessTracker.js.map +1 -0
  207. package/build/esm/utils/RecommendationMatcher.js +53 -0
  208. package/build/esm/utils/RecommendationMatcher.js.map +1 -0
  209. package/build/esm/utils/SubscriptionTracker.js +132 -0
  210. package/build/esm/utils/SubscriptionTracker.js.map +1 -0
  211. package/build/esm/utils/UnusedFieldAnalyzer.js +186 -0
  212. package/build/esm/utils/UnusedFieldAnalyzer.js.map +1 -0
  213. package/build/esm/utils/WaterfallDetector.js +200 -0
  214. package/build/esm/utils/WaterfallDetector.js.map +1 -0
  215. package/build/esm/utils/computePayload.js +37 -0
  216. package/build/esm/utils/computePayload.js.map +1 -0
  217. package/build/esm/utils/computeRequest.js +29 -0
  218. package/build/esm/utils/computeRequest.js.map +1 -0
  219. package/build/esm/utils/format.js +69 -0
  220. package/build/esm/utils/format.js.map +1 -0
  221. package/build/esm/utils/logger.js +31 -0
  222. package/build/esm/utils/logger.js.map +1 -0
  223. package/build/esm/vite/constants.js +18 -0
  224. package/build/esm/vite/constants.js.map +1 -0
  225. package/build/esm/vite/hookInstaller.js +99 -0
  226. package/build/esm/vite/hookInstaller.js.map +1 -0
  227. package/build/esm/vite/index.js +77 -0
  228. package/build/esm/vite/index.js.map +1 -0
  229. package/build/types/DevToolsContext.d.ts +3 -0
  230. package/build/types/DevToolsContext.d.ts.map +1 -0
  231. package/build/types/components/ActionMetrics.d.ts +6 -0
  232. package/build/types/components/ActionMetrics.d.ts.map +1 -0
  233. package/build/types/components/BubbleChart.d.ts +10 -0
  234. package/build/types/components/BubbleChart.d.ts.map +1 -0
  235. package/build/types/components/CacheInspectorTab.d.ts +6 -0
  236. package/build/types/components/CacheInspectorTab.d.ts.map +1 -0
  237. package/build/types/components/CacheMetrics.d.ts +6 -0
  238. package/build/types/components/CacheMetrics.d.ts.map +1 -0
  239. package/build/types/components/ComponentCard.d.ts +13 -0
  240. package/build/types/components/ComponentCard.d.ts.map +1 -0
  241. package/build/types/components/ComputeTab.d.ts +6 -0
  242. package/build/types/components/ComputeTab.d.ts.map +1 -0
  243. package/build/types/components/CopyableCodeBlock.d.ts +7 -0
  244. package/build/types/components/CopyableCodeBlock.d.ts.map +1 -0
  245. package/build/types/components/DebuggingTab.d.ts +6 -0
  246. package/build/types/components/DebuggingTab.d.ts.map +1 -0
  247. package/build/types/components/HookRow.d.ts +9 -0
  248. package/build/types/components/HookRow.d.ts.map +1 -0
  249. package/build/types/components/ImprovementsTab.d.ts +7 -0
  250. package/build/types/components/ImprovementsTab.d.ts.map +1 -0
  251. package/build/types/components/InspectorSelectionHeader.d.ts +12 -0
  252. package/build/types/components/InspectorSelectionHeader.d.ts.map +1 -0
  253. package/build/types/components/InterceptTab.d.ts +126 -0
  254. package/build/types/components/InterceptTab.d.ts.map +1 -0
  255. package/build/types/components/IssueCard.d.ts +8 -0
  256. package/build/types/components/IssueCard.d.ts.map +1 -0
  257. package/build/types/components/LogEntryCard.d.ts +7 -0
  258. package/build/types/components/LogEntryCard.d.ts.map +1 -0
  259. package/build/types/components/MockEditor.d.ts +58 -0
  260. package/build/types/components/MockEditor.d.ts.map +1 -0
  261. package/build/types/components/MonitorErrorBoundary.d.ts +16 -0
  262. package/build/types/components/MonitorErrorBoundary.d.ts.map +1 -0
  263. package/build/types/components/MonitoringPanel.d.ts +8 -0
  264. package/build/types/components/MonitoringPanel.d.ts.map +1 -0
  265. package/build/types/components/ObjectLoadingMetrics.d.ts +7 -0
  266. package/build/types/components/ObjectLoadingMetrics.d.ts.map +1 -0
  267. package/build/types/components/OsdkAppErrorBoundary.d.ts +18 -0
  268. package/build/types/components/OsdkAppErrorBoundary.d.ts.map +1 -0
  269. package/build/types/components/OsdkDevTools.d.ts +2 -0
  270. package/build/types/components/OsdkDevTools.d.ts.map +1 -0
  271. package/build/types/components/OverrideEditor.d.ts +26 -0
  272. package/build/types/components/OverrideEditor.d.ts.map +1 -0
  273. package/build/types/components/PerformanceTab.d.ts +8 -0
  274. package/build/types/components/PerformanceTab.d.ts.map +1 -0
  275. package/build/types/components/PrimitiveSelectionPanel.d.ts +28 -0
  276. package/build/types/components/PrimitiveSelectionPanel.d.ts.map +1 -0
  277. package/build/types/components/issueTypes.d.ts +16 -0
  278. package/build/types/components/issueTypes.d.ts.map +1 -0
  279. package/build/types/components/resolveComponentName.d.ts +3 -0
  280. package/build/types/components/resolveComponentName.d.ts.map +1 -0
  281. package/build/types/components/testHelpers.d.ts +2 -0
  282. package/build/types/components/testHelpers.d.ts.map +1 -0
  283. package/build/types/css.d.d.ts +4 -0
  284. package/build/types/css.d.d.ts.map +1 -0
  285. package/build/types/fiber/DegradationNotice.d.ts +8 -0
  286. package/build/types/fiber/DegradationNotice.d.ts.map +1 -0
  287. package/build/types/fiber/DevtoolsHook.d.ts +7 -0
  288. package/build/types/fiber/DevtoolsHook.d.ts.map +1 -0
  289. package/build/types/fiber/FiberAccess.d.ts +2 -0
  290. package/build/types/fiber/FiberAccess.d.ts.map +1 -0
  291. package/build/types/fiber/FiberInspection.d.ts +6 -0
  292. package/build/types/fiber/FiberInspection.d.ts.map +1 -0
  293. package/build/types/fiber/FiberTags.d.ts +33 -0
  294. package/build/types/fiber/FiberTags.d.ts.map +1 -0
  295. package/build/types/fiber/HookStateInspector.d.ts +45 -0
  296. package/build/types/fiber/HookStateInspector.d.ts.map +1 -0
  297. package/build/types/fiber/SafeFiberOperation.d.ts +7 -0
  298. package/build/types/fiber/SafeFiberOperation.d.ts.map +1 -0
  299. package/build/types/fiber/capabilities.d.ts +38 -0
  300. package/build/types/fiber/capabilities.d.ts.map +1 -0
  301. package/build/types/fiber/traverseFiber.d.ts +5 -0
  302. package/build/types/fiber/traverseFiber.d.ts.map +1 -0
  303. package/build/types/fiber/types.d.ts +87 -0
  304. package/build/types/fiber/types.d.ts.map +1 -0
  305. package/build/types/fiber/validation.d.ts +10 -0
  306. package/build/types/fiber/validation.d.ts.map +1 -0
  307. package/build/types/hooks/createPollingStore.d.ts +5 -0
  308. package/build/types/hooks/createPollingStore.d.ts.map +1 -0
  309. package/build/types/hooks/useActiveComponents.d.ts +3 -0
  310. package/build/types/hooks/useActiveComponents.d.ts.map +1 -0
  311. package/build/types/hooks/useComponentRegistry.d.ts +3 -0
  312. package/build/types/hooks/useComponentRegistry.d.ts.map +1 -0
  313. package/build/types/hooks/useComputeSelectors.d.ts +7 -0
  314. package/build/types/hooks/useComputeSelectors.d.ts.map +1 -0
  315. package/build/types/hooks/useConsoleLogs.d.ts +7 -0
  316. package/build/types/hooks/useConsoleLogs.d.ts.map +1 -0
  317. package/build/types/hooks/useInspectorSelection.d.ts +9 -0
  318. package/build/types/hooks/useInspectorSelection.d.ts.map +1 -0
  319. package/build/types/hooks/useMetrics.d.ts +3 -0
  320. package/build/types/hooks/useMetrics.d.ts.map +1 -0
  321. package/build/types/hooks/usePersistedState.d.ts +1 -0
  322. package/build/types/hooks/usePersistedState.d.ts.map +1 -0
  323. package/build/types/hooks/useRecommendations.d.ts +10 -0
  324. package/build/types/hooks/useRecommendations.d.ts.map +1 -0
  325. package/build/types/hooks/useSharedTick.d.ts +1 -0
  326. package/build/types/hooks/useSharedTick.d.ts.map +1 -0
  327. package/build/types/hooks/useTimeElapsed.d.ts +1 -0
  328. package/build/types/hooks/useTimeElapsed.d.ts.map +1 -0
  329. package/build/types/hooks/useTrackerSubscription.d.ts +16 -0
  330. package/build/types/hooks/useTrackerSubscription.d.ts.map +1 -0
  331. package/build/types/hooks/useUnusedFieldAnalysis.d.ts +8 -0
  332. package/build/types/hooks/useUnusedFieldAnalysis.d.ts.map +1 -0
  333. package/build/types/index.d.ts +21 -0
  334. package/build/types/index.d.ts.map +1 -0
  335. package/build/types/inspector/ClickToInspectSystem.d.ts +40 -0
  336. package/build/types/inspector/ClickToInspectSystem.d.ts.map +1 -0
  337. package/build/types/inspector/components/ComponentLabel.d.ts +3 -0
  338. package/build/types/inspector/components/ComponentLabel.d.ts.map +1 -0
  339. package/build/types/inspector/components/InspectorBanner.d.ts +5 -0
  340. package/build/types/inspector/components/InspectorBanner.d.ts.map +1 -0
  341. package/build/types/inspector/components/InspectorOverlay.d.ts +3 -0
  342. package/build/types/inspector/components/InspectorOverlay.d.ts.map +1 -0
  343. package/build/types/inspector/components/SelectionHighlight.d.ts +3 -0
  344. package/build/types/inspector/components/SelectionHighlight.d.ts.map +1 -0
  345. package/build/types/inspector/createClickToInspect.d.ts +3 -0
  346. package/build/types/inspector/createClickToInspect.d.ts.map +1 -0
  347. package/build/types/inspector/hooks/useAnimatedBounds.d.ts +2 -0
  348. package/build/types/inspector/hooks/useAnimatedBounds.d.ts.map +1 -0
  349. package/build/types/inspector/index.d.ts +13 -0
  350. package/build/types/inspector/index.d.ts.map +1 -0
  351. package/build/types/inspector/inspectorController.d.ts +2 -0
  352. package/build/types/inspector/inspectorController.d.ts.map +1 -0
  353. package/build/types/inspector/types.d.ts +94 -0
  354. package/build/types/inspector/types.d.ts.map +1 -0
  355. package/build/types/inspector/utils/elementBounds.d.ts +3 -0
  356. package/build/types/inspector/utils/elementBounds.d.ts.map +1 -0
  357. package/build/types/inspector/utils/interpolation.d.ts +7 -0
  358. package/build/types/inspector/utils/interpolation.d.ts.map +1 -0
  359. package/build/types/inspector/utils/labelPositioning.d.ts +3 -0
  360. package/build/types/inspector/utils/labelPositioning.d.ts.map +1 -0
  361. package/build/types/mocking/MockCacheKeyGenerator.d.ts +41 -0
  362. package/build/types/mocking/MockCacheKeyGenerator.d.ts.map +1 -0
  363. package/build/types/mocking/MockManager.d.ts +103 -0
  364. package/build/types/mocking/MockManager.d.ts.map +1 -0
  365. package/build/types/prototyping/PrototypeOverrideStore.d.ts +33 -0
  366. package/build/types/prototyping/PrototypeOverrideStore.d.ts.map +1 -0
  367. package/build/types/prototyping/index.d.ts +1 -0
  368. package/build/types/prototyping/index.d.ts.map +1 -0
  369. package/build/types/public/vite.d.ts +2 -0
  370. package/build/types/public/vite.d.ts.map +1 -0
  371. package/build/types/register.d.ts +1 -0
  372. package/build/types/register.d.ts.map +1 -0
  373. package/build/types/scss.d.d.ts +6 -0
  374. package/build/types/scss.d.d.ts.map +1 -0
  375. package/build/types/store/ComputeStore.d.ts +47 -0
  376. package/build/types/store/ComputeStore.d.ts.map +1 -0
  377. package/build/types/store/ConsoleLogStore.d.ts +29 -0
  378. package/build/types/store/ConsoleLogStore.d.ts.map +1 -0
  379. package/build/types/store/MetricsStore.d.ts +42 -0
  380. package/build/types/store/MetricsStore.d.ts.map +1 -0
  381. package/build/types/store/MonitorStore.d.ts +86 -0
  382. package/build/types/store/MonitorStore.d.ts.map +1 -0
  383. package/build/types/store/SubscribableStore.d.ts +6 -0
  384. package/build/types/store/SubscribableStore.d.ts.map +1 -0
  385. package/build/types/store/WindowErrorStore.d.ts +32 -0
  386. package/build/types/store/WindowErrorStore.d.ts.map +1 -0
  387. package/build/types/styles.d.ts +1 -0
  388. package/build/types/styles.d.ts.map +1 -0
  389. package/build/types/types/compute.d.ts +73 -0
  390. package/build/types/types/compute.d.ts.map +1 -0
  391. package/build/types/types/emissions.d.ts +24 -0
  392. package/build/types/types/emissions.d.ts.map +1 -0
  393. package/build/types/types/index.d.ts +143 -0
  394. package/build/types/types/index.d.ts.map +1 -0
  395. package/build/types/utils/ActionLifecycleTracker.d.ts +39 -0
  396. package/build/types/utils/ActionLifecycleTracker.d.ts.map +1 -0
  397. package/build/types/utils/CacheEfficiencyAnalyzer.d.ts +45 -0
  398. package/build/types/utils/CacheEfficiencyAnalyzer.d.ts.map +1 -0
  399. package/build/types/utils/CircularBuffer.d.ts +18 -0
  400. package/build/types/utils/CircularBuffer.d.ts.map +1 -0
  401. package/build/types/utils/ComponentContextCapture.d.ts +29 -0
  402. package/build/types/utils/ComponentContextCapture.d.ts.map +1 -0
  403. package/build/types/utils/ComponentPrimitiveDiscovery.d.ts +62 -0
  404. package/build/types/utils/ComponentPrimitiveDiscovery.d.ts.map +1 -0
  405. package/build/types/utils/ComponentQueryRegistry.d.ts +91 -0
  406. package/build/types/utils/ComponentQueryRegistry.d.ts.map +1 -0
  407. package/build/types/utils/ComputeMonitor.d.ts +14 -0
  408. package/build/types/utils/ComputeMonitor.d.ts.map +1 -0
  409. package/build/types/utils/EventTimeline.d.ts +102 -0
  410. package/build/types/utils/EventTimeline.d.ts.map +1 -0
  411. package/build/types/utils/LinkTraversalTracker.d.ts +43 -0
  412. package/build/types/utils/LinkTraversalTracker.d.ts.map +1 -0
  413. package/build/types/utils/MockDataGenerator.d.ts +23 -0
  414. package/build/types/utils/MockDataGenerator.d.ts.map +1 -0
  415. package/build/types/utils/ObservableClientMonitor.d.ts +62 -0
  416. package/build/types/utils/ObservableClientMonitor.d.ts.map +1 -0
  417. package/build/types/utils/PerformanceRecommendationEngine.d.ts +67 -0
  418. package/build/types/utils/PerformanceRecommendationEngine.d.ts.map +1 -0
  419. package/build/types/utils/PropertyAccessTracker.d.ts +50 -0
  420. package/build/types/utils/PropertyAccessTracker.d.ts.map +1 -0
  421. package/build/types/utils/RecommendationMatcher.d.ts +5 -0
  422. package/build/types/utils/RecommendationMatcher.d.ts.map +1 -0
  423. package/build/types/utils/SubscriptionTracker.d.ts +17 -0
  424. package/build/types/utils/SubscriptionTracker.d.ts.map +1 -0
  425. package/build/types/utils/UnusedFieldAnalyzer.d.ts +46 -0
  426. package/build/types/utils/UnusedFieldAnalyzer.d.ts.map +1 -0
  427. package/build/types/utils/WaterfallDetector.d.ts +28 -0
  428. package/build/types/utils/WaterfallDetector.d.ts.map +1 -0
  429. package/build/types/utils/computePayload.d.ts +3 -0
  430. package/build/types/utils/computePayload.d.ts.map +1 -0
  431. package/build/types/utils/computeRequest.d.ts +20 -0
  432. package/build/types/utils/computeRequest.d.ts.map +1 -0
  433. package/build/types/utils/format.d.ts +5 -0
  434. package/build/types/utils/format.d.ts.map +1 -0
  435. package/build/types/utils/logger.d.ts +2 -0
  436. package/build/types/utils/logger.d.ts.map +1 -0
  437. package/build/types/vite/constants.d.ts +1 -0
  438. package/build/types/vite/constants.d.ts.map +1 -0
  439. package/build/types/vite/hookInstaller.d.ts +1 -0
  440. package/build/types/vite/hookInstaller.d.ts.map +1 -0
  441. package/build/types/vite/index.d.ts +20 -0
  442. package/build/types/vite/index.d.ts.map +1 -0
  443. package/package.json +114 -0
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useMemo } from "react";
18
+ import { useComponentRegistry } from "./useComponentRegistry.js";
19
+ export function useActiveComponents(monitorStore) {
20
+ const registry = useComponentRegistry(monitorStore);
21
+ const version = registry.getVersion();
22
+ return useMemo(() => {
23
+ return registry.getActiveComponents();
24
+ // registry version triggers recalculation
25
+ }, [registry, version]);
26
+ }
27
+ //# sourceMappingURL=useActiveComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActiveComponents.js","names":["useMemo","useComponentRegistry","useActiveComponents","monitorStore","registry","version","getVersion","getActiveComponents"],"sources":["useActiveComponents.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMemo } from \"react\";\nimport type { MonitorStore } from \"../store/MonitorStore.js\";\nimport type { ComponentHookBinding } from \"../utils/ComponentQueryRegistry.js\";\nimport { useComponentRegistry } from \"./useComponentRegistry.js\";\n\nexport function useActiveComponents(\n monitorStore: MonitorStore,\n): Map<string, ComponentHookBinding[]> {\n const registry = useComponentRegistry(monitorStore);\n const version = registry.getVersion();\n\n return useMemo(() => {\n return registry.getActiveComponents();\n // registry version triggers recalculation\n }, [registry, version]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,OAAO;AAG/B,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,OAAO,SAASC,mBAAmBA,CACjCC,YAA0B,EACW;EACrC,MAAMC,QAAQ,GAAGH,oBAAoB,CAACE,YAAY,CAAC;EACnD,MAAME,OAAO,GAAGD,QAAQ,CAACE,UAAU,CAAC,CAAC;EAErC,OAAON,OAAO,CAAC,MAAM;IACnB,OAAOI,QAAQ,CAACG,mBAAmB,CAAC,CAAC;IACrC;EACF,CAAC,EAAE,CAACH,QAAQ,EAAEC,OAAO,CAAC,CAAC;AACzB","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ export function useComponentRegistry(monitorStore) {
19
+ const registry = monitorStore.getComponentRegistry();
20
+ const subscribe = React.useCallback(callback => registry.subscribe(callback), [registry]);
21
+ const getSnapshot = React.useCallback(() => registry.getVersion(), [registry]);
22
+ React.useSyncExternalStore(subscribe, getSnapshot);
23
+ return registry;
24
+ }
25
+ //# sourceMappingURL=useComponentRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComponentRegistry.js","names":["React","useComponentRegistry","monitorStore","registry","getComponentRegistry","subscribe","useCallback","callback","getSnapshot","getVersion","useSyncExternalStore"],"sources":["useComponentRegistry.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport type { MonitorStore } from \"../store/MonitorStore.js\";\nimport type { ComponentQueryRegistry } from \"../utils/ComponentQueryRegistry.js\";\n\nexport function useComponentRegistry(\n monitorStore: MonitorStore,\n): ComponentQueryRegistry {\n const registry = monitorStore.getComponentRegistry();\n\n const subscribe = React.useCallback(\n (callback: () => void) => registry.subscribe(callback),\n [registry],\n );\n\n const getSnapshot = React.useCallback(\n () => registry.getVersion(),\n [registry],\n );\n\n React.useSyncExternalStore(subscribe, getSnapshot);\n\n return registry;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAIzB,OAAO,SAASC,oBAAoBA,CAClCC,YAA0B,EACF;EACxB,MAAMC,QAAQ,GAAGD,YAAY,CAACE,oBAAoB,CAAC,CAAC;EAEpD,MAAMC,SAAS,GAAGL,KAAK,CAACM,WAAW,CAChCC,QAAoB,IAAKJ,QAAQ,CAACE,SAAS,CAACE,QAAQ,CAAC,EACtD,CAACJ,QAAQ,CACX,CAAC;EAED,MAAMK,WAAW,GAAGR,KAAK,CAACM,WAAW,CACnC,MAAMH,QAAQ,CAACM,UAAU,CAAC,CAAC,EAC3B,CAACN,QAAQ,CACX,CAAC;EAEDH,KAAK,CAACU,oBAAoB,CAACL,SAAS,EAAEG,WAAW,CAAC;EAElD,OAAOL,QAAQ;AACjB","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useCallback, useSyncExternalStore } from "react";
18
+ export function useComputeMetrics(store) {
19
+ const subscribe = useCallback(callback => store.subscribe(callback), [store]);
20
+ const getSnapshot = useCallback(() => store.getSnapshot().metrics, [store]);
21
+ return useSyncExternalStore(subscribe, getSnapshot);
22
+ }
23
+ export function useComputeRequests(store) {
24
+ const subscribe = useCallback(callback => store.subscribe(callback), [store]);
25
+ const getSnapshot = useCallback(() => store.getSnapshot().requests, [store]);
26
+ return useSyncExternalStore(subscribe, getSnapshot);
27
+ }
28
+ export function useComputeRecording(store) {
29
+ const subscribe = useCallback(callback => store.subscribe(callback), [store]);
30
+ const getSnapshot = useCallback(() => store.getSnapshot().isRecording, [store]);
31
+ return useSyncExternalStore(subscribe, getSnapshot);
32
+ }
33
+ export function useComputeNetworkPaused(store) {
34
+ const subscribe = useCallback(callback => store.subscribe(callback), [store]);
35
+ const getSnapshot = useCallback(() => store.getSnapshot().isNetworkPaused, [store]);
36
+ return useSyncExternalStore(subscribe, getSnapshot);
37
+ }
38
+ export function useComputeLastRecordingEvent(store) {
39
+ const subscribe = useCallback(callback => store.subscribe(callback), [store]);
40
+ const getSnapshot = useCallback(() => store.getSnapshot().lastRecordingEvent, [store]);
41
+ return useSyncExternalStore(subscribe, getSnapshot);
42
+ }
43
+ //# sourceMappingURL=useComputeSelectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComputeSelectors.js","names":["useCallback","useSyncExternalStore","useComputeMetrics","store","subscribe","callback","getSnapshot","metrics","useComputeRequests","requests","useComputeRecording","isRecording","useComputeNetworkPaused","isNetworkPaused","useComputeLastRecordingEvent","lastRecordingEvent"],"sources":["useComputeSelectors.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useSyncExternalStore } from \"react\";\nimport type { ComputeStore } from \"../store/ComputeStore.js\";\nimport type {\n ComputeMetrics,\n ComputeRequest,\n RecordingEvent,\n} from \"../types/compute.js\";\n\nexport function useComputeMetrics(store: ComputeStore): ComputeMetrics {\n const subscribe = useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n const getSnapshot = useCallback(() => store.getSnapshot().metrics, [store]);\n return useSyncExternalStore(subscribe, getSnapshot);\n}\n\nexport function useComputeRequests(\n store: ComputeStore,\n): ReadonlyArray<ComputeRequest> {\n const subscribe = useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n const getSnapshot = useCallback(() => store.getSnapshot().requests, [store]);\n return useSyncExternalStore(subscribe, getSnapshot);\n}\n\nexport function useComputeRecording(store: ComputeStore): boolean {\n const subscribe = useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n const getSnapshot = useCallback(() => store.getSnapshot().isRecording, [\n store,\n ]);\n return useSyncExternalStore(subscribe, getSnapshot);\n}\n\nexport function useComputeNetworkPaused(store: ComputeStore): boolean {\n const subscribe = useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n const getSnapshot = useCallback(\n () => store.getSnapshot().isNetworkPaused,\n [store],\n );\n return useSyncExternalStore(subscribe, getSnapshot);\n}\n\nexport function useComputeLastRecordingEvent(\n store: ComputeStore,\n): RecordingEvent | undefined {\n const subscribe = useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n const getSnapshot = useCallback(\n () => store.getSnapshot().lastRecordingEvent,\n [store],\n );\n return useSyncExternalStore(subscribe, getSnapshot);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AAQzD,OAAO,SAASC,iBAAiBA,CAACC,KAAmB,EAAkB;EACrE,MAAMC,SAAS,GAAGJ,WAAW,CAC1BK,QAAoB,IAAKF,KAAK,CAACC,SAAS,CAACC,QAAQ,CAAC,EACnD,CAACF,KAAK,CACR,CAAC;EACD,MAAMG,WAAW,GAAGN,WAAW,CAAC,MAAMG,KAAK,CAACG,WAAW,CAAC,CAAC,CAACC,OAAO,EAAE,CAACJ,KAAK,CAAC,CAAC;EAC3E,OAAOF,oBAAoB,CAACG,SAAS,EAAEE,WAAW,CAAC;AACrD;AAEA,OAAO,SAASE,kBAAkBA,CAChCL,KAAmB,EACY;EAC/B,MAAMC,SAAS,GAAGJ,WAAW,CAC1BK,QAAoB,IAAKF,KAAK,CAACC,SAAS,CAACC,QAAQ,CAAC,EACnD,CAACF,KAAK,CACR,CAAC;EACD,MAAMG,WAAW,GAAGN,WAAW,CAAC,MAAMG,KAAK,CAACG,WAAW,CAAC,CAAC,CAACG,QAAQ,EAAE,CAACN,KAAK,CAAC,CAAC;EAC5E,OAAOF,oBAAoB,CAACG,SAAS,EAAEE,WAAW,CAAC;AACrD;AAEA,OAAO,SAASI,mBAAmBA,CAACP,KAAmB,EAAW;EAChE,MAAMC,SAAS,GAAGJ,WAAW,CAC1BK,QAAoB,IAAKF,KAAK,CAACC,SAAS,CAACC,QAAQ,CAAC,EACnD,CAACF,KAAK,CACR,CAAC;EACD,MAAMG,WAAW,GAAGN,WAAW,CAAC,MAAMG,KAAK,CAACG,WAAW,CAAC,CAAC,CAACK,WAAW,EAAE,CACrER,KAAK,CACN,CAAC;EACF,OAAOF,oBAAoB,CAACG,SAAS,EAAEE,WAAW,CAAC;AACrD;AAEA,OAAO,SAASM,uBAAuBA,CAACT,KAAmB,EAAW;EACpE,MAAMC,SAAS,GAAGJ,WAAW,CAC1BK,QAAoB,IAAKF,KAAK,CAACC,SAAS,CAACC,QAAQ,CAAC,EACnD,CAACF,KAAK,CACR,CAAC;EACD,MAAMG,WAAW,GAAGN,WAAW,CAC7B,MAAMG,KAAK,CAACG,WAAW,CAAC,CAAC,CAACO,eAAe,EACzC,CAACV,KAAK,CACR,CAAC;EACD,OAAOF,oBAAoB,CAACG,SAAS,EAAEE,WAAW,CAAC;AACrD;AAEA,OAAO,SAASQ,4BAA4BA,CAC1CX,KAAmB,EACS;EAC5B,MAAMC,SAAS,GAAGJ,WAAW,CAC1BK,QAAoB,IAAKF,KAAK,CAACC,SAAS,CAACC,QAAQ,CAAC,EACnD,CAACF,KAAK,CACR,CAAC;EACD,MAAMG,WAAW,GAAGN,WAAW,CAC7B,MAAMG,KAAK,CAACG,WAAW,CAAC,CAAC,CAACS,kBAAkB,EAC5C,CAACZ,KAAK,CACR,CAAC;EACD,OAAOF,oBAAoB,CAACG,SAAS,EAAEE,WAAW,CAAC;AACrD","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ export function useConsoleLogs(monitorStore) {
19
+ const store = monitorStore.getConsoleLogStore();
20
+ const subscribe = React.useCallback(callback => store.subscribe(callback), [store]);
21
+ const cachedRef = React.useRef({
22
+ entries: store.getEntries(),
23
+ count: store.getSize()
24
+ });
25
+ const getSnapshot = React.useCallback(() => {
26
+ const entries = store.getEntries();
27
+ const count = store.getSize();
28
+ const prev = cachedRef.current;
29
+ if (prev.entries === entries && prev.count === count) {
30
+ return prev;
31
+ }
32
+ cachedRef.current = {
33
+ entries,
34
+ count
35
+ };
36
+ return cachedRef.current;
37
+ }, [store]);
38
+ const snapshot = React.useSyncExternalStore(subscribe, getSnapshot);
39
+ const clear = React.useCallback(() => store.clear(), [store]);
40
+ return {
41
+ entries: snapshot.entries,
42
+ count: snapshot.count,
43
+ clear
44
+ };
45
+ }
46
+ //# sourceMappingURL=useConsoleLogs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConsoleLogs.js","names":["React","useConsoleLogs","monitorStore","store","getConsoleLogStore","subscribe","useCallback","callback","cachedRef","useRef","entries","getEntries","count","getSize","getSnapshot","prev","current","snapshot","useSyncExternalStore","clear"],"sources":["useConsoleLogs.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport type { ConsoleLogEntry } from \"../store/ConsoleLogStore.js\";\nimport type { MonitorStore } from \"../store/MonitorStore.js\";\n\ninterface ConsoleLogSnapshot {\n entries: readonly ConsoleLogEntry[];\n count: number;\n}\n\nexport function useConsoleLogs(monitorStore: MonitorStore): {\n entries: readonly ConsoleLogEntry[];\n count: number;\n clear: () => void;\n} {\n const store = monitorStore.getConsoleLogStore();\n\n const subscribe = React.useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n\n const cachedRef = React.useRef<ConsoleLogSnapshot>({\n entries: store.getEntries(),\n count: store.getSize(),\n });\n\n const getSnapshot = React.useCallback(\n (): ConsoleLogSnapshot => {\n const entries = store.getEntries();\n const count = store.getSize();\n const prev = cachedRef.current;\n if (prev.entries === entries && prev.count === count) {\n return prev;\n }\n cachedRef.current = { entries, count };\n return cachedRef.current;\n },\n [store],\n );\n\n const snapshot = React.useSyncExternalStore(subscribe, getSnapshot);\n\n const clear = React.useCallback(() => store.clear(), [store]);\n\n return {\n entries: snapshot.entries,\n count: snapshot.count,\n clear,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AASzB,OAAO,SAASC,cAAcA,CAACC,YAA0B,EAIvD;EACA,MAAMC,KAAK,GAAGD,YAAY,CAACE,kBAAkB,CAAC,CAAC;EAE/C,MAAMC,SAAS,GAAGL,KAAK,CAACM,WAAW,CAChCC,QAAoB,IAAKJ,KAAK,CAACE,SAAS,CAACE,QAAQ,CAAC,EACnD,CAACJ,KAAK,CACR,CAAC;EAED,MAAMK,SAAS,GAAGR,KAAK,CAACS,MAAM,CAAqB;IACjDC,OAAO,EAAEP,KAAK,CAACQ,UAAU,CAAC,CAAC;IAC3BC,KAAK,EAAET,KAAK,CAACU,OAAO,CAAC;EACvB,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGd,KAAK,CAACM,WAAW,CACnC,MAA0B;IACxB,MAAMI,OAAO,GAAGP,KAAK,CAACQ,UAAU,CAAC,CAAC;IAClC,MAAMC,KAAK,GAAGT,KAAK,CAACU,OAAO,CAAC,CAAC;IAC7B,MAAME,IAAI,GAAGP,SAAS,CAACQ,OAAO;IAC9B,IAAID,IAAI,CAACL,OAAO,KAAKA,OAAO,IAAIK,IAAI,CAACH,KAAK,KAAKA,KAAK,EAAE;MACpD,OAAOG,IAAI;IACb;IACAP,SAAS,CAACQ,OAAO,GAAG;MAAEN,OAAO;MAAEE;IAAM,CAAC;IACtC,OAAOJ,SAAS,CAACQ,OAAO;EAC1B,CAAC,EACD,CAACb,KAAK,CACR,CAAC;EAED,MAAMc,QAAQ,GAAGjB,KAAK,CAACkB,oBAAoB,CAACb,SAAS,EAAES,WAAW,CAAC;EAEnE,MAAMK,KAAK,GAAGnB,KAAK,CAACM,WAAW,CAAC,MAAMH,KAAK,CAACgB,KAAK,CAAC,CAAC,EAAE,CAAChB,KAAK,CAAC,CAAC;EAE7D,OAAO;IACLO,OAAO,EAAEO,QAAQ,CAACP,OAAO;IACzBE,KAAK,EAAEK,QAAQ,CAACL,KAAK;IACrBO;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ class InspectorSelectionStore {
19
+ state = {
20
+ isSelectionActive: false,
21
+ discoveredPrimitives: null
22
+ };
23
+ listeners = new Set();
24
+ subscribe(callback) {
25
+ this.listeners.add(callback);
26
+ const handlePrimitivesDiscovered = event => {
27
+ this.state = {
28
+ isSelectionActive: false,
29
+ discoveredPrimitives: event.detail.primitives
30
+ };
31
+ this.notify();
32
+ };
33
+ const handleSelectionModeDeactivated = () => {
34
+ this.state = {
35
+ ...this.state,
36
+ isSelectionActive: false
37
+ };
38
+ this.notify();
39
+ };
40
+ window.addEventListener("primitives-discovered", handlePrimitivesDiscovered);
41
+ window.addEventListener("inspector-deactivated", handleSelectionModeDeactivated);
42
+ return () => {
43
+ this.listeners.delete(callback);
44
+ window.removeEventListener("primitives-discovered", handlePrimitivesDiscovered);
45
+ window.removeEventListener("inspector-deactivated", handleSelectionModeDeactivated);
46
+ };
47
+ }
48
+ getSnapshot() {
49
+ return this.state;
50
+ }
51
+ activateSelection(monitorStore) {
52
+ const clickToInspect = monitorStore.getClickToInspectSystem();
53
+ if (clickToInspect) {
54
+ clickToInspect.activate();
55
+ this.state = {
56
+ isSelectionActive: true,
57
+ discoveredPrimitives: null
58
+ };
59
+ this.notify();
60
+ }
61
+ }
62
+ clearDiscoveredPrimitives() {
63
+ this.state = {
64
+ ...this.state,
65
+ discoveredPrimitives: null
66
+ };
67
+ this.notify();
68
+ }
69
+ notify() {
70
+ for (const listener of this.listeners) {
71
+ listener();
72
+ }
73
+ }
74
+ }
75
+ export function useInspectorSelection(monitorStore) {
76
+ const storeRef = React.useRef(null);
77
+ if (storeRef.current == null) {
78
+ storeRef.current = new InspectorSelectionStore();
79
+ }
80
+ const store = storeRef.current;
81
+ const subscribe = React.useCallback(callback => store.subscribe(callback), [store]);
82
+ const getSnapshot = React.useCallback(() => store.getSnapshot(), [store]);
83
+ const snapshot = React.useSyncExternalStore(subscribe, getSnapshot);
84
+ const activateSelection = React.useCallback(() => store.activateSelection(monitorStore), [store, monitorStore]);
85
+ const clearDiscoveredPrimitives = React.useCallback(() => store.clearDiscoveredPrimitives(), [store]);
86
+ return {
87
+ isSelectionActive: snapshot.isSelectionActive,
88
+ discoveredPrimitives: snapshot.discoveredPrimitives,
89
+ activateSelection,
90
+ clearDiscoveredPrimitives
91
+ };
92
+ }
93
+ //# sourceMappingURL=useInspectorSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInspectorSelection.js","names":["React","InspectorSelectionStore","state","isSelectionActive","discoveredPrimitives","listeners","Set","subscribe","callback","add","handlePrimitivesDiscovered","event","detail","primitives","notify","handleSelectionModeDeactivated","window","addEventListener","delete","removeEventListener","getSnapshot","activateSelection","monitorStore","clickToInspect","getClickToInspectSystem","activate","clearDiscoveredPrimitives","listener","useInspectorSelection","storeRef","useRef","current","store","useCallback","snapshot","useSyncExternalStore"],"sources":["useInspectorSelection.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport type { MonitorStore } from \"../store/MonitorStore.js\";\nimport type { DiscoveredPrimitives } from \"../utils/ComponentPrimitiveDiscovery.js\";\n\nexport interface InspectorSelectionState {\n isSelectionActive: boolean;\n discoveredPrimitives: DiscoveredPrimitives | null;\n activateSelection: () => void;\n clearDiscoveredPrimitives: () => void;\n}\n\ninterface InspectorSelectionSnapshot {\n isSelectionActive: boolean;\n discoveredPrimitives: DiscoveredPrimitives | null;\n}\n\nclass InspectorSelectionStore {\n private state: InspectorSelectionSnapshot = {\n isSelectionActive: false,\n discoveredPrimitives: null,\n };\n private listeners = new Set<() => void>();\n\n subscribe(callback: () => void): () => void {\n this.listeners.add(callback);\n\n const handlePrimitivesDiscovered = (event: Event) => {\n const customEvent = event as CustomEvent<{\n componentId: string;\n primitives: DiscoveredPrimitives;\n }>;\n this.state = {\n isSelectionActive: false,\n discoveredPrimitives: customEvent.detail.primitives,\n };\n this.notify();\n };\n\n const handleSelectionModeDeactivated = () => {\n this.state = {\n ...this.state,\n isSelectionActive: false,\n };\n this.notify();\n };\n\n window.addEventListener(\n \"primitives-discovered\",\n handlePrimitivesDiscovered,\n );\n window.addEventListener(\n \"inspector-deactivated\",\n handleSelectionModeDeactivated,\n );\n\n return () => {\n this.listeners.delete(callback);\n window.removeEventListener(\n \"primitives-discovered\",\n handlePrimitivesDiscovered,\n );\n window.removeEventListener(\n \"inspector-deactivated\",\n handleSelectionModeDeactivated,\n );\n };\n }\n\n getSnapshot(): InspectorSelectionSnapshot {\n return this.state;\n }\n\n activateSelection(monitorStore: MonitorStore): void {\n const clickToInspect = monitorStore.getClickToInspectSystem();\n if (clickToInspect) {\n clickToInspect.activate();\n this.state = {\n isSelectionActive: true,\n discoveredPrimitives: null,\n };\n this.notify();\n }\n }\n\n clearDiscoveredPrimitives(): void {\n this.state = {\n ...this.state,\n discoveredPrimitives: null,\n };\n this.notify();\n }\n\n private notify(): void {\n for (const listener of this.listeners) {\n listener();\n }\n }\n}\n\nexport function useInspectorSelection(\n monitorStore: MonitorStore,\n): InspectorSelectionState {\n const storeRef = React.useRef<InspectorSelectionStore | null>(null);\n\n if (storeRef.current == null) {\n storeRef.current = new InspectorSelectionStore();\n }\n\n const store = storeRef.current;\n\n const subscribe = React.useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n\n const getSnapshot = React.useCallback(\n () => store.getSnapshot(),\n [store],\n );\n\n const snapshot = React.useSyncExternalStore(subscribe, getSnapshot);\n\n const activateSelection = React.useCallback(\n () => store.activateSelection(monitorStore),\n [store, monitorStore],\n );\n\n const clearDiscoveredPrimitives = React.useCallback(\n () => store.clearDiscoveredPrimitives(),\n [store],\n );\n\n return {\n isSelectionActive: snapshot.isSelectionActive,\n discoveredPrimitives: snapshot.discoveredPrimitives,\n activateSelection,\n clearDiscoveredPrimitives,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAgBzB,MAAMC,uBAAuB,CAAC;EACpBC,KAAK,GAA+B;IAC1CC,iBAAiB,EAAE,KAAK;IACxBC,oBAAoB,EAAE;EACxB,CAAC;EACOC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;EAEzCC,SAASA,CAACC,QAAoB,EAAc;IAC1C,IAAI,CAACH,SAAS,CAACI,GAAG,CAACD,QAAQ,CAAC;IAE5B,MAAME,0BAA0B,GAAIC,KAAY,IAAK;MAKnD,IAAI,CAACT,KAAK,GAAG;QACXC,iBAAiB,EAAE,KAAK;QACxBC,oBAAoB,EANFO,KAAK,CAMWC,MAAM,CAACC;MAC3C,CAAC;MACD,IAAI,CAACC,MAAM,CAAC,CAAC;IACf,CAAC;IAED,MAAMC,8BAA8B,GAAGA,CAAA,KAAM;MAC3C,IAAI,CAACb,KAAK,GAAG;QACX,GAAG,IAAI,CAACA,KAAK;QACbC,iBAAiB,EAAE;MACrB,CAAC;MACD,IAAI,CAACW,MAAM,CAAC,CAAC;IACf,CAAC;IAEDE,MAAM,CAACC,gBAAgB,CACrB,uBAAuB,EACvBP,0BACF,CAAC;IACDM,MAAM,CAACC,gBAAgB,CACrB,uBAAuB,EACvBF,8BACF,CAAC;IAED,OAAO,MAAM;MACX,IAAI,CAACV,SAAS,CAACa,MAAM,CAACV,QAAQ,CAAC;MAC/BQ,MAAM,CAACG,mBAAmB,CACxB,uBAAuB,EACvBT,0BACF,CAAC;MACDM,MAAM,CAACG,mBAAmB,CACxB,uBAAuB,EACvBJ,8BACF,CAAC;IACH,CAAC;EACH;EAEAK,WAAWA,CAAA,E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S,EAAEa,WAAW,CAAC;EAEnE,MAAMC,iBAAiB,GAAGrB,KAAK,CAACiC,WAAW,CACzC,MAAMD,KAAK,CAACX,iBAAiB,CAACC,YAAY,CAAC,EAC3C,CAACU,KAAK,EAAEV,YAAY,CACtB,CAAC;EAED,MAAMI,yBAAyB,GAAG1B,KAAK,CAACiC,WAAW,CACjD,MAAMD,KAAK,CAACN,yBAAyB,CAAC,CAAC,EACvC,CAACM,KAAK,CACR,CAAC;EAED,OAAO;IACL7B,iBAAiB,EAAE+B,QAAQ,CAAC/B,iBAAiB;IAC7CC,oBAAoB,EAAE8B,QAAQ,CAAC9B,oBAAoB;IACnDiB,iBAAiB;IACjBK;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useCallback, useSyncExternalStore } from "react";
18
+ export function useMetrics(store) {
19
+ const subscribe = useCallback(callback => store.subscribe(callback), [store]);
20
+ const getSnapshot = useCallback(() => store.getSnapshot(), [store]);
21
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
22
+ }
23
+ //# sourceMappingURL=useMetrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMetrics.js","names":["useCallback","useSyncExternalStore","useMetrics","store","subscribe","callback","getSnapshot"],"sources":["useMetrics.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useSyncExternalStore } from \"react\";\nimport type { MetricsStore } from \"../store/MetricsStore.js\";\nimport type { MetricsSnapshot } from \"../types/index.js\";\n\nexport function useMetrics(store: MetricsStore): MetricsSnapshot {\n const subscribe = useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n const getSnapshot = useCallback(\n () => store.getSnapshot(),\n [store],\n );\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AAIzD,OAAO,SAASC,UAAUA,CAACC,KAAmB,EAAmB;EAC/D,MAAMC,SAAS,GAAGJ,WAAW,CAC1BK,QAAoB,IAAKF,KAAK,CAACC,SAAS,CAACC,QAAQ,CAAC,EACnD,CAACF,KAAK,CACR,CAAC;EACD,MAAMG,WAAW,GAAGN,WAAW,CAC7B,MAAMG,KAAK,CAACG,WAAW,CAAC,CAAC,EACzB,CAACH,KAAK,CACR,CAAC;EACD,OAAOF,oBAAoB,CAACG,SAAS,EAAEE,WAAW,EAAEA,WAAW,CAAC;AAClE","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ function readFromStorage(key, defaultValue) {
19
+ if (typeof window === "undefined") {
20
+ return defaultValue;
21
+ }
22
+ try {
23
+ const stored = localStorage.getItem(key);
24
+ return stored ? JSON.parse(stored) : defaultValue;
25
+ } catch {
26
+ return defaultValue;
27
+ }
28
+ }
29
+ export function usePersistedState(key, defaultValue) {
30
+ const storeRef = React.useRef(null);
31
+ if (storeRef.current == null || storeRef.current.key !== key) {
32
+ storeRef.current = {
33
+ key,
34
+ value: readFromStorage(key, defaultValue),
35
+ listeners: storeRef.current?.listeners ?? new Set()
36
+ };
37
+ }
38
+ const subscribe = React.useCallback(callback => {
39
+ const store = storeRef.current;
40
+ if (store == null) {
41
+ return () => {};
42
+ }
43
+ store.listeners.add(callback);
44
+ const handleStorageChange = e => {
45
+ if (e.key === key && e.newValue && store != null) {
46
+ try {
47
+ store.value = JSON.parse(e.newValue);
48
+ for (const listener of store.listeners) {
49
+ listener();
50
+ }
51
+ } catch {}
52
+ }
53
+ };
54
+ if (typeof window !== "undefined") {
55
+ window.addEventListener("storage", handleStorageChange);
56
+ }
57
+ return () => {
58
+ store.listeners.delete(callback);
59
+ if (typeof window !== "undefined") {
60
+ window.removeEventListener("storage", handleStorageChange);
61
+ }
62
+ };
63
+ }, [key]);
64
+ const getSnapshot = React.useCallback(() => {
65
+ if (storeRef.current == null) {
66
+ return defaultValue;
67
+ }
68
+ return storeRef.current.value;
69
+ }, [defaultValue]);
70
+ const value = React.useSyncExternalStore(subscribe, getSnapshot);
71
+ const setPersistedValue = React.useCallback(newValue => {
72
+ const store = storeRef.current;
73
+ if (store == null) {
74
+ return;
75
+ }
76
+ const resolvedValue = typeof newValue === "function" ? newValue(store.value) : newValue;
77
+ store.value = resolvedValue;
78
+ if (typeof window !== "undefined") {
79
+ try {
80
+ localStorage.setItem(key, JSON.stringify(resolvedValue));
81
+ } catch {}
82
+ }
83
+ for (const listener of store.listeners) {
84
+ listener();
85
+ }
86
+ }, [key]);
87
+ return [value, setPersistedValue];
88
+ }
89
+ //# sourceMappingURL=usePersistedState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePersistedState.js","names":["React","readFromStorage","key","defaultValue","window","stored","localStorage","getItem","JSON","parse","usePersistedState","storeRef","useRef","current","value","listeners","Set","subscribe","useCallback","callback","store","add","handleStorageChange","e","newValue","listener","addEventListener","delete","removeEventListener","getSnapshot","useSyncExternalStore","setPersistedValue","resolvedValue","setItem","stringify"],"sources":["usePersistedState.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nfunction readFromStorage<T>(key: string, defaultValue: T): T {\n if (typeof window === \"undefined\") {\n return defaultValue;\n }\n\n try {\n const stored = localStorage.getItem(key);\n return stored ? JSON.parse(stored) : defaultValue;\n } catch {\n return defaultValue;\n }\n}\n\nexport function usePersistedState<T>(\n key: string,\n defaultValue: T,\n): [T, (value: T | ((prev: T) => T)) => void] {\n const storeRef = React.useRef<\n {\n key: string;\n value: T;\n listeners: Set<() => void>;\n } | null\n >(null);\n\n if (storeRef.current == null || storeRef.current.key !== key) {\n storeRef.current = {\n key,\n value: readFromStorage(key, defaultValue),\n listeners: storeRef.current?.listeners ?? new Set(),\n };\n }\n\n const subscribe = React.useCallback(\n (callback: () => void) => {\n const store = storeRef.current;\n if (store == null) {\n return () => {};\n }\n store.listeners.add(callback);\n\n const handleStorageChange = (e: StorageEvent) => {\n if (e.key === key && e.newValue && store != null) {\n try {\n store.value = JSON.parse(e.newValue);\n for (const listener of store.listeners) {\n listener();\n }\n } catch {\n }\n }\n };\n\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"storage\", handleStorageChange);\n }\n\n return () => {\n store.listeners.delete(callback);\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"storage\", handleStorageChange);\n }\n };\n },\n [key],\n );\n\n const getSnapshot = React.useCallback(\n (): T => {\n if (storeRef.current == null) {\n return defaultValue;\n }\n return storeRef.current.value;\n },\n [defaultValue],\n );\n\n const value = React.useSyncExternalStore(subscribe, getSnapshot);\n\n const setPersistedValue = React.useCallback(\n (newValue: T | ((prev: T) => T)) => {\n const store = storeRef.current;\n if (store == null) {\n return;\n }\n\n const resolvedValue = typeof newValue === \"function\"\n ? (newValue as (prev: T) => T)(store.value)\n : newValue;\n\n store.value = resolvedValue;\n\n if (typeof window !== \"undefined\") {\n try {\n localStorage.setItem(key, JSON.stringify(resolvedValue));\n } catch {\n }\n }\n\n for (const listener of store.listeners) {\n listener();\n }\n },\n [key],\n );\n\n return [value, setPersistedValue];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,eAAeA,CAAIC,GAAW,EAAEC,YAAe,EAAK;EAC3D,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,OAAOD,YAAY;EACrB;EAEA,IAAI;IACF,MAAME,MAAM,GAAGC,YAAY,CAACC,OAAO,CAACL,GAAG,CAAC;IACxC,OAAOG,MAAM,GAAGG,IAAI,CAACC,KAAK,CAACJ,MAAM,CAAC,GAAGF,YAAY;EACnD,CAAC,CAAC,MAAM;IACN,OAAOA,YAAY;EACrB;AACF;AAEA,OAAO,SAASO,iBAAiBA,CAC/BR,GAAW,EACXC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ACjCA,MAAM,CAACwB,mBAAmB,CAAC,SAAS,EAAEN,mBAAmB,CAAC;MAC5D;IACF,CAAC;EACH,CAAC,EACD,CAACpB,GAAG,CACN,CAAC;EAED,MAAM2B,WAAW,GAAG7B,KAAK,CAACkB,WAAW,CACnC,MAAS;IACP,IAAIP,QAAQ,CAACE,OAAO,IAAI,IAAI,EAAE;MAC5B,OAAOV,YAAY;IACrB;IACA,OAAOQ,QAAQ,CAACE,OAAO,CAACC,KAAK;EAC/B,CAAC,EACD,CAACX,YAAY,CACf,CAAC;EAED,MAAMW,KAAK,GAAGd,KAAK,CAAC8B,oBAAoB,CAACb,SAAS,EAAEY,WAAW,CAAC;EAEhE,MAAME,iBAAiB,GAAG/B,KAAK,CAACkB,WAAW,CACxCM,QAA8B,IAAK;IAClC,MAAMJ,KAAK,GAAGT,QAAQ,CAACE,OAAO;IAC9B,IAAIO,KAAK,IAAI,IAAI,EAAE;MACjB;IACF;IAEA,MAAMY,aAAa,GAAG,OAAOR,QAAQ,KAAK,UAAU,GAC/CA,QAAQ,CAAoBJ,KAAK,CAACN,KAAK,CAAC,GACzCU,QAAQ;IAEZJ,KAAK,CAACN,KAAK,GAAGkB,aAAa;IAE3B,IAAI,OAAO5B,MAAM,KAAK,WAAW,EAAE;MACjC,IAAI;QACFE,YAAY,CAAC2B,OAAO,CAAC/B,GAAG,EAAEM,IAAI,CAAC0B,SAAS,CAACF,aAAa,CAAC,CAAC;MAC1D,CAAC,CAAC,MAAM,CACR;IACF;IAEA,KAAK,MAAMP,QAAQ,IAAIL,KAAK,CAACL,SAAS,EAAE;MACtCU,QAAQ,CAAC,CAAC;IACZ;EACF,CAAC,EACD,CAACvB,GAAG,CACN,CAAC;EAED,OAAO,CAACY,KAAK,EAAEiB,iBAAiB,CAAC;AACnC","ignoreList":[]}
@@ -0,0 +1,123 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ class RecommendationsStore {
19
+ state = {
20
+ recommendations: [],
21
+ isLoading: true,
22
+ error: null
23
+ };
24
+ listeners = new Set();
25
+ constructor(monitorStore) {
26
+ this.monitorStore = monitorStore;
27
+ }
28
+ subscribe(callback) {
29
+ this.listeners.add(callback);
30
+ if (this.listeners.size === 1) {
31
+ setTimeout(() => void this.refresh(), 0);
32
+ const metricsStore = this.monitorStore.getMetricsStore();
33
+ this.unsubscribeMetrics = metricsStore.subscribe(() => {
34
+ clearTimeout(this.debounceTimeout);
35
+ this.debounceTimeout = setTimeout(() => {
36
+ void this.refresh();
37
+ }, 1000);
38
+ });
39
+ }
40
+ return () => {
41
+ this.listeners.delete(callback);
42
+ if (this.listeners.size === 0) {
43
+ if (this.unsubscribeMetrics) {
44
+ this.unsubscribeMetrics();
45
+ this.unsubscribeMetrics = undefined;
46
+ }
47
+ clearTimeout(this.debounceTimeout);
48
+ }
49
+ };
50
+ }
51
+ getSnapshot() {
52
+ return this.state;
53
+ }
54
+ async refresh() {
55
+ this.state = {
56
+ ...this.state,
57
+ isLoading: true,
58
+ error: null
59
+ };
60
+ this.notify();
61
+ try {
62
+ const engine = this.monitorStore.getRecommendationEngine();
63
+ const snapshot = await this.monitorStore.getCacheSnapshot();
64
+ const freshRecommendations = engine.generateRecommendations(snapshot);
65
+ const merged = new Map();
66
+ for (const rec of this.state.recommendations) {
67
+ merged.set(rec.id, rec);
68
+ }
69
+ for (const rec of freshRecommendations) {
70
+ merged.set(rec.id, rec);
71
+ }
72
+ this.state = {
73
+ recommendations: Array.from(merged.values()),
74
+ isLoading: false,
75
+ error: null
76
+ };
77
+ this.notify();
78
+ } catch (e) {
79
+ this.state = {
80
+ ...this.state,
81
+ isLoading: false,
82
+ error: e instanceof Error ? e : new Error(String(e))
83
+ };
84
+ this.notify();
85
+ }
86
+ }
87
+ dismiss(id) {
88
+ const engine = this.monitorStore.getRecommendationEngine();
89
+ engine.dismissRecommendation(id);
90
+ this.state = {
91
+ ...this.state,
92
+ recommendations: this.state.recommendations.filter(r => r.id !== id)
93
+ };
94
+ this.notify();
95
+ }
96
+ notify() {
97
+ for (const listener of this.listeners) {
98
+ listener();
99
+ }
100
+ }
101
+ }
102
+ export function useRecommendations(monitorStore) {
103
+ const storeRef = React.useRef(null);
104
+ if (storeRef.current == null) {
105
+ storeRef.current = new RecommendationsStore(monitorStore);
106
+ }
107
+ const store = storeRef.current;
108
+ const subscribe = React.useCallback(callback => store.subscribe(callback), [store]);
109
+ const getSnapshot = React.useCallback(() => store.getSnapshot(), [store]);
110
+ const state = React.useSyncExternalStore(subscribe, getSnapshot);
111
+ const refresh = React.useCallback(() => {
112
+ void store.refresh();
113
+ }, [store]);
114
+ const dismiss = React.useCallback(id => store.dismiss(id), [store]);
115
+ return {
116
+ recommendations: state.recommendations,
117
+ isLoading: state.isLoading,
118
+ error: state.error,
119
+ refresh,
120
+ dismiss
121
+ };
122
+ }
123
+ //# sourceMappingURL=useRecommendations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRecommendations.js","names":["React","RecommendationsStore","state","recommendations","isLoading","error","listeners","Set","constructor","monitorStore","subscribe","callback","add","size","setTimeout","refresh","metricsStore","getMetricsStore","unsubscribeMetrics","clearTimeout","debounceTimeout","delete","undefined","getSnapshot","notify","engine","getRecommendationEngine","snapshot","getCacheSnapshot","freshRecommendations","generateRecommendations","merged","Map","rec","set","id","Array","from","values","e","Error","String","dismiss","dismissRecommendation","filter","r","listener","useRecommendations","storeRef","useRef","current","store","useCallback","useSyncExternalStore"],"sources":["useRecommendations.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport type { MonitorStore } from \"../store/MonitorStore.js\";\nimport type { Recommendation } from \"../utils/PerformanceRecommendationEngine.js\";\n\nexport interface RecommendationsState {\n recommendations: Recommendation[];\n isLoading: boolean;\n error: Error | null;\n refresh: () => void;\n dismiss: (id: string) => void;\n}\n\ninterface RecommendationsInternalState {\n recommendations: Recommendation[];\n isLoading: boolean;\n error: Error | null;\n}\n\nclass RecommendationsStore {\n private state: RecommendationsInternalState = {\n recommendations: [],\n isLoading: true,\n error: null,\n };\n private listeners = new Set<() => void>();\n private unsubscribeMetrics: (() => void) | undefined;\n private debounceTimeout: ReturnType<typeof setTimeout> | undefined;\n\n constructor(private readonly monitorStore: MonitorStore) {}\n\n subscribe(callback: () => void): () => void {\n this.listeners.add(callback);\n\n if (this.listeners.size === 1) {\n setTimeout(() => void this.refresh(), 0);\n const metricsStore = this.monitorStore.getMetricsStore();\n this.unsubscribeMetrics = metricsStore.subscribe(() => {\n clearTimeout(this.debounceTimeout);\n this.debounceTimeout = setTimeout(() => {\n void this.refresh();\n }, 1000);\n });\n }\n\n return () => {\n this.listeners.delete(callback);\n if (this.listeners.size === 0) {\n if (this.unsubscribeMetrics) {\n this.unsubscribeMetrics();\n this.unsubscribeMetrics = undefined;\n }\n clearTimeout(this.debounceTimeout);\n }\n };\n }\n\n getSnapshot(): RecommendationsInternalState {\n return this.state;\n }\n\n async refresh(): Promise<void> {\n this.state = { ...this.state, isLoading: true, error: null };\n this.notify();\n try {\n const engine = this.monitorStore.getRecommendationEngine();\n const snapshot = await this.monitorStore.getCacheSnapshot();\n const freshRecommendations = engine.generateRecommendations(snapshot);\n const merged = new Map<string, Recommendation>();\n for (const rec of this.state.recommendations) {\n merged.set(rec.id, rec);\n }\n for (const rec of freshRecommendations) {\n merged.set(rec.id, rec);\n }\n this.state = {\n recommendations: Array.from(merged.values()),\n isLoading: false,\n error: null,\n };\n this.notify();\n } catch (e) {\n this.state = {\n ...this.state,\n isLoading: false,\n error: e instanceof Error ? e : new Error(String(e)),\n };\n this.notify();\n }\n }\n\n dismiss(id: string): void {\n const engine = this.monitorStore.getRecommendationEngine();\n engine.dismissRecommendation(id);\n this.state = {\n ...this.state,\n recommendations: this.state.recommendations.filter((r) => r.id !== id),\n };\n this.notify();\n }\n\n private notify(): void {\n for (const listener of this.listeners) {\n listener();\n }\n }\n}\n\nexport function useRecommendations(\n monitorStore: MonitorStore,\n): RecommendationsState {\n const storeRef = React.useRef<RecommendationsStore | null>(null);\n\n if (storeRef.current == null) {\n storeRef.current = new RecommendationsStore(monitorStore);\n }\n\n const store = storeRef.current;\n\n const subscribe = React.useCallback(\n (callback: () => void) => store.subscribe(callback),\n [store],\n );\n\n const getSnapshot = React.useCallback(\n () => store.getSnapshot(),\n [store],\n );\n\n const state = React.useSyncExternalStore(subscribe, getSnapshot);\n\n const refresh = React.useCallback(\n () => {\n void store.refresh();\n },\n [store],\n );\n\n const dismiss = React.useCallback(\n (id: string) => store.dismiss(id),\n [store],\n );\n\n return {\n recommendations: state.recommendations,\n isLoading: state.isLoading,\n error: state.error,\n refresh,\n dismiss,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAkBzB,MAAMC,oBAAoB,CAAC;EACjBC,KAAK,GAAiC;IAC5CC,eAAe,EAAE,EAAE;IACnBC,SAAS,EAAE,IAAI;IACfC,KAA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ACP,EAAE,CAAC,EACjC,CAACgB,KAAK,CACR,CAAC;EAED,OAAO;IACLhD,eAAe,EAAED,KAAK,CAACC,eAAe;IACtCC,SAAS,EAAEF,KAAK,CAACE,SAAS;IAC1BC,KAAK,EAAEH,KAAK,CAACG,KAAK;IAClBU,OAAO;IACP2B;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ const tickListeners = new Set();
19
+ let tickInterval = null;
20
+ let tickVersion = 0;
21
+ function startTick() {
22
+ if (!tickInterval) {
23
+ tickInterval = setInterval(() => {
24
+ tickVersion++;
25
+ tickListeners.forEach(fn => fn());
26
+ }, 1000);
27
+ }
28
+ }
29
+ function stopTick() {
30
+ if (tickListeners.size === 0 && tickInterval) {
31
+ clearInterval(tickInterval);
32
+ tickInterval = null;
33
+ }
34
+ }
35
+ function subscribeTick(callback) {
36
+ tickListeners.add(callback);
37
+ startTick();
38
+ return () => {
39
+ tickListeners.delete(callback);
40
+ stopTick();
41
+ };
42
+ }
43
+ function getTickSnapshot() {
44
+ return tickVersion;
45
+ }
46
+ export function useSharedTick() {
47
+ return React.useSyncExternalStore(subscribeTick, getTickSnapshot);
48
+ }
49
+ //# sourceMappingURL=useSharedTick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSharedTick.js","names":["React","tickListeners","Set","tickInterval","tickVersion","startTick","setInterval","forEach","fn","stopTick","size","clearInterval","subscribeTick","callback","add","delete","getTickSnapshot","useSharedTick","useSyncExternalStore"],"sources":["useSharedTick.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\nconst tickListeners = new Set<() => void>();\nlet tickInterval: ReturnType<typeof setInterval> | null = null;\nlet tickVersion = 0;\n\nfunction startTick() {\n if (!tickInterval) {\n tickInterval = setInterval(() => {\n tickVersion++;\n tickListeners.forEach(fn => fn());\n }, 1000);\n }\n}\n\nfunction stopTick() {\n if (tickListeners.size === 0 && tickInterval) {\n clearInterval(tickInterval);\n tickInterval = null;\n }\n}\n\nfunction subscribeTick(callback: () => void): () => void {\n tickListeners.add(callback);\n startTick();\n return () => {\n tickListeners.delete(callback);\n stopTick();\n };\n}\n\nfunction getTickSnapshot(): number {\n return tickVersion;\n}\n\nexport function useSharedTick(): number {\n return React.useSyncExternalStore(subscribeTick, getTickSnapshot);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAa,CAAC;AAC3C,IAAIC,YAAmD,GAAG,IAAI;AAC9D,IAAIC,WAAW,GAAG,CAAC;AAEnB,SAASC,SAASA,CAAA,EAAG;EACnB,IAAI,CAACF,YAAY,EAAE;IACjBA,YAAY,GAAGG,WAAW,CAAC,MAAM;MAC/BF,WAAW,EAAE;MACbH,aAAa,CAACM,OAAO,CAACC,EAAE,IAAIA,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC,EAAE,IAAI,CAAC;EACV;AACF;AAEA,SAASC,QAAQA,CAAA,EAAG;EAClB,IAAIR,aAAa,CAACS,IAAI,KAAK,CAAC,IAAIP,YAAY,EAAE;IAC5CQ,aAAa,CAACR,YAAY,CAAC;IAC3BA,YAAY,GAAG,IAAI;EACrB;AACF;AAEA,SAASS,aAAaA,CAACC,QAAoB,EAAc;EACvDZ,aAAa,CAACa,GAAG,CAACD,QAAQ,CAAC;EAC3BR,SAAS,CAAC,CAAC;EACX,OAAO,MAAM;IACXJ,aAAa,CAACc,MAAM,CAACF,QAAQ,CAAC;IAC9BJ,QAAQ,CAAC,CAAC;EACZ,CAAC;AACH;AAEA,SAASO,eAAeA,CAAA,EAAW;EACjC,OAAOZ,WAAW;AACpB;AAEA,OAAO,SAASa,aAAaA,CAAA,EAAW;EACtC,OAAOjB,KAAK,CAACkB,oBAAoB,CAACN,aAAa,EAAEI,eAAe,CAAC;AACnE","ignoreList":[]}