react-native-inapp-inspector 1.1.13 → 1.1.15
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/README.md +9 -34
- package/dist/commonjs/assets/svgAssets.d.ts +3 -0
- package/dist/commonjs/assets/svgAssets.js +17 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/commonjs/components/AnalyticsEventCard.js +120 -50
- package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
- package/dist/commonjs/components/AnalyticsGraph.js +8 -8
- package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
- package/dist/commonjs/components/AnalyticsTabView.js +157 -0
- package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
- package/dist/commonjs/components/AnimatedEntrance.js +2 -2
- package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
- package/dist/commonjs/components/ApiDetailView.js +304 -0
- package/dist/commonjs/components/ApisTabView.d.ts +33 -0
- package/dist/commonjs/components/ApisTabView.js +235 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
- package/dist/commonjs/components/CodeSnippet.js +34 -34
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
- package/dist/commonjs/components/ConsoleLogCard.js +262 -442
- package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
- package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
- package/dist/commonjs/components/DiffViewer.js +4 -2
- package/dist/commonjs/components/DomainHeader.js +66 -41
- package/dist/commonjs/components/EmptyState.d.ts +2 -2
- package/dist/commonjs/components/EmptyState.js +2 -2
- package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
- package/dist/commonjs/components/EndOfListFooter.js +90 -0
- package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
- package/dist/commonjs/components/ErrorBoundary.js +28 -28
- package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
- package/dist/commonjs/components/FloatingBubble.js +75 -0
- package/dist/commonjs/components/HeadersSection.js +5 -3
- package/dist/commonjs/components/HighlightText.d.ts +1 -1
- package/dist/commonjs/components/HighlightText.js +5 -7
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +232 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
- package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
- package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
- package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +281 -0
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
- package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TabBar.js +95 -0
- package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
- package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
- package/dist/commonjs/components/InspectorHeader.js +329 -0
- package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
- package/dist/commonjs/components/InspectorTabBar.js +90 -0
- package/dist/commonjs/components/JsonViewer.d.ts +4 -1
- package/dist/commonjs/components/JsonViewer.js +110 -171
- package/dist/commonjs/components/LogCard.js +109 -86
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
- package/dist/commonjs/components/MetaAccordion.js +23 -21
- package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
- package/dist/commonjs/components/NavigationTracker.js +76 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +54 -8
- package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
- package/dist/commonjs/components/ReduxTabView.js +56 -0
- package/dist/commonjs/components/ReduxTreeView.js +241 -200
- package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
- package/dist/commonjs/components/SegmentedTabs.js +52 -0
- package/dist/commonjs/components/SettingsView.d.ts +13 -0
- package/dist/commonjs/components/SettingsView.js +328 -0
- package/dist/commonjs/components/TouchableScale.d.ts +2 -2
- package/dist/commonjs/components/TouchableScale.js +2 -2
- package/dist/commonjs/components/TreeNode.js +2 -2
- package/dist/commonjs/constants/index.js +1 -12
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +42 -1
- package/dist/commonjs/customHooks/consoleLogger.js +137 -13
- package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
- package/dist/commonjs/customHooks/networkLogger.js +0 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
- package/dist/commonjs/enums/index.d.ts +39 -0
- package/dist/commonjs/enums/index.js +50 -0
- package/dist/commonjs/helpers/index.d.ts +27 -1
- package/dist/commonjs/helpers/index.js +187 -12
- package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
- package/dist/commonjs/i18n/en.json +144 -0
- package/dist/commonjs/i18n/index.d.ts +2 -0
- package/dist/commonjs/i18n/index.js +27 -0
- package/dist/commonjs/i18n/locales/en.json +314 -0
- package/dist/commonjs/index.d.ts +2 -3
- package/dist/commonjs/index.js +207 -4927
- package/dist/commonjs/styles/AppColors.d.ts +148 -0
- package/dist/commonjs/styles/AppColors.js +176 -0
- package/dist/commonjs/styles/common.d.ts +3 -0
- package/dist/commonjs/styles/common.js +201 -0
- package/dist/commonjs/styles/index.d.ts +219 -435
- package/dist/commonjs/styles/index.js +312 -488
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.js +4 -0
- package/dist/commonjs/types/index.d.ts +4 -111
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/interfaces.d.ts +337 -0
- package/dist/commonjs/types/interfaces.js +2 -0
- package/dist/esm/assets/svgAssets.d.ts +3 -0
- package/dist/esm/assets/svgAssets.js +14 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/esm/components/AnalyticsEventCard.js +118 -48
- package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
- package/dist/esm/components/AnalyticsGraph.js +8 -8
- package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
- package/dist/esm/components/AnalyticsTabView.js +151 -0
- package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
- package/dist/esm/components/AnimatedEntrance.js +2 -2
- package/dist/esm/components/ApiDetailView.d.ts +22 -0
- package/dist/esm/components/ApiDetailView.js +264 -0
- package/dist/esm/components/ApisTabView.d.ts +33 -0
- package/dist/esm/components/ApisTabView.js +196 -0
- package/dist/esm/components/CodeSnippet.d.ts +1 -5
- package/dist/esm/components/CodeSnippet.js +34 -34
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
- package/dist/esm/components/ConsoleLogCard.js +262 -409
- package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/esm/components/ConsoleLogDetailView.js +271 -0
- package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/esm/components/ConsoleLogsTabView.js +348 -0
- package/dist/esm/components/DiffViewer.js +4 -2
- package/dist/esm/components/DomainHeader.js +66 -41
- package/dist/esm/components/EmptyState.d.ts +2 -2
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/EndOfListFooter.d.ts +8 -0
- package/dist/esm/components/EndOfListFooter.js +83 -0
- package/dist/esm/components/ErrorBoundary.d.ts +5 -14
- package/dist/esm/components/ErrorBoundary.js +29 -29
- package/dist/esm/components/FloatingBubble.d.ts +14 -0
- package/dist/esm/components/FloatingBubble.js +68 -0
- package/dist/esm/components/HeadersSection.js +5 -3
- package/dist/esm/components/HighlightText.d.ts +1 -1
- package/dist/esm/components/HighlightText.js +5 -7
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +194 -0
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
- package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/esm/components/Inspector/FabLauncher.js +49 -0
- package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
- package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/esm/components/Inspector/InspectorContext.js +13 -0
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
- package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/LogDetail.js +925 -0
- package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/esm/components/Inspector/MainScreen.js +63 -0
- package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
- package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkTab.js +243 -0
- package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxTab.js +70 -0
- package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
- package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
- package/dist/esm/components/Inspector/TabBar.js +90 -0
- package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/esm/components/Inspector/WebViewTab.js +752 -0
- package/dist/esm/components/InspectorHeader.d.ts +19 -0
- package/dist/esm/components/InspectorHeader.js +323 -0
- package/dist/esm/components/InspectorTabBar.d.ts +16 -0
- package/dist/esm/components/InspectorTabBar.js +84 -0
- package/dist/esm/components/JsonViewer.d.ts +4 -1
- package/dist/esm/components/JsonViewer.js +111 -172
- package/dist/esm/components/LogCard.js +111 -88
- package/dist/esm/components/MetaAccordion.d.ts +1 -10
- package/dist/esm/components/MetaAccordion.js +23 -21
- package/dist/esm/components/NavigationTracker.d.ts +7 -0
- package/dist/esm/components/NavigationTracker.js +39 -0
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +46 -6
- package/dist/esm/components/ReduxTabView.d.ts +9 -0
- package/dist/esm/components/ReduxTabView.js +50 -0
- package/dist/esm/components/ReduxTreeView.js +243 -202
- package/dist/esm/components/SegmentedTabs.d.ts +15 -0
- package/dist/esm/components/SegmentedTabs.js +47 -0
- package/dist/esm/components/SettingsView.d.ts +13 -0
- package/dist/esm/components/SettingsView.js +321 -0
- package/dist/esm/components/TouchableScale.d.ts +2 -2
- package/dist/esm/components/TouchableScale.js +2 -2
- package/dist/esm/components/TreeNode.js +2 -2
- package/dist/esm/constants/index.js +1 -12
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/esm/customHooks/analyticsLogger.js +37 -0
- package/dist/esm/customHooks/consoleLogger.js +137 -13
- package/dist/esm/customHooks/networkLogger.d.ts +0 -1
- package/dist/esm/customHooks/networkLogger.js +0 -1
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
- package/dist/esm/enums/index.d.ts +39 -0
- package/dist/esm/enums/index.js +47 -0
- package/dist/esm/helpers/index.d.ts +27 -1
- package/dist/esm/helpers/index.js +180 -11
- package/dist/esm/helpers/settingsStore.d.ts +2 -24
- package/dist/esm/i18n/en.json +144 -0
- package/dist/esm/i18n/index.d.ts +2 -0
- package/dist/esm/i18n/index.js +22 -0
- package/dist/esm/i18n/locales/en.json +314 -0
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +207 -4923
- package/dist/esm/styles/AppColors.d.ts +148 -0
- package/dist/esm/styles/AppColors.js +176 -0
- package/dist/esm/styles/common.d.ts +3 -0
- package/dist/esm/styles/common.js +197 -0
- package/dist/esm/styles/index.d.ts +219 -435
- package/dist/esm/styles/index.js +312 -488
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.js +3 -0
- package/dist/esm/types/index.d.ts +4 -111
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/types/interfaces.d.ts +337 -0
- package/dist/esm/types/interfaces.js +1 -0
- package/example/App.tsx +88 -1
- package/example/android/app/build.gradle +29 -1
- package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
- package/example/android/build.gradle +31 -4
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradle.properties +1 -0
- package/example/android/settings.gradle +20 -1
- package/example/package-lock.json +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,757 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const InspectorContext_1 = require("./InspectorContext");
|
|
9
|
+
const TouchableScale_1 = __importDefault(require("../TouchableScale"));
|
|
10
|
+
const AnimatedEntrance_1 = __importDefault(require("../AnimatedEntrance"));
|
|
11
|
+
const EmptyState_1 = __importDefault(require("../EmptyState"));
|
|
12
|
+
const HighlightText_1 = __importDefault(require("../HighlightText"));
|
|
13
|
+
const CodeSnippet_1 = __importDefault(require("../CodeSnippet"));
|
|
14
|
+
const CopyButton_1 = __importDefault(require("../CopyButton"));
|
|
15
|
+
const styles_1 = __importDefault(require("../../styles"));
|
|
16
|
+
const AppColors_1 = require("../../styles/AppColors");
|
|
17
|
+
const AppFonts_1 = require("../../styles/AppFonts");
|
|
18
|
+
const webViewLogger_1 = require("../../customHooks/webViewLogger");
|
|
19
|
+
const NetworkIcons_1 = require("../NetworkIcons");
|
|
20
|
+
let OriginalWebView = null;
|
|
21
|
+
try {
|
|
22
|
+
const RNWebView = require('react-native-webview');
|
|
23
|
+
OriginalWebView = RNWebView.WebView || RNWebView.default;
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
// Silent fail
|
|
27
|
+
}
|
|
28
|
+
const previewInspectScript = `
|
|
29
|
+
(function() {
|
|
30
|
+
var style = document.createElement('style');
|
|
31
|
+
style.innerHTML = '* { cursor: pointer !important; }';
|
|
32
|
+
document.head.appendChild(style);
|
|
33
|
+
|
|
34
|
+
document.addEventListener('click', function(e) {
|
|
35
|
+
var el = e.target;
|
|
36
|
+
if (!el) return;
|
|
37
|
+
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
|
|
41
|
+
var oldOutline = el.style.outline;
|
|
42
|
+
var oldTransition = el.style.transition;
|
|
43
|
+
el.style.transition = 'outline 0.15s ease';
|
|
44
|
+
el.style.outline = '3px solid #684B9B';
|
|
45
|
+
setTimeout(function() {
|
|
46
|
+
el.style.outline = oldOutline;
|
|
47
|
+
el.style.transition = oldTransition;
|
|
48
|
+
}, 600);
|
|
49
|
+
|
|
50
|
+
var tagName = el.tagName.toLowerCase();
|
|
51
|
+
var searchStr = '<' + tagName;
|
|
52
|
+
|
|
53
|
+
if (el.id) {
|
|
54
|
+
searchStr += ' id="' + el.id + '"';
|
|
55
|
+
} else if (el.className && typeof el.className === 'string') {
|
|
56
|
+
var firstClass = el.className.trim().split(/\\s+/)[0];
|
|
57
|
+
if (firstClass) {
|
|
58
|
+
searchStr += ' class="' + firstClass;
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
var text = (el.textContent || '').trim().substring(0, 25);
|
|
62
|
+
if (text) {
|
|
63
|
+
searchStr = text;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
|
|
68
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
69
|
+
type: 'preview-inspect',
|
|
70
|
+
tagName: tagName,
|
|
71
|
+
id: el.id || '',
|
|
72
|
+
className: typeof el.className === 'string' ? el.className : '',
|
|
73
|
+
searchStr: searchStr
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
}, true);
|
|
77
|
+
})();
|
|
78
|
+
true;
|
|
79
|
+
`;
|
|
80
|
+
const WebViewTab = () => {
|
|
81
|
+
const { webViewNavHistory, webViewSearch, webViewSubTab, setWebViewSubTab, webViewLogs, webViewHtml, webViewCss, webViewJs, webViewHtmlUrl, htmlSubTab, setHtmlSubTab, isHtmlTabReady, inspectedElement, setInspectedElement, getSearchTermForTab, filteredNavHistory, isDark, } = (0, InspectorContext_1.useInspector)();
|
|
82
|
+
if (webViewNavHistory.length === 0) {
|
|
83
|
+
return (<react_native_1.View style={styles_1.default.emptyContainer}>
|
|
84
|
+
<react_native_1.View style={styles_1.default.emptyIconWrap}>
|
|
85
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.purple} size={32}/>
|
|
86
|
+
</react_native_1.View>
|
|
87
|
+
<react_native_1.Text style={styles_1.default.emptyTitle}>
|
|
88
|
+
No WebView Activity
|
|
89
|
+
</react_native_1.Text>
|
|
90
|
+
<react_native_1.Text style={styles_1.default.emptySub}>
|
|
91
|
+
Load a webpage within a connected WebView component to
|
|
92
|
+
inspect pages, page source, and console logs.
|
|
93
|
+
</react_native_1.Text>
|
|
94
|
+
</react_native_1.View>);
|
|
95
|
+
}
|
|
96
|
+
return (<react_native_1.View style={{ flex: 1 }}>
|
|
97
|
+
{/* ─── Current Page Address Bar (Now on top) ─── */}
|
|
98
|
+
{(() => {
|
|
99
|
+
const currentUrl = webViewNavHistory[0]?.url;
|
|
100
|
+
if (!currentUrl)
|
|
101
|
+
return null;
|
|
102
|
+
return (<react_native_1.View style={{
|
|
103
|
+
paddingHorizontal: 12,
|
|
104
|
+
paddingTop: 6,
|
|
105
|
+
paddingBottom: 6,
|
|
106
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
107
|
+
borderBottomWidth: 1,
|
|
108
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
109
|
+
}}>
|
|
110
|
+
<react_native_1.View style={{
|
|
111
|
+
flexDirection: 'row',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
114
|
+
borderRadius: 8,
|
|
115
|
+
borderWidth: 1.5,
|
|
116
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
117
|
+
paddingHorizontal: 10,
|
|
118
|
+
paddingVertical: 5,
|
|
119
|
+
gap: 8,
|
|
120
|
+
}}>
|
|
121
|
+
{/* Left: Lock and HTTPS label */}
|
|
122
|
+
<react_native_1.View style={{
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
alignItems: 'center',
|
|
125
|
+
gap: 4,
|
|
126
|
+
}}>
|
|
127
|
+
<react_native_1.Text style={{ fontSize: 11 }}>🔒</react_native_1.Text>
|
|
128
|
+
<react_native_1.Text style={{
|
|
129
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
130
|
+
fontSize: 9.5,
|
|
131
|
+
color: AppColors_1.AppColors.greenColor,
|
|
132
|
+
letterSpacing: 0.5,
|
|
133
|
+
}}>
|
|
134
|
+
HTTPS
|
|
135
|
+
</react_native_1.Text>
|
|
136
|
+
</react_native_1.View>
|
|
137
|
+
<react_native_1.View style={{
|
|
138
|
+
width: 1.5,
|
|
139
|
+
height: 12,
|
|
140
|
+
backgroundColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
141
|
+
}}/>
|
|
142
|
+
|
|
143
|
+
{/* Middle: URL text (Address style) */}
|
|
144
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
145
|
+
<HighlightText_1.default text={currentUrl} search={webViewSearch} numberOfLines={1} ellipsizeMode="tail" style={{
|
|
146
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
147
|
+
fontSize: 11.5,
|
|
148
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
149
|
+
}} highlightStyle={styles_1.default.highlight} detectLinks={false}/>
|
|
150
|
+
</react_native_1.View>
|
|
151
|
+
|
|
152
|
+
{/* Right: Copy Button */}
|
|
153
|
+
<CopyButton_1.default value={currentUrl} label="URL"/>
|
|
154
|
+
|
|
155
|
+
{/* Right: Globe Icon button to open browser */}
|
|
156
|
+
<TouchableScale_1.default onPress={() => react_native_1.Linking.openURL(currentUrl)} hitSlop={8} style={{
|
|
157
|
+
width: 26,
|
|
158
|
+
height: 26,
|
|
159
|
+
borderRadius: 13,
|
|
160
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
161
|
+
borderWidth: 1,
|
|
162
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
justifyContent: 'center',
|
|
165
|
+
}}>
|
|
166
|
+
<NetworkIcons_1.GlobeIcon size={11} color={AppColors_1.AppColors.purple}/>
|
|
167
|
+
</TouchableScale_1.default>
|
|
168
|
+
</react_native_1.View>
|
|
169
|
+
</react_native_1.View>);
|
|
170
|
+
})()}
|
|
171
|
+
|
|
172
|
+
{/* ─── WebView Sub-Tabs (Now below Address Bar) ─── */}
|
|
173
|
+
<react_native_1.View style={{
|
|
174
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
175
|
+
borderBottomWidth: 1,
|
|
176
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
177
|
+
paddingVertical: 6,
|
|
178
|
+
}}>
|
|
179
|
+
<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{
|
|
180
|
+
paddingHorizontal: 12,
|
|
181
|
+
flexDirection: 'row',
|
|
182
|
+
gap: 8,
|
|
183
|
+
}}>
|
|
184
|
+
{/* Sub-tab 1: Preview */}
|
|
185
|
+
<react_native_1.Pressable style={[
|
|
186
|
+
{
|
|
187
|
+
paddingVertical: 6,
|
|
188
|
+
paddingHorizontal: 14,
|
|
189
|
+
borderRadius: 8,
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
flexDirection: 'row',
|
|
192
|
+
gap: 6,
|
|
193
|
+
backgroundColor: 'rgba(0, 0, 0, 0.03)',
|
|
194
|
+
borderWidth: 1,
|
|
195
|
+
borderColor: 'transparent',
|
|
196
|
+
},
|
|
197
|
+
webViewSubTab === 'preview' && {
|
|
198
|
+
backgroundColor: AppColors_1.AppColors.purple,
|
|
199
|
+
borderColor: AppColors_1.AppColors.purple,
|
|
200
|
+
},
|
|
201
|
+
]} onPress={() => {
|
|
202
|
+
(0, InspectorContext_1.animateNextLayout)();
|
|
203
|
+
setWebViewSubTab('preview');
|
|
204
|
+
}}>
|
|
205
|
+
<NetworkIcons_1.EyeIcon color={webViewSubTab === 'preview'
|
|
206
|
+
? '#FFFFFF'
|
|
207
|
+
: AppColors_1.AppColors.grayTextWeak} size={13}/>
|
|
208
|
+
<react_native_1.Text style={{
|
|
209
|
+
fontFamily: webViewSubTab === 'preview'
|
|
210
|
+
? AppFonts_1.AppFonts.interBold
|
|
211
|
+
: AppFonts_1.AppFonts.interMedium,
|
|
212
|
+
fontSize: 12,
|
|
213
|
+
color: webViewSubTab === 'preview'
|
|
214
|
+
? '#FFFFFF'
|
|
215
|
+
: AppColors_1.AppColors.grayTextStrong,
|
|
216
|
+
}}>
|
|
217
|
+
Preview
|
|
218
|
+
</react_native_1.Text>
|
|
219
|
+
</react_native_1.Pressable>
|
|
220
|
+
|
|
221
|
+
{/* Sub-tab 2: Page Source */}
|
|
222
|
+
<react_native_1.Pressable style={[
|
|
223
|
+
{
|
|
224
|
+
paddingVertical: 6,
|
|
225
|
+
paddingHorizontal: 14,
|
|
226
|
+
borderRadius: 8,
|
|
227
|
+
alignItems: 'center',
|
|
228
|
+
flexDirection: 'row',
|
|
229
|
+
gap: 6,
|
|
230
|
+
backgroundColor: 'rgba(0, 0, 0, 0.03)',
|
|
231
|
+
borderWidth: 1,
|
|
232
|
+
borderColor: 'transparent',
|
|
233
|
+
},
|
|
234
|
+
webViewSubTab === 'html' && {
|
|
235
|
+
backgroundColor: AppColors_1.AppColors.purple,
|
|
236
|
+
borderColor: AppColors_1.AppColors.purple,
|
|
237
|
+
},
|
|
238
|
+
]} onPress={() => {
|
|
239
|
+
(0, InspectorContext_1.animateNextLayout)();
|
|
240
|
+
setWebViewSubTab('html');
|
|
241
|
+
}}>
|
|
242
|
+
<NetworkIcons_1.HtmlIcon color={webViewSubTab === 'html'
|
|
243
|
+
? '#FFFFFF'
|
|
244
|
+
: AppColors_1.AppColors.grayTextWeak} size={13}/>
|
|
245
|
+
<react_native_1.Text style={{
|
|
246
|
+
fontFamily: webViewSubTab === 'html'
|
|
247
|
+
? AppFonts_1.AppFonts.interBold
|
|
248
|
+
: AppFonts_1.AppFonts.interMedium,
|
|
249
|
+
fontSize: 12,
|
|
250
|
+
color: webViewSubTab === 'html'
|
|
251
|
+
? '#FFFFFF'
|
|
252
|
+
: AppColors_1.AppColors.grayTextStrong,
|
|
253
|
+
}}>
|
|
254
|
+
Page Source
|
|
255
|
+
</react_native_1.Text>
|
|
256
|
+
</react_native_1.Pressable>
|
|
257
|
+
|
|
258
|
+
{/* Sub-tab 3: History */}
|
|
259
|
+
<react_native_1.Pressable style={[
|
|
260
|
+
{
|
|
261
|
+
paddingVertical: 6,
|
|
262
|
+
paddingHorizontal: 14,
|
|
263
|
+
borderRadius: 8,
|
|
264
|
+
alignItems: 'center',
|
|
265
|
+
flexDirection: 'row',
|
|
266
|
+
gap: 6,
|
|
267
|
+
backgroundColor: 'rgba(0, 0, 0, 0.03)',
|
|
268
|
+
borderWidth: 1,
|
|
269
|
+
borderColor: 'transparent',
|
|
270
|
+
},
|
|
271
|
+
webViewSubTab === 'navigation' && {
|
|
272
|
+
backgroundColor: AppColors_1.AppColors.purple,
|
|
273
|
+
borderColor: AppColors_1.AppColors.purple,
|
|
274
|
+
},
|
|
275
|
+
]} onPress={() => {
|
|
276
|
+
(0, InspectorContext_1.animateNextLayout)();
|
|
277
|
+
setWebViewSubTab('navigation');
|
|
278
|
+
}}>
|
|
279
|
+
<NetworkIcons_1.ClockIcon color={webViewSubTab === 'navigation'
|
|
280
|
+
? '#FFFFFF'
|
|
281
|
+
: AppColors_1.AppColors.grayTextWeak} size={13}/>
|
|
282
|
+
<react_native_1.Text style={{
|
|
283
|
+
fontFamily: webViewSubTab === 'navigation'
|
|
284
|
+
? AppFonts_1.AppFonts.interBold
|
|
285
|
+
: AppFonts_1.AppFonts.interMedium,
|
|
286
|
+
fontSize: 12,
|
|
287
|
+
color: webViewSubTab === 'navigation'
|
|
288
|
+
? '#FFFFFF'
|
|
289
|
+
: AppColors_1.AppColors.grayTextStrong,
|
|
290
|
+
}}>
|
|
291
|
+
History ({webViewNavHistory.length})
|
|
292
|
+
</react_native_1.Text>
|
|
293
|
+
</react_native_1.Pressable>
|
|
294
|
+
|
|
295
|
+
{/* Sub-tab 4: Console */}
|
|
296
|
+
<react_native_1.Pressable style={[
|
|
297
|
+
{
|
|
298
|
+
paddingVertical: 6,
|
|
299
|
+
paddingHorizontal: 14,
|
|
300
|
+
borderRadius: 8,
|
|
301
|
+
alignItems: 'center',
|
|
302
|
+
flexDirection: 'row',
|
|
303
|
+
gap: 6,
|
|
304
|
+
backgroundColor: 'rgba(0, 0, 0, 0.03)',
|
|
305
|
+
borderWidth: 1,
|
|
306
|
+
borderColor: 'transparent',
|
|
307
|
+
},
|
|
308
|
+
webViewSubTab === 'console' && {
|
|
309
|
+
backgroundColor: AppColors_1.AppColors.purple,
|
|
310
|
+
borderColor: AppColors_1.AppColors.purple,
|
|
311
|
+
},
|
|
312
|
+
]} onPress={() => {
|
|
313
|
+
(0, InspectorContext_1.animateNextLayout)();
|
|
314
|
+
setWebViewSubTab('console');
|
|
315
|
+
}}>
|
|
316
|
+
<NetworkIcons_1.TerminalIcon color={webViewSubTab === 'console'
|
|
317
|
+
? '#FFFFFF'
|
|
318
|
+
: AppColors_1.AppColors.grayTextWeak} size={13}/>
|
|
319
|
+
<react_native_1.Text style={{
|
|
320
|
+
fontFamily: webViewSubTab === 'console'
|
|
321
|
+
? AppFonts_1.AppFonts.interBold
|
|
322
|
+
: AppFonts_1.AppFonts.interMedium,
|
|
323
|
+
fontSize: 12,
|
|
324
|
+
color: webViewSubTab === 'console'
|
|
325
|
+
? '#FFFFFF'
|
|
326
|
+
: AppColors_1.AppColors.grayTextStrong,
|
|
327
|
+
}}>
|
|
328
|
+
Console ({webViewLogs.length})
|
|
329
|
+
</react_native_1.Text>
|
|
330
|
+
</react_native_1.Pressable>
|
|
331
|
+
</react_native_1.ScrollView>
|
|
332
|
+
</react_native_1.View>
|
|
333
|
+
|
|
334
|
+
{webViewSubTab === 'html' ? (<react_native_1.View style={{ flex: 1 }}>
|
|
335
|
+
{webViewHtml || webViewCss || webViewJs ? (<react_native_1.View style={{ flex: 1 }}>
|
|
336
|
+
{/* Clear Inspect Banner */}
|
|
337
|
+
{inspectedElement && (<react_native_1.View style={{
|
|
338
|
+
flexDirection: 'row',
|
|
339
|
+
alignItems: 'center',
|
|
340
|
+
justifyContent: 'space-between',
|
|
341
|
+
backgroundColor: AppColors_1.AppColors.purpleShade50,
|
|
342
|
+
paddingHorizontal: 12,
|
|
343
|
+
paddingVertical: 6,
|
|
344
|
+
borderBottomWidth: 1,
|
|
345
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
346
|
+
}}>
|
|
347
|
+
<react_native_1.Text style={{
|
|
348
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
349
|
+
fontSize: 11.5,
|
|
350
|
+
color: AppColors_1.AppColors.purple,
|
|
351
|
+
flex: 1,
|
|
352
|
+
}}>
|
|
353
|
+
Inspecting element:{' '}
|
|
354
|
+
<react_native_1.Text style={{
|
|
355
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
356
|
+
}}>
|
|
357
|
+
<{inspectedElement.tagName}
|
|
358
|
+
{inspectedElement.id
|
|
359
|
+
? ` id="${inspectedElement.id}"`
|
|
360
|
+
: ''}
|
|
361
|
+
{inspectedElement.className
|
|
362
|
+
? ` class="${inspectedElement.className
|
|
363
|
+
.trim()
|
|
364
|
+
.split(/\s+/)[0]}"`
|
|
365
|
+
: ''}
|
|
366
|
+
>
|
|
367
|
+
</react_native_1.Text>
|
|
368
|
+
</react_native_1.Text>
|
|
369
|
+
<react_native_1.Pressable onPress={() => setInspectedElement(null)} style={{
|
|
370
|
+
paddingHorizontal: 8,
|
|
371
|
+
paddingVertical: 4,
|
|
372
|
+
}}>
|
|
373
|
+
<react_native_1.Text style={{
|
|
374
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
375
|
+
fontSize: 11,
|
|
376
|
+
color: AppColors_1.AppColors.purple,
|
|
377
|
+
}}>
|
|
378
|
+
Clear Inspect
|
|
379
|
+
</react_native_1.Text>
|
|
380
|
+
</react_native_1.Pressable>
|
|
381
|
+
</react_native_1.View>)}
|
|
382
|
+
|
|
383
|
+
{/* Inner sub-tabs inside HTML source view */}
|
|
384
|
+
<react_native_1.View style={{
|
|
385
|
+
flexDirection: 'row',
|
|
386
|
+
borderBottomWidth: 1,
|
|
387
|
+
borderBottomColor: AppColors_1.AppColors.dividerColor,
|
|
388
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
389
|
+
paddingHorizontal: 12,
|
|
390
|
+
gap: 12,
|
|
391
|
+
}}>
|
|
392
|
+
{['html', 'css', 'javascript'].map(tab => {
|
|
393
|
+
const active = htmlSubTab === tab;
|
|
394
|
+
const label = tab === 'html'
|
|
395
|
+
? 'HTML'
|
|
396
|
+
: tab === 'css'
|
|
397
|
+
? 'CSS'
|
|
398
|
+
: 'JavaScript';
|
|
399
|
+
const activeColor = tab === 'html'
|
|
400
|
+
? '#EA580C' // Orange
|
|
401
|
+
: tab === 'css'
|
|
402
|
+
? '#2563EB' // Blue
|
|
403
|
+
: '#D97706'; // Dark Yellow/Amber
|
|
404
|
+
return (<react_native_1.Pressable key={tab} onPress={() => {
|
|
405
|
+
(0, InspectorContext_1.animateNextLayout)();
|
|
406
|
+
setHtmlSubTab(tab);
|
|
407
|
+
}} style={{
|
|
408
|
+
paddingVertical: 8,
|
|
409
|
+
paddingHorizontal: 4,
|
|
410
|
+
borderBottomWidth: 2,
|
|
411
|
+
borderBottomColor: active
|
|
412
|
+
? activeColor
|
|
413
|
+
: 'transparent',
|
|
414
|
+
flexDirection: 'row',
|
|
415
|
+
alignItems: 'center',
|
|
416
|
+
gap: 4,
|
|
417
|
+
}}>
|
|
418
|
+
{tab === 'html' && (<NetworkIcons_1.HtmlIcon color={active
|
|
419
|
+
? activeColor
|
|
420
|
+
: AppColors_1.AppColors.grayTextWeak} size={14}/>)}
|
|
421
|
+
{tab === 'css' && (<NetworkIcons_1.CssIcon color={active
|
|
422
|
+
? activeColor
|
|
423
|
+
: AppColors_1.AppColors.grayTextWeak} size={14}/>)}
|
|
424
|
+
{tab === 'javascript' && (<NetworkIcons_1.JsIcon color={active
|
|
425
|
+
? activeColor
|
|
426
|
+
: AppColors_1.AppColors.grayTextWeak} size={14}/>)}
|
|
427
|
+
<react_native_1.Text style={{
|
|
428
|
+
fontFamily: active
|
|
429
|
+
? AppFonts_1.AppFonts.interBold
|
|
430
|
+
: AppFonts_1.AppFonts.interMedium,
|
|
431
|
+
fontSize: 13,
|
|
432
|
+
color: active
|
|
433
|
+
? activeColor
|
|
434
|
+
: AppColors_1.AppColors.grayTextWeak,
|
|
435
|
+
}}>
|
|
436
|
+
{label}
|
|
437
|
+
</react_native_1.Text>
|
|
438
|
+
</react_native_1.Pressable>);
|
|
439
|
+
})}
|
|
440
|
+
</react_native_1.View>
|
|
441
|
+
<react_native_1.View style={{ flex: 1, padding: 12 }}>
|
|
442
|
+
{!isHtmlTabReady ? (<react_native_1.View style={{
|
|
443
|
+
flex: 1,
|
|
444
|
+
justifyContent: 'center',
|
|
445
|
+
alignItems: 'center',
|
|
446
|
+
minHeight: 200,
|
|
447
|
+
}}>
|
|
448
|
+
<react_native_1.ActivityIndicator size="large" color={AppColors_1.AppColors.purple}/>
|
|
449
|
+
</react_native_1.View>) : htmlSubTab === 'html' ? (webViewHtml ? (<CodeSnippet_1.default code={webViewHtml} language="html" search={getSearchTermForTab()}/>) : (<react_native_1.Text style={{
|
|
450
|
+
fontFamily: 'monospace',
|
|
451
|
+
fontSize: 11,
|
|
452
|
+
color: '#94A3B8',
|
|
453
|
+
padding: 12,
|
|
454
|
+
}}>
|
|
455
|
+
No HTML content captured.
|
|
456
|
+
</react_native_1.Text>)) : htmlSubTab === 'css' ? (webViewCss ? (<CodeSnippet_1.default code={webViewCss} language="css" search={getSearchTermForTab()}/>) : (<react_native_1.Text style={{
|
|
457
|
+
fontFamily: 'monospace',
|
|
458
|
+
fontSize: 11,
|
|
459
|
+
color: '#94A3B8',
|
|
460
|
+
padding: 12,
|
|
461
|
+
}}>
|
|
462
|
+
No CSS styles detected on this page.
|
|
463
|
+
</react_native_1.Text>)) : webViewJs ? (<CodeSnippet_1.default code={webViewJs} language="javascript" search={getSearchTermForTab()}/>) : (<react_native_1.Text style={{
|
|
464
|
+
fontFamily: 'monospace',
|
|
465
|
+
fontSize: 11,
|
|
466
|
+
color: '#94A3B8',
|
|
467
|
+
padding: 12,
|
|
468
|
+
}}>
|
|
469
|
+
No scripts detected on this page.
|
|
470
|
+
</react_native_1.Text>)}
|
|
471
|
+
</react_native_1.View>
|
|
472
|
+
</react_native_1.View>) : (<react_native_1.View style={styles_1.default.emptyContainer}>
|
|
473
|
+
<react_native_1.View style={styles_1.default.emptyIconWrap}>
|
|
474
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.purple} size={32}/>
|
|
475
|
+
</react_native_1.View>
|
|
476
|
+
<react_native_1.Text style={styles_1.default.emptyTitle}>
|
|
477
|
+
No Page Source Captured
|
|
478
|
+
</react_native_1.Text>
|
|
479
|
+
<react_native_1.Text style={styles_1.default.emptySub}>
|
|
480
|
+
Load a page in the WebView to inspect its
|
|
481
|
+
HTML, CSS, or Javascript source.
|
|
482
|
+
</react_native_1.Text>
|
|
483
|
+
</react_native_1.View>)}
|
|
484
|
+
</react_native_1.View>) : webViewSubTab === 'navigation' ? (<react_native_1.FlatList data={filteredNavHistory} keyExtractor={(item, index) => `${index}-${item.timestamp}`} style={{
|
|
485
|
+
flex: 1,
|
|
486
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
487
|
+
}} ListHeaderComponent={<react_native_1.View style={{
|
|
488
|
+
paddingHorizontal: 16,
|
|
489
|
+
paddingTop: 12,
|
|
490
|
+
paddingBottom: 8,
|
|
491
|
+
}}>
|
|
492
|
+
<react_native_1.Text style={styles_1.default.resultCount}>
|
|
493
|
+
Navigation History ({webViewNavHistory.length}
|
|
494
|
+
)
|
|
495
|
+
</react_native_1.Text>
|
|
496
|
+
</react_native_1.View>} renderItem={({ item, index, }) => {
|
|
497
|
+
const isLatest = index === 0;
|
|
498
|
+
const formatNavTime = (ts) => {
|
|
499
|
+
const d = new Date(ts);
|
|
500
|
+
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`;
|
|
501
|
+
};
|
|
502
|
+
return (<AnimatedEntrance_1.default index={index} distance={8} style={{
|
|
503
|
+
marginHorizontal: 16,
|
|
504
|
+
marginVertical: 6,
|
|
505
|
+
borderRadius: 12,
|
|
506
|
+
borderWidth: 1,
|
|
507
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
508
|
+
backgroundColor: isLatest
|
|
509
|
+
? AppColors_1.AppColors.purpleShade50
|
|
510
|
+
: AppColors_1.AppColors.primaryLight,
|
|
511
|
+
padding: 14,
|
|
512
|
+
flexDirection: 'row',
|
|
513
|
+
alignItems: 'center',
|
|
514
|
+
justifyContent: 'space-between',
|
|
515
|
+
gap: 12,
|
|
516
|
+
shadowColor: '#000000',
|
|
517
|
+
shadowOffset: { width: 0, height: 2 },
|
|
518
|
+
shadowOpacity: isDark ? 0.2 : 0.04,
|
|
519
|
+
shadowRadius: 4,
|
|
520
|
+
elevation: 2,
|
|
521
|
+
}}>
|
|
522
|
+
<react_native_1.View style={{ flex: 1, gap: 8 }}>
|
|
523
|
+
{/* Top row: Title and Badge */}
|
|
524
|
+
<react_native_1.View style={{
|
|
525
|
+
flexDirection: 'row',
|
|
526
|
+
alignItems: 'center',
|
|
527
|
+
gap: 8,
|
|
528
|
+
flexWrap: 'wrap',
|
|
529
|
+
}}>
|
|
530
|
+
<react_native_1.Text numberOfLines={1} ellipsizeMode="tail" style={{
|
|
531
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
532
|
+
fontSize: 14,
|
|
533
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
534
|
+
flexShrink: 1,
|
|
535
|
+
}}>
|
|
536
|
+
{item.title || 'Untitled Page'}
|
|
537
|
+
</react_native_1.Text>
|
|
538
|
+
{isLatest && (<react_native_1.View style={{
|
|
539
|
+
flexDirection: 'row',
|
|
540
|
+
alignItems: 'center',
|
|
541
|
+
gap: 4,
|
|
542
|
+
backgroundColor: AppColors_1.AppColors.greenStatus,
|
|
543
|
+
paddingHorizontal: 8,
|
|
544
|
+
paddingVertical: 3,
|
|
545
|
+
borderRadius: 12,
|
|
546
|
+
}}>
|
|
547
|
+
<react_native_1.View style={{
|
|
548
|
+
width: 6,
|
|
549
|
+
height: 6,
|
|
550
|
+
borderRadius: 3,
|
|
551
|
+
backgroundColor: AppColors_1.AppColors.greenBaggageText,
|
|
552
|
+
}}/>
|
|
553
|
+
<react_native_1.Text style={{
|
|
554
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
555
|
+
fontSize: 9.5,
|
|
556
|
+
color: AppColors_1.AppColors.greenBaggageText,
|
|
557
|
+
}}>
|
|
558
|
+
Active
|
|
559
|
+
</react_native_1.Text>
|
|
560
|
+
</react_native_1.View>)}
|
|
561
|
+
</react_native_1.View>
|
|
562
|
+
|
|
563
|
+
{/* Middle row: URL with Globe Icon */}
|
|
564
|
+
<react_native_1.View style={{
|
|
565
|
+
flexDirection: 'row',
|
|
566
|
+
alignItems: 'center',
|
|
567
|
+
gap: 6,
|
|
568
|
+
}}>
|
|
569
|
+
<NetworkIcons_1.GlobeIcon size={12} color={AppColors_1.AppColors.grayTextWeak}/>
|
|
570
|
+
<HighlightText_1.default text={item.url} search={webViewSearch} numberOfLines={2} ellipsizeMode="tail" style={{
|
|
571
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
572
|
+
fontSize: 12,
|
|
573
|
+
color: AppColors_1.AppColors.grayText,
|
|
574
|
+
flex: 1,
|
|
575
|
+
}} highlightStyle={styles_1.default.highlight} detectLinks={true}/>
|
|
576
|
+
</react_native_1.View>
|
|
577
|
+
|
|
578
|
+
{/* Bottom row: Time */}
|
|
579
|
+
<react_native_1.View style={{
|
|
580
|
+
flexDirection: 'row',
|
|
581
|
+
alignItems: 'center',
|
|
582
|
+
gap: 6,
|
|
583
|
+
}}>
|
|
584
|
+
<NetworkIcons_1.ClockIcon size={11} color={AppColors_1.AppColors.grayTextWeak}/>
|
|
585
|
+
<react_native_1.Text style={{
|
|
586
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
587
|
+
fontSize: 11,
|
|
588
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
589
|
+
}}>
|
|
590
|
+
{formatNavTime(item.timestamp)}
|
|
591
|
+
</react_native_1.Text>
|
|
592
|
+
</react_native_1.View>
|
|
593
|
+
</react_native_1.View>
|
|
594
|
+
<CopyButton_1.default value={item.url} label="URL"/>
|
|
595
|
+
</AnimatedEntrance_1.default>);
|
|
596
|
+
}} initialNumToRender={15} maxToRenderPerBatch={15} windowSize={7} removeClippedSubviews={true} ListEmptyComponent={<EmptyState_1.default isSearch={webViewSearch.length > 0}/>} contentContainerStyle={[
|
|
597
|
+
styles_1.default.listContent,
|
|
598
|
+
filteredNavHistory.length === 0 && {
|
|
599
|
+
flexGrow: 1,
|
|
600
|
+
},
|
|
601
|
+
]} keyboardShouldPersistTaps="handled"/>) : webViewSubTab === 'console' ? (<react_native_1.View style={{
|
|
602
|
+
flex: 1,
|
|
603
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
604
|
+
}}>
|
|
605
|
+
{webViewLogs.length > 0 ? (<react_native_1.FlatList data={webViewLogs} keyExtractor={(item) => String(item.id)} style={{ flex: 1 }} ListHeaderComponent={<react_native_1.View style={{
|
|
606
|
+
paddingHorizontal: 16,
|
|
607
|
+
paddingTop: 12,
|
|
608
|
+
paddingBottom: 8,
|
|
609
|
+
flexDirection: 'row',
|
|
610
|
+
justifyContent: 'space-between',
|
|
611
|
+
alignItems: 'center',
|
|
612
|
+
}}>
|
|
613
|
+
<react_native_1.Text style={styles_1.default.resultCount}>
|
|
614
|
+
Console Logs ({webViewLogs.length})
|
|
615
|
+
</react_native_1.Text>
|
|
616
|
+
<TouchableScale_1.default onPress={() => (0, webViewLogger_1.clearWebViewData)()} style={{
|
|
617
|
+
padding: 6,
|
|
618
|
+
borderRadius: 6,
|
|
619
|
+
backgroundColor: AppColors_1.AppColors.primaryLight,
|
|
620
|
+
borderWidth: 1,
|
|
621
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
622
|
+
}}>
|
|
623
|
+
<NetworkIcons_1.TrashIcon color={AppColors_1.AppColors.errorColor} size={14}/>
|
|
624
|
+
</TouchableScale_1.default>
|
|
625
|
+
</react_native_1.View>} renderItem={({ item }) => {
|
|
626
|
+
const logColor = item.type === 'error'
|
|
627
|
+
? AppColors_1.AppColors.errorColor
|
|
628
|
+
: item.type === 'warn'
|
|
629
|
+
? AppColors_1.AppColors.warningIconGold
|
|
630
|
+
: item.type === 'info'
|
|
631
|
+
? AppColors_1.AppColors.skyBlue
|
|
632
|
+
: AppColors_1.AppColors.grayTextWeak;
|
|
633
|
+
const bgColor = item.type === 'error'
|
|
634
|
+
? 'rgba(255, 46, 87, 0.06)'
|
|
635
|
+
: item.type === 'warn'
|
|
636
|
+
? 'rgba(191, 162, 82, 0.08)'
|
|
637
|
+
: AppColors_1.AppColors.primaryLight;
|
|
638
|
+
const d = new Date(item.timestamp);
|
|
639
|
+
const timeStr = `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}:${String(d.getSeconds()).padStart(2, '0')}`;
|
|
640
|
+
return (<AnimatedEntrance_1.default index={item.id} distance={8} style={{
|
|
641
|
+
marginHorizontal: 12,
|
|
642
|
+
marginVertical: 3,
|
|
643
|
+
borderRadius: 8,
|
|
644
|
+
borderWidth: 1,
|
|
645
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
646
|
+
borderLeftWidth: 3,
|
|
647
|
+
borderLeftColor: logColor,
|
|
648
|
+
backgroundColor: bgColor,
|
|
649
|
+
padding: 10,
|
|
650
|
+
flexDirection: 'row',
|
|
651
|
+
gap: 8,
|
|
652
|
+
alignItems: 'flex-start',
|
|
653
|
+
}}>
|
|
654
|
+
<react_native_1.View style={{ paddingTop: 1 }}>
|
|
655
|
+
<NetworkIcons_1.TerminalIcon color={logColor} size={11}/>
|
|
656
|
+
</react_native_1.View>
|
|
657
|
+
<react_native_1.View style={{ flex: 1, gap: 3 }}>
|
|
658
|
+
<react_native_1.View style={{
|
|
659
|
+
flexDirection: 'row',
|
|
660
|
+
alignItems: 'center',
|
|
661
|
+
justifyContent: 'space-between',
|
|
662
|
+
}}>
|
|
663
|
+
<react_native_1.Text style={{
|
|
664
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
665
|
+
fontSize: 10,
|
|
666
|
+
color: logColor,
|
|
667
|
+
textTransform: 'uppercase',
|
|
668
|
+
letterSpacing: 0.5,
|
|
669
|
+
}}>
|
|
670
|
+
{item.type}
|
|
671
|
+
</react_native_1.Text>
|
|
672
|
+
<react_native_1.Text style={{
|
|
673
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
674
|
+
fontSize: 10,
|
|
675
|
+
color: AppColors_1.AppColors.grayTextWeak,
|
|
676
|
+
}}>
|
|
677
|
+
{timeStr}
|
|
678
|
+
</react_native_1.Text>
|
|
679
|
+
</react_native_1.View>
|
|
680
|
+
<react_native_1.Text style={{
|
|
681
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
682
|
+
fontSize: 12,
|
|
683
|
+
color: AppColors_1.AppColors.primaryBlack,
|
|
684
|
+
lineHeight: 16,
|
|
685
|
+
}}>
|
|
686
|
+
{item.message}
|
|
687
|
+
</react_native_1.Text>
|
|
688
|
+
</react_native_1.View>
|
|
689
|
+
</AnimatedEntrance_1.default>);
|
|
690
|
+
}} initialNumToRender={20} maxToRenderPerBatch={20} windowSize={7} contentContainerStyle={[
|
|
691
|
+
styles_1.default.listContent,
|
|
692
|
+
webViewLogs.length === 0 && { flexGrow: 1 },
|
|
693
|
+
]}/>) : (<react_native_1.View style={styles_1.default.emptyContainer}>
|
|
694
|
+
<react_native_1.View style={styles_1.default.emptyIconWrap}>
|
|
695
|
+
<NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.purple} size={32}/>
|
|
696
|
+
</react_native_1.View>
|
|
697
|
+
<react_native_1.Text style={styles_1.default.emptyTitle}>
|
|
698
|
+
No Console Logs
|
|
699
|
+
</react_native_1.Text>
|
|
700
|
+
<react_native_1.Text style={styles_1.default.emptySub}>
|
|
701
|
+
Console logs from the WebView will appear
|
|
702
|
+
here.
|
|
703
|
+
</react_native_1.Text>
|
|
704
|
+
</react_native_1.View>)}
|
|
705
|
+
</react_native_1.View>) : (<react_native_1.View style={{
|
|
706
|
+
flex: 1,
|
|
707
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
708
|
+
}}>
|
|
709
|
+
{webViewHtml ? (OriginalWebView ? (<OriginalWebView source={{
|
|
710
|
+
html: webViewHtml,
|
|
711
|
+
baseUrl: webViewHtmlUrl,
|
|
712
|
+
}} injectedJavaScript={previewInspectScript} onMessage={(event) => {
|
|
713
|
+
try {
|
|
714
|
+
const data = JSON.parse(event.nativeEvent.data);
|
|
715
|
+
if (data.type === 'preview-inspect') {
|
|
716
|
+
setInspectedElement({
|
|
717
|
+
tagName: data.tagName,
|
|
718
|
+
id: data.id,
|
|
719
|
+
className: data.className,
|
|
720
|
+
searchStr: data.searchStr,
|
|
721
|
+
});
|
|
722
|
+
setWebViewSubTab('html');
|
|
723
|
+
setHtmlSubTab('html');
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
catch (err) { }
|
|
727
|
+
}} style={{ flex: 1 }}/>) : (<react_native_1.View style={{
|
|
728
|
+
flex: 1,
|
|
729
|
+
justifyContent: 'center',
|
|
730
|
+
alignItems: 'center',
|
|
731
|
+
padding: 20,
|
|
732
|
+
}}>
|
|
733
|
+
<react_native_1.Text style={{
|
|
734
|
+
color: AppColors_1.AppColors.grayText,
|
|
735
|
+
textAlign: 'center',
|
|
736
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
737
|
+
}}>
|
|
738
|
+
react-native-webview is not installed in the
|
|
739
|
+
target project. Install it to enable Preview
|
|
740
|
+
mode.
|
|
741
|
+
</react_native_1.Text>
|
|
742
|
+
</react_native_1.View>)) : (<react_native_1.View style={styles_1.default.emptyContainer}>
|
|
743
|
+
<react_native_1.View style={styles_1.default.emptyIconWrap}>
|
|
744
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.purple} size={32}/>
|
|
745
|
+
</react_native_1.View>
|
|
746
|
+
<react_native_1.Text style={styles_1.default.emptyTitle}>
|
|
747
|
+
No Preview Available
|
|
748
|
+
</react_native_1.Text>
|
|
749
|
+
<react_native_1.Text style={styles_1.default.emptySub}>
|
|
750
|
+
Load a page in the WebView to see its visual
|
|
751
|
+
preview.
|
|
752
|
+
</react_native_1.Text>
|
|
753
|
+
</react_native_1.View>)}
|
|
754
|
+
</react_native_1.View>)}
|
|
755
|
+
</react_native_1.View>);
|
|
756
|
+
};
|
|
757
|
+
exports.default = WebViewTab;
|