react-native-inapp-inspector 2.4.1 → 2.4.2
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.ar.md +163 -0
- package/README.de.md +163 -0
- package/README.es.md +164 -0
- package/README.fr.md +163 -0
- package/README.hi.md +163 -0
- package/README.ja.md +180 -0
- package/README.ko.md +163 -0
- package/README.md +340 -243
- package/README.pt-BR.md +163 -0
- package/README.ru.md +163 -0
- package/README.zh-CN.md +387 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +82 -21
- package/assets/banner_dark.svg +186 -0
- package/assets/banner_light.svg +186 -0
- package/assets/icon_circle.svg +148 -0
- package/assets/icon_square.svg +369 -0
- package/assets/inapp_inspector_icon.gif +0 -0
- package/assets/inapp_inspector_icon_original.gif +0 -0
- package/assets/social_preview.png +0 -0
- package/assets/walkthrough.gif +0 -0
- package/dist/commonjs/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/commonjs/components/AnimatedBrandOwl.js +175 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +1 -0
- package/dist/commonjs/components/AppHeaderLogo.js +7 -5
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +139 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +2 -1
- package/dist/commonjs/components/ConsoleLogCard.js +23 -39
- package/dist/commonjs/components/Inspector/AboutModal.js +44 -54
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +5 -5
- package/dist/commonjs/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +11 -11
- package/dist/commonjs/components/Inspector/CrashTab.js +14 -12
- package/dist/commonjs/components/Inspector/DebuggingTab.js +17 -17
- package/dist/commonjs/components/Inspector/FabLauncher.js +22 -30
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +2 -2
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +46 -33
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +21 -19
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +85 -101
- package/dist/commonjs/components/Inspector/NetworkTab.js +50 -50
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/commonjs/components/Inspector/PushCard.d.ts +3 -2
- package/dist/commonjs/components/Inspector/PushCard.js +5 -4
- package/dist/commonjs/components/Inspector/PushDetail.js +32 -23
- package/dist/commonjs/components/Inspector/PushTab.js +12 -12
- package/dist/commonjs/components/Inspector/ReduxDetail.js +32 -32
- package/dist/commonjs/components/Inspector/ReduxTab.js +5 -5
- package/dist/commonjs/components/Inspector/SettingsPanel.js +258 -139
- package/dist/commonjs/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SocketCard.js +116 -0
- package/dist/commonjs/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/SocketDetail.js +317 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/commonjs/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SocketTab.js +112 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +38 -36
- package/dist/commonjs/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/SupportModal.js +125 -0
- package/dist/commonjs/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SupportPage.js +227 -0
- package/dist/commonjs/components/Inspector/TabBar.js +24 -23
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +24 -24
- package/dist/commonjs/components/JsonViewer.js +7 -7
- package/dist/commonjs/components/LogCard.d.ts +3 -2
- package/dist/commonjs/components/LogCard.js +13 -13
- package/dist/commonjs/components/LogSyntaxHighlighter.js +5 -5
- package/dist/commonjs/components/ModuleErrorBoundary.js +2 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +15 -0
- package/dist/commonjs/components/NetworkIcons.js +38 -3
- package/dist/commonjs/components/SegmentedTabs.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/socketLogger.d.ts +26 -0
- package/dist/commonjs/customHooks/socketLogger.js +2 -0
- package/dist/commonjs/helpers/index.js +3 -3
- package/dist/commonjs/helpers/memoryManager.d.ts +1 -0
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +5 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.d.ts +3 -1
- package/dist/commonjs/helpers/shareFormatter.js +8 -7
- package/dist/commonjs/i18n/index.d.ts +99 -1
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -0
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -0
- package/dist/commonjs/i18n/locales/it.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -0
- package/dist/commonjs/i18n/locales/mr.json +1 -0
- package/dist/commonjs/i18n/locales/nl.json +1 -0
- package/dist/commonjs/i18n/locales/pa.json +1 -0
- package/dist/commonjs/i18n/locales/pl.json +1 -0
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -0
- package/dist/commonjs/i18n/locales/te.json +1 -0
- package/dist/commonjs/i18n/locales/tr.json +1 -0
- package/dist/commonjs/i18n/locales/vi.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +13 -13
- package/dist/commonjs/index.js +5 -4
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/socket.d.ts +4 -0
- package/dist/commonjs/socket.js +1 -0
- package/dist/commonjs/styles/index.d.ts +23 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +40 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +122 -1
- package/dist/esm/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/esm/components/AnimatedBrandOwl.js +175 -0
- package/dist/esm/components/AppHeaderLogo.d.ts +1 -0
- package/dist/esm/components/AppHeaderLogo.js +7 -5
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +139 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +2 -1
- package/dist/esm/components/ConsoleLogCard.js +61 -77
- package/dist/esm/components/Inspector/AboutModal.js +85 -95
- package/dist/esm/components/Inspector/AnalyticsTab.js +15 -15
- package/dist/esm/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/esm/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +47 -47
- package/dist/esm/components/Inspector/CrashTab.js +34 -32
- package/dist/esm/components/Inspector/DebuggingTab.js +29 -29
- package/dist/esm/components/Inspector/FabLauncher.js +50 -58
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +7 -7
- package/dist/esm/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/esm/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/esm/components/Inspector/MainScreen.js +123 -110
- package/dist/esm/components/Inspector/MediaGalleryTab.js +64 -62
- package/dist/esm/components/Inspector/MediaPreviewModal.js +107 -123
- package/dist/esm/components/Inspector/NetworkTab.js +90 -90
- package/dist/esm/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/esm/components/Inspector/PushCard.d.ts +3 -2
- package/dist/esm/components/Inspector/PushCard.js +23 -22
- package/dist/esm/components/Inspector/PushDetail.js +34 -25
- package/dist/esm/components/Inspector/PushTab.js +23 -23
- package/dist/esm/components/Inspector/ReduxDetail.js +42 -42
- package/dist/esm/components/Inspector/ReduxTab.js +22 -22
- package/dist/esm/components/Inspector/SettingsPanel.js +495 -376
- package/dist/esm/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/esm/components/Inspector/SocketCard.js +116 -0
- package/dist/esm/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/SocketDetail.js +317 -0
- package/dist/esm/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/esm/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/esm/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/esm/components/Inspector/SocketTab.js +112 -0
- package/dist/esm/components/Inspector/StorageTab.js +145 -143
- package/dist/esm/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/esm/components/Inspector/SupportModal.js +125 -0
- package/dist/esm/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/esm/components/Inspector/SupportPage.js +227 -0
- package/dist/esm/components/Inspector/TabBar.js +36 -35
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +22 -22
- package/dist/esm/components/JsonViewer.js +55 -55
- package/dist/esm/components/LogCard.d.ts +3 -2
- package/dist/esm/components/LogCard.js +60 -60
- package/dist/esm/components/LogSyntaxHighlighter.js +5 -5
- package/dist/esm/components/ModuleErrorBoundary.js +23 -23
- package/dist/esm/components/NetworkIcons.d.ts +15 -0
- package/dist/esm/components/NetworkIcons.js +38 -3
- package/dist/esm/components/SegmentedTabs.js +7 -7
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/socketLogger.d.ts +26 -0
- package/dist/esm/customHooks/socketLogger.js +2 -0
- package/dist/esm/helpers/index.js +3 -3
- package/dist/esm/helpers/memoryManager.d.ts +1 -0
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +5 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/helpers/shareFormatter.d.ts +3 -1
- package/dist/esm/helpers/shareFormatter.js +8 -7
- package/dist/esm/i18n/index.d.ts +99 -1
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -0
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -0
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -0
- package/dist/esm/i18n/locales/it.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -0
- package/dist/esm/i18n/locales/mr.json +1 -0
- package/dist/esm/i18n/locales/nl.json +1 -0
- package/dist/esm/i18n/locales/pa.json +1 -0
- package/dist/esm/i18n/locales/pl.json +1 -0
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -0
- package/dist/esm/i18n/locales/te.json +1 -0
- package/dist/esm/i18n/locales/tr.json +1 -0
- package/dist/esm/i18n/locales/vi.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +13 -13
- package/dist/esm/index.js +8 -7
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/socket.d.ts +4 -0
- package/dist/esm/socket.js +1 -0
- package/dist/esm/styles/index.d.ts +23 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +40 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +122 -1
- package/ios/NetworkInspectorModule.mm +102 -12
- package/package.json +204 -2
- package/src/native/NativeInspector.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPersistentStorageAvailable=void 0,exports.setCustomStorage=setCustomStorage,exports.loadSettings=loadSettings,exports.saveSettings=saveSettings,exports.clearPersistedSettings=clearPersistedSettings,exports.getCustomStorage=getCustomStorage,exports.calculateRamBasedLimits=calculateRamBasedLimits;const react_native_1=require("react-native"),NativeInspector_1=require("../native/NativeInspector"),memory=new Map;let customStorage=null;function setCustomStorage(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPersistentStorageAvailable=void 0,exports.setCustomStorage=setCustomStorage,exports.loadSettings=loadSettings,exports.saveSettings=saveSettings,exports.clearPersistedSettings=clearPersistedSettings,exports.getCustomStorage=getCustomStorage,exports.calculateRamBasedLimits=calculateRamBasedLimits;const react_native_1=require("react-native"),NativeInspector_1=require("../native/NativeInspector"),memory=new Map;let customStorage=null;function setCustomStorage(e){customStorage=e}const SETTINGS_KEY="rn-inapp-inspector.settings.v1";async function loadSettings(){try{if(customStorage){const t=await customStorage.getItem(SETTINGS_KEY);if(!t)return{};const s=JSON.parse(t);return s&&typeof s=="object"?s:{}}if((0,NativeInspector_1.isNativeModuleAvailable)()){const t=await(0,NativeInspector_1.getNativeStorageItem)(SETTINGS_KEY);if(t){const s=JSON.parse(t);return s&&typeof s=="object"?s:{}}}if(react_native_1.Platform.OS==="ios"){const t=react_native_1.Settings.get(SETTINGS_KEY);if(!t)return{};if(typeof t=="string"){const s=JSON.parse(t);return s&&typeof s=="object"?s:{}}return t&&typeof t=="object"?t:{}}const e=memory.get(SETTINGS_KEY);if(!e)return{};const r=JSON.parse(e);return r&&typeof r=="object"?r:{}}catch{return{}}}function saveSettings(e){try{const r=JSON.stringify(e);if(customStorage){customStorage.setItem(SETTINGS_KEY,r);return}if((0,NativeInspector_1.isNativeModuleAvailable)()&&(0,NativeInspector_1.setNativeStorageItem)(SETTINGS_KEY,r),react_native_1.Platform.OS==="ios"){react_native_1.Settings.set({[SETTINGS_KEY]:r});return}memory.set(SETTINGS_KEY,r)}catch{}}async function clearPersistedSettings(){try{if(customStorage){typeof customStorage.removeItem=="function"?await customStorage.removeItem(SETTINGS_KEY):await customStorage.setItem(SETTINGS_KEY,"");return}if((0,NativeInspector_1.isNativeModuleAvailable)()&&await(0,NativeInspector_1.setNativeStorageItem)(SETTINGS_KEY,null),react_native_1.Platform.OS==="ios"){react_native_1.Settings.set({[SETTINGS_KEY]:null});return}memory.delete(SETTINGS_KEY)}catch{}}const isPersistentStorageAvailable=()=>customStorage!==null||(0,NativeInspector_1.isNativeModuleAvailable)()||react_native_1.Platform.OS==="ios";exports.isPersistentStorageAvailable=isPersistentStorageAvailable;function getCustomStorage(){return customStorage}function calculateRamBasedLimits(e){return e>=3e3?{maxNetworkLogs:500,maxConsoleLogs:500,maxAnalyticsEvents:300,maxCrashRecords:150,maxPushRecords:100,maxSocketRecords:100,profileName:"High-End",freeRamMb:e}:e>=1500?{maxNetworkLogs:300,maxConsoleLogs:300,maxAnalyticsEvents:200,maxCrashRecords:100,maxPushRecords:75,maxSocketRecords:75,profileName:"Standard",freeRamMb:e}:e>=600?{maxNetworkLogs:200,maxConsoleLogs:200,maxAnalyticsEvents:100,maxCrashRecords:50,maxPushRecords:50,maxSocketRecords:50,profileName:"Compact",freeRamMb:e}:{maxNetworkLogs:100,maxConsoleLogs:100,maxAnalyticsEvents:50,maxCrashRecords:25,maxPushRecords:25,maxSocketRecords:25,profileName:"Ultra-Light",freeRamMb:e}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnalyticsEvent, ConsoleLog, CrashRecord, NetworkLog, PushNotificationRecord, ReduxHistoryEntry } from '../types';
|
|
1
|
+
import type { AnalyticsEvent, ConsoleLog, CrashRecord, NetworkLog, PushNotificationRecord, ReduxHistoryEntry, SocketConnectionRecord } from '../types';
|
|
2
2
|
export declare function formatApiReport(log: NetworkLog): string;
|
|
3
3
|
export declare function formatPushReport(record: PushNotificationRecord): string;
|
|
4
4
|
export declare function formatCrashReport(crash: CrashRecord): string;
|
|
@@ -11,3 +11,5 @@ export declare function shareCrashReport(crash: CrashRecord): Promise<void>;
|
|
|
11
11
|
export declare function shareAnalyticsReport(event: AnalyticsEvent): Promise<void>;
|
|
12
12
|
export declare function shareReduxReport(action: ReduxHistoryEntry): Promise<void>;
|
|
13
13
|
export declare function shareLogReport(log: ConsoleLog): Promise<void>;
|
|
14
|
+
export declare function formatSocketReport(record: SocketConnectionRecord): string;
|
|
15
|
+
export declare function shareSocketReport(record: SocketConnectionRecord): Promise<void>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport;const react_native_1=require("react-native"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const
|
|
2
|
-
`)}function formatPushReport(e){const
|
|
3
|
-
`)}function formatCrashReport(e){const
|
|
4
|
-
`)}function formatAnalyticsReport(e){const
|
|
5
|
-
`)}function formatReduxReport(e){const
|
|
6
|
-
`)}function formatLogReport(e){const
|
|
7
|
-
`)}async function triggerNativeShare(e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport,exports.formatSocketReport=formatSocketReport,exports.shareSocketReport=shareSocketReport;const react_native_1=require("react-native"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const a=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",p=e.duration!=null?`${e.duration}ms`:"N/A",i=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=(0,index_1.getCurlCommand)(e),n=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${a}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${p}`,`\u{1F552} Time: ${i}`];return e.client&&n.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),n.push(`\u{1F310} URL: ${e.url||"N/A"}`),n.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(n.push("\u{1F4CB} Request Headers:"),n.push(safeStringify(e.requestHeaders)),n.push("")),e.request!=null&&e.request!==""&&(n.push("\u{1F4DD} Request Body:"),n.push(safeStringify(e.request)),n.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(n.push("\u{1F4D1} Response Headers:"),n.push(safeStringify(e.responseHeaders)),n.push("")),e.response!=null&&e.response!==""&&(n.push("\u{1F4E5} Response Data:"),n.push(safeStringify(e.response)),n.push("")),s&&(n.push("\u{1F4BB} cURL Command:"),n.push(s),n.push("")),n.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),n.push("Generated by React Native InApp Inspector"),n.join(`
|
|
2
|
+
`)}function formatPushReport(e){const a=(0,index_1.formatDateTime)(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),p=(e.appState||"unknown").toUpperCase(),i=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${p}`,`\u{1F3AF} Action: ${i}`,`\u{1F552} Time: ${a}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(safeStringify(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(safeStringify(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(safeStringify(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
|
|
3
|
+
`)}function formatCrashReport(e){const a=`${e.dateStr||""} ${e.timeStr||""}`.trim()||(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${a}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(p=>{t.push(` \u2022 [${p.type}] ${p.message} (${(0,index_1.formatDateTime)(p.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
4
|
+
`)}function formatAnalyticsReport(e){const a=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${a}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(safeStringify(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(safeStringify(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
5
|
+
`)}function formatReduxReport(e){const a=typeof e.timestamp=="number"?(0,index_1.formatDateTime)(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${a}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(safeStringify(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(safeStringify(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(safeStringify(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
6
|
+
`)}function formatLogReport(e){const a=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${a}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(safeStringify(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
7
|
+
`)}async function triggerNativeShare(e,a){try{await react_native_1.Share.share({title:e,message:a},{dialogTitle:e})}catch(t){t?.message!=="User did not share"&&react_native_1.Alert.alert("Share Error",t?.message||"Failed to open share sheet")}}async function shareApiReport(e){const a=formatApiReport(e),t=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await triggerNativeShare(t,a)}async function sharePushReport(e){const a=formatPushReport(e),t=`Push: ${e.title||e.id||"Notification"}`;await triggerNativeShare(t,a)}async function shareCrashReport(e){const a=formatCrashReport(e),t=`Crash: ${e.name||e.message||"Error"}`;await triggerNativeShare(t,a)}async function shareAnalyticsReport(e){const a=formatAnalyticsReport(e),t=`Analytics: ${e.name||"Event"}`;await triggerNativeShare(t,a)}async function shareReduxReport(e){const a=formatReduxReport(e),t=`Redux: ${e.type||"Action"}`;await triggerNativeShare(t,a)}async function shareLogReport(e){const a=formatLogReport(e),t=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await triggerNativeShare(t,a)}function formatSocketReport(e){const a=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),p=e.duration!=null?`${e.duration}ms`:"Active / Open",i=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${a}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${i}`,`\u23F3 Duration: ${p}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(safeStringify(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((n,u)=>{const r=n.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",o=n.eventName?` [${n.eventName}]`:"";s.push(`--- Frame #${u+1} (${r}${o}, ${n.type}, ${n.size||0}B) ---`),s.push(safeStringify(n.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
|
|
8
|
+
`)}async function shareSocketReport(e){const a=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await triggerNativeShare(t,a)}
|
|
@@ -2,40 +2,133 @@ import React from 'react';
|
|
|
2
2
|
export declare const SUPPORTED_LANGUAGES: readonly [{
|
|
3
3
|
readonly code: "en";
|
|
4
4
|
readonly name: "English";
|
|
5
|
+
readonly nativeName: "English";
|
|
6
|
+
readonly flag: "🇺🇸";
|
|
5
7
|
}, {
|
|
6
8
|
readonly code: "es";
|
|
7
9
|
readonly name: "Español";
|
|
10
|
+
readonly nativeName: "Español";
|
|
11
|
+
readonly flag: "🇪🇸";
|
|
8
12
|
}, {
|
|
9
13
|
readonly code: "fr";
|
|
10
14
|
readonly name: "Français";
|
|
15
|
+
readonly nativeName: "Français";
|
|
16
|
+
readonly flag: "🇫🇷";
|
|
11
17
|
}, {
|
|
12
18
|
readonly code: "de";
|
|
13
19
|
readonly name: "Deutsch";
|
|
20
|
+
readonly nativeName: "Deutsch";
|
|
21
|
+
readonly flag: "🇩🇪";
|
|
14
22
|
}, {
|
|
15
23
|
readonly code: "zh";
|
|
16
24
|
readonly name: "中文";
|
|
25
|
+
readonly nativeName: "简体中文";
|
|
26
|
+
readonly flag: "🇨🇳";
|
|
17
27
|
}, {
|
|
18
28
|
readonly code: "ja";
|
|
19
29
|
readonly name: "日本語";
|
|
30
|
+
readonly nativeName: "日本語";
|
|
31
|
+
readonly flag: "🇯🇵";
|
|
20
32
|
}, {
|
|
21
33
|
readonly code: "ko";
|
|
22
34
|
readonly name: "한국어";
|
|
35
|
+
readonly nativeName: "한국어";
|
|
36
|
+
readonly flag: "🇰🇷";
|
|
23
37
|
}, {
|
|
24
38
|
readonly code: "pt";
|
|
25
39
|
readonly name: "Português";
|
|
40
|
+
readonly nativeName: "Português";
|
|
41
|
+
readonly flag: "🇧🇷";
|
|
26
42
|
}, {
|
|
27
43
|
readonly code: "ru";
|
|
28
44
|
readonly name: "Русский";
|
|
45
|
+
readonly nativeName: "Русский";
|
|
46
|
+
readonly flag: "🇷🇺";
|
|
29
47
|
}, {
|
|
30
48
|
readonly code: "hi";
|
|
31
49
|
readonly name: "हिन्दी";
|
|
50
|
+
readonly nativeName: "हिन्दी";
|
|
51
|
+
readonly flag: "🇮🇳";
|
|
52
|
+
}, {
|
|
53
|
+
readonly code: "ta";
|
|
54
|
+
readonly name: "Tamil";
|
|
55
|
+
readonly nativeName: "தமிழ்";
|
|
56
|
+
readonly flag: "🇮🇳";
|
|
57
|
+
}, {
|
|
58
|
+
readonly code: "te";
|
|
59
|
+
readonly name: "Telugu";
|
|
60
|
+
readonly nativeName: "తెలుగు";
|
|
61
|
+
readonly flag: "🇮🇳";
|
|
62
|
+
}, {
|
|
63
|
+
readonly code: "kn";
|
|
64
|
+
readonly name: "Kannada";
|
|
65
|
+
readonly nativeName: "ಕನ್ನಡ";
|
|
66
|
+
readonly flag: "🇮🇳";
|
|
67
|
+
}, {
|
|
68
|
+
readonly code: "ml";
|
|
69
|
+
readonly name: "Malayalam";
|
|
70
|
+
readonly nativeName: "മലയാളം";
|
|
71
|
+
readonly flag: "🇮🇳";
|
|
72
|
+
}, {
|
|
73
|
+
readonly code: "bn";
|
|
74
|
+
readonly name: "Bengali";
|
|
75
|
+
readonly nativeName: "বাংলা";
|
|
76
|
+
readonly flag: "🇮🇳";
|
|
77
|
+
}, {
|
|
78
|
+
readonly code: "mr";
|
|
79
|
+
readonly name: "Marathi";
|
|
80
|
+
readonly nativeName: "मराठी";
|
|
81
|
+
readonly flag: "🇮🇳";
|
|
82
|
+
}, {
|
|
83
|
+
readonly code: "gu";
|
|
84
|
+
readonly name: "Gujarati";
|
|
85
|
+
readonly nativeName: "ગુજરાતી";
|
|
86
|
+
readonly flag: "🇮🇳";
|
|
87
|
+
}, {
|
|
88
|
+
readonly code: "pa";
|
|
89
|
+
readonly name: "Punjabi";
|
|
90
|
+
readonly nativeName: "ਪੰਜਾਬੀ";
|
|
91
|
+
readonly flag: "🇮🇳";
|
|
32
92
|
}, {
|
|
33
93
|
readonly code: "ar";
|
|
34
94
|
readonly name: "العربية";
|
|
95
|
+
readonly nativeName: "العربية";
|
|
96
|
+
readonly flag: "🇸🇦";
|
|
97
|
+
}, {
|
|
98
|
+
readonly code: "it";
|
|
99
|
+
readonly name: "Italiano";
|
|
100
|
+
readonly nativeName: "Italiano";
|
|
101
|
+
readonly flag: "🇮🇹";
|
|
102
|
+
}, {
|
|
103
|
+
readonly code: "id";
|
|
104
|
+
readonly name: "Bahasa Indonesia";
|
|
105
|
+
readonly nativeName: "Bahasa Indonesia";
|
|
106
|
+
readonly flag: "🇮🇩";
|
|
107
|
+
}, {
|
|
108
|
+
readonly code: "tr";
|
|
109
|
+
readonly name: "Türkçe";
|
|
110
|
+
readonly nativeName: "Türkçe";
|
|
111
|
+
readonly flag: "🇹🇷";
|
|
112
|
+
}, {
|
|
113
|
+
readonly code: "vi";
|
|
114
|
+
readonly name: "Tiếng Việt";
|
|
115
|
+
readonly nativeName: "Tiếng Việt";
|
|
116
|
+
readonly flag: "🇻🇳";
|
|
117
|
+
}, {
|
|
118
|
+
readonly code: "nl";
|
|
119
|
+
readonly name: "Nederlands";
|
|
120
|
+
readonly nativeName: "Nederlands";
|
|
121
|
+
readonly flag: "🇳🇱";
|
|
122
|
+
}, {
|
|
123
|
+
readonly code: "pl";
|
|
124
|
+
readonly name: "Polski";
|
|
125
|
+
readonly nativeName: "Polski";
|
|
126
|
+
readonly flag: "🇵🇱";
|
|
35
127
|
}];
|
|
36
128
|
export type SupportedLanguageCode = (typeof SUPPORTED_LANGUAGES)[number]['code'];
|
|
37
129
|
type TranslationParams = Record<string, any>;
|
|
38
|
-
export declare function t(key: string, optionsOrFallback?: TranslationParams | string): string;
|
|
130
|
+
export declare function t(key: string, optionsOrFallback?: TranslationParams | string, fallbackStr?: string): string;
|
|
131
|
+
export declare function getLanguage(): string;
|
|
39
132
|
export declare function setLanguage(lang: string): void;
|
|
40
133
|
export declare function addTranslations(lang: string, translations: Record<string, any>): void;
|
|
41
134
|
export declare function setTranslations(translations: Record<string, any>, lang?: string): void;
|
|
@@ -44,6 +137,7 @@ export declare const i18n: {
|
|
|
44
137
|
language: string;
|
|
45
138
|
changeLanguage: typeof setLanguage;
|
|
46
139
|
addResourceBundle: (lng: string, _ns: string, resources: any) => void;
|
|
140
|
+
getLanguage: typeof getLanguage;
|
|
47
141
|
setLanguage: typeof setLanguage;
|
|
48
142
|
addTranslations: typeof addTranslations;
|
|
49
143
|
setTranslations: typeof setTranslations;
|
|
@@ -55,10 +149,14 @@ export declare function useTranslation(): {
|
|
|
55
149
|
language: string;
|
|
56
150
|
changeLanguage: typeof setLanguage;
|
|
57
151
|
addResourceBundle: (lng: string, _ns: string, resources: any) => void;
|
|
152
|
+
getLanguage: typeof getLanguage;
|
|
58
153
|
setLanguage: typeof setLanguage;
|
|
59
154
|
addTranslations: typeof addTranslations;
|
|
60
155
|
setTranslations: typeof setTranslations;
|
|
61
156
|
};
|
|
157
|
+
language: string;
|
|
158
|
+
currentLanguage: string;
|
|
159
|
+
setLanguage: typeof setLanguage;
|
|
62
160
|
};
|
|
63
161
|
export declare const I18nextProvider: ({ children }: {
|
|
64
162
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.I18nextProvider=exports.i18n=exports.SUPPORTED_LANGUAGES=void 0,exports.t=t,exports.setLanguage=setLanguage,exports.addTranslations=addTranslations,exports.setTranslations=setTranslations,exports.useTranslation=useTranslation;const react_1=__importDefault(require("react")),en_json_1=__importDefault(require("./locales/en.json")),es_json_1=__importDefault(require("./locales/es.json")),fr_json_1=__importDefault(require("./locales/fr.json")),de_json_1=__importDefault(require("./locales/de.json")),zh_json_1=__importDefault(require("./locales/zh.json")),ja_json_1=__importDefault(require("./locales/ja.json")),ko_json_1=__importDefault(require("./locales/ko.json")),pt_json_1=__importDefault(require("./locales/pt.json")),ru_json_1=__importDefault(require("./locales/ru.json")),hi_json_1=__importDefault(require("./locales/hi.json")),ar_json_1=__importDefault(require("./locales/ar.json"));exports.SUPPORTED_LANGUAGES=[{code:"en",name:"English"},{code:"es",name:"Espa\xF1ol"},{code:"fr",name:"Fran\xE7ais"},{code:"de",name:"Deutsch"},{code:"zh",name:"\u4E2D\u6587"},{code:"ja",name:"\u65E5\u672C\u8A9E"},{code:"ko",name:"\uD55C\uAD6D\uC5B4"},{code:"pt",name:"Portugu\xEAs"},{code:"ru",name:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},{code:"hi",name:"\u0939\u093F\u0928\u094D\u0926\u0940"},{code:"ar",name:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629"}];const localeRegistry={en:en_json_1.default,es:es_json_1.default,fr:fr_json_1.default,de:de_json_1.default,zh:zh_json_1.default,ja:ja_json_1.default,ko:ko_json_1.default,pt:pt_json_1.default,ru:ru_json_1.default,hi:hi_json_1.default,ar:ar_json_1.default};let currentLanguage="en";function lookupKey(e,n){if(!e||!n)return;const
|
|
1
|
+
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.I18nextProvider=exports.i18n=exports.SUPPORTED_LANGUAGES=void 0,exports.t=t,exports.getLanguage=getLanguage,exports.setLanguage=setLanguage,exports.addTranslations=addTranslations,exports.setTranslations=setTranslations,exports.useTranslation=useTranslation;const react_1=__importDefault(require("react")),en_json_1=__importDefault(require("./locales/en.json")),es_json_1=__importDefault(require("./locales/es.json")),fr_json_1=__importDefault(require("./locales/fr.json")),de_json_1=__importDefault(require("./locales/de.json")),zh_json_1=__importDefault(require("./locales/zh.json")),ja_json_1=__importDefault(require("./locales/ja.json")),ko_json_1=__importDefault(require("./locales/ko.json")),pt_json_1=__importDefault(require("./locales/pt.json")),ru_json_1=__importDefault(require("./locales/ru.json")),hi_json_1=__importDefault(require("./locales/hi.json")),ar_json_1=__importDefault(require("./locales/ar.json")),it_json_1=__importDefault(require("./locales/it.json")),id_json_1=__importDefault(require("./locales/id.json")),tr_json_1=__importDefault(require("./locales/tr.json")),vi_json_1=__importDefault(require("./locales/vi.json")),nl_json_1=__importDefault(require("./locales/nl.json")),pl_json_1=__importDefault(require("./locales/pl.json")),ta_json_1=__importDefault(require("./locales/ta.json")),te_json_1=__importDefault(require("./locales/te.json")),kn_json_1=__importDefault(require("./locales/kn.json")),ml_json_1=__importDefault(require("./locales/ml.json")),bn_json_1=__importDefault(require("./locales/bn.json")),mr_json_1=__importDefault(require("./locales/mr.json")),gu_json_1=__importDefault(require("./locales/gu.json")),pa_json_1=__importDefault(require("./locales/pa.json"));exports.SUPPORTED_LANGUAGES=[{code:"en",name:"English",nativeName:"English",flag:"\u{1F1FA}\u{1F1F8}"},{code:"es",name:"Espa\xF1ol",nativeName:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"fr",name:"Fran\xE7ais",nativeName:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"de",name:"Deutsch",nativeName:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"zh",name:"\u4E2D\u6587",nativeName:"\u7B80\u4F53\u4E2D\u6587",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ja",name:"\u65E5\u672C\u8A9E",nativeName:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko",name:"\uD55C\uAD6D\uC5B4",nativeName:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"pt",name:"Portugu\xEAs",nativeName:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ru",name:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"hi",name:"\u0939\u093F\u0928\u094D\u0926\u0940",nativeName:"\u0939\u093F\u0928\u094D\u0926\u0940",flag:"\u{1F1EE}\u{1F1F3}"},{code:"ta",name:"Tamil",nativeName:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",flag:"\u{1F1EE}\u{1F1F3}"},{code:"te",name:"Telugu",nativeName:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",flag:"\u{1F1EE}\u{1F1F3}"},{code:"kn",name:"Kannada",nativeName:"\u0C95\u0CA8\u0CCD\u0CA8\u0CA1",flag:"\u{1F1EE}\u{1F1F3}"},{code:"ml",name:"Malayalam",nativeName:"\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02",flag:"\u{1F1EE}\u{1F1F3}"},{code:"bn",name:"Bengali",nativeName:"\u09AC\u09BE\u0982\u09B2\u09BE",flag:"\u{1F1EE}\u{1F1F3}"},{code:"mr",name:"Marathi",nativeName:"\u092E\u0930\u093E\u0920\u0940",flag:"\u{1F1EE}\u{1F1F3}"},{code:"gu",name:"Gujarati",nativeName:"\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0",flag:"\u{1F1EE}\u{1F1F3}"},{code:"pa",name:"Punjabi",nativeName:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40",flag:"\u{1F1EE}\u{1F1F3}"},{code:"ar",name:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",nativeName:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"},{code:"it",name:"Italiano",nativeName:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"id",name:"Bahasa Indonesia",nativeName:"Bahasa Indonesia",flag:"\u{1F1EE}\u{1F1E9}"},{code:"tr",name:"T\xFCrk\xE7e",nativeName:"T\xFCrk\xE7e",flag:"\u{1F1F9}\u{1F1F7}"},{code:"vi",name:"Ti\u1EBFng Vi\u1EC7t",nativeName:"Ti\u1EBFng Vi\u1EC7t",flag:"\u{1F1FB}\u{1F1F3}"},{code:"nl",name:"Nederlands",nativeName:"Nederlands",flag:"\u{1F1F3}\u{1F1F1}"},{code:"pl",name:"Polski",nativeName:"Polski",flag:"\u{1F1F5}\u{1F1F1}"}];const localeRegistry={en:en_json_1.default,es:es_json_1.default,fr:fr_json_1.default,de:de_json_1.default,zh:zh_json_1.default,ja:ja_json_1.default,ko:ko_json_1.default,pt:pt_json_1.default,ru:ru_json_1.default,hi:hi_json_1.default,ta:ta_json_1.default,te:te_json_1.default,kn:kn_json_1.default,ml:ml_json_1.default,bn:bn_json_1.default,mr:mr_json_1.default,gu:gu_json_1.default,pa:pa_json_1.default,ar:ar_json_1.default,it:it_json_1.default,id:id_json_1.default,tr:tr_json_1.default,vi:vi_json_1.default,nl:nl_json_1.default,pl:pl_json_1.default};let currentLanguage="en";const listeners=new Set;function lookupKey(e,n){if(!e||!n)return;const a=n.split(".");let o=e;for(let s=0;s<a.length;s++){if(o==null)return;o=o[a[s]]}return o}function interpolate(e,n){return!n||typeof e!="string"?e:e.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(a,o)=>n[o]!==void 0?String(n[o]):`{{${o}}}`)}function t(e,n,a){const o=localeRegistry[currentLanguage]||localeRegistry.en;let s=lookupKey(o,e);return s===void 0&¤tLanguage!=="en"&&(s=lookupKey(localeRegistry.en,e)),typeof s=="string"?typeof n=="object"&&n!==null?interpolate(s,n):s:typeof n=="string"?n:typeof a=="string"?typeof n=="object"&&n!==null?interpolate(a,n):a:e}function getLanguage(){return currentLanguage}function setLanguage(e){typeof e=="string"&&e.trim()&&(currentLanguage=e.trim(),exports.i18n.language=currentLanguage,listeners.forEach(n=>{try{n()}catch{}}))}function addTranslations(e,n){!e||!n||typeof n!="object"||(localeRegistry[e]={...localeRegistry[e]||{},...n},listeners.forEach(a=>{try{a()}catch{}}))}function setTranslations(e,n="en"){addTranslations(n,e)}exports.i18n={t,language:currentLanguage,changeLanguage:setLanguage,addResourceBundle:(e,n,a)=>addTranslations(e,a),getLanguage,setLanguage,addTranslations,setTranslations};function useTranslation(){const[,e]=react_1.default.useState(0);return react_1.default.useEffect(()=>{const n=()=>e(a=>a+1);return listeners.add(n),()=>{listeners.delete(n)}},[]),{t,i18n:exports.i18n,language:currentLanguage,currentLanguage,setLanguage}}const I18nextProvider=({children:e})=>react_1.default.createElement(react_1.default.Fragment,null,e);exports.I18nextProvider=I18nextProvider,exports.default=exports.i18n;
|