Merge remote-tracking branch 'origin/main' into react/type_widgets

This commit is contained in:
Elian Doran
2025-10-10 22:46:53 +03:00
206 changed files with 14442 additions and 2446 deletions

View File

@@ -892,6 +892,18 @@ export function deferred<T>(): DeferredPromise<T> {
})();
}
/**
* Handles left or right placement of e.g. tooltips in case of right-to-left languages. If the current language is a RTL one, then left and right are swapped. Other directions are unaffected.
* @param placement a string optionally containing a "left" or "right" value.
* @returns a left/right value swapped if needed, or the same as input otherwise.
*/
export function handleRightToLeftPlacement<T extends string>(placement: T) {
if (!glob.isRtl) return placement;
if (placement === "left") return "right";
if (placement === "right") return "left";
return placement;
}
export default {
reloadFrontendApp,
restartDesktopApp,