- 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
186 lines
4.5 KiB
JavaScript
186 lines
4.5 KiB
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, '__esModule', {
|
|
value: true
|
|
});
|
|
exports.printIteratorEntries = printIteratorEntries;
|
|
exports.printIteratorValues = printIteratorValues;
|
|
exports.printListItems = printListItems;
|
|
exports.printObjectProperties = printObjectProperties;
|
|
|
|
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
const getKeysOfEnumerableProperties = object => {
|
|
const keys = Object.keys(object).sort();
|
|
|
|
if (Object.getOwnPropertySymbols) {
|
|
Object.getOwnPropertySymbols(object).forEach(symbol => {
|
|
if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
|
|
keys.push(symbol);
|
|
}
|
|
});
|
|
}
|
|
|
|
return keys;
|
|
};
|
|
/**
|
|
* Return entries (for example, of a map)
|
|
* with spacing, indentation, and comma
|
|
* without surrounding punctuation (for example, braces)
|
|
*/
|
|
|
|
function printIteratorEntries( // Flow 0.51.0: property `@@iterator` of $Iterator not found in Object
|
|
// To allow simplistic getRecordIterator in immutable.js
|
|
iterator,
|
|
config,
|
|
indentation,
|
|
depth,
|
|
refs,
|
|
printer, // Too bad, so sad that separator for ECMAScript Map has been ' => '
|
|
// What a distracting diff if you change a data structure to/from
|
|
separator = ': '
|
|
) {
|
|
let result = '';
|
|
let current = iterator.next();
|
|
|
|
if (!current.done) {
|
|
result += config.spacingOuter;
|
|
const indentationNext = indentation + config.indent;
|
|
|
|
while (!current.done) {
|
|
const name = printer(
|
|
current.value[0],
|
|
config,
|
|
indentationNext,
|
|
depth,
|
|
refs
|
|
);
|
|
const value = printer(
|
|
current.value[1],
|
|
config,
|
|
indentationNext,
|
|
depth,
|
|
refs
|
|
);
|
|
result += indentationNext + name + separator + value;
|
|
current = iterator.next();
|
|
|
|
if (!current.done) {
|
|
result += ',' + config.spacingInner;
|
|
} else if (!config.min) {
|
|
result += ',';
|
|
}
|
|
}
|
|
|
|
result += config.spacingOuter + indentation;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
/**
|
|
* Return values (for example, of a set)
|
|
* with spacing, indentation, and comma
|
|
* without surrounding punctuation (braces or brackets)
|
|
*/
|
|
|
|
function printIteratorValues(
|
|
iterator,
|
|
config,
|
|
indentation,
|
|
depth,
|
|
refs,
|
|
printer
|
|
) {
|
|
let result = '';
|
|
let current = iterator.next();
|
|
|
|
if (!current.done) {
|
|
result += config.spacingOuter;
|
|
const indentationNext = indentation + config.indent;
|
|
|
|
while (!current.done) {
|
|
result +=
|
|
indentationNext +
|
|
printer(current.value, config, indentationNext, depth, refs);
|
|
current = iterator.next();
|
|
|
|
if (!current.done) {
|
|
result += ',' + config.spacingInner;
|
|
} else if (!config.min) {
|
|
result += ',';
|
|
}
|
|
}
|
|
|
|
result += config.spacingOuter + indentation;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
/**
|
|
* Return items (for example, of an array)
|
|
* with spacing, indentation, and comma
|
|
* without surrounding punctuation (for example, brackets)
|
|
**/
|
|
|
|
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
let result = '';
|
|
|
|
if (list.length) {
|
|
result += config.spacingOuter;
|
|
const indentationNext = indentation + config.indent;
|
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
result +=
|
|
indentationNext +
|
|
printer(list[i], config, indentationNext, depth, refs);
|
|
|
|
if (i < list.length - 1) {
|
|
result += ',' + config.spacingInner;
|
|
} else if (!config.min) {
|
|
result += ',';
|
|
}
|
|
}
|
|
|
|
result += config.spacingOuter + indentation;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
/**
|
|
* Return properties of an object
|
|
* with spacing, indentation, and comma
|
|
* without surrounding punctuation (for example, braces)
|
|
*/
|
|
|
|
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
let result = '';
|
|
const keys = getKeysOfEnumerableProperties(val);
|
|
|
|
if (keys.length) {
|
|
result += config.spacingOuter;
|
|
const indentationNext = indentation + config.indent;
|
|
|
|
for (let i = 0; i < keys.length; i++) {
|
|
const key = keys[i];
|
|
const name = printer(key, config, indentationNext, depth, refs);
|
|
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
result += indentationNext + name + ': ' + value;
|
|
|
|
if (i < keys.length - 1) {
|
|
result += ',' + config.spacingInner;
|
|
} else if (!config.min) {
|
|
result += ',';
|
|
}
|
|
}
|
|
|
|
result += config.spacingOuter + indentation;
|
|
}
|
|
|
|
return result;
|
|
}
|