react-native-prod-debugger 1.0.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/LICENSE +21 -0
- package/README.md +350 -0
- package/lib/commonjs/core/DebugBubble.js +139 -0
- package/lib/commonjs/core/DebugBubble.js.map +1 -0
- package/lib/commonjs/core/DebugOverlay.js +184 -0
- package/lib/commonjs/core/DebugOverlay.js.map +1 -0
- package/lib/commonjs/core/DebuggerProvider.js +174 -0
- package/lib/commonjs/core/DebuggerProvider.js.map +1 -0
- package/lib/commonjs/core/GestureDetector.js +83 -0
- package/lib/commonjs/core/GestureDetector.js.map +1 -0
- package/lib/commonjs/core/PluginRegistry.js +124 -0
- package/lib/commonjs/core/PluginRegistry.js.map +1 -0
- package/lib/commonjs/core/theme.js +50 -0
- package/lib/commonjs/core/theme.js.map +1 -0
- package/lib/commonjs/core/types.js +6 -0
- package/lib/commonjs/core/types.js.map +1 -0
- package/lib/commonjs/core/useDebugger.js +27 -0
- package/lib/commonjs/core/useDebugger.js.map +1 -0
- package/lib/commonjs/core/utils.js +239 -0
- package/lib/commonjs/core/utils.js.map +1 -0
- package/lib/commonjs/index.js +132 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/plugins/console/ConsoleInterceptor.js +103 -0
- package/lib/commonjs/plugins/console/ConsoleInterceptor.js.map +1 -0
- package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js +269 -0
- package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js.map +1 -0
- package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js +363 -0
- package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
- package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js +218 -0
- package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js.map +1 -0
- package/lib/commonjs/plugins/customActions/actionStore.js +46 -0
- package/lib/commonjs/plugins/customActions/actionStore.js.map +1 -0
- package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js +268 -0
- package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
- package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js +184 -0
- package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
- package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js +381 -0
- package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
- package/lib/commonjs/plugins/featureFlags/flagStore.js +125 -0
- package/lib/commonjs/plugins/featureFlags/flagStore.js.map +1 -0
- package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js +250 -0
- package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/navigationInspector/navigationStore.js +65 -0
- package/lib/commonjs/plugins/navigationInspector/navigationStore.js.map +1 -0
- package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js +709 -0
- package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/network/NetworkInterceptor.js +305 -0
- package/lib/commonjs/plugins/network/NetworkInterceptor.js.map +1 -0
- package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js +261 -0
- package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js +265 -0
- package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
- package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js +50 -0
- package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
- package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js +378 -0
- package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js +62 -0
- package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
- package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js +496 -0
- package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
- package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js +44 -0
- package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
- package/lib/commonjs/plugins/timeline/TimelinePlugin.js +294 -0
- package/lib/commonjs/plugins/timeline/TimelinePlugin.js.map +1 -0
- package/lib/commonjs/plugins/timeline/timelineStore.js +61 -0
- package/lib/commonjs/plugins/timeline/timelineStore.js.map +1 -0
- package/lib/module/core/DebugBubble.js +131 -0
- package/lib/module/core/DebugBubble.js.map +1 -0
- package/lib/module/core/DebugOverlay.js +176 -0
- package/lib/module/core/DebugOverlay.js.map +1 -0
- package/lib/module/core/DebuggerProvider.js +167 -0
- package/lib/module/core/DebuggerProvider.js.map +1 -0
- package/lib/module/core/GestureDetector.js +75 -0
- package/lib/module/core/GestureDetector.js.map +1 -0
- package/lib/module/core/PluginRegistry.js +116 -0
- package/lib/module/core/PluginRegistry.js.map +1 -0
- package/lib/module/core/theme.js +43 -0
- package/lib/module/core/theme.js.map +1 -0
- package/lib/module/core/types.js +2 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/useDebugger.js +21 -0
- package/lib/module/core/useDebugger.js.map +1 -0
- package/lib/module/core/utils.js +219 -0
- package/lib/module/core/utils.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/plugins/console/ConsoleInterceptor.js +97 -0
- package/lib/module/plugins/console/ConsoleInterceptor.js.map +1 -0
- package/lib/module/plugins/console/ConsoleViewerPlugin.js +262 -0
- package/lib/module/plugins/console/ConsoleViewerPlugin.js.map +1 -0
- package/lib/module/plugins/crashReporter/CrashReporterPlugin.js +357 -0
- package/lib/module/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
- package/lib/module/plugins/customActions/CustomActionsPlugin.js +211 -0
- package/lib/module/plugins/customActions/CustomActionsPlugin.js.map +1 -0
- package/lib/module/plugins/customActions/actionStore.js +38 -0
- package/lib/module/plugins/customActions/actionStore.js.map +1 -0
- package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js +261 -0
- package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
- package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js +177 -0
- package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
- package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js +374 -0
- package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
- package/lib/module/plugins/featureFlags/flagStore.js +117 -0
- package/lib/module/plugins/featureFlags/flagStore.js.map +1 -0
- package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js +243 -0
- package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/navigationInspector/navigationStore.js +58 -0
- package/lib/module/plugins/navigationInspector/navigationStore.js.map +1 -0
- package/lib/module/plugins/network/NetworkInspectorPlugin.js +703 -0
- package/lib/module/plugins/network/NetworkInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/network/NetworkInterceptor.js +299 -0
- package/lib/module/plugins/network/NetworkInterceptor.js.map +1 -0
- package/lib/module/plugins/performance/PerformanceMonitorPlugin.js +254 -0
- package/lib/module/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
- package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js +258 -0
- package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
- package/lib/module/plugins/remoteConfig/remoteConfigStore.js +43 -0
- package/lib/module/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
- package/lib/module/plugins/stateInspector/StateInspectorPlugin.js +372 -0
- package/lib/module/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/stateInspector/stateAdapterRegistry.js +54 -0
- package/lib/module/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
- package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js +489 -0
- package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
- package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js +36 -0
- package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
- package/lib/module/plugins/timeline/TimelinePlugin.js +287 -0
- package/lib/module/plugins/timeline/TimelinePlugin.js.map +1 -0
- package/lib/module/plugins/timeline/timelineStore.js +54 -0
- package/lib/module/plugins/timeline/timelineStore.js.map +1 -0
- package/lib/typescript/core/DebugBubble.d.ts +22 -0
- package/lib/typescript/core/DebugBubble.d.ts.map +1 -0
- package/lib/typescript/core/DebugOverlay.d.ts +18 -0
- package/lib/typescript/core/DebugOverlay.d.ts.map +1 -0
- package/lib/typescript/core/DebuggerProvider.d.ts +25 -0
- package/lib/typescript/core/DebuggerProvider.d.ts.map +1 -0
- package/lib/typescript/core/GestureDetector.d.ts +20 -0
- package/lib/typescript/core/GestureDetector.d.ts.map +1 -0
- package/lib/typescript/core/PluginRegistry.d.ts +41 -0
- package/lib/typescript/core/PluginRegistry.d.ts.map +1 -0
- package/lib/typescript/core/theme.d.ts +11 -0
- package/lib/typescript/core/theme.d.ts.map +1 -0
- package/lib/typescript/core/types.d.ts +269 -0
- package/lib/typescript/core/types.d.ts.map +1 -0
- package/lib/typescript/core/useDebugger.d.ts +14 -0
- package/lib/typescript/core/useDebugger.d.ts.map +1 -0
- package/lib/typescript/core/utils.d.ts +46 -0
- package/lib/typescript/core/utils.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +23 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts +32 -0
- package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts +3 -0
- package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts +3 -0
- package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts +3 -0
- package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/customActions/actionStore.d.ts +16 -0
- package/lib/typescript/plugins/customActions/actionStore.d.ts.map +1 -0
- package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts +3 -0
- package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts +3 -0
- package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts +3 -0
- package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/featureFlags/flagStore.d.ts +45 -0
- package/lib/typescript/plugins/featureFlags/flagStore.d.ts.map +1 -0
- package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts +30 -0
- package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts.map +1 -0
- package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/network/NetworkInterceptor.d.ts +42 -0
- package/lib/typescript/plugins/network/NetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts +3 -0
- package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts +20 -0
- package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts.map +1 -0
- package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts +34 -0
- package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts.map +1 -0
- package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts +3 -0
- package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts +16 -0
- package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts.map +1 -0
- package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts +3 -0
- package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/timeline/timelineStore.d.ts +24 -0
- package/lib/typescript/plugins/timeline/timelineStore.d.ts.map +1 -0
- package/package.json +131 -0
- package/src/core/DebugBubble.tsx +149 -0
- package/src/core/DebugOverlay.tsx +211 -0
- package/src/core/DebuggerProvider.tsx +211 -0
- package/src/core/GestureDetector.tsx +95 -0
- package/src/core/PluginRegistry.ts +118 -0
- package/src/core/theme.ts +41 -0
- package/src/core/types.ts +339 -0
- package/src/core/useDebugger.ts +24 -0
- package/src/core/utils.ts +221 -0
- package/src/index.ts +67 -0
- package/src/plugins/console/ConsoleInterceptor.ts +110 -0
- package/src/plugins/console/ConsoleViewerPlugin.tsx +241 -0
- package/src/plugins/crashReporter/CrashReporterPlugin.tsx +316 -0
- package/src/plugins/customActions/CustomActionsPlugin.tsx +199 -0
- package/src/plugins/customActions/actionStore.ts +49 -0
- package/src/plugins/deepLinkTester/DeepLinkTesterPlugin.tsx +213 -0
- package/src/plugins/deviceInfo/DeviceInfoPlugin.tsx +153 -0
- package/src/plugins/featureFlags/FeatureFlagsPlugin.tsx +338 -0
- package/src/plugins/featureFlags/flagStore.ts +118 -0
- package/src/plugins/navigationInspector/NavigationInspectorPlugin.tsx +170 -0
- package/src/plugins/navigationInspector/navigationStore.ts +70 -0
- package/src/plugins/network/NetworkInspectorPlugin.tsx +598 -0
- package/src/plugins/network/NetworkInterceptor.ts +344 -0
- package/src/plugins/performance/PerformanceMonitorPlugin.tsx +194 -0
- package/src/plugins/remoteConfig/RemoteConfigPlugin.tsx +205 -0
- package/src/plugins/remoteConfig/remoteConfigStore.ts +48 -0
- package/src/plugins/stateInspector/StateInspectorPlugin.tsx +342 -0
- package/src/plugins/stateInspector/stateAdapterRegistry.ts +66 -0
- package/src/plugins/storageBrowser/StorageBrowserPlugin.tsx +410 -0
- package/src/plugins/storageBrowser/storageAdapterRegistry.ts +47 -0
- package/src/plugins/timeline/TimelinePlugin.tsx +242 -0
- package/src/plugins/timeline/timelineStore.ts +65 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { View, Text, FlatList, TouchableOpacity, ScrollView, StyleSheet } from 'react-native';
|
|
3
|
+
import { generateId, formatTimestamp, copyToClipboard, shareText } from '../../core/utils';
|
|
4
|
+
|
|
5
|
+
// ─── Crash Store ────────────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
class CrashStoreClass {
|
|
8
|
+
entries = [];
|
|
9
|
+
listeners = new Set();
|
|
10
|
+
isActive = false;
|
|
11
|
+
maxEntries = 100;
|
|
12
|
+
originalHandler = null;
|
|
13
|
+
start() {
|
|
14
|
+
if (this.isActive) return;
|
|
15
|
+
this.isActive = true;
|
|
16
|
+
|
|
17
|
+
// Capture unhandled JS errors
|
|
18
|
+
const ErrorUtils = globalThis.ErrorUtils;
|
|
19
|
+
if (ErrorUtils) {
|
|
20
|
+
this.originalHandler = ErrorUtils.getGlobalHandler();
|
|
21
|
+
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
22
|
+
this.addEntry({
|
|
23
|
+
id: generateId(),
|
|
24
|
+
timestamp: Date.now(),
|
|
25
|
+
message: error.message,
|
|
26
|
+
stack: error.stack,
|
|
27
|
+
isFatal: isFatal ?? false
|
|
28
|
+
});
|
|
29
|
+
// Forward to original handler
|
|
30
|
+
if (this.originalHandler) {
|
|
31
|
+
this.originalHandler(error, isFatal);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Capture unhandled promise rejections
|
|
37
|
+
const tracking = require('promise/setimmediate/rejection-tracking');
|
|
38
|
+
if (tracking) {
|
|
39
|
+
try {
|
|
40
|
+
tracking.enable({
|
|
41
|
+
allRejections: true,
|
|
42
|
+
onUnhandled: (_id, error) => {
|
|
43
|
+
this.addEntry({
|
|
44
|
+
id: generateId(),
|
|
45
|
+
timestamp: Date.now(),
|
|
46
|
+
message: error?.message || 'Unhandled Promise Rejection',
|
|
47
|
+
stack: error?.stack,
|
|
48
|
+
isFatal: false
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
} catch {
|
|
53
|
+
// Rejection tracking may not be available
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
stop() {
|
|
58
|
+
if (!this.isActive) return;
|
|
59
|
+
this.isActive = false;
|
|
60
|
+
const ErrorUtils = globalThis.ErrorUtils;
|
|
61
|
+
if (ErrorUtils && this.originalHandler) {
|
|
62
|
+
ErrorUtils.setGlobalHandler(this.originalHandler);
|
|
63
|
+
this.originalHandler = null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
addEntry(entry) {
|
|
67
|
+
this.entries = [entry, ...this.entries].slice(0, this.maxEntries);
|
|
68
|
+
this.notify();
|
|
69
|
+
}
|
|
70
|
+
getAll() {
|
|
71
|
+
return [...this.entries];
|
|
72
|
+
}
|
|
73
|
+
clear() {
|
|
74
|
+
this.entries = [];
|
|
75
|
+
this.notify();
|
|
76
|
+
}
|
|
77
|
+
subscribe(listener) {
|
|
78
|
+
this.listeners.add(listener);
|
|
79
|
+
listener(this.entries);
|
|
80
|
+
return () => this.listeners.delete(listener);
|
|
81
|
+
}
|
|
82
|
+
notify() {
|
|
83
|
+
const snapshot = this.entries;
|
|
84
|
+
for (const l of this.listeners) {
|
|
85
|
+
try {
|
|
86
|
+
l(snapshot);
|
|
87
|
+
} catch {
|
|
88
|
+
/* ignore */
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const crashStore = new CrashStoreClass();
|
|
94
|
+
|
|
95
|
+
// ─── Crash Reporter Panel ───────────────────────────────────────────────────
|
|
96
|
+
|
|
97
|
+
const CrashReporterPanel = ({
|
|
98
|
+
theme
|
|
99
|
+
}) => {
|
|
100
|
+
const [entries, setEntries] = useState([]);
|
|
101
|
+
const [selectedEntry, setSelectedEntry] = useState(null);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const unsub = crashStore.subscribe(setEntries);
|
|
104
|
+
return unsub;
|
|
105
|
+
}, []);
|
|
106
|
+
const handleClear = useCallback(() => {
|
|
107
|
+
crashStore.clear();
|
|
108
|
+
setSelectedEntry(null);
|
|
109
|
+
}, []);
|
|
110
|
+
if (selectedEntry) {
|
|
111
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
112
|
+
style: styles.container
|
|
113
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
114
|
+
style: [styles.header, {
|
|
115
|
+
backgroundColor: theme.surface,
|
|
116
|
+
borderBottomColor: theme.border
|
|
117
|
+
}]
|
|
118
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
119
|
+
onPress: () => setSelectedEntry(null),
|
|
120
|
+
activeOpacity: 0.7
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
122
|
+
style: [styles.backBtn, {
|
|
123
|
+
color: theme.accent
|
|
124
|
+
}]
|
|
125
|
+
}, "\u2190 Back")), /*#__PURE__*/React.createElement(View, {
|
|
126
|
+
style: styles.headerActions
|
|
127
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
128
|
+
onPress: () => copyToClipboard(`${selectedEntry.message}\n\n${selectedEntry.stack || ''}`),
|
|
129
|
+
activeOpacity: 0.7
|
|
130
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
131
|
+
style: [styles.actionText, {
|
|
132
|
+
color: theme.accent
|
|
133
|
+
}]
|
|
134
|
+
}, "Copy")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
135
|
+
onPress: () => shareText(`${selectedEntry.message}\n\n${selectedEntry.stack || ''}`, 'Crash Report'),
|
|
136
|
+
activeOpacity: 0.7
|
|
137
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
138
|
+
style: [styles.actionText, {
|
|
139
|
+
color: theme.accent
|
|
140
|
+
}]
|
|
141
|
+
}, "Share")))), /*#__PURE__*/React.createElement(ScrollView, {
|
|
142
|
+
style: styles.detailContent
|
|
143
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
144
|
+
style: [styles.crashBadge, {
|
|
145
|
+
backgroundColor: selectedEntry.isFatal ? theme.error : theme.warning
|
|
146
|
+
}]
|
|
147
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
148
|
+
style: styles.crashBadgeText
|
|
149
|
+
}, selectedEntry.isFatal ? 'FATAL' : 'NON-FATAL')), /*#__PURE__*/React.createElement(Text, {
|
|
150
|
+
style: [styles.crashTime, {
|
|
151
|
+
color: theme.textMuted
|
|
152
|
+
}]
|
|
153
|
+
}, formatTimestamp(selectedEntry.timestamp)), /*#__PURE__*/React.createElement(Text, {
|
|
154
|
+
style: [styles.crashMessage, {
|
|
155
|
+
color: theme.text
|
|
156
|
+
}]
|
|
157
|
+
}, selectedEntry.message), selectedEntry.stack && /*#__PURE__*/React.createElement(View, {
|
|
158
|
+
style: [styles.stackBlock, {
|
|
159
|
+
backgroundColor: theme.codeBackground
|
|
160
|
+
}]
|
|
161
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
162
|
+
style: [styles.stackText, {
|
|
163
|
+
color: theme.codeText
|
|
164
|
+
}],
|
|
165
|
+
selectable: true
|
|
166
|
+
}, selectedEntry.stack)), selectedEntry.componentStack && /*#__PURE__*/React.createElement(View, {
|
|
167
|
+
style: [styles.stackBlock, {
|
|
168
|
+
backgroundColor: theme.codeBackground,
|
|
169
|
+
marginTop: 12
|
|
170
|
+
}]
|
|
171
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
172
|
+
style: [styles.stackLabel, {
|
|
173
|
+
color: theme.textSecondary
|
|
174
|
+
}]
|
|
175
|
+
}, "Component Stack"), /*#__PURE__*/React.createElement(Text, {
|
|
176
|
+
style: [styles.stackText, {
|
|
177
|
+
color: theme.codeText
|
|
178
|
+
}],
|
|
179
|
+
selectable: true
|
|
180
|
+
}, selectedEntry.componentStack))));
|
|
181
|
+
}
|
|
182
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
183
|
+
style: styles.container
|
|
184
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
185
|
+
style: [styles.header, {
|
|
186
|
+
backgroundColor: theme.surface,
|
|
187
|
+
borderBottomColor: theme.border
|
|
188
|
+
}]
|
|
189
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
190
|
+
style: [styles.headerTitle, {
|
|
191
|
+
color: theme.text
|
|
192
|
+
}]
|
|
193
|
+
}, entries.length > 0 ? `${entries.length} crashes` : 'No crashes 🎉'), entries.length > 0 && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
194
|
+
onPress: handleClear,
|
|
195
|
+
activeOpacity: 0.7
|
|
196
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
197
|
+
style: [styles.clearBtn, {
|
|
198
|
+
color: theme.error
|
|
199
|
+
}]
|
|
200
|
+
}, "Clear"))), /*#__PURE__*/React.createElement(FlatList, {
|
|
201
|
+
data: entries,
|
|
202
|
+
keyExtractor: item => item.id,
|
|
203
|
+
renderItem: ({
|
|
204
|
+
item
|
|
205
|
+
}) => /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
206
|
+
style: [styles.crashRow, {
|
|
207
|
+
borderBottomColor: theme.border,
|
|
208
|
+
backgroundColor: item.isFatal ? `${theme.error}10` : theme.surface
|
|
209
|
+
}],
|
|
210
|
+
onPress: () => setSelectedEntry(item),
|
|
211
|
+
activeOpacity: 0.7
|
|
212
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
213
|
+
style: [styles.fatalDot, {
|
|
214
|
+
backgroundColor: item.isFatal ? theme.error : theme.warning
|
|
215
|
+
}]
|
|
216
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
217
|
+
style: styles.crashInfo
|
|
218
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
219
|
+
style: [styles.crashMsg, {
|
|
220
|
+
color: theme.text
|
|
221
|
+
}],
|
|
222
|
+
numberOfLines: 2
|
|
223
|
+
}, item.message), /*#__PURE__*/React.createElement(Text, {
|
|
224
|
+
style: [styles.crashTimestamp, {
|
|
225
|
+
color: theme.textMuted
|
|
226
|
+
}]
|
|
227
|
+
}, formatTimestamp(item.timestamp)))),
|
|
228
|
+
ListEmptyComponent: /*#__PURE__*/React.createElement(View, {
|
|
229
|
+
style: styles.emptyContainer
|
|
230
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
231
|
+
style: styles.emptyIcon
|
|
232
|
+
}, "\u2705"), /*#__PURE__*/React.createElement(Text, {
|
|
233
|
+
style: [styles.emptyText, {
|
|
234
|
+
color: theme.textMuted
|
|
235
|
+
}]
|
|
236
|
+
}, "No crashes captured"))
|
|
237
|
+
}));
|
|
238
|
+
};
|
|
239
|
+
const styles = StyleSheet.create({
|
|
240
|
+
container: {
|
|
241
|
+
flex: 1
|
|
242
|
+
},
|
|
243
|
+
header: {
|
|
244
|
+
flexDirection: 'row',
|
|
245
|
+
justifyContent: 'space-between',
|
|
246
|
+
alignItems: 'center',
|
|
247
|
+
paddingHorizontal: 12,
|
|
248
|
+
paddingVertical: 10,
|
|
249
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
250
|
+
},
|
|
251
|
+
headerTitle: {
|
|
252
|
+
fontSize: 14,
|
|
253
|
+
fontWeight: '700'
|
|
254
|
+
},
|
|
255
|
+
clearBtn: {
|
|
256
|
+
fontSize: 13,
|
|
257
|
+
fontWeight: '700'
|
|
258
|
+
},
|
|
259
|
+
backBtn: {
|
|
260
|
+
fontSize: 14,
|
|
261
|
+
fontWeight: '600'
|
|
262
|
+
},
|
|
263
|
+
headerActions: {
|
|
264
|
+
flexDirection: 'row',
|
|
265
|
+
gap: 12
|
|
266
|
+
},
|
|
267
|
+
actionText: {
|
|
268
|
+
fontSize: 12,
|
|
269
|
+
fontWeight: '600'
|
|
270
|
+
},
|
|
271
|
+
crashRow: {
|
|
272
|
+
flexDirection: 'row',
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
paddingHorizontal: 12,
|
|
275
|
+
paddingVertical: 10,
|
|
276
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
277
|
+
},
|
|
278
|
+
fatalDot: {
|
|
279
|
+
width: 8,
|
|
280
|
+
height: 8,
|
|
281
|
+
borderRadius: 4,
|
|
282
|
+
marginRight: 10
|
|
283
|
+
},
|
|
284
|
+
crashInfo: {
|
|
285
|
+
flex: 1
|
|
286
|
+
},
|
|
287
|
+
crashMsg: {
|
|
288
|
+
fontSize: 13,
|
|
289
|
+
fontWeight: '500'
|
|
290
|
+
},
|
|
291
|
+
crashTimestamp: {
|
|
292
|
+
fontSize: 10,
|
|
293
|
+
marginTop: 2
|
|
294
|
+
},
|
|
295
|
+
emptyContainer: {
|
|
296
|
+
alignItems: 'center',
|
|
297
|
+
paddingVertical: 60
|
|
298
|
+
},
|
|
299
|
+
emptyIcon: {
|
|
300
|
+
fontSize: 48,
|
|
301
|
+
marginBottom: 12
|
|
302
|
+
},
|
|
303
|
+
emptyText: {
|
|
304
|
+
fontSize: 13
|
|
305
|
+
},
|
|
306
|
+
detailContent: {
|
|
307
|
+
flex: 1,
|
|
308
|
+
padding: 12
|
|
309
|
+
},
|
|
310
|
+
crashBadge: {
|
|
311
|
+
alignSelf: 'flex-start',
|
|
312
|
+
paddingHorizontal: 10,
|
|
313
|
+
paddingVertical: 3,
|
|
314
|
+
borderRadius: 6,
|
|
315
|
+
marginBottom: 8
|
|
316
|
+
},
|
|
317
|
+
crashBadgeText: {
|
|
318
|
+
fontSize: 10,
|
|
319
|
+
fontWeight: '800',
|
|
320
|
+
color: '#FFF',
|
|
321
|
+
letterSpacing: 1
|
|
322
|
+
},
|
|
323
|
+
crashTime: {
|
|
324
|
+
fontSize: 11,
|
|
325
|
+
marginBottom: 8
|
|
326
|
+
},
|
|
327
|
+
crashMessage: {
|
|
328
|
+
fontSize: 16,
|
|
329
|
+
fontWeight: '700',
|
|
330
|
+
marginBottom: 16
|
|
331
|
+
},
|
|
332
|
+
stackBlock: {
|
|
333
|
+
padding: 12,
|
|
334
|
+
borderRadius: 8
|
|
335
|
+
},
|
|
336
|
+
stackLabel: {
|
|
337
|
+
fontSize: 11,
|
|
338
|
+
fontWeight: '700',
|
|
339
|
+
marginBottom: 4,
|
|
340
|
+
textTransform: 'uppercase'
|
|
341
|
+
},
|
|
342
|
+
stackText: {
|
|
343
|
+
fontSize: 11,
|
|
344
|
+
fontFamily: 'monospace',
|
|
345
|
+
lineHeight: 18
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
export function createCrashReporterPlugin() {
|
|
349
|
+
return {
|
|
350
|
+
id: 'crash-reporter',
|
|
351
|
+
name: 'Crashes',
|
|
352
|
+
icon: '💥',
|
|
353
|
+
component: CrashReporterPanel,
|
|
354
|
+
order: 100
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=CrashReporterPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","useCallback","View","Text","FlatList","TouchableOpacity","ScrollView","StyleSheet","generateId","formatTimestamp","copyToClipboard","shareText","CrashStoreClass","entries","listeners","Set","isActive","maxEntries","originalHandler","start","ErrorUtils","globalThis","getGlobalHandler","setGlobalHandler","error","isFatal","addEntry","id","timestamp","Date","now","message","stack","tracking","require","enable","allRejections","onUnhandled","_id","stop","entry","slice","notify","getAll","clear","subscribe","listener","add","delete","snapshot","l","crashStore","CrashReporterPanel","theme","setEntries","selectedEntry","setSelectedEntry","unsub","handleClear","createElement","style","styles","container","header","backgroundColor","surface","borderBottomColor","border","onPress","activeOpacity","backBtn","color","accent","headerActions","actionText","detailContent","crashBadge","warning","crashBadgeText","crashTime","textMuted","crashMessage","text","stackBlock","codeBackground","stackText","codeText","selectable","componentStack","marginTop","stackLabel","textSecondary","headerTitle","length","clearBtn","data","keyExtractor","item","renderItem","crashRow","fatalDot","crashInfo","crashMsg","numberOfLines","crashTimestamp","ListEmptyComponent","emptyContainer","emptyIcon","emptyText","create","flex","flexDirection","justifyContent","alignItems","paddingHorizontal","paddingVertical","borderBottomWidth","hairlineWidth","fontSize","fontWeight","gap","width","height","borderRadius","marginRight","marginBottom","padding","alignSelf","letterSpacing","textTransform","fontFamily","lineHeight","createCrashReporterPlugin","name","icon","component","order"],"sourceRoot":"../../../../src","sources":["plugins/crashReporter/CrashReporterPlugin.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC/D,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAE7F,SAASC,UAAU,EAAEC,eAAe,EAAEC,eAAe,EAAEC,SAAS,QAAQ,kBAAkB;;AAE1F;;AAIA,MAAMC,eAAe,CAAC;EACZC,OAAO,GAAiB,EAAE;EAC1BC,SAAS,GAAuB,IAAIC,GAAG,CAAC,CAAC;EACzCC,QAAQ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,EAAE,SAAS;IACfC,IAAI,EAAE,IAAI;IACVC,SAAS,EAAEnF,kBAAkB;IAC7BoF,KAAK,EAAE;EACT,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, ScrollView, StyleSheet, Alert, ActivityIndicator } from 'react-native';
|
|
3
|
+
import { actionStore } from './actionStore';
|
|
4
|
+
const CustomActionsPanel = ({
|
|
5
|
+
theme
|
|
6
|
+
}) => {
|
|
7
|
+
const [actions, setActions] = useState([]);
|
|
8
|
+
const [runningAction, setRunningAction] = useState(null);
|
|
9
|
+
const [lastResult, setLastResult] = useState(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const unsub = actionStore.subscribe(setActions);
|
|
12
|
+
return unsub;
|
|
13
|
+
}, []);
|
|
14
|
+
const handleRun = useCallback(async action => {
|
|
15
|
+
const execute = async () => {
|
|
16
|
+
setRunningAction(action.id);
|
|
17
|
+
setLastResult(null);
|
|
18
|
+
try {
|
|
19
|
+
await action.handler();
|
|
20
|
+
setLastResult({
|
|
21
|
+
id: action.id,
|
|
22
|
+
success: true,
|
|
23
|
+
message: 'Completed'
|
|
24
|
+
});
|
|
25
|
+
} catch (err) {
|
|
26
|
+
setLastResult({
|
|
27
|
+
id: action.id,
|
|
28
|
+
success: false,
|
|
29
|
+
message: err instanceof Error ? err.message : 'Failed'
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
setRunningAction(null);
|
|
33
|
+
};
|
|
34
|
+
if (action.destructive) {
|
|
35
|
+
Alert.alert('⚠️ Confirm', `Run "${action.name}"? This action is marked as destructive.`, [{
|
|
36
|
+
text: 'Cancel',
|
|
37
|
+
style: 'cancel'
|
|
38
|
+
}, {
|
|
39
|
+
text: 'Run',
|
|
40
|
+
style: 'destructive',
|
|
41
|
+
onPress: execute
|
|
42
|
+
}]);
|
|
43
|
+
} else {
|
|
44
|
+
execute();
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
const groups = React.useMemo(() => {
|
|
48
|
+
const groupMap = new Map();
|
|
49
|
+
for (const action of actions) {
|
|
50
|
+
const group = action.group || 'General';
|
|
51
|
+
const list = groupMap.get(group) || [];
|
|
52
|
+
list.push(action);
|
|
53
|
+
groupMap.set(group, list);
|
|
54
|
+
}
|
|
55
|
+
return groupMap;
|
|
56
|
+
}, [actions]);
|
|
57
|
+
if (actions.length === 0) {
|
|
58
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
59
|
+
style: styles.emptyContainer
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
61
|
+
style: styles.emptyIcon
|
|
62
|
+
}, "\uD83C\uDFAF"), /*#__PURE__*/React.createElement(Text, {
|
|
63
|
+
style: [styles.emptyTitle, {
|
|
64
|
+
color: theme.text
|
|
65
|
+
}]
|
|
66
|
+
}, "No Custom Actions"), /*#__PURE__*/React.createElement(Text, {
|
|
67
|
+
style: [styles.emptyDesc, {
|
|
68
|
+
color: theme.textMuted
|
|
69
|
+
}]
|
|
70
|
+
}, "Register actions:", '\n\n', /*#__PURE__*/React.createElement(Text, {
|
|
71
|
+
style: {
|
|
72
|
+
fontFamily: 'monospace',
|
|
73
|
+
color: theme.codeText
|
|
74
|
+
}
|
|
75
|
+
}, 'registerAction({\n id: "clear-cache",\n name: "Clear Cache",\n icon: "🗑️",\n handler: () => clearCache(),\n})')));
|
|
76
|
+
}
|
|
77
|
+
return /*#__PURE__*/React.createElement(ScrollView, {
|
|
78
|
+
style: styles.container
|
|
79
|
+
}, lastResult && /*#__PURE__*/React.createElement(View, {
|
|
80
|
+
style: [styles.resultBanner, {
|
|
81
|
+
backgroundColor: lastResult.success ? `${theme.success}20` : `${theme.error}20`
|
|
82
|
+
}]
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
84
|
+
style: [styles.resultText, {
|
|
85
|
+
color: lastResult.success ? theme.success : theme.error
|
|
86
|
+
}]
|
|
87
|
+
}, lastResult.success ? '✅' : '❌', " ", lastResult.message)), Array.from(groups.entries()).map(([groupName, groupActions]) => /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
key: groupName,
|
|
89
|
+
style: styles.group
|
|
90
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
91
|
+
style: [styles.groupTitle, {
|
|
92
|
+
color: theme.textSecondary
|
|
93
|
+
}]
|
|
94
|
+
}, groupName), /*#__PURE__*/React.createElement(View, {
|
|
95
|
+
style: styles.grid
|
|
96
|
+
}, groupActions.map(action => /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
97
|
+
key: action.id,
|
|
98
|
+
style: [styles.actionCard, {
|
|
99
|
+
backgroundColor: theme.surface,
|
|
100
|
+
borderColor: action.destructive ? theme.error : theme.border
|
|
101
|
+
}],
|
|
102
|
+
onPress: () => handleRun(action),
|
|
103
|
+
activeOpacity: 0.7,
|
|
104
|
+
disabled: !!runningAction
|
|
105
|
+
}, runningAction === action.id ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
106
|
+
color: theme.accent,
|
|
107
|
+
size: "small"
|
|
108
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
109
|
+
style: styles.actionIcon
|
|
110
|
+
}, action.icon || '⚡'), /*#__PURE__*/React.createElement(Text, {
|
|
111
|
+
style: [styles.actionName, {
|
|
112
|
+
color: action.destructive ? theme.error : theme.text
|
|
113
|
+
}],
|
|
114
|
+
numberOfLines: 1
|
|
115
|
+
}, action.name), action.description && /*#__PURE__*/React.createElement(Text, {
|
|
116
|
+
style: [styles.actionDesc, {
|
|
117
|
+
color: theme.textMuted
|
|
118
|
+
}],
|
|
119
|
+
numberOfLines: 2
|
|
120
|
+
}, action.description))))))), /*#__PURE__*/React.createElement(View, {
|
|
121
|
+
style: {
|
|
122
|
+
height: 40
|
|
123
|
+
}
|
|
124
|
+
}));
|
|
125
|
+
};
|
|
126
|
+
const styles = StyleSheet.create({
|
|
127
|
+
container: {
|
|
128
|
+
flex: 1
|
|
129
|
+
},
|
|
130
|
+
emptyContainer: {
|
|
131
|
+
flex: 1,
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
paddingHorizontal: 32
|
|
135
|
+
},
|
|
136
|
+
emptyIcon: {
|
|
137
|
+
fontSize: 48,
|
|
138
|
+
marginBottom: 16
|
|
139
|
+
},
|
|
140
|
+
emptyTitle: {
|
|
141
|
+
fontSize: 16,
|
|
142
|
+
fontWeight: '700',
|
|
143
|
+
marginBottom: 8
|
|
144
|
+
},
|
|
145
|
+
emptyDesc: {
|
|
146
|
+
fontSize: 13,
|
|
147
|
+
textAlign: 'center',
|
|
148
|
+
lineHeight: 20
|
|
149
|
+
},
|
|
150
|
+
resultBanner: {
|
|
151
|
+
padding: 10,
|
|
152
|
+
marginHorizontal: 12,
|
|
153
|
+
marginVertical: 8,
|
|
154
|
+
borderRadius: 8
|
|
155
|
+
},
|
|
156
|
+
resultText: {
|
|
157
|
+
fontSize: 13,
|
|
158
|
+
fontWeight: '600',
|
|
159
|
+
textAlign: 'center'
|
|
160
|
+
},
|
|
161
|
+
group: {
|
|
162
|
+
paddingHorizontal: 12,
|
|
163
|
+
marginBottom: 16
|
|
164
|
+
},
|
|
165
|
+
groupTitle: {
|
|
166
|
+
fontSize: 11,
|
|
167
|
+
fontWeight: '700',
|
|
168
|
+
textTransform: 'uppercase',
|
|
169
|
+
letterSpacing: 1,
|
|
170
|
+
marginBottom: 8,
|
|
171
|
+
marginTop: 12
|
|
172
|
+
},
|
|
173
|
+
grid: {
|
|
174
|
+
flexDirection: 'row',
|
|
175
|
+
flexWrap: 'wrap',
|
|
176
|
+
gap: 8
|
|
177
|
+
},
|
|
178
|
+
actionCard: {
|
|
179
|
+
width: '47%',
|
|
180
|
+
padding: 16,
|
|
181
|
+
borderRadius: 12,
|
|
182
|
+
borderWidth: 1,
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
justifyContent: 'center',
|
|
185
|
+
minHeight: 90
|
|
186
|
+
},
|
|
187
|
+
actionIcon: {
|
|
188
|
+
fontSize: 24,
|
|
189
|
+
marginBottom: 8
|
|
190
|
+
},
|
|
191
|
+
actionName: {
|
|
192
|
+
fontSize: 13,
|
|
193
|
+
fontWeight: '700',
|
|
194
|
+
textAlign: 'center'
|
|
195
|
+
},
|
|
196
|
+
actionDesc: {
|
|
197
|
+
fontSize: 10,
|
|
198
|
+
textAlign: 'center',
|
|
199
|
+
marginTop: 4
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
export function createCustomActionsPlugin() {
|
|
203
|
+
return {
|
|
204
|
+
id: 'custom-actions',
|
|
205
|
+
name: 'Actions',
|
|
206
|
+
icon: '🎯',
|
|
207
|
+
component: CustomActionsPanel,
|
|
208
|
+
order: 110
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=CustomActionsPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","useCallback","View","Text","TouchableOpacity","ScrollView","StyleSheet","Alert","ActivityIndicator","actionStore","CustomActionsPanel","theme","actions","setActions","runningAction","setRunningAction","lastResult","setLastResult","unsub","subscribe","handleRun","action","execute","id","handler","success","message","err","Error","destructive","alert","name","text","style","onPress","groups","useMemo","groupMap","Map","group","list","get","push","set","length","createElement","styles","emptyContainer","emptyIcon","emptyTitle","color","emptyDesc","textMuted","fontFamily","codeText","container","resultBanner","backgroundColor","error","resultText","Array","from","entries","map","groupName","groupActions","key","groupTitle","textSecondary","grid","actionCard","surface","borderColor","border","activeOpacity","disabled","accent","size","Fragment","actionIcon","icon","actionName","numberOfLines","description","actionDesc","height","create","flex","alignItems","justifyContent","paddingHorizontal","fontSize","marginBottom","fontWeight","textAlign","lineHeight","padding","marginHorizontal","marginVertical","borderRadius","textTransform","letterSpacing","marginTop","flexDirection","flexWrap","gap","width","borderWidth","minHeight","createCustomAction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oreClass {
|
|
2
|
+
actions = new Map();
|
|
3
|
+
listeners = new Set();
|
|
4
|
+
register(action) {
|
|
5
|
+
this.actions.set(action.id, action);
|
|
6
|
+
this.notify();
|
|
7
|
+
}
|
|
8
|
+
remove(id) {
|
|
9
|
+
this.actions.delete(id);
|
|
10
|
+
this.notify();
|
|
11
|
+
}
|
|
12
|
+
getAll() {
|
|
13
|
+
return Array.from(this.actions.values());
|
|
14
|
+
}
|
|
15
|
+
subscribe(listener) {
|
|
16
|
+
this.listeners.add(listener);
|
|
17
|
+
listener(this.getAll());
|
|
18
|
+
return () => this.listeners.delete(listener);
|
|
19
|
+
}
|
|
20
|
+
notify() {
|
|
21
|
+
const snapshot = this.getAll();
|
|
22
|
+
for (const l of this.listeners) {
|
|
23
|
+
try {
|
|
24
|
+
l(snapshot);
|
|
25
|
+
} catch {
|
|
26
|
+
/* ignore */
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export const actionStore = new ActionStoreClass();
|
|
32
|
+
export function registerAction(action) {
|
|
33
|
+
actionStore.register(action);
|
|
34
|
+
}
|
|
35
|
+
export function removeAction(id) {
|
|
36
|
+
actionStore.remove(id);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=actionStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ActionStoreClass","actions","Map","listeners","Set","register","action","set","id","notify","remove","delete","getAll","Array","from","values","subscribe","listener","add","snapshot","l","actionStore","registerAction","removeAction"],"sourceRoot":"../../../../src","sources":["plugins/customActions/actionStore.ts"],"mappings":"AAIA,MAAMA,gBAAgB,CAAC;EACbC,OAAO,GAA8B,IAAIC,GAAG,CAAC,CAAC;EAC9CC,SAAS,GAAwB,IAAIC,GAAG,CAAC,CAAC;EAElDC,QAAQA,CAACC,MAAoB,EAAQ;IACnC,IAAI,CAACL,OAAO,CAACM,GAAG,CAACD,MAAM,CAACE,EAAE,EAAEF,MAAM,CAAC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