UNPKG

@lobehub/editor

Version:

A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.

30 lines 932 B
import { IS_APPLE } from '@lexical/utils'; export var nodeDetect = function nodeDetect() { return typeof process !== 'undefined' && process.versions && !!process.versions.node; }; export var browserDetect = function browserDetect() { return typeof window !== 'undefined' && window.document !== undefined; }; export var isNode = nodeDetect(); export var isBrowser = browserDetect(); export var macOSDetect = function macOSDetect() { if (isNode) { return process.platform === 'darwin'; } if (isBrowser) { return window.navigator.platform.includes('Mac'); } return false; }; export var isMac = macOSDetect(); export var CONTROL_OR_META = { ctrlKey: !IS_APPLE, metaKey: IS_APPLE }; export var CONTROL_OR_META_AND_SHIFT = { ctrlKey: !IS_APPLE, metaKey: IS_APPLE, shiftKey: true }; export { IS_FIREFOX, IS_APPLE as isApple } from '@lexical/utils'; export var isOnServerSide = typeof window === 'undefined';