@difizen/libro-jupyter 0.0.2-alpha.0

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.
Files changed (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/es/add-between-cell/add-between-cell-command-contribution.d.ts +14 -0
  4. package/es/add-between-cell/add-between-cell-command-contribution.d.ts.map +1 -0
  5. package/es/add-between-cell/add-between-cell-command-contribution.js +97 -0
  6. package/es/add-between-cell/add-between-cell.d.ts +5 -0
  7. package/es/add-between-cell/add-between-cell.d.ts.map +1 -0
  8. package/es/add-between-cell/add-between-cell.js +243 -0
  9. package/es/add-between-cell/index.d.ts +3 -0
  10. package/es/add-between-cell/index.d.ts.map +1 -0
  11. package/es/add-between-cell/index.js +2 -0
  12. package/es/add-between-cell/index.less +103 -0
  13. package/es/add-between-cell/module.d.ts +3 -0
  14. package/es/add-between-cell/module.d.ts.map +1 -0
  15. package/es/add-between-cell/module.js +8 -0
  16. package/es/cell/index.d.ts +3 -0
  17. package/es/cell/index.d.ts.map +1 -0
  18. package/es/cell/index.js +2 -0
  19. package/es/cell/jupyter-code-cell-model.d.ts +12 -0
  20. package/es/cell/jupyter-code-cell-model.d.ts.map +1 -0
  21. package/es/cell/jupyter-code-cell-model.js +56 -0
  22. package/es/cell/jupyter-code-cell-view.d.ts +18 -0
  23. package/es/cell/jupyter-code-cell-view.d.ts.map +1 -0
  24. package/es/cell/jupyter-code-cell-view.js +280 -0
  25. package/es/command/command-contribution.d.ts +10 -0
  26. package/es/command/command-contribution.d.ts.map +1 -0
  27. package/es/command/command-contribution.js +161 -0
  28. package/es/command/index.d.ts +3 -0
  29. package/es/command/index.d.ts.map +1 -0
  30. package/es/command/index.js +2 -0
  31. package/es/command/keybinding-contribution.d.ts +8 -0
  32. package/es/command/keybinding-contribution.d.ts.map +1 -0
  33. package/es/command/keybinding-contribution.js +37 -0
  34. package/es/components/cell-execution-tip.d.ts +6 -0
  35. package/es/components/cell-execution-tip.d.ts.map +1 -0
  36. package/es/components/cell-execution-tip.js +69 -0
  37. package/es/components/cell-input-bottom-blank.d.ts +5 -0
  38. package/es/components/cell-input-bottom-blank.d.ts.map +1 -0
  39. package/es/components/cell-input-bottom-blank.js +21 -0
  40. package/es/components/icons.d.ts +5 -0
  41. package/es/components/icons.d.ts.map +1 -0
  42. package/es/components/icons.js +154 -0
  43. package/es/components/index.d.ts +4 -0
  44. package/es/components/index.d.ts.map +1 -0
  45. package/es/components/index.js +3 -0
  46. package/es/components/index.less +82 -0
  47. package/es/config/config-contribution.d.ts +10 -0
  48. package/es/config/config-contribution.d.ts.map +1 -0
  49. package/es/config/config-contribution.js +50 -0
  50. package/es/config/config.d.ts +3 -0
  51. package/es/config/config.d.ts.map +1 -0
  52. package/es/config/config.js +11 -0
  53. package/es/config/index.d.ts +2 -0
  54. package/es/config/index.d.ts.map +1 -0
  55. package/es/config/index.js +1 -0
  56. package/es/configuration/index.d.ts +3 -0
  57. package/es/configuration/index.d.ts.map +1 -0
  58. package/es/configuration/index.js +2 -0
  59. package/es/configuration/libro-configuration-contribution.d.ts +5 -0
  60. package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
  61. package/es/configuration/libro-configuration-contribution.js +24 -0
  62. package/es/configuration/libro-configuration.d.ts +3 -0
  63. package/es/configuration/libro-configuration.d.ts.map +1 -0
  64. package/es/configuration/libro-configuration.js +12 -0
  65. package/es/contents/content-contribution.d.ts +7 -0
  66. package/es/contents/content-contribution.d.ts.map +1 -0
  67. package/es/contents/content-contribution.js +63 -0
  68. package/es/contents/index.d.ts +2 -0
  69. package/es/contents/index.d.ts.map +1 -0
  70. package/es/contents/index.js +1 -0
  71. package/es/file/file-name-alias.d.ts +7 -0
  72. package/es/file/file-name-alias.d.ts.map +1 -0
  73. package/es/file/file-name-alias.js +26 -0
  74. package/es/file/file-protocol.d.ts +8 -0
  75. package/es/file/file-protocol.d.ts.map +1 -0
  76. package/es/file/file-protocol.js +7 -0
  77. package/es/file/file-service.d.ts +31 -0
  78. package/es/file/file-service.d.ts.map +1 -0
  79. package/es/file/file-service.js +329 -0
  80. package/es/file/file-tree-label-provider.d.ts +13 -0
  81. package/es/file/file-tree-label-provider.d.ts.map +1 -0
  82. package/es/file/file-tree-label-provider.js +62 -0
  83. package/es/file/file-view/index.d.ts +14 -0
  84. package/es/file/file-view/index.d.ts.map +1 -0
  85. package/es/file/file-view/index.js +101 -0
  86. package/es/file/file-view/index.less +5 -0
  87. package/es/file/index.d.ts +7 -0
  88. package/es/file/index.d.ts.map +1 -0
  89. package/es/file/index.js +6 -0
  90. package/es/file/module.d.ts +3 -0
  91. package/es/file/module.d.ts.map +1 -0
  92. package/es/file/module.js +8 -0
  93. package/es/file/navigatable-view.d.ts +24 -0
  94. package/es/file/navigatable-view.d.ts.map +1 -0
  95. package/es/file/navigatable-view.js +151 -0
  96. package/es/file/open-handler-contribution.d.ts +11 -0
  97. package/es/file/open-handler-contribution.d.ts.map +1 -0
  98. package/es/file/open-handler-contribution.js +102 -0
  99. package/es/index.d.ts +32 -0
  100. package/es/index.d.ts.map +1 -0
  101. package/es/index.js +31 -0
  102. package/es/keybind-instructions/index.d.ts +6 -0
  103. package/es/keybind-instructions/index.d.ts.map +1 -0
  104. package/es/keybind-instructions/index.js +5 -0
  105. package/es/keybind-instructions/index.less +177 -0
  106. package/es/keybind-instructions/keybind-instructions-contribution.d.ts +11 -0
  107. package/es/keybind-instructions/keybind-instructions-contribution.d.ts.map +1 -0
  108. package/es/keybind-instructions/keybind-instructions-contribution.js +84 -0
  109. package/es/keybind-instructions/keybind-instructions-icon.d.ts +3 -0
  110. package/es/keybind-instructions/keybind-instructions-icon.d.ts.map +1 -0
  111. package/es/keybind-instructions/keybind-instructions-icon.js +23 -0
  112. package/es/keybind-instructions/keybind-instructions-items.d.ts +14 -0
  113. package/es/keybind-instructions/keybind-instructions-items.d.ts.map +1 -0
  114. package/es/keybind-instructions/keybind-instructions-items.js +589 -0
  115. package/es/keybind-instructions/keybind-instructions-view.d.ts +16 -0
  116. package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -0
  117. package/es/keybind-instructions/keybind-instructions-view.js +224 -0
  118. package/es/keybind-instructions/module.d.ts +3 -0
  119. package/es/keybind-instructions/module.d.ts.map +1 -0
  120. package/es/keybind-instructions/module.js +5 -0
  121. package/es/libro-jupyter-file-service.d.ts +106 -0
  122. package/es/libro-jupyter-file-service.d.ts.map +1 -0
  123. package/es/libro-jupyter-file-service.js +127 -0
  124. package/es/libro-jupyter-model.d.ts +49 -0
  125. package/es/libro-jupyter-model.d.ts.map +1 -0
  126. package/es/libro-jupyter-model.js +505 -0
  127. package/es/libro-jupyter-protocol.d.ts +38 -0
  128. package/es/libro-jupyter-protocol.d.ts.map +1 -0
  129. package/es/libro-jupyter-protocol.js +9 -0
  130. package/es/libro-jupyter-server-launch-manager.d.ts +11 -0
  131. package/es/libro-jupyter-server-launch-manager.d.ts.map +1 -0
  132. package/es/libro-jupyter-server-launch-manager.js +59 -0
  133. package/es/libro-jupyter-view.d.ts +10 -0
  134. package/es/libro-jupyter-view.d.ts.map +1 -0
  135. package/es/libro-jupyter-view.js +42 -0
  136. package/es/module.d.ts +3 -0
  137. package/es/module.d.ts.map +1 -0
  138. package/es/module.js +48 -0
  139. package/es/output/index.d.ts +2 -0
  140. package/es/output/index.d.ts.map +1 -0
  141. package/es/output/index.js +1 -0
  142. package/es/output/libro-jupyter-outputarea.d.ts +8 -0
  143. package/es/output/libro-jupyter-outputarea.d.ts.map +1 -0
  144. package/es/output/libro-jupyter-outputarea.js +77 -0
  145. package/es/rendermime/assets/plotly.svg +31 -0
  146. package/es/rendermime/index.d.ts +5 -0
  147. package/es/rendermime/index.d.ts.map +1 -0
  148. package/es/rendermime/index.js +4 -0
  149. package/es/rendermime/index.less +22 -0
  150. package/es/rendermime/module.d.ts +3 -0
  151. package/es/rendermime/module.d.ts.map +1 -0
  152. package/es/rendermime/module.js +3 -0
  153. package/es/rendermime/plotly-render.d.ts +7 -0
  154. package/es/rendermime/plotly-render.d.ts.map +1 -0
  155. package/es/rendermime/plotly-render.js +30 -0
  156. package/es/rendermime/plotly-renderers.d.ts +58 -0
  157. package/es/rendermime/plotly-renderers.d.ts.map +1 -0
  158. package/es/rendermime/plotly-renderers.js +211 -0
  159. package/es/rendermime/plotly-rendermime-contribution.d.ts +12 -0
  160. package/es/rendermime/plotly-rendermime-contribution.d.ts.map +1 -0
  161. package/es/rendermime/plotly-rendermime-contribution.js +22 -0
  162. package/es/theme/color-registry.d.ts +6 -0
  163. package/es/theme/color-registry.d.ts.map +1 -0
  164. package/es/theme/color-registry.js +393 -0
  165. package/es/theme/index.d.ts +2 -0
  166. package/es/theme/index.d.ts.map +1 -0
  167. package/es/theme/index.js +1 -0
  168. package/es/toolbar/index.d.ts +6 -0
  169. package/es/toolbar/index.d.ts.map +1 -0
  170. package/es/toolbar/index.js +5 -0
  171. package/es/toolbar/index.less +194 -0
  172. package/es/toolbar/kernel-selector-dropdown.d.ts +13 -0
  173. package/es/toolbar/kernel-selector-dropdown.d.ts.map +1 -0
  174. package/es/toolbar/kernel-selector-dropdown.js +165 -0
  175. package/es/toolbar/kernel-status-and-selector.d.ts +18 -0
  176. package/es/toolbar/kernel-status-and-selector.d.ts.map +1 -0
  177. package/es/toolbar/kernel-status-and-selector.js +164 -0
  178. package/es/toolbar/run-selector.d.ts +3 -0
  179. package/es/toolbar/run-selector.d.ts.map +1 -0
  180. package/es/toolbar/run-selector.js +98 -0
  181. package/es/toolbar/save-file-error-contribution.d.ts +5 -0
  182. package/es/toolbar/save-file-error-contribution.d.ts.map +1 -0
  183. package/es/toolbar/save-file-error-contribution.js +23 -0
  184. package/es/toolbar/save-file-error.d.ts +5 -0
  185. package/es/toolbar/save-file-error.d.ts.map +1 -0
  186. package/es/toolbar/save-file-error.js +27 -0
  187. package/es/toolbar/side-toolbar-run-selector.d.ts +3 -0
  188. package/es/toolbar/side-toolbar-run-selector.d.ts.map +1 -0
  189. package/es/toolbar/side-toolbar-run-selector.js +67 -0
  190. package/es/toolbar/toolbar-contribution.d.ts +9 -0
  191. package/es/toolbar/toolbar-contribution.d.ts.map +1 -0
  192. package/es/toolbar/toolbar-contribution.js +67 -0
  193. package/es/typings/index.d.ts +31 -0
  194. package/es/utils/index.d.ts +11 -0
  195. package/es/utils/index.d.ts.map +1 -0
  196. package/es/utils/index.js +47 -0
  197. package/package.json +75 -0
  198. package/src/add-between-cell/add-between-cell-command-contribution.ts +63 -0
  199. package/src/add-between-cell/add-between-cell.tsx +201 -0
  200. package/src/add-between-cell/index.less +103 -0
  201. package/src/add-between-cell/index.ts +2 -0
  202. package/src/add-between-cell/module.ts +13 -0
  203. package/src/cell/index.ts +2 -0
  204. package/src/cell/jupyter-code-cell-model.ts +36 -0
  205. package/src/cell/jupyter-code-cell-view.tsx +221 -0
  206. package/src/command/command-contribution.ts +163 -0
  207. package/src/command/index.ts +2 -0
  208. package/src/command/keybinding-contribution.ts +25 -0
  209. package/src/components/cell-execution-tip.tsx +107 -0
  210. package/src/components/cell-input-bottom-blank.tsx +24 -0
  211. package/src/components/icons.tsx +117 -0
  212. package/src/components/index.less +82 -0
  213. package/src/components/index.ts +3 -0
  214. package/src/config/config-contribution.ts +21 -0
  215. package/src/config/config.ts +14 -0
  216. package/src/config/index.ts +1 -0
  217. package/src/configuration/index.ts +2 -0
  218. package/src/configuration/libro-configuration-contribution.ts +11 -0
  219. package/src/configuration/libro-configuration.ts +14 -0
  220. package/src/contents/content-contribution.ts +32 -0
  221. package/src/contents/index.ts +1 -0
  222. package/src/file/file-name-alias.ts +15 -0
  223. package/src/file/file-protocol.ts +7 -0
  224. package/src/file/file-service.ts +179 -0
  225. package/src/file/file-tree-label-provider.ts +42 -0
  226. package/src/file/file-view/index.less +5 -0
  227. package/src/file/file-view/index.tsx +90 -0
  228. package/src/file/index.ts +6 -0
  229. package/src/file/module.ts +19 -0
  230. package/src/file/navigatable-view.tsx +93 -0
  231. package/src/file/open-handler-contribution.ts +44 -0
  232. package/src/index.ts +32 -0
  233. package/src/keybind-instructions/index.less +177 -0
  234. package/src/keybind-instructions/index.ts +5 -0
  235. package/src/keybind-instructions/keybind-instructions-contribution.ts +47 -0
  236. package/src/keybind-instructions/keybind-instructions-icon.tsx +28 -0
  237. package/src/keybind-instructions/keybind-instructions-items.tsx +597 -0
  238. package/src/keybind-instructions/keybind-instructions-view.tsx +239 -0
  239. package/src/keybind-instructions/module.ts +11 -0
  240. package/src/libro-jupyter-file-service.ts +158 -0
  241. package/src/libro-jupyter-model.ts +289 -0
  242. package/src/libro-jupyter-protocol.ts +59 -0
  243. package/src/libro-jupyter-server-launch-manager.ts +36 -0
  244. package/src/libro-jupyter-view.tsx +24 -0
  245. package/src/module.ts +105 -0
  246. package/src/output/index.ts +1 -0
  247. package/src/output/libro-jupyter-outputarea.tsx +71 -0
  248. package/src/rendermime/assets/plotly.svg +31 -0
  249. package/src/rendermime/index.less +13 -0
  250. package/src/rendermime/index.ts +4 -0
  251. package/src/rendermime/module.ts +7 -0
  252. package/src/rendermime/plotly-render.tsx +35 -0
  253. package/src/rendermime/plotly-renderers.ts +191 -0
  254. package/src/rendermime/plotly-rendermime-contribution.ts +15 -0
  255. package/src/theme/color-registry.ts +301 -0
  256. package/src/theme/index.ts +1 -0
  257. package/src/toolbar/index.less +194 -0
  258. package/src/toolbar/index.ts +5 -0
  259. package/src/toolbar/kernel-selector-dropdown.tsx +204 -0
  260. package/src/toolbar/kernel-status-and-selector.tsx +195 -0
  261. package/src/toolbar/run-selector.tsx +110 -0
  262. package/src/toolbar/save-file-error-contribution.ts +10 -0
  263. package/src/toolbar/save-file-error.tsx +35 -0
  264. package/src/toolbar/side-toolbar-run-selector.tsx +77 -0
  265. package/src/toolbar/toolbar-contribution.tsx +62 -0
  266. package/src/typings/index.d.ts +31 -0
  267. package/src/utils/index.ts +65 -0
@@ -0,0 +1,47 @@
1
+ import { LibroCommandRegister, LibroToolbarArea, LibroView } from '@difizen/libro-core';
2
+ import type { CommandRegistry, ToolbarRegistry } from '@difizen/mana-app';
3
+ import { ModalContribution } from '@difizen/mana-app';
4
+ import { ToolbarContribution, CommandContribution } from '@difizen/mana-app';
5
+ import { inject, singleton } from '@difizen/mana-app';
6
+ import { l10n } from '@difizen/mana-l10n';
7
+
8
+ import { KeybindInstructionsIcon } from './keybind-instructions-icon.js';
9
+ import { KeybindInstrutionModal } from './keybind-instructions-view.js';
10
+
11
+ const KeybindInstructionsCommand = {
12
+ id: 'notebook:keybind-instructions',
13
+ };
14
+
15
+ @singleton({ contrib: [CommandContribution, ToolbarContribution, ModalContribution] })
16
+ export class KeybindInstructionsContribution
17
+ implements CommandContribution, ToolbarContribution, ModalContribution
18
+ {
19
+ @inject(LibroCommandRegister) protected readonly libroCommand: LibroCommandRegister;
20
+
21
+ registerCommands(command: CommandRegistry) {
22
+ this.libroCommand.registerLibroCommand(command, KeybindInstructionsCommand, {
23
+ execute: async (_cell, libro) => {
24
+ if (!libro || !(libro instanceof LibroView)) {
25
+ return;
26
+ }
27
+ },
28
+ isVisible: (_cell, _libro, path) => {
29
+ return path === LibroToolbarArea.HeaderRight;
30
+ },
31
+ });
32
+ }
33
+
34
+ registerToolbarItems(registry: ToolbarRegistry) {
35
+ registry.registerItem({
36
+ id: KeybindInstructionsCommand.id,
37
+ icon: KeybindInstructionsIcon,
38
+ command: KeybindInstructionsCommand.id,
39
+ order: 'l',
40
+ tooltip: l10n.t('查看快捷键'),
41
+ });
42
+ }
43
+
44
+ registerModal() {
45
+ return KeybindInstrutionModal;
46
+ }
47
+ }
@@ -0,0 +1,28 @@
1
+ import { KeybindInstructionsOutlined } from '@difizen/libro-core';
2
+ import { ModalService, useInject } from '@difizen/mana-app';
3
+ import type { FC } from 'react';
4
+
5
+ import {
6
+ KeybindInstrutionsService,
7
+ KeybindInstrutionModal,
8
+ } from './keybind-instructions-view.js';
9
+
10
+ export const KeybindInstructionsIcon: FC = () => {
11
+ const keybindInstrutionsService = useInject(KeybindInstrutionsService);
12
+ const modalService = useInject(ModalService);
13
+ const handleClick = () => {
14
+ modalService.openModal(KeybindInstrutionModal);
15
+ keybindInstrutionsService.contextKey.disableCommandMode();
16
+ };
17
+ return (
18
+ <div className="libro-keybind-instructions-icon" onClick={handleClick}>
19
+ <KeybindInstructionsOutlined
20
+ className="libro-keybind-instructions-icon-svg"
21
+ style={{
22
+ display: 'inline-block',
23
+ verticalAlign: 'middle',
24
+ }}
25
+ />
26
+ </div>
27
+ );
28
+ };
@@ -0,0 +1,597 @@
1
+ import { singleton } from '@difizen/mana-app';
2
+ import { l10n } from '@difizen/mana-l10n';
3
+ import { Tag } from 'antd';
4
+ import type { ColumnsType } from 'antd/es/table';
5
+
6
+ export interface DataType {
7
+ key: React.Key;
8
+ actionDescription: React.ReactNode;
9
+ keybind: React.ReactNode;
10
+ }
11
+
12
+ @singleton()
13
+ export class LibroKeybindItems {
14
+ commandModeActionColumns: ColumnsType<DataType> = [
15
+ {
16
+ title: l10n.t('命令态操作'),
17
+ dataIndex: 'actionDescription',
18
+ width: '125px',
19
+ },
20
+ {
21
+ title: l10n.t('快捷键'),
22
+ // width: '100px',
23
+ dataIndex: 'keybind',
24
+ },
25
+ ];
26
+
27
+ editModeActionColumns: ColumnsType<DataType> = [
28
+ {
29
+ title: l10n.t('编辑态操作'),
30
+ dataIndex: 'actionDescription',
31
+ width: '125px',
32
+ },
33
+ {
34
+ title: l10n.t('快捷键'),
35
+ dataIndex: 'keybind',
36
+ },
37
+ ];
38
+
39
+ editModeData: DataType[] = [
40
+ {
41
+ key: '1',
42
+ actionDescription: l10n.t('保存文件'),
43
+ keybind: (
44
+ <>
45
+ <Tag>Cmd</Tag>
46
+ <Tag>S</Tag>
47
+ </>
48
+ ),
49
+ },
50
+ {
51
+ key: '2',
52
+ actionDescription: l10n.t('运行选中cell'),
53
+ keybind: (
54
+ <>
55
+ <Tag>Cmd</Tag>
56
+ <Tag>Enter</Tag>
57
+ </>
58
+ ),
59
+ },
60
+ {
61
+ key: '3',
62
+ actionDescription: l10n.t('运行并选择下一个cell'),
63
+ keybind: (
64
+ <>
65
+ <Tag>Shift</Tag>
66
+ <Tag>Enter</Tag>
67
+ </>
68
+ ),
69
+ },
70
+ {
71
+ key: '4',
72
+ actionDescription: l10n.t('运行并新增cell'),
73
+ keybind: (
74
+ <>
75
+ <Tag>Alt</Tag>
76
+ <Tag>Enter</Tag>
77
+ </>
78
+ ),
79
+ },
80
+ {
81
+ key: '5',
82
+ actionDescription: l10n.t('隐藏Code'),
83
+ keybind: (
84
+ <>
85
+ <Tag>Cmd</Tag>
86
+ <Tag>&apos;</Tag>
87
+ </>
88
+ ),
89
+ },
90
+ {
91
+ key: '6',
92
+ actionDescription: l10n.t('隐藏Output'),
93
+ keybind: (
94
+ <>
95
+ <Tag>Cmd</Tag>
96
+ <Tag>O</Tag>
97
+ </>
98
+ ),
99
+ },
100
+ {
101
+ key: '7',
102
+ actionDescription: l10n.t('切分cell'),
103
+ keybind: (
104
+ <>
105
+ <Tag>Cmd</Tag>
106
+ <Tag>Shift</Tag>
107
+ <Tag>-</Tag>
108
+ </>
109
+ ),
110
+ },
111
+ {
112
+ key: '8',
113
+ actionDescription: l10n.t('选中当前所在行'),
114
+ keybind: (
115
+ <>
116
+ <Tag>Command</Tag>
117
+ <Tag>L</Tag>{' '}
118
+ </>
119
+ ),
120
+ },
121
+ {
122
+ key: '9',
123
+ actionDescription: l10n.t('全选'),
124
+ keybind: (
125
+ <>
126
+ <Tag>Cmd</Tag>
127
+ <Tag>A</Tag>
128
+ </>
129
+ ),
130
+ },
131
+ {
132
+ key: '10',
133
+ actionDescription: l10n.t('光标移至行首'),
134
+ keybind: (
135
+ <>
136
+ <Tag>Cmd</Tag>
137
+ <Tag>Left</Tag>
138
+ </>
139
+ ),
140
+ },
141
+ {
142
+ key: '11',
143
+ actionDescription: l10n.t('光标移至行尾'),
144
+ keybind: (
145
+ <>
146
+ <Tag>Cmd</Tag>
147
+ <Tag>Right</Tag>
148
+ </>
149
+ ),
150
+ },
151
+ {
152
+ key: '12',
153
+ actionDescription: l10n.t('光标移至文档首'),
154
+ keybind: (
155
+ <>
156
+ <Tag>Cmd</Tag>
157
+ <Tag>Up</Tag>
158
+ </>
159
+ ),
160
+ },
161
+ {
162
+ key: '13',
163
+ actionDescription: l10n.t('光标移至文档尾'),
164
+ keybind: (
165
+ <>
166
+ <Tag>Cmd</Tag>
167
+ <Tag>Down</Tag>
168
+ </>
169
+ ),
170
+ },
171
+ {
172
+ key: '14',
173
+ actionDescription: l10n.t('向上移动当前所在行'),
174
+ keybind: (
175
+ <>
176
+ <Tag>Alt</Tag>
177
+ <Tag>Up</Tag>
178
+ </>
179
+ ),
180
+ },
181
+ {
182
+ key: '15',
183
+ actionDescription: l10n.t('向下移动当前所在行'),
184
+ keybind: (
185
+ <>
186
+ <Tag>Alt</Tag>
187
+ <Tag>Down</Tag>
188
+ </>
189
+ ),
190
+ },
191
+ {
192
+ key: '16',
193
+ actionDescription: l10n.t('向上拷贝当前所在行'),
194
+ keybind: (
195
+ <>
196
+ <Tag>Shift</Tag>
197
+ <Tag>Alt</Tag>
198
+ <Tag>Up</Tag>
199
+ </>
200
+ ),
201
+ },
202
+ {
203
+ key: '17',
204
+ actionDescription: l10n.t('向下拷贝当前所在行'),
205
+ keybind: (
206
+ <>
207
+ <Tag>Shift</Tag>
208
+ <Tag>Alt</Tag>
209
+ <Tag>Down</Tag>
210
+ </>
211
+ ),
212
+ },
213
+ {
214
+ key: '18',
215
+ actionDescription: l10n.t('删除光标至行首内容'),
216
+ keybind: (
217
+ <>
218
+ <Tag>Cmd</Tag>
219
+ <Tag>Backspace</Tag>
220
+ </>
221
+ ),
222
+ },
223
+ {
224
+ key: '19',
225
+ actionDescription: l10n.t('删除光标至行尾内容'),
226
+ keybind: (
227
+ <>
228
+ <Tag>Cmd</Tag>
229
+ <Tag>Delete</Tag>
230
+ </>
231
+ ),
232
+ },
233
+ {
234
+ key: '20',
235
+ actionDescription: l10n.t('撤销'),
236
+ keybind: (
237
+ <>
238
+ <Tag>Cmd</Tag>
239
+ <Tag>Z</Tag>
240
+ </>
241
+ ),
242
+ },
243
+ {
244
+ key: '21',
245
+ actionDescription: l10n.t('恢复'),
246
+ keybind: (
247
+ <>
248
+ <Tag>Cmd</Tag>
249
+ <Tag>Shift</Tag>
250
+ <Tag>Z</Tag>
251
+ </>
252
+ ),
253
+ },
254
+ {
255
+ key: '22',
256
+ actionDescription: l10n.t('撤销选中'),
257
+ keybind: (
258
+ <>
259
+ <Tag>Cmd</Tag>
260
+ <Tag>U</Tag>{' '}
261
+ </>
262
+ ),
263
+ },
264
+ {
265
+ key: '23',
266
+ actionDescription: l10n.t('恢复选中'),
267
+ keybind: (
268
+ <>
269
+ <Tag>Cmd</Tag>
270
+ <Tag>Shift</Tag>
271
+ <Tag>U</Tag>
272
+ </>
273
+ ),
274
+ },
275
+ ];
276
+
277
+ commandModeData: DataType[] = [
278
+ {
279
+ key: '1',
280
+ actionDescription: l10n.t('保存文件'),
281
+ keybind: (
282
+ <>
283
+ <Tag>Cmd</Tag>
284
+ <Tag>S</Tag>
285
+ </>
286
+ ),
287
+ },
288
+ {
289
+ key: '2',
290
+ actionDescription: l10n.t('运行选中cell'),
291
+ keybind: (
292
+ <>
293
+ <Tag>Cmd</Tag>
294
+ <Tag>Enter</Tag>
295
+ </>
296
+ ),
297
+ },
298
+ {
299
+ key: '3',
300
+ actionDescription: l10n.t('运行并选择下一个cell'),
301
+ keybind: (
302
+ <>
303
+ <Tag>Shift</Tag>
304
+ <Tag>Enter</Tag>
305
+ </>
306
+ ),
307
+ },
308
+ {
309
+ key: '4',
310
+ actionDescription: l10n.t('运行并新增cell'),
311
+ keybind: (
312
+ <>
313
+ <Tag>Alt</Tag>
314
+ <Tag>Enter</Tag>
315
+ </>
316
+ ),
317
+ },
318
+ {
319
+ key: '5',
320
+ actionDescription: l10n.t('选中上个cell'),
321
+ keybind: (
322
+ <>
323
+ <Tag>Up</Tag>/<Tag>K</Tag>
324
+ </>
325
+ ),
326
+ },
327
+ {
328
+ key: '6',
329
+ actionDescription: l10n.t('隐藏Code'),
330
+ keybind: (
331
+ <>
332
+ <Tag>Cmd</Tag>
333
+ <Tag>&apos;</Tag>
334
+ </>
335
+ ),
336
+ },
337
+ {
338
+ key: '7',
339
+ actionDescription: l10n.t('隐藏Output'),
340
+ keybind: (
341
+ <>
342
+ <Tag>Cmd</Tag>
343
+ <Tag>O</Tag>
344
+ </>
345
+ ),
346
+ },
347
+ {
348
+ key: '8',
349
+ actionDescription: l10n.t('选中下个cell'),
350
+ keybind: (
351
+ <>
352
+ <Tag>Down</Tag>/<Tag>J</Tag>
353
+ </>
354
+ ),
355
+ },
356
+ {
357
+ key: '9',
358
+ actionDescription: l10n.t('向上新增cell'),
359
+ keybind: (
360
+ <>
361
+ <Tag>A</Tag>
362
+ </>
363
+ ),
364
+ },
365
+ {
366
+ key: '10',
367
+ actionDescription: l10n.t('向下新增cell'),
368
+ keybind: (
369
+ <>
370
+ <Tag>B</Tag>
371
+ </>
372
+ ),
373
+ },
374
+ {
375
+ key: '11',
376
+ actionDescription: l10n.t('删除选中cell'),
377
+ keybind: (
378
+ <>
379
+ <Tag>D D</Tag>
380
+ </>
381
+ ),
382
+ },
383
+ {
384
+ key: '12',
385
+ actionDescription: l10n.t('复制cell'),
386
+ keybind: (
387
+ <>
388
+ <Tag>C</Tag>
389
+ </>
390
+ ),
391
+ },
392
+ {
393
+ key: '13',
394
+ actionDescription: l10n.t('剪切cell'),
395
+ keybind: (
396
+ <>
397
+ <Tag>X</Tag>
398
+ </>
399
+ ),
400
+ },
401
+ {
402
+ key: '14',
403
+ actionDescription: l10n.t('粘贴cell'),
404
+ keybind: (
405
+ <>
406
+ <Tag>V</Tag>
407
+ </>
408
+ ),
409
+ },
410
+ {
411
+ key: '15',
412
+ actionDescription: l10n.t('上移cell'),
413
+ keybind: (
414
+ <>
415
+ <Tag>Cmd</Tag>
416
+ <Tag>Shift</Tag>
417
+ <Tag>Up</Tag>
418
+ </>
419
+ ),
420
+ },
421
+ {
422
+ key: '16',
423
+ actionDescription: l10n.t('下移cell'),
424
+ keybind: (
425
+ <>
426
+ <Tag>Cmd</Tag>
427
+ <Tag>Shift</Tag>
428
+ <Tag>Down</Tag>
429
+ </>
430
+ ),
431
+ },
432
+ {
433
+ key: '17',
434
+ actionDescription: l10n.t('合并选中cell'),
435
+ keybind: (
436
+ <>
437
+ <Tag>Shift</Tag>
438
+ <Tag>M</Tag>
439
+ </>
440
+ ),
441
+ },
442
+ {
443
+ key: '18',
444
+ actionDescription: l10n.t('向下合并cell'),
445
+ keybind: (
446
+ <>
447
+ <Tag>Cmd</Tag>
448
+ <Tag>Shift</Tag>
449
+ <Tag>M</Tag>
450
+ </>
451
+ ),
452
+ },
453
+ {
454
+ key: '19',
455
+ actionDescription: l10n.t('向上合并cell'),
456
+ keybind: (
457
+ <>
458
+ <Tag>Cmd</Tag>
459
+ <Tag>Backspace</Tag>
460
+ </>
461
+ ),
462
+ },
463
+ {
464
+ key: '20',
465
+ actionDescription: l10n.t('撤销'),
466
+ keybind: (
467
+ <>
468
+ <Tag>Z</Tag>
469
+ </>
470
+ ),
471
+ },
472
+ {
473
+ key: '21',
474
+ actionDescription: l10n.t('恢复'),
475
+ keybind: (
476
+ <>
477
+ <Tag>Shift</Tag>
478
+ <Tag>Z</Tag>
479
+ </>
480
+ ),
481
+ },
482
+ {
483
+ key: '22',
484
+ actionDescription: l10n.t('转为Code Cell'),
485
+ keybind: (
486
+ <>
487
+ <Tag>Y</Tag>
488
+ </>
489
+ ),
490
+ },
491
+ {
492
+ key: '23',
493
+ actionDescription: l10n.t('转为Markdown Cell'),
494
+ keybind: (
495
+ <>
496
+ <Tag>M</Tag>
497
+ </>
498
+ ),
499
+ },
500
+ {
501
+ key: '24',
502
+ actionDescription: l10n.t('转为一级标题'),
503
+ keybind: (
504
+ <>
505
+ <Tag>1</Tag>
506
+ </>
507
+ ),
508
+ },
509
+ {
510
+ key: '25',
511
+ actionDescription: l10n.t('转为二级标题'),
512
+ keybind: (
513
+ <>
514
+ <Tag>2</Tag>
515
+ </>
516
+ ),
517
+ },
518
+ {
519
+ key: '26',
520
+ actionDescription: l10n.t('转为三级标题'),
521
+ keybind: (
522
+ <>
523
+ <Tag>3</Tag>
524
+ </>
525
+ ),
526
+ },
527
+ {
528
+ key: '27',
529
+ actionDescription: l10n.t('转为四级标题'),
530
+ keybind: (
531
+ <>
532
+ <Tag>4</Tag>
533
+ </>
534
+ ),
535
+ },
536
+ {
537
+ key: '28',
538
+ actionDescription: l10n.t('转为五级标题'),
539
+ keybind: (
540
+ <>
541
+ <Tag>5</Tag>
542
+ </>
543
+ ),
544
+ },
545
+ {
546
+ key: '29',
547
+ actionDescription: l10n.t('转为六级标题'),
548
+ keybind: (
549
+ <>
550
+ <Tag>6</Tag>
551
+ </>
552
+ ),
553
+ },
554
+ {
555
+ key: '30',
556
+ actionDescription: l10n.t('向上多选Cell'),
557
+ keybind: (
558
+ <>
559
+ <Tag>Shift</Tag>
560
+ <Tag>Up</Tag>/<Tag>Shift</Tag>
561
+ <Tag>K</Tag>
562
+ </>
563
+ ),
564
+ },
565
+ {
566
+ key: '31',
567
+ actionDescription: l10n.t('向下多选Cell'),
568
+ keybind: (
569
+ <>
570
+ <Tag>Shift</Tag>
571
+ <Tag>Down</Tag>/<Tag>Shift</Tag>
572
+ <Tag>J</Tag>
573
+ </>
574
+ ),
575
+ },
576
+ {
577
+ key: '32',
578
+ actionDescription: l10n.t('选中当前及之前cell'),
579
+ keybind: (
580
+ <>
581
+ <Tag>Shift</Tag>
582
+ <Tag>Home</Tag>
583
+ </>
584
+ ),
585
+ },
586
+ {
587
+ key: '33',
588
+ actionDescription: l10n.t('选中当前及之后cell'),
589
+ keybind: (
590
+ <>
591
+ <Tag>Shift</Tag>
592
+ <Tag>End</Tag>
593
+ </>
594
+ ),
595
+ },
596
+ ];
597
+ }