- 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
114 lines
4.2 KiB
JavaScript
114 lines
4.2 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.filterConfig = filterConfig;
|
|
exports.findNodeHandle = findNodeHandle;
|
|
exports.scheduleFlushOperations = scheduleFlushOperations;
|
|
exports.MouseButton = exports.baseGestureHandlerWithMonitorProps = exports.baseGestureHandlerProps = void 0;
|
|
|
|
var _reactNative = require("react-native");
|
|
|
|
var _handlersRegistry = require("./handlersRegistry");
|
|
|
|
var _utils = require("../utils");
|
|
|
|
var _RNGestureHandlerModule = _interopRequireDefault(require("../RNGestureHandlerModule"));
|
|
|
|
var _ghQueueMicrotask = require("../ghQueueMicrotask");
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
// Previous types exported gesture handlers as classes which creates an interface and variable, both named the same as class.
|
|
// Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof
|
|
// e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.
|
|
// See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.
|
|
const commonProps = ['id', 'enabled', 'shouldCancelWhenOutside', 'hitSlop', 'cancelsTouchesInView', 'userSelect', 'activeCursor', 'mouseButton', 'enableContextMenu', 'touchAction'];
|
|
const componentInteractionProps = ['waitFor', 'simultaneousHandlers', 'blocksHandlers'];
|
|
const baseGestureHandlerProps = [...commonProps, ...componentInteractionProps, 'onBegan', 'onFailed', 'onCancelled', 'onActivated', 'onEnded', 'onGestureEvent', 'onHandlerStateChange'];
|
|
exports.baseGestureHandlerProps = baseGestureHandlerProps;
|
|
const baseGestureHandlerWithMonitorProps = [...commonProps, 'needsPointerData', 'manualActivation'];
|
|
exports.baseGestureHandlerWithMonitorProps = baseGestureHandlerWithMonitorProps;
|
|
let MouseButton;
|
|
exports.MouseButton = MouseButton;
|
|
|
|
(function (MouseButton) {
|
|
MouseButton[MouseButton["LEFT"] = 1] = "LEFT";
|
|
MouseButton[MouseButton["RIGHT"] = 2] = "RIGHT";
|
|
MouseButton[MouseButton["MIDDLE"] = 4] = "MIDDLE";
|
|
MouseButton[MouseButton["BUTTON_4"] = 8] = "BUTTON_4";
|
|
MouseButton[MouseButton["BUTTON_5"] = 16] = "BUTTON_5";
|
|
MouseButton[MouseButton["ALL"] = 31] = "ALL";
|
|
})(MouseButton || (exports.MouseButton = MouseButton = {}));
|
|
|
|
function isConfigParam(param, name) {
|
|
// param !== Object(param) returns false if `param` is a function
|
|
// or an object and returns true if `param` is null
|
|
return param !== undefined && (param !== Object(param) || !('__isNative' in param)) && name !== 'onHandlerStateChange' && name !== 'onGestureEvent';
|
|
}
|
|
|
|
function filterConfig(props, validProps, defaults = {}) {
|
|
const filteredConfig = { ...defaults
|
|
};
|
|
|
|
for (const key of validProps) {
|
|
let value = props[key];
|
|
|
|
if (isConfigParam(value, key)) {
|
|
if (key === 'simultaneousHandlers' || key === 'waitFor') {
|
|
value = transformIntoHandlerTags(props[key]);
|
|
} else if (key === 'hitSlop' && typeof value !== 'object') {
|
|
value = {
|
|
top: value,
|
|
left: value,
|
|
bottom: value,
|
|
right: value
|
|
};
|
|
}
|
|
|
|
filteredConfig[key] = value;
|
|
}
|
|
}
|
|
|
|
return filteredConfig;
|
|
}
|
|
|
|
function transformIntoHandlerTags(handlerIDs) {
|
|
handlerIDs = (0, _utils.toArray)(handlerIDs);
|
|
|
|
if (_reactNative.Platform.OS === 'web') {
|
|
return handlerIDs.map(({
|
|
current
|
|
}) => current).filter(handle => handle);
|
|
} // converts handler string IDs into their numeric tags
|
|
|
|
|
|
return handlerIDs.map(handlerID => {
|
|
var _handlerID$current;
|
|
|
|
return _handlersRegistry.handlerIDToTag[handlerID] || ((_handlerID$current = handlerID.current) === null || _handlerID$current === void 0 ? void 0 : _handlerID$current.handlerTag) || -1;
|
|
}).filter(handlerTag => handlerTag > 0);
|
|
}
|
|
|
|
function findNodeHandle(node) {
|
|
if (_reactNative.Platform.OS === 'web') {
|
|
return node;
|
|
}
|
|
|
|
return (0, _reactNative.findNodeHandle)(node);
|
|
}
|
|
|
|
let flushOperationsScheduled = false;
|
|
|
|
function scheduleFlushOperations() {
|
|
if (!flushOperationsScheduled) {
|
|
flushOperationsScheduled = true;
|
|
(0, _ghQueueMicrotask.ghQueueMicrotask)(() => {
|
|
_RNGestureHandlerModule.default.flushOperations();
|
|
|
|
flushOperationsScheduled = false;
|
|
});
|
|
}
|
|
}
|
|
//# sourceMappingURL=gestureHandlerCommon.js.map
|