diff --git a/rsconcept/frontend/src/features/help/items/help-interface.tsx b/rsconcept/frontend/src/features/help/items/help-interface.tsx
index d7dec2f2..a2d5aa5e 100644
--- a/rsconcept/frontend/src/features/help/items/help-interface.tsx
+++ b/rsconcept/frontend/src/features/help/items/help-interface.tsx
@@ -8,6 +8,7 @@ import {
IconPin,
IconUser2
} from '@/components/icons';
+import { isMac } from '@/utils/utils';
import { Subtopics } from '../components/subtopics';
import { HelpTopic } from '../models/help-topic';
@@ -33,7 +34,7 @@ export function HelpInterface() {
Навигация и настройки
-
- Ctrl + клик на объект навигации откроет новую вкладку
+ {isMac() ? 'Cmd + клик' : 'Ctrl + клик'} на объект навигации откроет новую вкладку
-
навигационную панель можно скрыть с помощью кнопки в правом
diff --git a/rsconcept/frontend/src/features/help/items/ui/help-library.tsx b/rsconcept/frontend/src/features/help/items/ui/help-library.tsx
index 59dd40f2..d542b024 100644
--- a/rsconcept/frontend/src/features/help/items/ui/help-library.tsx
+++ b/rsconcept/frontend/src/features/help/items/ui/help-library.tsx
@@ -15,6 +15,7 @@ import {
IconSubfolders,
IconUserSearch
} from '@/components/icons';
+import { isMac } from '@/utils/utils';
import { LinkTopic } from '../../components/link-topic';
import { HelpTopic } from '../../models/help-topic';
@@ -38,7 +39,7 @@ export function HelpLibrary() {
клик по строке - переход к редактированию схемы
-
- Ctrl + клик по строке откроет схему в новой вкладке
+ {isMac() ? 'Cmd + клик' : 'Ctrl + клик'} по строке откроет схему в новой вкладке
- Фильтры атрибутов три позиции: да/нет/не применять
-
@@ -74,7 +75,11 @@ export function HelpLibrary() {
клик по папке отображает справа схемы в ней
-
- Ctrl + клик по папке копирует путь в буфер обмена
+
+ {isMac()
+ ? 'Cmd + клик по папке копирует путь в буфер обмена'
+ : 'Ctrl + клик по папке копирует путь в буфер обмена'}
+
-
клик по иконке сворачивает/разворачивает вложенные
diff --git a/rsconcept/frontend/src/features/help/items/ui/help-rscard.tsx b/rsconcept/frontend/src/features/help/items/ui/help-rscard.tsx
index 02a29f01..5ba96651 100644
--- a/rsconcept/frontend/src/features/help/items/ui/help-rscard.tsx
+++ b/rsconcept/frontend/src/features/help/items/ui/help-rscard.tsx
@@ -8,6 +8,7 @@ import {
IconPublic,
IconSave
} from '@/components/icons';
+import { isMac } from '@/utils/utils';
import { LinkTopic } from '../../components/link-topic';
import { HelpTopic } from '../../models/help-topic';
@@ -34,7 +35,7 @@ export function HelpRSCard() {
переход к связанной
-
- сохранить изменения: Ctrl + S
+ сохранить изменения: {isMac() ? 'Cmd + S' : 'Ctrl + S'}
-
Редактор обладает правом редактирования
diff --git a/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx b/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx
index 1154429d..5347a348 100644
--- a/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx
+++ b/rsconcept/frontend/src/features/help/items/ui/help-rseditor.tsx
@@ -18,6 +18,7 @@ import {
IconTree,
IconTypeGraph
} from '@/components/icons';
+import { isMac } from '@/utils/utils';
import { LinkTopic } from '../../components/link-topic';
import { HelpTopic } from '../../models/help-topic';
@@ -40,7 +41,7 @@ export function HelpRSEditor() {
список конституент
-
- сохранить: Ctrl + S
+ сохранить: {isMac() ? 'Cmd + S' : 'Ctrl + S'}
-
сбросить изменения
@@ -104,7 +105,7 @@ export function HelpRSEditor() {
-
- Ctrl + Пробел вставка незанятого имени / замена проекции
+ {isMac() ? 'Cmd + Пробел' : 'Ctrl + Пробел'} вставка незанятого имени / замена проекции
@@ -116,7 +117,7 @@ export function HelpRSEditor() {
- Ctrl + Пробел открывает редактирование отсылок
+ {isMac() ? 'Cmd + Пробел' : 'Ctrl + Пробел'} открывает редактирование отсылок
diff --git a/rsconcept/frontend/src/features/library/components/toolbar-item-card.tsx b/rsconcept/frontend/src/features/library/components/toolbar-item-card.tsx
index ece1cb06..e1720670 100644
--- a/rsconcept/frontend/src/features/library/components/toolbar-item-card.tsx
+++ b/rsconcept/frontend/src/features/library/components/toolbar-item-card.tsx
@@ -12,7 +12,7 @@ import { cn } from '@/components/utils';
import { useModificationStore } from '@/stores/modification';
import { usePreferencesStore } from '@/stores/preferences';
import { tooltipText } from '@/utils/labels';
-import { prepareTooltip, sharePage } from '@/utils/utils';
+import { isMac, prepareTooltip, sharePage } from '@/utils/utils';
import { AccessPolicy, type ILibraryItem, LibraryItemType } from '../backend/types';
import { useMutatingLibrary } from '../backend/use-mutating-library';
@@ -71,7 +71,7 @@ export function ToolbarItemCard({
{ossSelector}
{isMutable || isModified ? (
}
onClick={onSubmit}
diff --git a/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/toolbar-oss-graph.tsx b/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/toolbar-oss-graph.tsx
index b73f96b1..13a68ba2 100644
--- a/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/toolbar-oss-graph.tsx
+++ b/rsconcept/frontend/src/features/oss/pages/oss-page/editor-oss-graph/toolbar-oss-graph.tsx
@@ -27,7 +27,7 @@ import { type Styling } from '@/components/props';
import { cn } from '@/components/utils';
import { useDialogsStore } from '@/stores/dialogs';
import { usePreferencesStore } from '@/stores/preferences';
-import { isIOS, notImplemented, prepareTooltip } from '@/utils/utils';
+import { isIOS, isMac, notImplemented, prepareTooltip } from '@/utils/utils';
import { useMutatingOss } from '../../../backend/use-mutating-oss';
import { useUpdateLayout } from '../../../backend/use-update-layout';
@@ -146,7 +146,7 @@ export function ToolbarOssGraph({
}
onClick={handleSavePositions}
diff --git a/rsconcept/frontend/src/features/rsform/components/refs-input/tooltip.ts b/rsconcept/frontend/src/features/rsform/components/refs-input/tooltip.ts
index 60be00dd..5ad20b6a 100644
--- a/rsconcept/frontend/src/features/rsform/components/refs-input/tooltip.ts
+++ b/rsconcept/frontend/src/features/rsform/components/refs-input/tooltip.ts
@@ -4,6 +4,7 @@ import { hoverTooltip, type TooltipView } from '@codemirror/view';
import clsx from 'clsx';
import { findContainedNodes } from '@/utils/codemirror';
+import { isMac } from '@/utils/utils';
import { describeConstituentaTerm, labelGrammeme } from '../../labels';
import { type IEntityReference, type ISyntacticReference } from '../../models/language';
@@ -95,7 +96,9 @@ function domTooltipEntityReference(ref: IEntityReference, cst: IConstituenta | n
if (canClick) {
const clickTip = document.createElement('p');
clickTip.className = 'text-center text-xs mt-1';
- clickTip.innerHTML = 'Ctrl + клик для переходаCtrl + пробел для редактирования';
+ clickTip.innerHTML = isMac()
+ ? 'Cmd + клик для переходаCmd + пробел для редактирования'
+ : 'Ctrl + клик для переходаCtrl + пробел для редактирования';
dom.appendChild(clickTip);
}
@@ -140,7 +143,9 @@ function domTooltipSyntacticReference(
if (canClick) {
const clickTip = document.createElement('p');
clickTip.className = 'text-center text-xs mt-1';
- clickTip.innerHTML = 'Ctrl + пробел для редактирования';
+ clickTip.innerHTML = isMac()
+ ? 'Cmd + пробел для редактирования'
+ : 'Ctrl + пробел для редактирования';
dom.appendChild(clickTip);
}
diff --git a/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-constituenta/toolbar-constituenta.tsx b/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-constituenta/toolbar-constituenta.tsx
index 0a8cdfbf..ff4d809d 100644
--- a/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-constituenta/toolbar-constituenta.tsx
+++ b/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-constituenta/toolbar-constituenta.tsx
@@ -22,7 +22,7 @@ import { cn } from '@/components/utils';
import { useModificationStore } from '@/stores/modification';
import { usePreferencesStore } from '@/stores/preferences';
import { tooltipText } from '@/utils/labels';
-import { prepareTooltip } from '@/utils/utils';
+import { isMac, prepareTooltip } from '@/utils/utils';
import { useMutatingRSForm } from '../../../backend/use-mutating-rsform';
import { type IConstituenta } from '../../../models/rsform';
@@ -97,7 +97,7 @@ export function ToolbarConstituenta({
{isContentEditable ? (
<>
}
onClick={onSubmit}
diff --git a/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-rsexpression/status-bar.tsx b/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-rsexpression/status-bar.tsx
index 9731a2f4..1d862338 100644
--- a/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-rsexpression/status-bar.tsx
+++ b/rsconcept/frontend/src/features/rsform/pages/rsform-page/editor-rsexpression/status-bar.tsx
@@ -10,7 +10,7 @@ import { cn } from '@/components/utils';
import { APP_COLORS } from '@/styling/colors';
import { globalIDs } from '@/utils/constants';
import { type RO } from '@/utils/meta';
-import { prepareTooltip } from '@/utils/utils';
+import { isMac, prepareTooltip } from '@/utils/utils';
import { type IExpressionParseDTO, ParsingStatus } from '../../../backend/types';
import { colorStatusBar } from '../../../colors';
@@ -55,7 +55,7 @@ export function StatusBar({ className, isModified, processing, activeCst, parseD
)}
style={{ backgroundColor: processing ? APP_COLORS.bgDefault : colorStatusBar(status) }}
data-tooltip-id={globalIDs.tooltip}
- data-tooltip-html={prepareTooltip('Проверить определение', 'Ctrl + Q')}
+ data-tooltip-html={prepareTooltip('Проверить определение', isMac() ? 'Cmd + Q' : 'Ctrl + Q')}
onClick={onAnalyze}
>
{processing ? (
diff --git a/rsconcept/frontend/src/utils/utils.ts b/rsconcept/frontend/src/utils/utils.ts
index faa72b04..95e29e80 100644
--- a/rsconcept/frontend/src/utils/utils.ts
+++ b/rsconcept/frontend/src/utils/utils.ts
@@ -215,12 +215,22 @@ export function prepareTooltip(text: string, hotkey?: string) {
/**
* Utility to detect iOS/iPadOS.
*/
-export function isIOS() {
+export function isIOS(): boolean {
if (typeof navigator === 'undefined') {
return false;
}
return (
- /iPad|iPhone|iPod/.test(navigator.userAgent) ||
+ /iPad|iPhone|iPod/i.test(navigator.userAgent) ||
(navigator.userAgent.includes('Macintosh') && 'ontouchend' in document)
);
}
+
+/**
+ * Utility to detect Mac device.
+ */
+export function isMac(): boolean {
+ if (typeof navigator === 'undefined') {
+ return false;
+ }
+ return /Macintosh|MacIntel|MacPPC|Mac68K|Mac OS/i.test(navigator.userAgent);
+}