@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,72 @@
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
+ function stripTranslateFromTransform(element) {
18
+ const computedStyle = window.getComputedStyle(element);
19
+ const transform = computedStyle.transform;
20
+ if (!transform || transform === "none") {
21
+ return "";
22
+ }
23
+ const matrixMatch = transform.match(/matrix\(([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*[^,]+,\s*[^)]+\)/);
24
+ if (matrixMatch) {
25
+ const [, a, b, c, d] = matrixMatch;
26
+ if (a === "1" && b === "0" && c === "0" && d === "1") {
27
+ return "";
28
+ }
29
+ return `matrix(${a}, ${b}, ${c}, ${d}, 0, 0)`;
30
+ }
31
+ const matrix3dMatch = transform.match(/matrix3d\(([^)]+)\)/);
32
+ if (matrix3dMatch) {
33
+ const values = matrix3dMatch[1].split(",").map(v => v.trim());
34
+ if (values.length === 16) {
35
+ values[12] = "0";
36
+ values[13] = "0";
37
+ values[14] = "0";
38
+ return `matrix3d(${values.join(", ")})`;
39
+ }
40
+ }
41
+ return "";
42
+ }
43
+ export function createElementBounds(element) {
44
+ const boundingRect = element.getBoundingClientRect();
45
+ const computedStyle = window.getComputedStyle(element);
46
+ return {
47
+ x: boundingRect.left,
48
+ y: boundingRect.top,
49
+ width: boundingRect.width,
50
+ height: boundingRect.height,
51
+ borderRadius: computedStyle.borderRadius || "0px",
52
+ transform: stripTranslateFromTransform(element)
53
+ };
54
+ }
55
+ export function getElementAtPosition(clientX, clientY, ignoreSelector) {
56
+ const elementsAtPoint = document.elementsFromPoint(clientX, clientY);
57
+ for (const element of elementsAtPoint) {
58
+ if (ignoreSelector && element.matches(ignoreSelector)) {
59
+ continue;
60
+ }
61
+ if (element.hasAttribute("data-osdk-devtools-ignore")) {
62
+ continue;
63
+ }
64
+ const tagName = element.tagName.toLowerCase();
65
+ if (tagName === "script" || tagName === "style" || tagName === "link" || tagName === "meta" || tagName === "head" || tagName === "html") {
66
+ continue;
67
+ }
68
+ return element;
69
+ }
70
+ return null;
71
+ }
72
+ //# sourceMappingURL=elementBounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elementBounds.js","names":["stripTranslateFromTransform","element","computedStyle","window","getComputedStyle","transform","matrixMatch","match","a","b","c","d","matrix3dMatch","values","split","map","v","trim","length","join","createElementBounds","boundingRect","getBoundingClientRect","x","left","y","top","width","height","borderRadius","getElementAtPosition","clientX","clientY","ignoreSelector","elementsAtPoint","document","elementsFromPoint","matches","hasAttribute","tagName","toLowerCase"],"sources":["elementBounds.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 type { OverlayBounds } from \"../types.js\";\n\nfunction stripTranslateFromTransform(element: Element): string {\n const computedStyle = window.getComputedStyle(element);\n const transform = computedStyle.transform;\n\n if (!transform || transform === \"none\") {\n return \"\";\n }\n\n const matrixMatch = transform.match(\n /matrix\\(([^,]+),\\s*([^,]+),\\s*([^,]+),\\s*([^,]+),\\s*[^,]+,\\s*[^)]+\\)/,\n );\n\n if (matrixMatch) {\n const [, a, b, c, d] = matrixMatch;\n if (a === \"1\" && b === \"0\" && c === \"0\" && d === \"1\") {\n return \"\";\n }\n return `matrix(${a}, ${b}, ${c}, ${d}, 0, 0)`;\n }\n\n const matrix3dMatch = transform.match(/matrix3d\\(([^)]+)\\)/);\n if (matrix3dMatch) {\n const values = matrix3dMatch[1].split(\",\").map((v) => v.trim());\n if (values.length === 16) {\n values[12] = \"0\";\n values[13] = \"0\";\n values[14] = \"0\";\n return `matrix3d(${values.join(\", \")})`;\n }\n }\n\n return \"\";\n}\n\nexport function createElementBounds(element: Element): OverlayBounds {\n const boundingRect = element.getBoundingClientRect();\n const computedStyle = window.getComputedStyle(element);\n\n return {\n x: boundingRect.left,\n y: boundingRect.top,\n width: boundingRect.width,\n height: boundingRect.height,\n borderRadius: computedStyle.borderRadius || \"0px\",\n transform: stripTranslateFromTransform(element),\n };\n}\n\nexport function getElementAtPosition(\n clientX: number,\n clientY: number,\n ignoreSelector?: string,\n): Element | null {\n const elementsAtPoint = document.elementsFromPoint(clientX, clientY);\n\n for (const element of elementsAtPoint) {\n if (ignoreSelector && element.matches(ignoreSelector)) {\n continue;\n }\n\n if (element.hasAttribute(\"data-osdk-devtools-ignore\")) {\n continue;\n }\n\n const tagName = element.tagName.toLowerCase();\n if (\n tagName === \"script\"\n || tagName === \"style\"\n || tagName === \"link\"\n || tagName === \"meta\"\n || tagName === \"head\"\n || tagName === \"html\"\n ) {\n continue;\n }\n\n return element;\n }\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,2BAA2BA,CAACC,OAAgB,EAAU;EAC7D,MAAMC,aAAa,GAAGC,MAAM,CAACC,gBAAgB,CAACH,OAAO,CAAC;EACtD,MAAMI,SAAS,GAAGH,aAAa,CAACG,SAAS;EAEzC,IAAI,CAACA,SAAS,IAAIA,SAAS,KAAK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AACM,KAAK;IACzBC,MAAM,EAAEP,YAAY,CAACO,MAAM;IAC3BC,YAAY,EAAE3B,aAAa,CAAC2B,YAAY,IAAI,KAAK;IACjDxB,SAAS,EAAEL,2BAA2B,CAACC,OAAO;EAChD,CAAC;AACH;AAEA,OAAO,SAAS6B,oBAAoBA,CAClCC,OAAe,EACfC,OAAe,EACfC,cAAuB,EACP;EAChB,MAAMC,eAAe,GAAGC,QAAQ,CAACC,iBAAiB,CAACL,OAAO,EAAEC,OAAO,CAAC;EAEpE,KAAK,MAAM/B,OAAO,IAAIiC,eAAe,EAAE;IACrC,IAAID,cAAc,IAAIhC,OAAO,CAACoC,OAAO,CAACJ,cAAc,CAAC,EAAE;MACrD;IACF;IAEA,IAAIhC,OAAO,CAACqC,YAAY,CAAC,2BAA2B,CAAC,EAAE;MACrD;IACF;IAEA,MAAMC,OAAO,GAAGtC,OAAO,CAACsC,OAAO,CAACC,WAAW,CAAC,CAAC;IAC7C,IACED,OAAO,KAAK,QAAQ,IACjBA,OAAO,KAAK,OAAO,IACnBA,OAAO,KAAK,MAAM,IAClBA,OAAO,KAAK,MAAM,IAClBA,OAAO,KAAK,MAAM,IAClBA,OAAO,KAAK,MAAM,EACrB;MACA;IACF;IAEA,OAAOtC,OAAO;EAChB;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,26 @@
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
+ export function interpolate(start, end, factor) {
18
+ return start + (end - start) * factor;
19
+ }
20
+ export const INTERPOLATION_FACTORS = {
21
+ selection: 0.95,
22
+ drag: 0.7,
23
+ crosshair: 0.3
24
+ };
25
+ export const DEFAULT_CONVERGENCE_THRESHOLD = 0.5;
26
+ //# sourceMappingURL=interpolation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpolation.js","names":["interpolate","start","end","factor","INTERPOLATION_FACTORS","selection","drag","crosshair","DEFAULT_CONVERGENCE_THRESHOLD"],"sources":["interpolation.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\nexport function interpolate(\n start: number,\n end: number,\n factor: number,\n): number {\n return start + (end - start) * factor;\n}\n\nexport const INTERPOLATION_FACTORS = {\n selection: 0.95,\n drag: 0.7,\n crosshair: 0.3,\n} as const;\n\nexport const DEFAULT_CONVERGENCE_THRESHOLD = 0.5;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,WAAWA,CACzBC,KAAa,EACbC,GAAW,EACXC,MAAc,EACN;EACR,OAAOF,KAAK,GAAG,CAACC,GAAG,GAAGD,KAAK,IAAIE,MAAM;AACvC;AAEA,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,SAAS,EAAE,IAAI;EACfC,IAAI,EAAE,GAAG;EACTC,SAAS,EAAE;AACb,CAAU;AAEV,OAAO,MAAMC,6BAA6B,GAAG,GAAG","ignoreList":[]}
@@ -0,0 +1,62 @@
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
+ const VIEWPORT_MARGIN_PX = 8;
18
+ const ARROW_HEIGHT = 8;
19
+ const LABEL_GAP = 4;
20
+ const MIN_ARROW_OFFSET = 12;
21
+ export function computeLabelPosition(selectionBounds, labelWidth, labelHeight, mouseX) {
22
+ const viewportWidth = window.innerWidth;
23
+ const viewportHeight = window.innerHeight;
24
+ const selectionCenterX = selectionBounds.x + selectionBounds.width / 2;
25
+ const cursorX = mouseX ?? selectionCenterX;
26
+ const selectionBottom = selectionBounds.y + selectionBounds.height;
27
+ const selectionTop = selectionBounds.y;
28
+ let positionLeft = cursorX - labelWidth / 2;
29
+ let positionTop = selectionBottom + ARROW_HEIGHT + LABEL_GAP;
30
+ let arrowPosition = "bottom";
31
+ if (positionLeft + labelWidth > viewportWidth - VIEWPORT_MARGIN_PX) {
32
+ positionLeft = viewportWidth - labelWidth - VIEWPORT_MARGIN_PX;
33
+ }
34
+ if (positionLeft < VIEWPORT_MARGIN_PX) {
35
+ positionLeft = VIEWPORT_MARGIN_PX;
36
+ }
37
+ const fitsBelow = positionTop + labelHeight <= viewportHeight - VIEWPORT_MARGIN_PX;
38
+ if (!fitsBelow) {
39
+ positionTop = selectionTop - (labelHeight + ARROW_HEIGHT + LABEL_GAP);
40
+ arrowPosition = "top";
41
+ }
42
+ if (positionTop < VIEWPORT_MARGIN_PX) {
43
+ positionTop = VIEWPORT_MARGIN_PX;
44
+ }
45
+ if (positionTop + labelHeight > viewportHeight - VIEWPORT_MARGIN_PX) {
46
+ positionTop = viewportHeight - labelHeight - VIEWPORT_MARGIN_PX;
47
+ }
48
+ const arrowLeft = Math.max(MIN_ARROW_OFFSET, Math.min(cursorX - positionLeft, labelWidth - MIN_ARROW_OFFSET));
49
+ return {
50
+ left: positionLeft,
51
+ top: positionTop,
52
+ arrowLeft,
53
+ arrowPosition
54
+ };
55
+ }
56
+ export const OFFSCREEN_POSITION = {
57
+ left: -9999,
58
+ top: -9999,
59
+ arrowLeft: 0,
60
+ arrowPosition: "bottom"
61
+ };
62
+ //# sourceMappingURL=labelPositioning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labelPositioning.js","names":["VIEWPORT_MARGIN_PX","ARROW_HEIGHT","LABEL_GAP","MIN_ARROW_OFFSET","computeLabelPosition","selectionBounds","labelWidth","labelHeight","mouseX","viewportWidth","window","innerWidth","viewportHeight","innerHeight","selectionCenterX","x","width","cursorX","selectionBottom","y","height","selectionTop","positionLeft","positionTop","arrowPosition","fitsBelow","arrowLeft","Math","max","min","left","top","OFFSCREEN_POSITION"],"sources":["labelPositioning.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 type { LabelPosition, OverlayBounds } from \"../types.js\";\n\nconst VIEWPORT_MARGIN_PX = 8;\nconst ARROW_HEIGHT = 8;\nconst LABEL_GAP = 4;\nconst MIN_ARROW_OFFSET = 12;\n\nexport function computeLabelPosition(\n selectionBounds: OverlayBounds,\n labelWidth: number,\n labelHeight: number,\n mouseX: number,\n): LabelPosition {\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const selectionCenterX = selectionBounds.x + selectionBounds.width / 2;\n const cursorX = mouseX ?? selectionCenterX;\n const selectionBottom = selectionBounds.y + selectionBounds.height;\n const selectionTop = selectionBounds.y;\n\n let positionLeft = cursorX - labelWidth / 2;\n let positionTop = selectionBottom + ARROW_HEIGHT + LABEL_GAP;\n let arrowPosition: \"top\" | \"bottom\" = \"bottom\";\n\n if (positionLeft + labelWidth > viewportWidth - VIEWPORT_MARGIN_PX) {\n positionLeft = viewportWidth - labelWidth - VIEWPORT_MARGIN_PX;\n }\n if (positionLeft < VIEWPORT_MARGIN_PX) {\n positionLeft = VIEWPORT_MARGIN_PX;\n }\n\n const totalHeightNeeded = labelHeight + ARROW_HEIGHT + LABEL_GAP;\n const fitsBelow =\n positionTop + labelHeight <= viewportHeight - VIEWPORT_MARGIN_PX;\n\n if (!fitsBelow) {\n positionTop = selectionTop - totalHeightNeeded;\n arrowPosition = \"top\";\n }\n\n if (positionTop < VIEWPORT_MARGIN_PX) {\n positionTop = VIEWPORT_MARGIN_PX;\n }\n if (positionTop + labelHeight > viewportHeight - VIEWPORT_MARGIN_PX) {\n positionTop = viewportHeight - labelHeight - VIEWPORT_MARGIN_PX;\n }\n\n const arrowLeft = Math.max(\n MIN_ARROW_OFFSET,\n Math.min(cursorX - positionLeft, labelWidth - MIN_ARROW_OFFSET),\n );\n\n return {\n left: positionLeft,\n top: positionTop,\n arrowLeft,\n arrowPosition,\n };\n}\n\nexport const OFFSCREEN_POSITION: LabelPosition = {\n left: -9999,\n top: -9999,\n arrowLeft: 0,\n arrowPosition: \"bottom\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,kBAAkB,GAAG,CAAC;AAC5B,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,OA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,GAAGC,IAAI,CAACC,GAAG,CACxBzB,gBAAgB,EAChBwB,IAAI,CAACE,GAAG,CAACZ,OAAO,GAAGK,YAAY,EAAEhB,UAAU,GAAGH,gBAAgB,CAChE,CAAC;EAED,OAAO;IACL2B,IAAI,EAAER,YAAY;IAClBS,GAAG,EAAER,WAAW;IAChBG,SAAS;IACTF;EACF,CAAC;AACH;AAEA,OAAO,MAAMQ,kBAAiC,GAAG;EAC/CF,IAAI,EAAE,CAAC,IAAI;EACXC,GAAG,EAAE,CAAC,IAAI;EACVL,SAAS,EAAE,CAAC;EACZF,aAAa,EAAE;AACjB,CAAC","ignoreList":[]}
@@ -0,0 +1,109 @@
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
+ export class MockCacheKeyGenerator {
18
+ static generateCacheKey(primitive) {
19
+ switch (primitive.type) {
20
+ case "object":
21
+ return this.generateObjectCacheKey(primitive.data);
22
+ case "objectSet":
23
+ return this.generateObjectSetCacheKey(primitive.data);
24
+ case "link":
25
+ return this.generateLinkCacheKey(primitive.data);
26
+ case "aggregation":
27
+ return this.generateAggregationCacheKey(primitive.data);
28
+ case "action":
29
+ return null;
30
+ default:
31
+ return null;
32
+ }
33
+ }
34
+ static generateObjectCacheKey(data) {
35
+ return {
36
+ type: "object",
37
+ apiName: data.type,
38
+ primaryKey: data.primaryKey,
39
+ otherKeys: [data.type, data.primaryKey]
40
+ };
41
+ }
42
+ static generateObjectSetCacheKey(data) {
43
+ const whereClause = data.whereClause || {};
44
+ const orderBy = data.orderBy || [];
45
+ return {
46
+ type: "list",
47
+ apiName: data.type,
48
+ where: whereClause,
49
+ orderBy: orderBy,
50
+ otherKeys: [data.type, this.canonicalizeWhereClause(whereClause), this.canonicalizeOrderBy(orderBy)]
51
+ };
52
+ }
53
+ static generateLinkCacheKey(data) {
54
+ const whereClause = data.where || {};
55
+ const orderBy = data.orderBy || [];
56
+ return {
57
+ type: "link",
58
+ sourceType: data.sourceType,
59
+ sourcePk: data.sourcePk,
60
+ linkName: data.linkName,
61
+ where: whereClause,
62
+ orderBy: orderBy,
63
+ otherKeys: [data.sourceType, data.sourcePk, data.linkName, this.canonicalizeWhereClause(whereClause), this.canonicalizeOrderBy(orderBy)]
64
+ };
65
+ }
66
+ static generateAggregationCacheKey(data) {
67
+ const whereClause = data.whereClause || {};
68
+ const aggregate = data.aggregate || {};
69
+ return {
70
+ type: "aggregation",
71
+ apiName: data.type,
72
+ where: whereClause,
73
+ aggregate: aggregate,
74
+ otherKeys: ["object", data.type, this.canonicalizeWhereClause(whereClause), undefined, JSON.stringify(aggregate)]
75
+ };
76
+ }
77
+ static canonicalizeWhereClause(where) {
78
+ if (!where || Object.keys(where).length === 0) {
79
+ return "{}";
80
+ }
81
+ const sortedKeys = Object.keys(where).sort();
82
+ const sorted = {};
83
+ for (const key of sortedKeys) {
84
+ sorted[key] = where[key];
85
+ }
86
+ return JSON.stringify(sorted);
87
+ }
88
+ static canonicalizeOrderBy(orderBy) {
89
+ if (!orderBy || Array.isArray(orderBy) && orderBy.length === 0) {
90
+ return "[]";
91
+ }
92
+ if (!Array.isArray(orderBy)) {
93
+ return JSON.stringify([orderBy]);
94
+ }
95
+ return JSON.stringify(orderBy);
96
+ }
97
+ static cacheKeysMatch(key1, key2) {
98
+ if (key1.type !== key2.type) {
99
+ return false;
100
+ }
101
+ const serialized1 = JSON.stringify(key1.otherKeys);
102
+ const serialized2 = JSON.stringify(key2.otherKeys);
103
+ return serialized1 === serialized2;
104
+ }
105
+ static cacheKeyToString(cacheKey) {
106
+ return JSON.stringify([cacheKey.type, ...cacheKey.otherKeys]);
107
+ }
108
+ }
109
+ //# sourceMappingURL=MockCacheKeyGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockCacheKeyGenerator.js","names":["MockCacheKeyGenerator","generateCacheKey","primitive","type","generateObjectCacheKey","data","generateObjectSetCacheKey","generateLinkCacheKey","generateAggregationCacheKey","apiName","primaryKey","otherKeys","whereClause","orderBy","where","canonicalizeWhereClause","canonicalizeOrderBy","sourceType","sourcePk","linkName","aggregate","undefined","JSON","stringify","Object","keys","length","sortedKeys","sort","sorted","key","Array","isArray","cacheKeysMatch","key1","key2","serialized1","serialized2","cacheKeyToString","cacheKey"],"sources":["MockCacheKeyGenerator.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 type { SelectedPrimitive } from \"../components/PrimitiveSelectionPanel.js\";\n\ntype OrderByEntry = Record<string, \"asc\" | \"desc\">;\ntype OrderByValue = OrderByEntry | OrderByEntry[];\n\nexport interface ObjectCacheKeyData {\n type: string;\n primaryKey?: string;\n}\n\nexport interface ObjectSetCacheKeyData {\n type: string;\n whereClause?: Record<string, unknown>;\n orderBy?: OrderByValue;\n}\n\nexport interface LinkCacheKeyData {\n sourceType: string;\n sourcePk?: string;\n linkName: string;\n where?: Record<string, unknown>;\n orderBy?: OrderByValue;\n}\n\nexport interface AggregationCacheKeyData {\n type: string;\n whereClause?: Record<string, unknown>;\n aggregate?: Record<string, unknown>;\n}\n\nexport interface CacheKey {\n type: string;\n otherKeys: unknown[];\n [key: string]: unknown;\n}\n\nexport class MockCacheKeyGenerator {\n static generateCacheKey(primitive: SelectedPrimitive): CacheKey | null {\n switch (primitive.type) {\n case \"object\":\n return this.generateObjectCacheKey(primitive.data);\n\n case \"objectSet\":\n return this.generateObjectSetCacheKey(primitive.data);\n\n case \"link\":\n return this.generateLinkCacheKey(primitive.data);\n\n case \"aggregation\":\n return this.generateAggregationCacheKey(primitive.data);\n\n case \"action\":\n return null;\n\n default:\n return null;\n }\n }\n\n private static generateObjectCacheKey(data: ObjectCacheKeyData): CacheKey {\n return {\n type: \"object\",\n apiName: data.type,\n primaryKey: data.primaryKey,\n otherKeys: [data.type, data.primaryKey],\n };\n }\n\n private static generateObjectSetCacheKey(\n data: ObjectSetCacheKeyData,\n ): CacheKey {\n const whereClause = data.whereClause || {};\n const orderBy = data.orderBy || [];\n\n return {\n type: \"list\",\n apiName: data.type,\n where: whereClause,\n orderBy: orderBy,\n otherKeys: [\n data.type,\n this.canonicalizeWhereClause(whereClause),\n this.canonicalizeOrderBy(orderBy),\n ],\n };\n }\n\n private static generateLinkCacheKey(data: LinkCacheKeyData): CacheKey {\n const whereClause = data.where || {};\n const orderBy = data.orderBy || [];\n\n return {\n type: \"link\",\n sourceType: data.sourceType,\n sourcePk: data.sourcePk,\n linkName: data.linkName,\n where: whereClause,\n orderBy: orderBy,\n otherKeys: [\n data.sourceType,\n data.sourcePk,\n data.linkName,\n this.canonicalizeWhereClause(whereClause),\n this.canonicalizeOrderBy(orderBy),\n ],\n };\n }\n\n private static generateAggregationCacheKey(\n data: AggregationCacheKeyData,\n ): CacheKey {\n const whereClause = data.whereClause || {};\n const aggregate = data.aggregate || {};\n\n return {\n type: \"aggregation\",\n apiName: data.type,\n where: whereClause,\n aggregate: aggregate,\n otherKeys: [\n \"object\",\n data.type,\n this.canonicalizeWhereClause(whereClause),\n undefined,\n JSON.stringify(aggregate),\n ],\n };\n }\n\n private static canonicalizeWhereClause(\n where: Record<string, unknown>,\n ): string {\n if (!where || Object.keys(where).length === 0) {\n return \"{}\";\n }\n\n const sortedKeys = Object.keys(where).sort();\n const sorted: Record<string, unknown> = {};\n for (const key of sortedKeys) {\n sorted[key] = where[key];\n }\n\n return JSON.stringify(sorted);\n }\n\n private static canonicalizeOrderBy(\n orderBy: OrderByValue | undefined,\n ): string {\n if (!orderBy || (Array.isArray(orderBy) && orderBy.length === 0)) {\n return \"[]\";\n }\n\n if (!Array.isArray(orderBy)) {\n return JSON.stringify([orderBy]);\n }\n\n return JSON.stringify(orderBy);\n }\n\n static cacheKeysMatch(key1: CacheKey, key2: CacheKey): boolean {\n if (key1.type !== key2.type) {\n return false;\n }\n\n const serialized1 = JSON.stringify(key1.otherKeys);\n const serialized2 = JSON.stringify(key2.otherKeys);\n\n return serialized1 === serialized2;\n }\n\n static cacheKeyToString(cacheKey: CacheKey): string {\n return JSON.stringify([cacheKey.type, ...cacheKey.otherKeys]);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA,OAAO,MAAMA,qBAAqB,CAAC;EACjC,OAAOC,gBAAgBA,CAACC,SAA4B,EAAmB;IACrE,QAAQA,SAAS,CAACC,IAAI;MACpB,KAAK,QAAQ;QACX,OAAO,IAAI,CAACC,sBAAsB,CAACF,SAAS,CAACG,IAAI,CAAC;MAEpD,KAAK,WAAW;QACd,OAAO,IAAI,CAACC,yBAAyB,CAACJ,SAAS,CAACG,IAAI,CAAC;MAEvD,KAAK,MAAM;QACT,OAAO,IAAI,CAACE,oBAAoB,CAACL,SAAS,CAACG,IAAI,CAAC;MAElD,KAAK,aAAa;QAChB,OAAO,IAAI,CAACG,2BAA2B,CAACN,SAAS,CAACG,IAAI,CAAC;MAEzD,KAAK,QAAQ;QACX,OAAO,IAAI;MAEb;QACE,OAAO,IAAI;IACf;EACF;EAEA,OAAeD,sBAAsBA,CAACC,IAAwB,EAAY;IACxE,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AAOS,IAAI,CAACC,SAAS,CAACV,OAAO,CAAC;EAChC;EAEA,OAAOoB,cAAcA,CAACC,IAAc,EAAEC,IAAc,EAAW;IAC7D,IAAID,IAAI,CAAC/B,IAAI,KAAKgC,IAAI,CAAChC,IAAI,EAAE;MAC3B,OAAO,KAAK;IACd;IAEA,MAAMiC,WAAW,GAAGd,IAAI,CAACC,SAAS,CAACW,IAAI,CAACvB,SAAS,CAAC;IAClD,MAAM0B,WAAW,GAAGf,IAAI,CAACC,SAAS,CAACY,IAAI,CAACxB,SAAS,CAAC;IAElD,OAAOyB,WAAW,KAAKC,WAAW;EACpC;EAEA,OAAOC,gBAAgBA,CAACC,QAAkB,EAAU;IAClD,OAAOjB,IAAI,CAACC,SAAS,CAAC,CAACgB,QAAQ,CAACpC,IAAI,EAAE,GAAGoC,QAAQ,CAAC5B,SAAS,CAAC,CAAC;EAC/D;AACF","ignoreList":[]}
@@ -0,0 +1,281 @@
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 { MockCacheKeyGenerator } from "./MockCacheKeyGenerator.js";
18
+ export class MockManager {
19
+ mocks = new Map();
20
+ requestLog = [];
21
+ maxLogSize = 1000;
22
+ injectedObjects = new Map();
23
+ setStore(store) {
24
+ this.store = store;
25
+ }
26
+ setMockLayer(layer) {
27
+ this.mockLayer = layer;
28
+ }
29
+ injectMockedObjectToCache(mockId, objectType, primaryKey, objectData) {
30
+ const objectMockId = `${mockId}-object-${primaryKey}`;
31
+ this.mocks.set(objectMockId, {
32
+ id: objectMockId,
33
+ type: "object",
34
+ matcher: {
35
+ objectType: objectType,
36
+ primaryKey: String(primaryKey)
37
+ },
38
+ response: {
39
+ type: "object",
40
+ object: objectData
41
+ },
42
+ usedCount: 0,
43
+ enabled: true,
44
+ cacheKey: {
45
+ type: "object",
46
+ apiName: objectType,
47
+ primaryKey: primaryKey,
48
+ otherKeys: [objectType, primaryKey]
49
+ }
50
+ });
51
+ let injectedList = this.injectedObjects.get(mockId);
52
+ if (!injectedList) {
53
+ injectedList = [];
54
+ this.injectedObjects.set(mockId, injectedList);
55
+ }
56
+ injectedList.push({
57
+ objectType,
58
+ primaryKey,
59
+ mockId: objectMockId
60
+ });
61
+ if (this.mockLayer) {
62
+ this.mockLayer.invalidateMock(objectMockId);
63
+ }
64
+ if (this.store) {
65
+ this.store.invalidateObjectType(objectType);
66
+ }
67
+ }
68
+ cleanupInjectedObjects(mockId) {
69
+ const injected = this.injectedObjects.get(mockId);
70
+ if (!injected || injected.length === 0) {
71
+ return;
72
+ }
73
+ const affectedTypes = new Set();
74
+ for (const obj of injected) {
75
+ this.mocks.delete(obj.mockId);
76
+ if (this.mockLayer) {
77
+ this.mockLayer.invalidateMock(obj.mockId);
78
+ }
79
+ affectedTypes.add(obj.objectType);
80
+ }
81
+ if (this.store) {
82
+ for (const type of affectedTypes) {
83
+ this.store.invalidateObjectType(type);
84
+ }
85
+ }
86
+ this.injectedObjects.delete(mockId);
87
+ }
88
+ registerMock(mock) {
89
+ const id = mock.id || `mock-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
90
+ if (mock.primitive) {
91
+ const cacheKey = MockCacheKeyGenerator.generateCacheKey(mock.primitive);
92
+ if (cacheKey) {
93
+ mock.cacheKey = cacheKey;
94
+ }
95
+ }
96
+ this.mocks.set(id, {
97
+ ...mock,
98
+ id
99
+ });
100
+ if (this.mockLayer) {
101
+ this.mockLayer.invalidateMock(id);
102
+ }
103
+ if (this.store && mock.cacheKey) {
104
+ this.store.invalidateCacheKey(mock.cacheKey);
105
+ }
106
+ return id;
107
+ }
108
+ findMock(request) {
109
+ for (const mock of this.mocks.values()) {
110
+ if (!mock.enabled) {
111
+ continue;
112
+ }
113
+ if (mock.type !== request.type) {
114
+ continue;
115
+ }
116
+ if (mock.maxUses && mock.usedCount >= mock.maxUses) {
117
+ continue;
118
+ }
119
+ const isMatch = this.matches(mock.matcher, request);
120
+ if (isMatch) {
121
+ this.logRequest(request, mock.id);
122
+ mock.usedCount++;
123
+ if (mock.failureRate && Math.random() < mock.failureRate) {
124
+ return {
125
+ ...mock,
126
+ response: {
127
+ type: "error",
128
+ error: "Simulated failure: MOCK_FAILURE"
129
+ }
130
+ };
131
+ }
132
+ return mock;
133
+ }
134
+ }
135
+ this.logRequest(request);
136
+ return null;
137
+ }
138
+ matches(matcher, request) {
139
+ if (matcher.objectType && matcher.objectType !== request.objectType) {
140
+ return false;
141
+ }
142
+ if (matcher.primaryKey) {
143
+ if (matcher.primaryKey instanceof RegExp) {
144
+ if (!request.primaryKey || !matcher.primaryKey.test(request.primaryKey)) {
145
+ return false;
146
+ }
147
+ } else if (matcher.primaryKey !== request.primaryKey) {
148
+ return false;
149
+ }
150
+ }
151
+ if (matcher.actionName && matcher.actionName !== request.actionName) {
152
+ return false;
153
+ }
154
+ if (matcher.whereClause) {
155
+ if (JSON.stringify(matcher.whereClause) !== JSON.stringify(request.whereClause)) {
156
+ return false;
157
+ }
158
+ }
159
+ if (matcher.linkName && matcher.linkName !== request.linkName) {
160
+ return false;
161
+ }
162
+ return true;
163
+ }
164
+ logRequest(request, matchedMock) {
165
+ this.requestLog.push({
166
+ request,
167
+ matchedMock,
168
+ timestamp: Date.now()
169
+ });
170
+ if (this.requestLog.length > this.maxLogSize) {
171
+ this.requestLog.shift();
172
+ }
173
+ }
174
+ getMocks() {
175
+ return Array.from(this.mocks.values());
176
+ }
177
+ getMock(id) {
178
+ return this.mocks.get(id);
179
+ }
180
+ updateMock(id, updates) {
181
+ const mock = this.mocks.get(id);
182
+ if (!mock) {
183
+ return false;
184
+ }
185
+ if (mock.enabled && updates.enabled === false) {
186
+ this.cleanupInjectedObjects(id);
187
+ }
188
+ this.mocks.set(id, {
189
+ ...mock,
190
+ ...updates,
191
+ id
192
+ });
193
+ return true;
194
+ }
195
+ removeMock(id) {
196
+ const mock = this.mocks.get(id);
197
+ if (!mock) {
198
+ return false;
199
+ }
200
+ this.cleanupInjectedObjects(id);
201
+ this.mocks.delete(id);
202
+ if (this.mockLayer) {
203
+ this.mockLayer.invalidateMock(id);
204
+ }
205
+ if (this.store && mock.cacheKey) {
206
+ this.store.invalidateCacheKey(mock.cacheKey);
207
+ }
208
+ return true;
209
+ }
210
+ findMockByCacheKey(cacheKey) {
211
+ for (const mock of this.mocks.values()) {
212
+ if (mock.enabled && mock.cacheKey && MockCacheKeyGenerator.cacheKeysMatch(mock.cacheKey, cacheKey)) {
213
+ let response;
214
+ if (mock.response.type === "object") {
215
+ response = mock.response.object;
216
+ } else if (mock.response.type === "list") {
217
+ response = mock.response.list;
218
+ } else if (mock.response.type === "action") {
219
+ response = mock.response.result;
220
+ } else {
221
+ response = null;
222
+ }
223
+ return {
224
+ id: mock.id,
225
+ response,
226
+ metadata: {
227
+ mockType: mock.type,
228
+ usedCount: mock.usedCount
229
+ }
230
+ };
231
+ }
232
+ }
233
+ return null;
234
+ }
235
+ getRequestLog() {
236
+ return [...this.requestLog];
237
+ }
238
+ clear() {
239
+ this.mocks.clear();
240
+ this.requestLog = [];
241
+ }
242
+ exportMocks() {
243
+ return JSON.stringify(Array.from(this.mocks.values()), null, 2);
244
+ }
245
+ importMocks(json) {
246
+ try {
247
+ const imported = JSON.parse(json);
248
+ for (const mock of imported) {
249
+ this.registerMock(mock);
250
+ }
251
+ return imported.length;
252
+ } catch {
253
+ return 0;
254
+ }
255
+ }
256
+ getStats() {
257
+ let enabledMocks = 0;
258
+ let disabledMocks = 0;
259
+ let exhaustedMocks = 0;
260
+ for (const mock of this.mocks.values()) {
261
+ if (mock.enabled) {
262
+ enabledMocks++;
263
+ } else {
264
+ disabledMocks++;
265
+ }
266
+ if (mock.maxUses && mock.usedCount >= mock.maxUses) {
267
+ exhaustedMocks++;
268
+ }
269
+ }
270
+ const matchedRequests = this.requestLog.filter(entry => entry.matchedMock).length;
271
+ return {
272
+ totalMocks: this.mocks.size,
273
+ enabledMocks,
274
+ disabledMocks,
275
+ exhaustedMocks,
276
+ totalRequests: this.requestLog.length,
277
+ matchedRequests
278
+ };
279
+ }
280
+ }
281
+ //# sourceMappingURL=MockManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockManager.js","names":["MockCacheKeyGenerator","MockManager","mocks","Map","requestLog","maxLogSize","injectedObjects","setStore","store","setMockLayer","layer","mockLayer","injectMockedObjectToCache","mockId","objectType","primaryKey","objectData","objectMockId","set","id","type","matcher","String","response","object","usedCount","enabled","cacheKey","apiName","otherKeys","injectedList","get","push","invalidateMock","invalidateObjectType","cleanupInjectedObjects","injected","length","affectedTypes","Set","obj","delete","add","registerMock","mock","Date","now","Math","random","toString","substring","primitive","generateCacheKey","invalidateCacheKey","findMock","request","values","maxUses","isMatch","matches","logRequest","failureRate","error","RegExp","test","actionName","whereClause","JSON","stringify","linkName","matchedMock","timestamp","shift","getMocks","Array","from","getMock","updateMock","updates","removeMock","findMockByCacheKey","cacheKeysMatch","list","result","metadata","mockType","getRequestLog","clear","exportMocks","importMocks","json","imported","parse","getStats","enabledMocks","disabledMocks","exhaustedMocks","matchedRequests","filter","entry","totalMocks","size","totalRequests"],"sources":["MockManager.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 type { SelectedPrimitive } from \"../components/PrimitiveSelectionPanel.js\";\nimport type { CacheKey } from \"./MockCacheKeyGenerator.js\";\nimport { MockCacheKeyGenerator } from \"./MockCacheKeyGenerator.js\";\n\nexport interface MockMatcher {\n objectType?: string;\n primaryKey?: string | RegExp;\n actionName?: string;\n whereClause?: Record<string, unknown>;\n linkName?: string;\n}\n\nexport type MockResponseData =\n | { type: \"object\"; object: unknown }\n | { type: \"list\"; list: unknown[]; hasMore: boolean }\n | { type: \"action\"; result: unknown }\n | { type: \"error\"; error: string }\n | { type: \"passthrough\" };\n\nexport interface MockResponse {\n id: string;\n type: \"object\" | \"list\" | \"action\" | \"links\";\n matcher: MockMatcher;\n response: MockResponseData;\n delay?: number;\n failureRate?: number;\n maxUses?: number;\n usedCount: number;\n enabled: boolean;\n cacheKey?: CacheKey;\n primitive?: SelectedPrimitive;\n usePayload?: boolean;\n payload?: string;\n}\n\nexport interface MockRequest {\n type: \"object\" | \"list\" | \"action\" | \"links\";\n objectType?: string;\n primaryKey?: string;\n actionName?: string;\n whereClause?: Record<string, unknown>;\n linkName?: string;\n}\n\nexport interface RequestLogEntry {\n request: MockRequest;\n matchedMock?: string;\n timestamp: number;\n}\n\nexport interface InjectedObject {\n objectType: string;\n primaryKey: string | number;\n mockId: string;\n}\n\ninterface MockLayer {\n invalidateMock(mockId: string): void;\n}\n\ninterface MockStore {\n invalidateObjectType(objectType: string): void;\n invalidateCacheKey(cacheKey: CacheKey): void;\n}\n\nexport class MockManager {\n private mocks = new Map<string, MockResponse>();\n private requestLog: RequestLogEntry[] = [];\n private maxLogSize = 1000;\n private mockLayer?: MockLayer;\n private store?: MockStore;\n private injectedObjects = new Map<string, InjectedObject[]>();\n\n setStore(store: MockStore): void {\n this.store = store;\n }\n\n setMockLayer(layer: MockLayer): void {\n this.mockLayer = layer;\n }\n\n injectMockedObjectToCache(\n mockId: string,\n objectType: string,\n primaryKey: string | number,\n objectData: Record<string, unknown>,\n ): void {\n const objectMockId = `${mockId}-object-${primaryKey}`;\n this.mocks.set(objectMockId, {\n id: objectMockId,\n type: \"object\",\n matcher: {\n objectType: objectType,\n primaryKey: String(primaryKey),\n },\n response: {\n type: \"object\",\n object: objectData,\n },\n usedCount: 0,\n enabled: true,\n cacheKey: {\n type: \"object\",\n apiName: objectType,\n primaryKey: primaryKey,\n otherKeys: [objectType, primaryKey],\n },\n });\n\n let injectedList = this.injectedObjects.get(mockId);\n if (!injectedList) {\n injectedList = [];\n this.injectedObjects.set(mockId, injectedList);\n }\n injectedList.push({ objectType, primaryKey, mockId: objectMockId });\n\n if (this.mockLayer) {\n this.mockLayer.invalidateMock(objectMockId);\n }\n if (this.store) {\n this.store.invalidateObjectType(objectType);\n }\n }\n\n cleanupInjectedObjects(mockId: string): void {\n const injected = this.injectedObjects.get(mockId);\n if (!injected || injected.length === 0) {\n return;\n }\n\n const affectedTypes = new Set<string>();\n\n for (const obj of injected) {\n this.mocks.delete(obj.mockId);\n if (this.mockLayer) {\n this.mockLayer.invalidateMock(obj.mockId);\n }\n affectedTypes.add(obj.objectType);\n }\n\n if (this.store) {\n for (const type of affectedTypes) {\n this.store.invalidateObjectType(type);\n }\n }\n\n this.injectedObjects.delete(mockId);\n }\n\n registerMock(mock: MockResponse): string {\n const id = mock.id\n || `mock-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;\n\n if (mock.primitive) {\n const cacheKey = MockCacheKeyGenerator.generateCacheKey(mock.primitive);\n if (cacheKey) {\n mock.cacheKey = cacheKey;\n }\n }\n\n this.mocks.set(id, { ...mock, id });\n\n if (this.mockLayer) {\n this.mockLayer.invalidateMock(id);\n }\n\n if (this.store && mock.cacheKey) {\n this.store.invalidateCacheKey(mock.cacheKey);\n }\n\n return id;\n }\n\n findMock(request: MockRequest): MockResponse | null {\n for (const mock of this.mocks.values()) {\n if (!mock.enabled) {\n continue;\n }\n if (mock.type !== request.type) {\n continue;\n }\n\n if (mock.maxUses && mock.usedCount >= mock.maxUses) {\n continue;\n }\n\n const isMatch = this.matches(mock.matcher, request);\n\n if (isMatch) {\n this.logRequest(request, mock.id);\n\n mock.usedCount++;\n\n if (mock.failureRate && Math.random() < mock.failureRate) {\n return {\n ...mock,\n response: {\n type: \"error\",\n error: \"Simulated failure: MOCK_FAILURE\",\n },\n };\n }\n\n return mock;\n }\n }\n\n this.logRequest(request);\n return null;\n }\n\n private matches(matcher: MockMatcher, request: MockRequest): boolean {\n if (matcher.objectType && matcher.objectType !== request.objectType) {\n return false;\n }\n\n if (matcher.primaryKey) {\n if (matcher.primaryKey instanceof RegExp) {\n if (\n !request.primaryKey || !matcher.primaryKey.test(request.primaryKey)\n ) {\n return false;\n }\n } else if (matcher.primaryKey !== request.primaryKey) {\n return false;\n }\n }\n\n if (matcher.actionName && matcher.actionName !== request.actionName) {\n return false;\n }\n\n if (matcher.whereClause) {\n if (\n JSON.stringify(matcher.whereClause)\n !== JSON.stringify(request.whereClause)\n ) {\n return false;\n }\n }\n\n if (matcher.linkName && matcher.linkName !== request.linkName) {\n return false;\n }\n\n return true;\n }\n\n private logRequest(request: MockRequest, matchedMock?: string): void {\n this.requestLog.push({\n request,\n matchedMock,\n timestamp: Date.now(),\n });\n\n if (this.requestLog.length > this.maxLogSize) {\n this.requestLog.shift();\n }\n }\n\n getMocks(): MockResponse[] {\n return Array.from(this.mocks.values());\n }\n\n getMock(id: string): MockResponse | undefined {\n return this.mocks.get(id);\n }\n\n updateMock(id: string, updates: Partial<MockResponse>): boolean {\n const mock = this.mocks.get(id);\n if (!mock) {\n return false;\n }\n\n if (mock.enabled && updates.enabled === false) {\n this.cleanupInjectedObjects(id);\n }\n\n this.mocks.set(id, { ...mock, ...updates, id });\n return true;\n }\n\n removeMock(id: string): boolean {\n const mock = this.mocks.get(id);\n if (!mock) {\n return false;\n }\n\n this.cleanupInjectedObjects(id);\n this.mocks.delete(id);\n\n if (this.mockLayer) {\n this.mockLayer.invalidateMock(id);\n }\n if (this.store && mock.cacheKey) {\n this.store.invalidateCacheKey(mock.cacheKey);\n }\n\n return true;\n }\n\n findMockByCacheKey(\n cacheKey: CacheKey,\n ):\n | { id: string; response: unknown; metadata?: Record<string, unknown> }\n | null\n {\n for (const mock of this.mocks.values()) {\n if (\n mock.enabled && mock.cacheKey\n && MockCacheKeyGenerator.cacheKeysMatch(mock.cacheKey, cacheKey)\n ) {\n let response: unknown;\n\n if (mock.response.type === \"object\") {\n response = mock.response.object;\n } else if (mock.response.type === \"list\") {\n response = mock.response.list;\n } else if (mock.response.type === \"action\") {\n response = mock.response.result;\n } else {\n response = null;\n }\n\n return {\n id: mock.id,\n response,\n metadata: {\n mockType: mock.type,\n usedCount: mock.usedCount,\n },\n };\n }\n }\n return null;\n }\n\n getRequestLog(): RequestLogEntry[] {\n return [...this.requestLog];\n }\n\n clear(): void {\n this.mocks.clear();\n this.requestLog = [];\n }\n\n exportMocks(): string {\n return JSON.stringify(Array.from(this.mocks.values()), null, 2);\n }\n\n importMocks(json: string): number {\n try {\n const imported = JSON.parse(json) as MockResponse[];\n for (const mock of imported) {\n this.registerMock(mock);\n }\n return imported.length;\n } catch {\n return 0;\n }\n }\n\n getStats(): {\n totalMocks: number;\n enabledMocks: number;\n disabledMocks: number;\n exhaustedMocks: number;\n totalRequests: number;\n matchedRequests: number;\n } {\n let enabledMocks = 0;\n let disabledMocks = 0;\n let exhaustedMocks = 0;\n\n for (const mock of this.mocks.values()) {\n if (mock.enabled) {\n enabledMocks++;\n } else {\n disabledMocks++;\n }\n\n if (mock.maxUses && mock.usedCount >= mock.maxUses) {\n exhaustedMocks++;\n }\n }\n\n const matchedRequests =\n this.requestLog.filter((entry) => entry.matchedMock).length;\n\n return {\n totalMocks: this.mocks.size,\n enabledMocks,\n disabledMocks,\n exhaustedMocks,\n totalRequests: this.requestLog.length,\n matchedRequests,\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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