@lobehub/ui 1.168.1 → 1.168.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,60 +22,61 @@ import Icon from "../Icon";
22
22
  import LeftClickIcon from "./components/LeftClickIcon";
23
23
  import RightClickIcon from "./components/RightClickIcon";
24
24
  import { useStyles } from "./style";
25
- import { ALT_KEY, BACKSPACE_KEY, CONTROL_KEY, DOWN_KEY, ENTER_KEY, LEFT_CLICK_KEY, LEFT_KEY, META_KEY, MID_CLICK_KEY, MOD_KEY, RIGHT_CLICK_KEY, RIGHT_KEY, SHIFT_KEY, SPACE_KEY, TAB_KEY, UP_KEY, checkIsAppleDevice, splitKeysByPlus, startCase } from "./utils";
25
+ import { KeyMap } from "./type";
26
+ import { checkIsAppleDevice, splitKeysByPlus, startCase } from "./utils";
26
27
  import { jsx as _jsx } from "react/jsx-runtime";
27
28
  import { jsxs as _jsxs } from "react/jsx-runtime";
28
29
  var mappingKey = function mappingKey(isAppleDevice) {
29
30
  var _ref;
30
- return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, ALT_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
31
+ return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, KeyMap.Alt, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
31
32
  icon: Option
32
- }) : 'Alt'), BACKSPACE_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
33
+ }) : 'Alt'), KeyMap.Backspace, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
33
34
  icon: Delete
34
- }) : 'Backspace'), CONTROL_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
35
+ }) : 'Backspace'), KeyMap.Ctrl, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
35
36
  icon: ChevronUpIcon
36
- }) : 'Ctrl'), DOWN_KEY, /*#__PURE__*/_jsx(Icon, {
37
+ }) : 'Ctrl'), KeyMap.Down, /*#__PURE__*/_jsx(Icon, {
37
38
  icon: ArrowDownIcon
38
- })), ENTER_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
39
+ })), KeyMap.Enter, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
39
40
  icon: CornerDownLeftIcon
40
- }) : 'Enter'), LEFT_CLICK_KEY, /*#__PURE__*/_jsx(Icon, {
41
+ }) : 'Enter'), KeyMap.LeftClick, /*#__PURE__*/_jsx(Icon, {
41
42
  icon: LeftClickIcon,
42
43
  size: {
43
44
  fontSize: '1.15em',
44
45
  strokeWidth: 1.75
45
46
  }
46
- })), LEFT_KEY, /*#__PURE__*/_jsx(Icon, {
47
+ })), KeyMap.Left, /*#__PURE__*/_jsx(Icon, {
47
48
  icon: ArrowLeftIcon
48
- })), META_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
49
+ })), KeyMap.Meta, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
49
50
  icon: Command
50
51
  }) : /*#__PURE__*/_jsx(Icon, {
51
52
  icon: Grid2X2Icon
52
- })), MID_CLICK_KEY, /*#__PURE__*/_jsx(Icon, {
53
+ })), KeyMap.MiddleClick, /*#__PURE__*/_jsx(Icon, {
53
54
  icon: MouseIcon,
54
55
  size: {
55
56
  fontSize: '1.15em',
56
57
  strokeWidth: 1.75
57
58
  }
58
- })), MOD_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
59
+ })), KeyMap.Mod, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
59
60
  icon: Command
60
- }) : 'Ctrl'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, RIGHT_CLICK_KEY, /*#__PURE__*/_jsx(Icon, {
61
+ }) : 'Ctrl'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, KeyMap.RightClick, /*#__PURE__*/_jsx(Icon, {
61
62
  icon: RightClickIcon,
62
63
  size: {
63
64
  fontSize: '1.15em',
64
65
  strokeWidth: 1.75
65
66
  }
66
- })), RIGHT_KEY, /*#__PURE__*/_jsx(Icon, {
67
+ })), KeyMap.Right, /*#__PURE__*/_jsx(Icon, {
67
68
  icon: ArrowRightIcon
68
- })), SHIFT_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
69
+ })), KeyMap.Shift, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
69
70
  icon: ArrowBigUpIcon,
70
71
  size: {
71
72
  fontSize: '1.15em',
72
73
  strokeWidth: 1.75
73
74
  }
74
- }) : 'Shift'), SPACE_KEY, /*#__PURE__*/_jsx(Icon, {
75
+ }) : 'Shift'), KeyMap.Space, /*#__PURE__*/_jsx(Icon, {
75
76
  icon: SpaceIcon
76
- })), TAB_KEY, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
77
+ })), KeyMap.Tab, isAppleDevice ? /*#__PURE__*/_jsx(Icon, {
77
78
  icon: ArrowRightToLineIcon
78
- }) : 'Tab'), UP_KEY, /*#__PURE__*/_jsx(Icon, {
79
+ }) : 'Tab'), KeyMap.Up, /*#__PURE__*/_jsx(Icon, {
79
80
  icon: ArrowUpIcon
80
81
  }));
