Files
smart-city-digital-twin-mar…/smart-app-city/frontend/node_modules/fbjs/lib/UnicodeBidiDirection.js.flow
Eric FELIXINE e30ae8ed09 feat(smart-app): implement complete mobile app MVP
- 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
2026-06-01 18:00:35 -04:00

113 lines
2.7 KiB
Plaintext

/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule UnicodeBidiDirection
* @typechecks
* @flow
*/
/**
* Constants to represent text directionality
*
* Also defines a *global* direciton, to be used in bidi algorithms as a
* default fallback direciton, when no better direction is found or provided.
*
* NOTE: Use `setGlobalDir()`, or update `initGlobalDir()`, to set the initial
* global direction value based on the application.
*
* Part of the implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
'use strict';
const invariant = require("./invariant");
export type BidiDirection = 'LTR' | 'RTL' | 'NEUTRAL';
export type HTMLDir = 'ltr' | 'rtl';
const NEUTRAL = 'NEUTRAL'; // No strong direction
const LTR = 'LTR'; // Left-to-Right direction
const RTL = 'RTL'; // Right-to-Left direction
let globalDir: ?BidiDirection = null; // == Helpers ==
/**
* Check if a directionality value is a Strong one
*/
function isStrong(dir: BidiDirection): boolean {
return dir === LTR || dir === RTL;
}
/**
* Get string value to be used for `dir` HTML attribute or `direction` CSS
* property.
*/
function getHTMLDir(dir: BidiDirection): HTMLDir {
invariant(isStrong(dir), '`dir` must be a strong direction to be converted to HTML Direction');
return dir === LTR ? 'ltr' : 'rtl';
}
/**
* Get string value to be used for `dir` HTML attribute or `direction` CSS
* property, but returns null if `dir` has same value as `otherDir`.
* `null`.
*/
function getHTMLDirIfDifferent(dir: BidiDirection, otherDir: BidiDirection): ?HTMLDir {
invariant(isStrong(dir), '`dir` must be a strong direction to be converted to HTML Direction');
invariant(isStrong(otherDir), '`otherDir` must be a strong direction to be converted to HTML Direction');
return dir === otherDir ? null : getHTMLDir(dir);
} // == Global Direction ==
/**
* Set the global direction.
*/
function setGlobalDir(dir: BidiDirection): void {
globalDir = dir;
}
/**
* Initialize the global direction
*/
function initGlobalDir(): void {
setGlobalDir(LTR);
}
/**
* Get the global direction
*/
function getGlobalDir(): BidiDirection {
if (!globalDir) {
this.initGlobalDir();
}
invariant(globalDir, 'Global direction not set.');
return globalDir;
}
const UnicodeBidiDirection = {
// Values
NEUTRAL,
LTR,
RTL,
// Helpers
isStrong,
getHTMLDir,
getHTMLDirIfDifferent,
// Global Direction
setGlobalDir,
initGlobalDir,
getGlobalDir
};
module.exports = UnicodeBidiDirection;