@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.
- package/CHANGELOG.md +79 -0
- package/build/esm/DevToolsContext.js +19 -0
- package/build/esm/DevToolsContext.js.map +1 -0
- package/build/esm/components/ActionMetrics.js +89 -0
- package/build/esm/components/ActionMetrics.js.map +1 -0
- package/build/esm/components/BubbleChart.js +175 -0
- package/build/esm/components/BubbleChart.js.map +1 -0
- package/build/esm/components/BubbleChart.module.scss.js +6 -0
- package/build/esm/components/CacheInspectorTab.js +291 -0
- package/build/esm/components/CacheInspectorTab.js.map +1 -0
- package/build/esm/components/CacheInspectorTab.module.scss.js +39 -0
- package/build/esm/components/CacheMetrics.js +55 -0
- package/build/esm/components/CacheMetrics.js.map +1 -0
- package/build/esm/components/ComponentCard.js +124 -0
- package/build/esm/components/ComponentCard.js.map +1 -0
- package/build/esm/components/ComponentCard.module.scss.js +31 -0
- package/build/esm/components/ComputeTab.js +175 -0
- package/build/esm/components/ComputeTab.js.map +1 -0
- package/build/esm/components/CopyableCodeBlock.js +49 -0
- package/build/esm/components/CopyableCodeBlock.js.map +1 -0
- package/build/esm/components/CopyableCodeBlock.module.scss.js +10 -0
- package/build/esm/components/DebuggingTab.js +342 -0
- package/build/esm/components/DebuggingTab.js.map +1 -0
- package/build/esm/components/DebuggingTab.module.scss.js +18 -0
- package/build/esm/components/HookRow.js +180 -0
- package/build/esm/components/HookRow.js.map +1 -0
- package/build/esm/components/HookRow.module.scss.js +16 -0
- package/build/esm/components/ImprovementsTab.js +138 -0
- package/build/esm/components/ImprovementsTab.js.map +1 -0
- package/build/esm/components/ImprovementsTab.module.scss.js +30 -0
- package/build/esm/components/InspectorSelectionHeader.js +65 -0
- package/build/esm/components/InspectorSelectionHeader.js.map +1 -0
- package/build/esm/components/InterceptTab.js +862 -0
- package/build/esm/components/InterceptTab.js.map +1 -0
- package/build/esm/components/InterceptTab.module.scss.js +49 -0
- package/build/esm/components/IssueCard.js +115 -0
- package/build/esm/components/IssueCard.js.map +1 -0
- package/build/esm/components/IssueCard.module.scss.js +24 -0
- package/build/esm/components/LogEntryCard.js +94 -0
- package/build/esm/components/LogEntryCard.js.map +1 -0
- package/build/esm/components/LogEntryCard.module.scss.js +19 -0
- package/build/esm/components/MockEditor.js +316 -0
- package/build/esm/components/MockEditor.js.map +1 -0
- package/build/esm/components/MonitorErrorBoundary.js +64 -0
- package/build/esm/components/MonitorErrorBoundary.js.map +1 -0
- package/build/esm/components/MonitorErrorBoundary.module.scss.js +9 -0
- package/build/esm/components/MonitoringPanel.js +434 -0
- package/build/esm/components/MonitoringPanel.js.map +1 -0
- package/build/esm/components/MonitoringPanel.module.scss.js +81 -0
- package/build/esm/components/ObjectLoadingMetrics.js +60 -0
- package/build/esm/components/ObjectLoadingMetrics.js.map +1 -0
- package/build/esm/components/OsdkAppErrorBoundary.js +68 -0
- package/build/esm/components/OsdkAppErrorBoundary.js.map +1 -0
- package/build/esm/components/OsdkDevTools.js +40 -0
- package/build/esm/components/OsdkDevTools.js.map +1 -0
- package/build/esm/components/OverrideEditor.js +197 -0
- package/build/esm/components/OverrideEditor.js.map +1 -0
- package/build/esm/components/PerformanceTab.js +297 -0
- package/build/esm/components/PerformanceTab.js.map +1 -0
- package/build/esm/components/PrimitiveSelectionPanel.js +220 -0
- package/build/esm/components/PrimitiveSelectionPanel.js.map +1 -0
- package/build/esm/components/PrimitiveSelectionPanel.module.scss.js +26 -0
- package/build/esm/components/issueTypes.js +2 -0
- package/build/esm/components/issueTypes.js.map +1 -0
- package/build/esm/components/resolveComponentName.js +57 -0
- package/build/esm/components/resolveComponentName.js.map +1 -0
- package/build/esm/components/testHelpers.js +312 -0
- package/build/esm/components/testHelpers.js.map +1 -0
- package/build/esm/css.d.ts +20 -0
- package/build/esm/fiber/DegradationNotice.js +193 -0
- package/build/esm/fiber/DegradationNotice.js.map +1 -0
- package/build/esm/fiber/DevtoolsHook.js +252 -0
- package/build/esm/fiber/DevtoolsHook.js.map +1 -0
- package/build/esm/fiber/FiberAccess.js +65 -0
- package/build/esm/fiber/FiberAccess.js.map +1 -0
- package/build/esm/fiber/FiberInspection.js +140 -0
- package/build/esm/fiber/FiberInspection.js.map +1 -0
- package/build/esm/fiber/FiberTags.js +52 -0
- package/build/esm/fiber/FiberTags.js.map +1 -0
- package/build/esm/fiber/HookStateInspector.js +254 -0
- package/build/esm/fiber/HookStateInspector.js.map +1 -0
- package/build/esm/fiber/SafeFiberOperation.js +35 -0
- package/build/esm/fiber/SafeFiberOperation.js.map +1 -0
- package/build/esm/fiber/capabilities.js +180 -0
- package/build/esm/fiber/capabilities.js.map +1 -0
- package/build/esm/fiber/traverseFiber.js +129 -0
- package/build/esm/fiber/traverseFiber.js.map +1 -0
- package/build/esm/fiber/types.js +2 -0
- package/build/esm/fiber/types.js.map +1 -0
- package/build/esm/fiber/validation.js +155 -0
- package/build/esm/fiber/validation.js.map +1 -0
- package/build/esm/hooks/createPollingStore.js +81 -0
- package/build/esm/hooks/createPollingStore.js.map +1 -0
- package/build/esm/hooks/useActiveComponents.js +27 -0
- package/build/esm/hooks/useActiveComponents.js.map +1 -0
- package/build/esm/hooks/useComponentRegistry.js +25 -0
- package/build/esm/hooks/useComponentRegistry.js.map +1 -0
- package/build/esm/hooks/useComputeSelectors.js +43 -0
- package/build/esm/hooks/useComputeSelectors.js.map +1 -0
- package/build/esm/hooks/useConsoleLogs.js +46 -0
- package/build/esm/hooks/useConsoleLogs.js.map +1 -0
- package/build/esm/hooks/useInspectorSelection.js +93 -0
- package/build/esm/hooks/useInspectorSelection.js.map +1 -0
- package/build/esm/hooks/useMetrics.js +23 -0
- package/build/esm/hooks/useMetrics.js.map +1 -0
- package/build/esm/hooks/usePersistedState.js +89 -0
- package/build/esm/hooks/usePersistedState.js.map +1 -0
- package/build/esm/hooks/useRecommendations.js +123 -0
- package/build/esm/hooks/useRecommendations.js.map +1 -0
- package/build/esm/hooks/useSharedTick.js +49 -0
- package/build/esm/hooks/useSharedTick.js.map +1 -0
- package/build/esm/hooks/useTimeElapsed.js +51 -0
- package/build/esm/hooks/useTimeElapsed.js.map +1 -0
- package/build/esm/hooks/useTrackerSubscription.js +97 -0
- package/build/esm/hooks/useTrackerSubscription.js.map +1 -0
- package/build/esm/hooks/useUnusedFieldAnalysis.js +99 -0
- package/build/esm/hooks/useUnusedFieldAnalysis.js.map +1 -0
- package/build/esm/index.js +31 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/inspector/ClickToInspectSystem.js +228 -0
- package/build/esm/inspector/ClickToInspectSystem.js.map +1 -0
- package/build/esm/inspector/components/ComponentLabel.js +175 -0
- package/build/esm/inspector/components/ComponentLabel.js.map +1 -0
- package/build/esm/inspector/components/ComponentLabel.module.scss.js +12 -0
- package/build/esm/inspector/components/InspectorBanner.js +79 -0
- package/build/esm/inspector/components/InspectorBanner.js.map +1 -0
- package/build/esm/inspector/components/InspectorOverlay.js +149 -0
- package/build/esm/inspector/components/InspectorOverlay.js.map +1 -0
- package/build/esm/inspector/components/SelectionHighlight.js +74 -0
- package/build/esm/inspector/components/SelectionHighlight.js.map +1 -0
- package/build/esm/inspector/createClickToInspect.js +21 -0
- package/build/esm/inspector/createClickToInspect.js.map +1 -0
- package/build/esm/inspector/hooks/useAnimatedBounds.js +167 -0
- package/build/esm/inspector/hooks/useAnimatedBounds.js.map +1 -0
- package/build/esm/inspector/index.js +40 -0
- package/build/esm/inspector/index.js.map +1 -0
- package/build/esm/inspector/inspectorController.js +328 -0
- package/build/esm/inspector/inspectorController.js.map +1 -0
- package/build/esm/inspector/types.js +2 -0
- package/build/esm/inspector/types.js.map +1 -0
- package/build/esm/inspector/utils/elementBounds.js +72 -0
- package/build/esm/inspector/utils/elementBounds.js.map +1 -0
- package/build/esm/inspector/utils/interpolation.js +26 -0
- package/build/esm/inspector/utils/interpolation.js.map +1 -0
- package/build/esm/inspector/utils/labelPositioning.js +62 -0
- package/build/esm/inspector/utils/labelPositioning.js.map +1 -0
- package/build/esm/mocking/MockCacheKeyGenerator.js +109 -0
- package/build/esm/mocking/MockCacheKeyGenerator.js.map +1 -0
- package/build/esm/mocking/MockManager.js +281 -0
- package/build/esm/mocking/MockManager.js.map +1 -0
- package/build/esm/prototyping/PrototypeOverrideStore.js +66 -0
- package/build/esm/prototyping/PrototypeOverrideStore.js.map +1 -0
- package/build/esm/prototyping/index.js +18 -0
- package/build/esm/prototyping/index.js.map +1 -0
- package/build/esm/public/vite.js +19 -0
- package/build/esm/public/vite.js.map +1 -0
- package/build/esm/register.js +41 -0
- package/build/esm/register.js.map +1 -0
- package/build/esm/scss.d.ts +20 -0
- package/build/esm/store/ComputeStore.js +269 -0
- package/build/esm/store/ComputeStore.js.map +1 -0
- package/build/esm/store/ConsoleLogStore.js +289 -0
- package/build/esm/store/ConsoleLogStore.js.map +1 -0
- package/build/esm/store/MetricsStore.js +428 -0
- package/build/esm/store/MetricsStore.js.map +1 -0
- package/build/esm/store/MonitorStore.js +288 -0
- package/build/esm/store/MonitorStore.js.map +1 -0
- package/build/esm/store/SubscribableStore.js +38 -0
- package/build/esm/store/SubscribableStore.js.map +1 -0
- package/build/esm/store/WindowErrorStore.js +195 -0
- package/build/esm/store/WindowErrorStore.js.map +1 -0
- package/build/esm/styles.css +19441 -0
- package/build/esm/styles.js +31 -0
- package/build/esm/styles.js.map +1 -0
- package/build/esm/types/compute.js +2 -0
- package/build/esm/types/compute.js.map +1 -0
- package/build/esm/types/emissions.js +2 -0
- package/build/esm/types/emissions.js.map +1 -0
- package/build/esm/types/index.js +23 -0
- package/build/esm/types/index.js.map +1 -0
- package/build/esm/utils/ActionLifecycleTracker.js +178 -0
- package/build/esm/utils/ActionLifecycleTracker.js.map +1 -0
- package/build/esm/utils/CacheEfficiencyAnalyzer.js +198 -0
- package/build/esm/utils/CacheEfficiencyAnalyzer.js.map +1 -0
- package/build/esm/utils/CircularBuffer.js +96 -0
- package/build/esm/utils/CircularBuffer.js.map +1 -0
- package/build/esm/utils/ComponentContextCapture.js +215 -0
- package/build/esm/utils/ComponentContextCapture.js.map +1 -0
- package/build/esm/utils/ComponentPrimitiveDiscovery.js +173 -0
- package/build/esm/utils/ComponentPrimitiveDiscovery.js.map +1 -0
- package/build/esm/utils/ComponentQueryRegistry.js +340 -0
- package/build/esm/utils/ComponentQueryRegistry.js.map +1 -0
- package/build/esm/utils/ComputeMonitor.js +199 -0
- package/build/esm/utils/ComputeMonitor.js.map +1 -0
- package/build/esm/utils/EventTimeline.js +130 -0
- package/build/esm/utils/EventTimeline.js.map +1 -0
- package/build/esm/utils/LinkTraversalTracker.js +116 -0
- package/build/esm/utils/LinkTraversalTracker.js.map +1 -0
- package/build/esm/utils/MockDataGenerator.js +473 -0
- package/build/esm/utils/MockDataGenerator.js.map +1 -0
- package/build/esm/utils/ObservableClientMonitor.js +768 -0
- package/build/esm/utils/ObservableClientMonitor.js.map +1 -0
- package/build/esm/utils/PerformanceRecommendationEngine.js +185 -0
- package/build/esm/utils/PerformanceRecommendationEngine.js.map +1 -0
- package/build/esm/utils/PropertyAccessTracker.js +238 -0
- package/build/esm/utils/PropertyAccessTracker.js.map +1 -0
- package/build/esm/utils/RecommendationMatcher.js +53 -0
- package/build/esm/utils/RecommendationMatcher.js.map +1 -0
- package/build/esm/utils/SubscriptionTracker.js +132 -0
- package/build/esm/utils/SubscriptionTracker.js.map +1 -0
- package/build/esm/utils/UnusedFieldAnalyzer.js +186 -0
- package/build/esm/utils/UnusedFieldAnalyzer.js.map +1 -0
- package/build/esm/utils/WaterfallDetector.js +200 -0
- package/build/esm/utils/WaterfallDetector.js.map +1 -0
- package/build/esm/utils/computePayload.js +37 -0
- package/build/esm/utils/computePayload.js.map +1 -0
- package/build/esm/utils/computeRequest.js +29 -0
- package/build/esm/utils/computeRequest.js.map +1 -0
- package/build/esm/utils/format.js +69 -0
- package/build/esm/utils/format.js.map +1 -0
- package/build/esm/utils/logger.js +31 -0
- package/build/esm/utils/logger.js.map +1 -0
- package/build/esm/vite/constants.js +18 -0
- package/build/esm/vite/constants.js.map +1 -0
- package/build/esm/vite/hookInstaller.js +99 -0
- package/build/esm/vite/hookInstaller.js.map +1 -0
- package/build/esm/vite/index.js +77 -0
- package/build/esm/vite/index.js.map +1 -0
- package/build/types/DevToolsContext.d.ts +3 -0
- package/build/types/DevToolsContext.d.ts.map +1 -0
- package/build/types/components/ActionMetrics.d.ts +6 -0
- package/build/types/components/ActionMetrics.d.ts.map +1 -0
- package/build/types/components/BubbleChart.d.ts +10 -0
- package/build/types/components/BubbleChart.d.ts.map +1 -0
- package/build/types/components/CacheInspectorTab.d.ts +6 -0
- package/build/types/components/CacheInspectorTab.d.ts.map +1 -0
- package/build/types/components/CacheMetrics.d.ts +6 -0
- package/build/types/components/CacheMetrics.d.ts.map +1 -0
- package/build/types/components/ComponentCard.d.ts +13 -0
- package/build/types/components/ComponentCard.d.ts.map +1 -0
- package/build/types/components/ComputeTab.d.ts +6 -0
- package/build/types/components/ComputeTab.d.ts.map +1 -0
- package/build/types/components/CopyableCodeBlock.d.ts +7 -0
- package/build/types/components/CopyableCodeBlock.d.ts.map +1 -0
- package/build/types/components/DebuggingTab.d.ts +6 -0
- package/build/types/components/DebuggingTab.d.ts.map +1 -0
- package/build/types/components/HookRow.d.ts +9 -0
- package/build/types/components/HookRow.d.ts.map +1 -0
- package/build/types/components/ImprovementsTab.d.ts +7 -0
- package/build/types/components/ImprovementsTab.d.ts.map +1 -0
- package/build/types/components/InspectorSelectionHeader.d.ts +12 -0
- package/build/types/components/InspectorSelectionHeader.d.ts.map +1 -0
- package/build/types/components/InterceptTab.d.ts +126 -0
- package/build/types/components/InterceptTab.d.ts.map +1 -0
- package/build/types/components/IssueCard.d.ts +8 -0
- package/build/types/components/IssueCard.d.ts.map +1 -0
- package/build/types/components/LogEntryCard.d.ts +7 -0
- package/build/types/components/LogEntryCard.d.ts.map +1 -0
- package/build/types/components/MockEditor.d.ts +58 -0
- package/build/types/components/MockEditor.d.ts.map +1 -0
- package/build/types/components/MonitorErrorBoundary.d.ts +16 -0
- package/build/types/components/MonitorErrorBoundary.d.ts.map +1 -0
- package/build/types/components/MonitoringPanel.d.ts +8 -0
- package/build/types/components/MonitoringPanel.d.ts.map +1 -0
- package/build/types/components/ObjectLoadingMetrics.d.ts +7 -0
- package/build/types/components/ObjectLoadingMetrics.d.ts.map +1 -0
- package/build/types/components/OsdkAppErrorBoundary.d.ts +18 -0
- package/build/types/components/OsdkAppErrorBoundary.d.ts.map +1 -0
- package/build/types/components/OsdkDevTools.d.ts +2 -0
- package/build/types/components/OsdkDevTools.d.ts.map +1 -0
- package/build/types/components/OverrideEditor.d.ts +26 -0
- package/build/types/components/OverrideEditor.d.ts.map +1 -0
- package/build/types/components/PerformanceTab.d.ts +8 -0
- package/build/types/components/PerformanceTab.d.ts.map +1 -0
- package/build/types/components/PrimitiveSelectionPanel.d.ts +28 -0
- package/build/types/components/PrimitiveSelectionPanel.d.ts.map +1 -0
- package/build/types/components/issueTypes.d.ts +16 -0
- package/build/types/components/issueTypes.d.ts.map +1 -0
- package/build/types/components/resolveComponentName.d.ts +3 -0
- package/build/types/components/resolveComponentName.d.ts.map +1 -0
- package/build/types/components/testHelpers.d.ts +2 -0
- package/build/types/components/testHelpers.d.ts.map +1 -0
- package/build/types/css.d.d.ts +4 -0
- package/build/types/css.d.d.ts.map +1 -0
- package/build/types/fiber/DegradationNotice.d.ts +8 -0
- package/build/types/fiber/DegradationNotice.d.ts.map +1 -0
- package/build/types/fiber/DevtoolsHook.d.ts +7 -0
- package/build/types/fiber/DevtoolsHook.d.ts.map +1 -0
- package/build/types/fiber/FiberAccess.d.ts +2 -0
- package/build/types/fiber/FiberAccess.d.ts.map +1 -0
- package/build/types/fiber/FiberInspection.d.ts +6 -0
- package/build/types/fiber/FiberInspection.d.ts.map +1 -0
- package/build/types/fiber/FiberTags.d.ts +33 -0
- package/build/types/fiber/FiberTags.d.ts.map +1 -0
- package/build/types/fiber/HookStateInspector.d.ts +45 -0
- package/build/types/fiber/HookStateInspector.d.ts.map +1 -0
- package/build/types/fiber/SafeFiberOperation.d.ts +7 -0
- package/build/types/fiber/SafeFiberOperation.d.ts.map +1 -0
- package/build/types/fiber/capabilities.d.ts +38 -0
- package/build/types/fiber/capabilities.d.ts.map +1 -0
- package/build/types/fiber/traverseFiber.d.ts +5 -0
- package/build/types/fiber/traverseFiber.d.ts.map +1 -0
- package/build/types/fiber/types.d.ts +87 -0
- package/build/types/fiber/types.d.ts.map +1 -0
- package/build/types/fiber/validation.d.ts +10 -0
- package/build/types/fiber/validation.d.ts.map +1 -0
- package/build/types/hooks/createPollingStore.d.ts +5 -0
- package/build/types/hooks/createPollingStore.d.ts.map +1 -0
- package/build/types/hooks/useActiveComponents.d.ts +3 -0
- package/build/types/hooks/useActiveComponents.d.ts.map +1 -0
- package/build/types/hooks/useComponentRegistry.d.ts +3 -0
- package/build/types/hooks/useComponentRegistry.d.ts.map +1 -0
- package/build/types/hooks/useComputeSelectors.d.ts +7 -0
- package/build/types/hooks/useComputeSelectors.d.ts.map +1 -0
- package/build/types/hooks/useConsoleLogs.d.ts +7 -0
- package/build/types/hooks/useConsoleLogs.d.ts.map +1 -0
- package/build/types/hooks/useInspectorSelection.d.ts +9 -0
- package/build/types/hooks/useInspectorSelection.d.ts.map +1 -0
- package/build/types/hooks/useMetrics.d.ts +3 -0
- package/build/types/hooks/useMetrics.d.ts.map +1 -0
- package/build/types/hooks/usePersistedState.d.ts +1 -0
- package/build/types/hooks/usePersistedState.d.ts.map +1 -0
- package/build/types/hooks/useRecommendations.d.ts +10 -0
- package/build/types/hooks/useRecommendations.d.ts.map +1 -0
- package/build/types/hooks/useSharedTick.d.ts +1 -0
- package/build/types/hooks/useSharedTick.d.ts.map +1 -0
- package/build/types/hooks/useTimeElapsed.d.ts +1 -0
- package/build/types/hooks/useTimeElapsed.d.ts.map +1 -0
- package/build/types/hooks/useTrackerSubscription.d.ts +16 -0
- package/build/types/hooks/useTrackerSubscription.d.ts.map +1 -0
- package/build/types/hooks/useUnusedFieldAnalysis.d.ts +8 -0
- package/build/types/hooks/useUnusedFieldAnalysis.d.ts.map +1 -0
- package/build/types/index.d.ts +21 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/inspector/ClickToInspectSystem.d.ts +40 -0
- package/build/types/inspector/ClickToInspectSystem.d.ts.map +1 -0
- package/build/types/inspector/components/ComponentLabel.d.ts +3 -0
- package/build/types/inspector/components/ComponentLabel.d.ts.map +1 -0
- package/build/types/inspector/components/InspectorBanner.d.ts +5 -0
- package/build/types/inspector/components/InspectorBanner.d.ts.map +1 -0
- package/build/types/inspector/components/InspectorOverlay.d.ts +3 -0
- package/build/types/inspector/components/InspectorOverlay.d.ts.map +1 -0
- package/build/types/inspector/components/SelectionHighlight.d.ts +3 -0
- package/build/types/inspector/components/SelectionHighlight.d.ts.map +1 -0
- package/build/types/inspector/createClickToInspect.d.ts +3 -0
- package/build/types/inspector/createClickToInspect.d.ts.map +1 -0
- package/build/types/inspector/hooks/useAnimatedBounds.d.ts +2 -0
- package/build/types/inspector/hooks/useAnimatedBounds.d.ts.map +1 -0
- package/build/types/inspector/index.d.ts +13 -0
- package/build/types/inspector/index.d.ts.map +1 -0
- package/build/types/inspector/inspectorController.d.ts +2 -0
- package/build/types/inspector/inspectorController.d.ts.map +1 -0
- package/build/types/inspector/types.d.ts +94 -0
- package/build/types/inspector/types.d.ts.map +1 -0
- package/build/types/inspector/utils/elementBounds.d.ts +3 -0
- package/build/types/inspector/utils/elementBounds.d.ts.map +1 -0
- package/build/types/inspector/utils/interpolation.d.ts +7 -0
- package/build/types/inspector/utils/interpolation.d.ts.map +1 -0
- package/build/types/inspector/utils/labelPositioning.d.ts +3 -0
- package/build/types/inspector/utils/labelPositioning.d.ts.map +1 -0
- package/build/types/mocking/MockCacheKeyGenerator.d.ts +41 -0
- package/build/types/mocking/MockCacheKeyGenerator.d.ts.map +1 -0
- package/build/types/mocking/MockManager.d.ts +103 -0
- package/build/types/mocking/MockManager.d.ts.map +1 -0
- package/build/types/prototyping/PrototypeOverrideStore.d.ts +33 -0
- package/build/types/prototyping/PrototypeOverrideStore.d.ts.map +1 -0
- package/build/types/prototyping/index.d.ts +1 -0
- package/build/types/prototyping/index.d.ts.map +1 -0
- package/build/types/public/vite.d.ts +2 -0
- package/build/types/public/vite.d.ts.map +1 -0
- package/build/types/register.d.ts +1 -0
- package/build/types/register.d.ts.map +1 -0
- package/build/types/scss.d.d.ts +6 -0
- package/build/types/scss.d.d.ts.map +1 -0
- package/build/types/store/ComputeStore.d.ts +47 -0
- package/build/types/store/ComputeStore.d.ts.map +1 -0
- package/build/types/store/ConsoleLogStore.d.ts +29 -0
- package/build/types/store/ConsoleLogStore.d.ts.map +1 -0
- package/build/types/store/MetricsStore.d.ts +42 -0
- package/build/types/store/MetricsStore.d.ts.map +1 -0
- package/build/types/store/MonitorStore.d.ts +86 -0
- package/build/types/store/MonitorStore.d.ts.map +1 -0
- package/build/types/store/SubscribableStore.d.ts +6 -0
- package/build/types/store/SubscribableStore.d.ts.map +1 -0
- package/build/types/store/WindowErrorStore.d.ts +32 -0
- package/build/types/store/WindowErrorStore.d.ts.map +1 -0
- package/build/types/styles.d.ts +1 -0
- package/build/types/styles.d.ts.map +1 -0
- package/build/types/types/compute.d.ts +73 -0
- package/build/types/types/compute.d.ts.map +1 -0
- package/build/types/types/emissions.d.ts +24 -0
- package/build/types/types/emissions.d.ts.map +1 -0
- package/build/types/types/index.d.ts +143 -0
- package/build/types/types/index.d.ts.map +1 -0
- package/build/types/utils/ActionLifecycleTracker.d.ts +39 -0
- package/build/types/utils/ActionLifecycleTracker.d.ts.map +1 -0
- package/build/types/utils/CacheEfficiencyAnalyzer.d.ts +45 -0
- package/build/types/utils/CacheEfficiencyAnalyzer.d.ts.map +1 -0
- package/build/types/utils/CircularBuffer.d.ts +18 -0
- package/build/types/utils/CircularBuffer.d.ts.map +1 -0
- package/build/types/utils/ComponentContextCapture.d.ts +29 -0
- package/build/types/utils/ComponentContextCapture.d.ts.map +1 -0
- package/build/types/utils/ComponentPrimitiveDiscovery.d.ts +62 -0
- package/build/types/utils/ComponentPrimitiveDiscovery.d.ts.map +1 -0
- package/build/types/utils/ComponentQueryRegistry.d.ts +91 -0
- package/build/types/utils/ComponentQueryRegistry.d.ts.map +1 -0
- package/build/types/utils/ComputeMonitor.d.ts +14 -0
- package/build/types/utils/ComputeMonitor.d.ts.map +1 -0
- package/build/types/utils/EventTimeline.d.ts +102 -0
- package/build/types/utils/EventTimeline.d.ts.map +1 -0
- package/build/types/utils/LinkTraversalTracker.d.ts +43 -0
- package/build/types/utils/LinkTraversalTracker.d.ts.map +1 -0
- package/build/types/utils/MockDataGenerator.d.ts +23 -0
- package/build/types/utils/MockDataGenerator.d.ts.map +1 -0
- package/build/types/utils/ObservableClientMonitor.d.ts +62 -0
- package/build/types/utils/ObservableClientMonitor.d.ts.map +1 -0
- package/build/types/utils/PerformanceRecommendationEngine.d.ts +67 -0
- package/build/types/utils/PerformanceRecommendationEngine.d.ts.map +1 -0
- package/build/types/utils/PropertyAccessTracker.d.ts +50 -0
- package/build/types/utils/PropertyAccessTracker.d.ts.map +1 -0
- package/build/types/utils/RecommendationMatcher.d.ts +5 -0
- package/build/types/utils/RecommendationMatcher.d.ts.map +1 -0
- package/build/types/utils/SubscriptionTracker.d.ts +17 -0
- package/build/types/utils/SubscriptionTracker.d.ts.map +1 -0
- package/build/types/utils/UnusedFieldAnalyzer.d.ts +46 -0
- package/build/types/utils/UnusedFieldAnalyzer.d.ts.map +1 -0
- package/build/types/utils/WaterfallDetector.d.ts +28 -0
- package/build/types/utils/WaterfallDetector.d.ts.map +1 -0
- package/build/types/utils/computePayload.d.ts +3 -0
- package/build/types/utils/computePayload.d.ts.map +1 -0
- package/build/types/utils/computeRequest.d.ts +20 -0
- package/build/types/utils/computeRequest.d.ts.map +1 -0
- package/build/types/utils/format.d.ts +5 -0
- package/build/types/utils/format.d.ts.map +1 -0
- package/build/types/utils/logger.d.ts +2 -0
- package/build/types/utils/logger.d.ts.map +1 -0
- package/build/types/vite/constants.d.ts +1 -0
- package/build/types/vite/constants.d.ts.map +1 -0
- package/build/types/vite/hookInstaller.d.ts +1 -0
- package/build/types/vite/hookInstaller.d.ts.map +1 -0
- package/build/types/vite/index.d.ts +20 -0
- package/build/types/vite/index.d.ts.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1,316 @@
|
|
|
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 { Button, Callout, Checkbox, FormGroup, HTMLSelect, Icon, Radio, RadioGroup, TextArea } from "@blueprintjs/core";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import styles from "./InterceptTab.module.scss.js";
|
|
20
|
+
export const MockEditor = ({
|
|
21
|
+
selectedPrimitive,
|
|
22
|
+
editingMock,
|
|
23
|
+
mockType,
|
|
24
|
+
responseType,
|
|
25
|
+
usePayload,
|
|
26
|
+
mockPayload,
|
|
27
|
+
useResponse,
|
|
28
|
+
staticData,
|
|
29
|
+
functionCode,
|
|
30
|
+
errorMessage,
|
|
31
|
+
dispatch,
|
|
32
|
+
mockPrimitiveInfo,
|
|
33
|
+
onSaveMock,
|
|
34
|
+
onCancel
|
|
35
|
+
}) => {
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: styles.editorPanel
|
|
38
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: styles.panelHeader
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
41
|
+
icon: mockPrimitiveInfo?.icon ?? "cube"
|
|
42
|
+
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: styles.panelTitle
|
|
44
|
+
}, editingMock ? "Edit Mock" : "Create Mock"), /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: styles.panelSubtitle
|
|
46
|
+
}, mockPrimitiveInfo?.title, " \xB7 ", mockPrimitiveInfo?.subtitle)), /*#__PURE__*/React.createElement(Button, {
|
|
47
|
+
variant: "minimal",
|
|
48
|
+
size: "small",
|
|
49
|
+
icon: "cross",
|
|
50
|
+
"aria-label": "Close editor",
|
|
51
|
+
onClick: onCancel
|
|
52
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: styles.editorContent
|
|
54
|
+
}, mockPrimitiveInfo?.signature && /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: styles.primitiveSignature
|
|
56
|
+
}, /*#__PURE__*/React.createElement("code", null, mockPrimitiveInfo.signature)), /*#__PURE__*/React.createElement(FormGroup, {
|
|
57
|
+
label: "Response Type",
|
|
58
|
+
labelInfo: "(required)"
|
|
59
|
+
}, /*#__PURE__*/React.createElement(RadioGroup, {
|
|
60
|
+
inline: true,
|
|
61
|
+
onChange: e => dispatch({
|
|
62
|
+
type: "SET_RESPONSE_TYPE",
|
|
63
|
+
responseType: e.currentTarget.value
|
|
64
|
+
}),
|
|
65
|
+
selectedValue: responseType
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
67
|
+
label: "Success",
|
|
68
|
+
value: "success"
|
|
69
|
+
}), /*#__PURE__*/React.createElement(Radio, {
|
|
70
|
+
label: "Error/Failure",
|
|
71
|
+
value: "error"
|
|
72
|
+
}))), /*#__PURE__*/React.createElement(FormGroup, {
|
|
73
|
+
label: "Mock Type",
|
|
74
|
+
labelInfo: "(required)"
|
|
75
|
+
}, /*#__PURE__*/React.createElement(HTMLSelect, {
|
|
76
|
+
value: mockType,
|
|
77
|
+
onChange: e => dispatch({
|
|
78
|
+
type: "SET_MOCK_TYPE",
|
|
79
|
+
mockType: e.target.value
|
|
80
|
+
}),
|
|
81
|
+
fill: true,
|
|
82
|
+
options: [{
|
|
83
|
+
label: "Static Data",
|
|
84
|
+
value: "static"
|
|
85
|
+
}, {
|
|
86
|
+
label: "Function (Dynamic)",
|
|
87
|
+
value: "function"
|
|
88
|
+
}, {
|
|
89
|
+
label: "Pass-through (Original + Log)",
|
|
90
|
+
value: "passthrough"
|
|
91
|
+
}]
|
|
92
|
+
})), selectedPrimitive.type === "action" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
93
|
+
checked: usePayload,
|
|
94
|
+
onChange: e => dispatch({
|
|
95
|
+
type: "SET_USE_PAYLOAD",
|
|
96
|
+
usePayload: e.currentTarget.checked
|
|
97
|
+
}),
|
|
98
|
+
label: "Use Payload"
|
|
99
|
+
}), usePayload && /*#__PURE__*/React.createElement(FormGroup, {
|
|
100
|
+
label: "Action Payload (JSON)",
|
|
101
|
+
helperText: "The parameters to pass to the action"
|
|
102
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
103
|
+
value: mockPayload,
|
|
104
|
+
onChange: e => dispatch({
|
|
105
|
+
type: "SET_MOCK_PAYLOAD",
|
|
106
|
+
mockPayload: e.target.value
|
|
107
|
+
}),
|
|
108
|
+
fill: true,
|
|
109
|
+
rows: 4,
|
|
110
|
+
className: styles.codeEditor
|
|
111
|
+
}))), /*#__PURE__*/React.createElement(Checkbox, {
|
|
112
|
+
checked: useResponse,
|
|
113
|
+
onChange: e => dispatch({
|
|
114
|
+
type: "SET_USE_RESPONSE",
|
|
115
|
+
useResponse: e.currentTarget.checked
|
|
116
|
+
}),
|
|
117
|
+
label: "Use Response"
|
|
118
|
+
}), useResponse && /*#__PURE__*/React.createElement(React.Fragment, null, responseType === "error" && /*#__PURE__*/React.createElement(FormGroup, {
|
|
119
|
+
label: "Error Message",
|
|
120
|
+
helperText: "The error message to return"
|
|
121
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
122
|
+
value: errorMessage,
|
|
123
|
+
onChange: e => dispatch({
|
|
124
|
+
type: "SET_ERROR_MESSAGE",
|
|
125
|
+
errorMessage: e.target.value
|
|
126
|
+
}),
|
|
127
|
+
fill: true,
|
|
128
|
+
rows: 2
|
|
129
|
+
})), mockType === "static" && responseType === "success" && /*#__PURE__*/React.createElement(FormGroup, {
|
|
130
|
+
label: "Mock Data (JSON)",
|
|
131
|
+
helperText: "Enter the JSON response that this mock should return"
|
|
132
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
133
|
+
value: staticData,
|
|
134
|
+
onChange: e => dispatch({
|
|
135
|
+
type: "SET_STATIC_DATA",
|
|
136
|
+
staticData: e.target.value
|
|
137
|
+
}),
|
|
138
|
+
fill: true,
|
|
139
|
+
rows: 8,
|
|
140
|
+
className: styles.codeEditor
|
|
141
|
+
})), mockType === "function" && /*#__PURE__*/React.createElement(FormGroup, {
|
|
142
|
+
label: "Mock Function",
|
|
143
|
+
helperText: "Write a function that generates mock data dynamically"
|
|
144
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
145
|
+
value: functionCode,
|
|
146
|
+
onChange: e => dispatch({
|
|
147
|
+
type: "SET_FUNCTION_CODE",
|
|
148
|
+
functionCode: e.target.value
|
|
149
|
+
}),
|
|
150
|
+
fill: true,
|
|
151
|
+
rows: 10,
|
|
152
|
+
className: styles.codeEditor
|
|
153
|
+
}))), mockType === "passthrough" && /*#__PURE__*/React.createElement(Callout, {
|
|
154
|
+
intent: "primary",
|
|
155
|
+
icon: "info-sign"
|
|
156
|
+
}, "Pass-through mode will execute the real query but log all parameters and responses for debugging."), /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: styles.editorActions
|
|
158
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
159
|
+
intent: "primary",
|
|
160
|
+
icon: "floppy-disk",
|
|
161
|
+
onClick: onSaveMock
|
|
162
|
+
}, editingMock ? "Update Mock" : "Create Mock"), /*#__PURE__*/React.createElement(Button, {
|
|
163
|
+
variant: "minimal",
|
|
164
|
+
onClick: onCancel
|
|
165
|
+
}, "Cancel"))));
|
|
166
|
+
};
|
|
167
|
+
export function getMockPrimitiveInfo(primitive) {
|
|
168
|
+
switch (primitive.type) {
|
|
169
|
+
case "action":
|
|
170
|
+
return {
|
|
171
|
+
title: primitive.data.name,
|
|
172
|
+
subtitle: "Action",
|
|
173
|
+
icon: "flash",
|
|
174
|
+
signature: primitive.data.signature
|
|
175
|
+
};
|
|
176
|
+
case "objectSet":
|
|
177
|
+
return {
|
|
178
|
+
title: primitive.data.type,
|
|
179
|
+
subtitle: "Object Set Query",
|
|
180
|
+
icon: "th-list",
|
|
181
|
+
signature: `useOsdkObjects(${primitive.data.type})`
|
|
182
|
+
};
|
|
183
|
+
case "object":
|
|
184
|
+
return {
|
|
185
|
+
title: primitive.data.type,
|
|
186
|
+
subtitle: "Object Query",
|
|
187
|
+
icon: "cube",
|
|
188
|
+
signature: `useOsdkObject(${primitive.data.type}, ${primitive.data.primaryKey || "'...'"})`
|
|
189
|
+
};
|
|
190
|
+
case "link":
|
|
191
|
+
return {
|
|
192
|
+
title: primitive.data.linkName,
|
|
193
|
+
subtitle: "Link Traversal",
|
|
194
|
+
icon: "link",
|
|
195
|
+
signature: `useLinks(..., "${primitive.data.linkName}")`
|
|
196
|
+
};
|
|
197
|
+
case "query":
|
|
198
|
+
return {
|
|
199
|
+
title: primitive.data.hookType,
|
|
200
|
+
subtitle: "Advanced Query",
|
|
201
|
+
icon: "database",
|
|
202
|
+
signature: primitive.data.signature
|
|
203
|
+
};
|
|
204
|
+
case "aggregation":
|
|
205
|
+
return {
|
|
206
|
+
title: primitive.data.type,
|
|
207
|
+
subtitle: "Aggregation",
|
|
208
|
+
icon: "grouped-bar-chart",
|
|
209
|
+
signature: `useOsdkAggregation(${primitive.data.type})`
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export function createMatcherFromPrimitive(primitive) {
|
|
214
|
+
switch (primitive.type) {
|
|
215
|
+
case "action":
|
|
216
|
+
return {
|
|
217
|
+
actionName: primitive.data.name
|
|
218
|
+
};
|
|
219
|
+
case "objectSet":
|
|
220
|
+
return {
|
|
221
|
+
objectType: primitive.data.type,
|
|
222
|
+
whereClause: primitive.data.whereClause
|
|
223
|
+
};
|
|
224
|
+
case "aggregation":
|
|
225
|
+
return {
|
|
226
|
+
objectType: primitive.data.type,
|
|
227
|
+
whereClause: primitive.data.whereClause
|
|
228
|
+
};
|
|
229
|
+
case "object":
|
|
230
|
+
return {
|
|
231
|
+
objectType: primitive.data.type,
|
|
232
|
+
primaryKey: primitive.data.primaryKey
|
|
233
|
+
};
|
|
234
|
+
case "link":
|
|
235
|
+
return {
|
|
236
|
+
objectType: primitive.data.sourceType,
|
|
237
|
+
linkName: primitive.data.linkName
|
|
238
|
+
};
|
|
239
|
+
case "query":
|
|
240
|
+
return {};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export function createResponseFromConfig(primitive, mockData) {
|
|
244
|
+
if (primitive.type === "action") {
|
|
245
|
+
return {
|
|
246
|
+
type: "action",
|
|
247
|
+
result: mockData
|
|
248
|
+
};
|
|
249
|
+
} else if (primitive.type === "objectSet" || primitive.type === "link" || primitive.type === "aggregation") {
|
|
250
|
+
return {
|
|
251
|
+
type: "list",
|
|
252
|
+
list: Array.isArray(mockData) ? mockData : [mockData],
|
|
253
|
+
hasMore: false
|
|
254
|
+
};
|
|
255
|
+
} else {
|
|
256
|
+
return {
|
|
257
|
+
type: "object",
|
|
258
|
+
object: mockData
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
export const MockItem = /*#__PURE__*/React.memo(({
|
|
263
|
+
mock,
|
|
264
|
+
onToggle,
|
|
265
|
+
onDelete,
|
|
266
|
+
onEdit
|
|
267
|
+
}) => {
|
|
268
|
+
const info = mock.config ? getMockPrimitiveInfo(mock.config.primitive) : null;
|
|
269
|
+
const label = {
|
|
270
|
+
icon: info?.icon ?? "help",
|
|
271
|
+
text: info?.title ?? "Unknown"
|
|
272
|
+
};
|
|
273
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
274
|
+
className: styles.interceptItem
|
|
275
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
276
|
+
className: styles.interceptItemContent,
|
|
277
|
+
onClick: onEdit,
|
|
278
|
+
title: "Click to view/edit configuration"
|
|
279
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
280
|
+
className: styles.interceptItemHeader
|
|
281
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
282
|
+
icon: label.icon
|
|
283
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
284
|
+
className: styles.interceptItemTitle
|
|
285
|
+
}, label.text), /*#__PURE__*/React.createElement("span", {
|
|
286
|
+
className: `${styles.interceptBadge} ${styles.interceptBadgeMock}`
|
|
287
|
+
}, "mock"), /*#__PURE__*/React.createElement("span", {
|
|
288
|
+
className: styles.interceptItemMeta
|
|
289
|
+
}, mock.config?.mockType || "static"), /*#__PURE__*/React.createElement("span", {
|
|
290
|
+
className: styles.interceptItemMeta
|
|
291
|
+
}, "Used: ", mock.usedCount, "x")), /*#__PURE__*/React.createElement("div", {
|
|
292
|
+
className: styles.interceptItemDetails
|
|
293
|
+
}, mock.config?.responseType === "error" && /*#__PURE__*/React.createElement("span", {
|
|
294
|
+
className: styles.detail
|
|
295
|
+
}, "Error Response"))), /*#__PURE__*/React.createElement("div", {
|
|
296
|
+
className: styles.interceptItemActions
|
|
297
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
298
|
+
variant: "minimal",
|
|
299
|
+
size: "small",
|
|
300
|
+
intent: mock.enabled ? "success" : "warning",
|
|
301
|
+
icon: mock.enabled ? "pause" : "play",
|
|
302
|
+
onClick: onToggle,
|
|
303
|
+
title: mock.enabled ? "Pause mock" : "Resume mock",
|
|
304
|
+
"aria-label": mock.enabled ? "Pause mock" : "Resume mock"
|
|
305
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
306
|
+
variant: "minimal",
|
|
307
|
+
size: "small",
|
|
308
|
+
intent: "danger",
|
|
309
|
+
icon: "trash",
|
|
310
|
+
onClick: onDelete,
|
|
311
|
+
title: "Delete mock",
|
|
312
|
+
"aria-label": "Delete mock"
|
|
313
|
+
})));
|
|
314
|
+
});
|
|
315
|
+
MockItem.displayName = "MockItem";
|
|
316
|
+
//# sourceMappingURL=MockEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockEditor.js","names":["Button","Callout","Checkbox","FormGroup","HTMLSelect","Icon","Radio","RadioGroup","TextArea","React","styles","MockEditor","selectedPrimitive","editingMock","mockType","responseType","usePayload","mockPayload","useResponse","staticData","functionCode","errorMessage","dispatch","mockPrimitiveInfo","onSaveMock","onCancel","createElement","className","editorPanel","panelHeader","icon","panelTitle","panelSubtitle","title","subtitle","variant","size","onClick","editorContent","signature","primitiveSignature","label","labelInfo","inline","onChange","e","type","currentTarget","value","selectedValue","target","fill","options","Fragment","checked","helperText","rows","codeEditor","intent","editorActions","getMockPrimitiveInfo","primitive","data","name","primaryKey","linkName","hookType","createMatcherFromPrimitive","actionName","objectType","whereClause","sourceType","createResponseFromConfig","mockData","result","list","Array","isArray","hasMore","object","MockItem","memo","mock","onToggle","onDelete","onEdit","info","config","text","interceptItem","interceptItemContent","interceptItemHeader","interceptItemTitle","interceptBadge","interceptBadgeMock","interceptItemMeta","usedCount","interceptItemDetails","detail","interceptItemActions","enabled","displayName"],"sources":["MockEditor.tsx"],"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 {\n Button,\n Callout,\n Checkbox,\n FormGroup,\n HTMLSelect,\n Icon,\n Radio,\n RadioGroup,\n TextArea,\n} from \"@blueprintjs/core\";\nimport React from \"react\";\nimport type { MockResponse } from \"../mocking/MockManager.js\";\nimport type { InterceptAction, MockConfiguration } from \"./InterceptTab.js\";\nimport styles from \"./InterceptTab.module.scss\";\nimport type { SelectedPrimitive } from \"./PrimitiveSelectionPanel.js\";\n\ntype MockWithConfig = MockResponse & { config: MockConfiguration };\n\ninterface MockEditorProps {\n selectedPrimitive: SelectedPrimitive;\n editingMock: MockWithConfig | null;\n mockType: MockConfiguration[\"mockType\"];\n responseType: MockConfiguration[\"responseType\"];\n usePayload: boolean;\n mockPayload: string;\n useResponse: boolean;\n staticData: string;\n functionCode: string;\n errorMessage: string;\n dispatch: React.Dispatch<InterceptAction>;\n mockPrimitiveInfo: ReturnType<typeof getMockPrimitiveInfo> | null;\n onSaveMock: () => void;\n onCancel: () => void;\n}\n\nexport const MockEditor: React.FC<MockEditorProps> = ({\n selectedPrimitive,\n editingMock,\n mockType,\n responseType,\n usePayload,\n mockPayload,\n useResponse,\n staticData,\n functionCode,\n errorMessage,\n dispatch,\n mockPrimitiveInfo,\n onSaveMock,\n onCancel,\n}) => {\n return (\n <div className={styles.editorPanel}>\n <div className={styles.panelHeader}>\n <Icon icon={mockPrimitiveInfo?.icon ?? \"cube\"} />\n <div>\n <div className={styles.panelTitle}>\n {editingMock ? \"Edit Mock\" : \"Create Mock\"}\n </div>\n <div className={styles.panelSubtitle}>\n {mockPrimitiveInfo?.title} · {mockPrimitiveInfo?.subtitle}\n </div>\n </div>\n <Button\n variant=\"minimal\"\n size=\"small\"\n icon=\"cross\"\n aria-label=\"Close editor\"\n onClick={onCancel}\n />\n </div>\n\n <div className={styles.editorContent}>\n {mockPrimitiveInfo?.signature && (\n <div className={styles.primitiveSignature}>\n <code>{mockPrimitiveInfo.signature}</code>\n </div>\n )}\n\n <FormGroup label=\"Response Type\" labelInfo=\"(required)\">\n <RadioGroup\n inline={true}\n onChange={(e) =>\n dispatch({\n type: \"SET_RESPONSE_TYPE\",\n responseType: e.currentTarget\n .value as MockConfiguration[\"responseType\"],\n })}\n selectedValue={responseType}\n >\n <Radio label=\"Success\" value=\"success\" />\n <Radio label=\"Error/Failure\" value=\"error\" />\n </RadioGroup>\n </FormGroup>\n\n <FormGroup label=\"Mock Type\" labelInfo=\"(required)\">\n <HTMLSelect\n value={mockType}\n onChange={(e) =>\n dispatch({\n type: \"SET_MOCK_TYPE\",\n mockType: e.target.value as MockConfiguration[\"mockType\"],\n })}\n fill={true}\n options={[\n { label: \"Static Data\", value: \"static\" },\n { label: \"Function (Dynamic)\", value: \"function\" },\n {\n label: \"Pass-through (Original + Log)\",\n value: \"passthrough\",\n },\n ]}\n />\n </FormGroup>\n\n {selectedPrimitive.type === \"action\" && (\n <>\n <Checkbox\n checked={usePayload}\n onChange={(e) =>\n dispatch({\n type: \"SET_USE_PAYLOAD\",\n usePayload: e.currentTarget.checked,\n })}\n label=\"Use Payload\"\n />\n {usePayload && (\n <FormGroup\n label=\"Action Payload (JSON)\"\n helperText=\"The parameters to pass to the action\"\n >\n <TextArea\n value={mockPayload}\n onChange={(e) =>\n dispatch({\n type: \"SET_MOCK_PAYLOAD\",\n mockPayload: e.target.value,\n })}\n fill={true}\n rows={4}\n className={styles.codeEditor}\n />\n </FormGroup>\n )}\n </>\n )}\n\n <Checkbox\n checked={useResponse}\n onChange={(e) =>\n dispatch({\n type: \"SET_USE_RESPONSE\",\n useResponse: e.currentTarget.checked,\n })}\n label=\"Use Response\"\n />\n\n {useResponse && (\n <>\n {responseType === \"error\" && (\n <FormGroup\n label=\"Error Message\"\n helperText=\"The error message to return\"\n >\n <TextArea\n value={errorMessage}\n onChange={(e) =>\n dispatch({\n type: \"SET_ERROR_MESSAGE\",\n errorMessage: e.target.value,\n })}\n fill={true}\n rows={2}\n />\n </FormGroup>\n )}\n\n {mockType === \"static\" && responseType === \"success\" && (\n <FormGroup\n label=\"Mock Data (JSON)\"\n helperText=\"Enter the JSON response that this mock should return\"\n >\n <TextArea\n value={staticData}\n onChange={(e) =>\n dispatch({\n type: \"SET_STATIC_DATA\",\n staticData: e.target.value,\n })}\n fill={true}\n rows={8}\n className={styles.codeEditor}\n />\n </FormGroup>\n )}\n\n {mockType === \"function\" && (\n <FormGroup\n label=\"Mock Function\"\n helperText=\"Write a function that generates mock data dynamically\"\n >\n <TextArea\n value={functionCode}\n onChange={(e) =>\n dispatch({\n type: \"SET_FUNCTION_CODE\",\n functionCode: e.target.value,\n })}\n fill={true}\n rows={10}\n className={styles.codeEditor}\n />\n </FormGroup>\n )}\n </>\n )}\n\n {mockType === \"passthrough\" && (\n <Callout intent=\"primary\" icon=\"info-sign\">\n Pass-through mode will execute the real query but log all parameters\n and responses for debugging.\n </Callout>\n )}\n\n <div className={styles.editorActions}>\n <Button\n intent=\"primary\"\n icon=\"floppy-disk\"\n onClick={onSaveMock}\n >\n {editingMock ? \"Update Mock\" : \"Create Mock\"}\n </Button>\n <Button variant=\"minimal\" onClick={onCancel}>\n Cancel\n </Button>\n </div>\n </div>\n </div>\n );\n};\n\nexport function getMockPrimitiveInfo(primitive: SelectedPrimitive): {\n title: string;\n subtitle: string;\n icon:\n | \"flash\"\n | \"th-list\"\n | \"cube\"\n | \"link\"\n | \"database\"\n | \"grouped-bar-chart\";\n signature: string | undefined;\n} {\n switch (primitive.type) {\n case \"action\":\n return {\n title: primitive.data.name,\n subtitle: \"Action\",\n icon: \"flash\" as const,\n signature: primitive.data.signature,\n };\n case \"objectSet\":\n return {\n title: primitive.data.type,\n subtitle: \"Object Set Query\",\n icon: \"th-list\" as const,\n signature: `useOsdkObjects(${primitive.data.type})`,\n };\n case \"object\":\n return {\n title: primitive.data.type,\n subtitle: \"Object Query\",\n icon: \"cube\" as const,\n signature: `useOsdkObject(${primitive.data.type}, ${\n primitive.data.primaryKey || \"'...'\"\n })`,\n };\n case \"link\":\n return {\n title: primitive.data.linkName,\n subtitle: \"Link Traversal\",\n icon: \"link\" as const,\n signature: `useLinks(..., \"${primitive.data.linkName}\")`,\n };\n case \"query\":\n return {\n title: primitive.data.hookType,\n subtitle: \"Advanced Query\",\n icon: \"database\" as const,\n signature: primitive.data.signature,\n };\n case \"aggregation\":\n return {\n title: primitive.data.type,\n subtitle: \"Aggregation\",\n icon: \"grouped-bar-chart\" as const,\n signature: `useOsdkAggregation(${primitive.data.type})`,\n };\n }\n}\n\nexport function createMatcherFromPrimitive(primitive: SelectedPrimitive): {\n actionName?: string;\n objectType?: string;\n whereClause?: Record<string, unknown>;\n primaryKey?: string;\n linkName?: string;\n} {\n switch (primitive.type) {\n case \"action\":\n return { actionName: primitive.data.name };\n case \"objectSet\":\n return {\n objectType: primitive.data.type,\n whereClause: primitive.data.whereClause,\n };\n case \"aggregation\":\n return {\n objectType: primitive.data.type,\n whereClause: primitive.data.whereClause,\n };\n case \"object\":\n return {\n objectType: primitive.data.type,\n primaryKey: primitive.data.primaryKey,\n };\n case \"link\":\n return {\n objectType: primitive.data.sourceType,\n linkName: primitive.data.linkName,\n };\n case \"query\":\n return {};\n }\n}\n\nexport function createResponseFromConfig(\n primitive: SelectedPrimitive,\n mockData: unknown,\n): {\n type: \"action\";\n result: unknown;\n} | {\n type: \"list\";\n list: unknown[];\n hasMore: boolean;\n} | {\n type: \"object\";\n object: unknown;\n} {\n if (primitive.type === \"action\") {\n return { type: \"action\" as const, result: mockData };\n } else if (\n primitive.type === \"objectSet\" || primitive.type === \"link\"\n || primitive.type === \"aggregation\"\n ) {\n return {\n type: \"list\" as const,\n list: Array.isArray(mockData) ? mockData : [mockData],\n hasMore: false,\n };\n } else {\n return { type: \"object\" as const, object: mockData };\n }\n}\n\nexport interface MockItemProps {\n mock: MockResponse & { config: MockConfiguration };\n onToggle: () => void;\n onDelete: () => void;\n onEdit: () => void;\n}\n\nexport const MockItem: React.FC<MockItemProps> = React.memo(\n ({ mock, onToggle, onDelete, onEdit }) => {\n const info = mock.config\n ? getMockPrimitiveInfo(mock.config.primitive)\n : null;\n const label = {\n icon: info?.icon ?? (\"help\" as const),\n text: info?.title ?? \"Unknown\",\n };\n\n return (\n <div className={styles.interceptItem}>\n <div\n className={styles.interceptItemContent}\n onClick={onEdit}\n title=\"Click to view/edit configuration\"\n >\n <div className={styles.interceptItemHeader}>\n <Icon icon={label.icon} />\n <span className={styles.interceptItemTitle}>{label.text}</span>\n <span\n className={`${styles.interceptBadge} ${styles.interceptBadgeMock}`}\n >\n mock\n </span>\n <span className={styles.interceptItemMeta}>\n {mock.config?.mockType || \"static\"}\n </span>\n <span className={styles.interceptItemMeta}>\n Used: {mock.usedCount}x\n </span>\n </div>\n <div className={styles.interceptItemDetails}>\n {mock.config?.responseType === \"error\" && (\n <span className={styles.detail}>Error Response</span>\n )}\n </div>\n </div>\n\n <div className={styles.interceptItemActions}>\n <Button\n variant=\"minimal\"\n size=\"small\"\n intent={mock.enabled ? \"success\" : \"warning\"}\n icon={mock.enabled ? \"pause\" : \"play\"}\n onClick={onToggle}\n title={mock.enabled ? \"Pause mock\" : \"Resume mock\"}\n aria-label={mock.enabled ? \"Pause mock\" : \"Resume mock\"}\n />\n <Button\n variant=\"minimal\"\n size=\"small\"\n intent=\"danger\"\n icon=\"trash\"\n onClick={onDelete}\n title=\"Delete mock\"\n aria-label=\"Delete mock\"\n />\n </div>\n </div>\n );\n },\n);\n\nMockItem.displayName = \"MockItem\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,SAAS,EACTC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,EAAEoD,IAAI,CAACkB,OAAO,GAAG,OAAO,GAAG,MAAO;IACtC/D,OAAO,EAAE8C,QAAS;IAClBlD,KAAK,EAAEiD,IAAI,CAACkB,OAAO,GAAG,YAAY,GAAG,aAAc;IACnD,cAAYlB,IAAI,CAACkB,OAAO,GAAG,YAAY,GAAG;EAAc,CACzD,CAAC,eACF3F,KAAA,CAAAiB,aAAA,CAAC1B,MAAM;IACLmC,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAC,OAAO;IACZsB,MAAM,EAAC,QAAQ;IACf5B,IAAI,EAAC,OAAO;IACZO,OAAO,EAAE+C,QAAS;IAClBnD,KAAK,EAAC,aAAa;IACnB,cAAW;EAAa,CACzB,CACE,CACF,CAAC;AAEV,CACF,CAAC;AAED+C,QAAQ,CAACqB,WAAW,GAAG,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
import styles from "./MonitorErrorBoundary.module.scss.js";
|
|
19
|
+
export class MonitorErrorBoundary extends React.Component {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.state = {
|
|
23
|
+
hasError: false,
|
|
24
|
+
error: null
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static getDerivedStateFromError(error) {
|
|
28
|
+
return {
|
|
29
|
+
hasError: true,
|
|
30
|
+
error
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
componentDidCatch(error, errorInfo) {
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
console.error("[MonitorErrorBoundary] Error caught:", error);
|
|
36
|
+
// eslint-disable-next-line no-console
|
|
37
|
+
console.error("[MonitorErrorBoundary] Error info:", errorInfo);
|
|
38
|
+
this.props.onError?.(error, errorInfo);
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
if (this.state.hasError) {
|
|
42
|
+
if (process.env.NODE_ENV === "development") {
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: styles.container
|
|
45
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
46
|
+
className: styles.title
|
|
47
|
+
}, "Monitor Error"), /*#__PURE__*/React.createElement("p", {
|
|
48
|
+
className: styles.message
|
|
49
|
+
}, "An error occurred in the monitoring panel:"), /*#__PURE__*/React.createElement("pre", {
|
|
50
|
+
className: styles.stack
|
|
51
|
+
}, this.state.error?.message, "\n", this.state.error?.stack), /*#__PURE__*/React.createElement("button", {
|
|
52
|
+
onClick: () => this.setState({
|
|
53
|
+
hasError: false,
|
|
54
|
+
error: null
|
|
55
|
+
}),
|
|
56
|
+
className: styles.retryButton
|
|
57
|
+
}, "Retry"));
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return this.props.children;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=MonitorErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonitorErrorBoundary.js","names":["React","styles","MonitorErrorBoundary","Component","constructor","props","state","hasError","error","getDerivedStateFromError","componentDidCatch","errorInfo","console","onError","render","process","env","NODE_ENV","createElement","className","container","title","message","stack","onClick","setState","retryButton","children"],"sources":["MonitorErrorBoundary.tsx"],"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 styles from \"./MonitorErrorBoundary.module.scss\";\n\nexport interface MonitorErrorBoundaryProps {\n children: React.ReactNode;\n onError?: (error: Error, errorInfo: React.ErrorInfo) => void;\n}\n\ninterface MonitorErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n}\n\nexport class MonitorErrorBoundary extends React.Component<\n MonitorErrorBoundaryProps,\n MonitorErrorBoundaryState\n> {\n constructor(props: MonitorErrorBoundaryProps) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error): MonitorErrorBoundaryState {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n // eslint-disable-next-line no-console\n console.error(\"[MonitorErrorBoundary] Error caught:\", error);\n // eslint-disable-next-line no-console\n console.error(\"[MonitorErrorBoundary] Error info:\", errorInfo);\n this.props.onError?.(error, errorInfo);\n }\n\n render(): React.ReactNode {\n if (this.state.hasError) {\n if (process.env.NODE_ENV === \"development\") {\n return (\n <div className={styles.container}>\n <h3 className={styles.title}>\n Monitor Error\n </h3>\n <p className={styles.message}>\n An error occurred in the monitoring panel:\n </p>\n <pre className={styles.stack}>\n {this.state.error?.message}\n {\"\\n\"}\n {this.state.error?.stack}\n </pre>\n <button\n onClick={() => this.setState({ hasError: false, error: null })}\n className={styles.retryButton}\n >\n Retry\n </button>\n </div>\n );\n }\n\n return null;\n }\n\n return this.props.children;\n }\n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AAK,EAAEc,OAAO,EACzB,IAAI,EACJ,IAAI,CAAChB,KAAK,CAACE,KAAK,EAAEe,KAChB,CAAC,eACNvB,KAAA,CAAAkB,aAAA;UACEM,OAAO,EAAEA,CAAA,KAAM,IAAI,CAACC,QAAQ,CAAC;YAAElB,QAAQ,EAAE,KAAK;YAAEC,KAAK,EAAE;UAAK,CAAC,CAAE;UAC/DW,SAAS,EAAElB,MAAM,CAACyB;QAAY,GAC/B,OAEO,CACL,CAAC;MAEV;MAEA,OAAO,IAAI;IACb;IAEA,OAAO,IAAI,CAACrB,KAAK,CAACsB,QAAQ;EAC5B;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/build-css.mjs. Do not edit by hand.
|
|
2
|
+
const styles = {
|
|
3
|
+
"container": "MonitorErrorBoundary-module__container___5tzAcfsn",
|
|
4
|
+
"title": "MonitorErrorBoundary-module__title___goKqDL2v",
|
|
5
|
+
"message": "MonitorErrorBoundary-module__message___QOZveJPc",
|
|
6
|
+
"stack": "MonitorErrorBoundary-module__stack___RhJkOsV8",
|
|
7
|
+
"retryButton": "MonitorErrorBoundary-module__retryButton___hRRy-yEG"
|
|
8
|
+
};
|
|
9
|
+
export default styles;
|