- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
89 lines
2.7 KiB
JavaScript
89 lines
2.7 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true,
|
|
});
|
|
exports.default = void 0;
|
|
var _fs = require("fs");
|
|
var _path = _interopRequireDefault(require("path"));
|
|
var _tempDir = _interopRequireDefault(require("temp-dir"));
|
|
function _interopRequireDefault(obj) {
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
}
|
|
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*
|
|
* @format
|
|
* @oncall react_native
|
|
*/
|
|
|
|
const { Launcher: EdgeLauncher } = require("@rnx-kit/chromium-edge-launcher");
|
|
const ChromeLauncher = require("chrome-launcher");
|
|
|
|
/**
|
|
* Default `BrowserLauncher` implementation which opens URLs on the host
|
|
* machine.
|
|
*/
|
|
const DefaultBrowserLauncher = {
|
|
/**
|
|
* Attempt to open the debugger frontend in a Google Chrome or Microsoft Edge
|
|
* app window.
|
|
*/
|
|
launchDebuggerAppWindow: async (url) => {
|
|
let browserType = "chrome";
|
|
let chromePath;
|
|
try {
|
|
// Locate Chrome installation path, will throw if not found
|
|
chromePath = ChromeLauncher.getChromePath();
|
|
} catch (e) {
|
|
browserType = "edge";
|
|
chromePath = EdgeLauncher.getFirstInstallation();
|
|
if (chromePath == null) {
|
|
throw new Error(
|
|
"Unable to find a browser on the host to open the debugger. " +
|
|
"Supported browsers: Google Chrome, Microsoft Edge.\n" +
|
|
url
|
|
);
|
|
}
|
|
}
|
|
const userDataDir = await createTempDir(
|
|
`react-native-debugger-frontend-${browserType}`
|
|
);
|
|
const launchedChrome = await ChromeLauncher.launch({
|
|
chromeFlags: [
|
|
...ChromeLauncher.Launcher.defaultFlags().filter(
|
|
/**
|
|
* This flag controls whether Chrome treats a visually covered (occluded) tab
|
|
* as "backgrounded". We launch CDT as a single tab/window via `--app`, so we
|
|
* do want Chrome to treat our tab as "backgrounded" when the UI is covered.
|
|
* Omitting this flag allows "visibilitychange" events to fire properly.
|
|
*/
|
|
(flag) => flag !== "--disable-backgrounding-occluded-windows"
|
|
),
|
|
`--app=${url}`,
|
|
`--user-data-dir=${userDataDir}`,
|
|
"--window-size=1200,600",
|
|
"--guest",
|
|
],
|
|
chromePath,
|
|
ignoreDefaultFlags: true,
|
|
});
|
|
return {
|
|
kill: async () => launchedChrome.kill(),
|
|
};
|
|
},
|
|
};
|
|
async function createTempDir(dirName) {
|
|
const tempDir = _path.default.join(_tempDir.default, dirName);
|
|
await _fs.promises.mkdir(tempDir, {
|
|
recursive: true,
|
|
});
|
|
return tempDir;
|
|
}
|
|
var _default = DefaultBrowserLauncher;
|
|
exports.default = _default;
|