81
82
  };
@@ -0,0 +1,18 @@
1
+ export declare const enum KeyMap {
2
+ Alt = "alt",
3
+ Backspace = "backspace",
4
+ Ctrl = "ctrl",
5
+ Down = "down",
6
+ Enter = "enter",
7
+ Left = "left",
8
+ LeftClick = "left-click",
9
+ Meta = "meta",
10
+ MiddleClick = "middle-click",
11
+ Mod = "mod",
12
+ Right = "right",
13
+ RightClick = "right-click",
14
+ Shift = "shift",
15
+ Space = "space",
16
+ Tab = "tab",
17
+ Up = "up"
18
+ }
@@ -0,0 +1,18 @@
1
+ export var KeyMap = {
2
+ Alt: "alt",
3
+ Backspace: "backspace",
4
+ Ctrl: "ctrl",
5
+ Down: "down",
6
+ Enter: "enter",
7
+ Left: "left",
8
+ LeftClick: "left-click",
9
+ Meta: "meta",
10
+ MiddleClick: "middle-click",
11
+ Mod: "mod",
12
+ Right: "right",
13
+ RightClick: "right-click",
14
+ Shift: "shift",
15
+ Space: "space",
16
+ Tab: "tab",
17
+ Up: "up"
18
+ };
@@ -1,19 +1,3 @@
1
- export declare const ALT_KEY = "alt";
2
- export declare const MOD_KEY = "mod";
3
- export declare const SHIFT_KEY = "shift";
4
- export declare const META_KEY = "meta";
5
- export declare const BACKSPACE_KEY = "backspace";
6
- export declare const CONTROL_KEY = "ctrl";
7
- export declare const SPACE_KEY = "space";
8
- export declare const TAB_KEY = "tab";
9
- export declare const ENTER_KEY = "enter";
10
- export declare const LEFT_KEY = "left";
11
- export declare const RIGHT_KEY = "right";
12
- export declare const UP_KEY = "up";
13
- export declare const DOWN_KEY = "down";
14
- export declare const RIGHT_CLICK_KEY = "right-click";
15
- export declare const LEFT_CLICK_KEY = "left-click";
16
- export declare const MID_CLICK_KEY = "mid-click";
17
1
  export declare const splitKeysByPlus: (keys: string) => string[];
18
2
  export declare const startCase: (str: string) => string;
19
3
  export declare const checkIsAppleDevice: (isApple?: boolean) => boolean;
@@ -1,19 +1,3 @@
1
- export var ALT_KEY = 'alt';
2
- export var MOD_KEY = 'mod';
3
- export var SHIFT_KEY = 'shift';
4
- export var META_KEY = 'meta';
5
- export var BACKSPACE_KEY = 'backspace';
6
- export var CONTROL_KEY = 'ctrl';
7
- export var SPACE_KEY = 'space';
8
- export var TAB_KEY = 'tab';
9
- export var ENTER_KEY = 'enter';
10
- export var LEFT_KEY = 'left';
11
- export var RIGHT_KEY = 'right';
12
- export var UP_KEY = 'up';
13
- export var DOWN_KEY = 'down';
14
- export var RIGHT_CLICK_KEY = 'right-click';
15
- export var LEFT_CLICK_KEY = 'left-click';
16
- export var MID_CLICK_KEY = 'mid-click';
17
1
  export var splitKeysByPlus = function splitKeysByPlus(keys) {
18
2
  var placeholder = 'PLACEHOLDER';
19
3
  var parts = keys.replaceAll('++', "+".concat(placeholder)).split('+');
@@ -32,6 +32,7 @@ export { default as Header, type HeaderProps } from './Header';
32
32
  export { default as Highlighter, type HighlighterProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from './Highlighter';
33
33
  export { useChatListActionsBar } from './hooks/useChatListActionsBar';
34
34
  export { default as Hotkey, type HotkeyProps } from './Hotkey';
35
+ export { KeyMap } from './Hotkey/type';
35
36
  export { default as HotkeyInput, type HotkeyInputProps } from './HotkeyInput';
36
37
  export { default as Icon, type IconProps, type IconSize } from './Icon';
37
38
  export * from './Icon/icons';
package/es/components.js CHANGED
@@ -32,6 +32,7 @@ export { default as Header } from "./Header";
32
32
  export { default as Highlighter, SyntaxHighlighter } from "./Highlighter";
33
33
  export { useChatListActionsBar } from "./hooks/useChatListActionsBar";
34
34
  export { default as Hotkey } from "./Hotkey";
35
+ export { KeyMap } from "./Hotkey/type";
35
36
  export { default as HotkeyInput } from "./HotkeyInput";
36
37
  export { default as Icon } from "./Icon";
37
38
  export * from "./Icon/icons";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.168.1",
3
+ "version": "1.168.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",