- 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
3.8 KiB
JavaScript
89 lines
3.8 KiB
JavaScript
'use strict';
|
|
|
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
import { NativeEventEmitter, Platform, findNodeHandle } from 'react-native';
|
|
import { shouldBeUseWeb } from '../reanimated2/PlatformChecker';
|
|
import { runOnJS, runOnUIImmediately } from '../reanimated2/threads';
|
|
import NativeReanimatedModule from '../specs/NativeReanimatedModule';
|
|
const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
|
class JSPropsUpdaterPaper {
|
|
constructor() {
|
|
_defineProperty(this, "_reanimatedEventEmitter", void 0);
|
|
this._reanimatedEventEmitter = new NativeEventEmitter(
|
|
// NativeEventEmitter only uses this parameter on iOS.
|
|
Platform.OS === 'ios' ? NativeReanimatedModule : undefined);
|
|
}
|
|
addOnJSPropsChangeListener(animatedComponent) {
|
|
const viewTag = findNodeHandle(animatedComponent);
|
|
JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent);
|
|
if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {
|
|
const listener = data => {
|
|
const component = JSPropsUpdaterPaper._tagToComponentMapping.get(data.viewTag);
|
|
component === null || component === void 0 || component._updateFromNative(data.props);
|
|
};
|
|
this._reanimatedEventEmitter.addListener('onReanimatedPropsChange', listener);
|
|
}
|
|
}
|
|
removeOnJSPropsChangeListener(animatedComponent) {
|
|
const viewTag = findNodeHandle(animatedComponent);
|
|
JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag);
|
|
if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) {
|
|
this._reanimatedEventEmitter.removeAllListeners('onReanimatedPropsChange');
|
|
}
|
|
}
|
|
}
|
|
_defineProperty(JSPropsUpdaterPaper, "_tagToComponentMapping", new Map());
|
|
class JSPropsUpdaterFabric {
|
|
constructor() {
|
|
if (!JSPropsUpdaterFabric.isInitialized) {
|
|
const updater = (viewTag, props) => {
|
|
const component = JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag);
|
|
component === null || component === void 0 || component._updateFromNative(props);
|
|
};
|
|
runOnUIImmediately(() => {
|
|
'worklet';
|
|
|
|
global.updateJSProps = (viewTag, props) => {
|
|
runOnJS(updater)(viewTag, props);
|
|
};
|
|
})();
|
|
JSPropsUpdaterFabric.isInitialized = true;
|
|
}
|
|
}
|
|
addOnJSPropsChangeListener(animatedComponent) {
|
|
if (!JSPropsUpdaterFabric.isInitialized) {
|
|
return;
|
|
}
|
|
const viewTag = findNodeHandle(animatedComponent);
|
|
JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent);
|
|
}
|
|
removeOnJSPropsChangeListener(animatedComponent) {
|
|
if (!JSPropsUpdaterFabric.isInitialized) {
|
|
return;
|
|
}
|
|
const viewTag = findNodeHandle(animatedComponent);
|
|
JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag);
|
|
}
|
|
}
|
|
_defineProperty(JSPropsUpdaterFabric, "_tagToComponentMapping", new Map());
|
|
_defineProperty(JSPropsUpdaterFabric, "isInitialized", false);
|
|
class JSPropsUpdaterWeb {
|
|
addOnJSPropsChangeListener(_animatedComponent) {
|
|
// noop
|
|
}
|
|
removeOnJSPropsChangeListener(_animatedComponent) {
|
|
// noop
|
|
}
|
|
}
|
|
let JSPropsUpdater;
|
|
if (SHOULD_BE_USE_WEB) {
|
|
JSPropsUpdater = JSPropsUpdaterWeb;
|
|
} else if (global._IS_FABRIC) {
|
|
JSPropsUpdater = JSPropsUpdaterFabric;
|
|
} else {
|
|
JSPropsUpdater = JSPropsUpdaterPaper;
|
|
}
|
|
export default JSPropsUpdater;
|
|
//# sourceMappingURL=JSPropsUpdater.js.map
|