@difizen/libro-core 0.2.35-next.0 → 0.2.36

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 (41) hide show
  1. package/es/add-cell/libro-add-cell-view.d.ts.map +1 -1
  2. package/es/add-cell/libro-add-cell-view.js +1 -7
  3. package/es/cell/libro-cell-service.d.ts.map +1 -1
  4. package/es/cell/libro-cell-service.js +3 -0
  5. package/es/command/kernel-command.js +1 -1
  6. package/es/command/notebook-commands.js +3 -3
  7. package/es/components/cell-protocol.d.ts +4 -0
  8. package/es/components/cell-protocol.d.ts.map +1 -1
  9. package/es/components/cell-protocol.js +1 -0
  10. package/es/components/dnd-cell-item-render.d.ts +2 -0
  11. package/es/components/dnd-cell-item-render.d.ts.map +1 -1
  12. package/es/components/dnd-cell-item-render.js +17 -13
  13. package/es/components/dnd-component/index.less +4 -0
  14. package/es/index.less +10 -2
  15. package/es/libro-model.js +1 -1
  16. package/es/libro-setting.js +2 -2
  17. package/es/module.d.ts.map +1 -1
  18. package/es/module.js +4 -1
  19. package/es/settings/settings-modal.d.ts.map +1 -1
  20. package/es/settings/settings-modal.js +2 -1
  21. package/es/toolbar/hide-all-selector.js +4 -4
  22. package/es/toolbar/libro-toolbar.d.ts.map +1 -1
  23. package/es/toolbar/libro-toolbar.js +133 -108
  24. package/es/toolbar/side-toolar-more-select.d.ts.map +1 -1
  25. package/es/toolbar/side-toolar-more-select.js +82 -81
  26. package/package.json +5 -5
  27. package/src/add-cell/libro-add-cell-view.tsx +14 -23
  28. package/src/cell/libro-cell-service.ts +1 -0
  29. package/src/command/kernel-command.ts +1 -1
  30. package/src/command/notebook-commands.ts +3 -3
  31. package/src/components/cell-protocol.ts +4 -0
  32. package/src/components/dnd-cell-item-render.tsx +21 -17
  33. package/src/components/dnd-component/index.less +4 -0
  34. package/src/index.less +10 -2
  35. package/src/libro-model.ts +1 -1
  36. package/src/libro-setting.ts +2 -2
  37. package/src/module.ts +6 -0
  38. package/src/settings/settings-modal.tsx +2 -1
  39. package/src/toolbar/hide-all-selector.tsx +4 -4
  40. package/src/toolbar/libro-toolbar.tsx +15 -14
  41. package/src/toolbar/side-toolar-more-select.tsx +76 -72
@@ -8,6 +8,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
8
8
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
9
  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
10
10
  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
11
+ import { isMacintosh } from '@difizen/mana-app';
11
12
  import { inject, ModalService, singleton, ToolbarContribution, useObserve } from '@difizen/mana-app';
12
13
  import { l10n } from '@difizen/mana-l10n';
13
14
  import { DocumentCommands, NotebookCommands } from "../command/index.js";
@@ -48,29 +49,33 @@ export var LibroToolbarContribution = (_dec = singleton({
48
49
  id: DocumentCommands['Save'].id,
49
50
  command: DocumentCommands['Save'].id,
50
51
  icon: SaveIcon,
51
- tooltip: /*#__PURE__*/_jsxs("div", {
52
- className: "libro-tooltip",
53
- children: [/*#__PURE__*/_jsx("span", {
54
- className: "libro-tooltip-text",
55
- children: l10n.t('保存')
56
- }), /*#__PURE__*/_jsx("span", {
57
- className: "libro-tooltip-keybind",
58
- children: "Cmd + S"
59
- })]
60
- }),
52
+ tooltip: function tooltip() {
53
+ return /*#__PURE__*/_jsxs("div", {
54
+ className: "libro-tooltip",
55
+ children: [/*#__PURE__*/_jsx("span", {
56
+ className: "libro-tooltip-text",
57
+ children: l10n.t('保存')
58
+ }), /*#__PURE__*/_jsx("span", {
59
+ className: "libro-tooltip-keybind",
60
+ children: "".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + S")
61
+ })]
62
+ });
63
+ },
61
64
  group: ['group1'],
62
65
  order: '1'
63
66
  });
64
67
  registry.registerItem({
65
68
  id: NotebookCommands['Interrupt'].id,
66
69
  command: NotebookCommands['Interrupt'].id,
67
- tooltip: /*#__PURE__*/_jsx("div", {
68
- className: "libro-tooltip",
69
- children: /*#__PURE__*/_jsx("span", {
70
- className: "libro-tooltip-text",
71
- children: l10n.t('中断')
72
- })
73
- }),
70
+ tooltip: function tooltip() {
71
+ return /*#__PURE__*/_jsx("div", {
72
+ className: "libro-tooltip",
73
+ children: /*#__PURE__*/_jsx("span", {
74
+ className: "libro-tooltip-text",
75
+ children: l10n.t('中断')
76
+ })
77
+ });
78
+ },
74
79
  showLabelInline: true,
75
80
  group: ['group2'],
76
81
  order: 'b-all'
@@ -78,13 +83,15 @@ export var LibroToolbarContribution = (_dec = singleton({
78
83
  registry.registerItem({
79
84
  id: NotebookCommands['CloseAndShutdown'].id,
80
85
  command: NotebookCommands['CloseAndShutdown'].id,
81
- tooltip: /*#__PURE__*/_jsx("div", {
82
- className: "libro-tooltip",
83
- children: /*#__PURE__*/_jsx("span", {
84
- className: "libro-tooltip-text",
85
- children: l10n.t('关闭内核')
86
- })
87
- }),
86
+ tooltip: function tooltip() {
87
+ return /*#__PURE__*/_jsx("div", {
88
+ className: "libro-tooltip",
89
+ children: /*#__PURE__*/_jsx("span", {
90
+ className: "libro-tooltip-text",
91
+ children: l10n.t('关闭内核')
92
+ })
93
+ });
94
+ },
88
95
  showLabelInline: true,
89
96
  group: ['group2'],
90
97
  order: 'b-all'
@@ -92,13 +99,15 @@ export var LibroToolbarContribution = (_dec = singleton({
92
99
  registry.registerItem({
93
100
  id: NotebookCommands['RestartClearOutput'].id,
94
101
  command: NotebookCommands['RestartClearOutput'].id,
95
- tooltip: /*#__PURE__*/_jsx("div", {
96
- className: "libro-tooltip",
97
- children: /*#__PURE__*/_jsx("span", {
98
- className: "libro-tooltip-text",
99
- children: l10n.t('重启并清空输出')
100
- })
101
- }),
102
+ tooltip: function tooltip() {
103
+ return /*#__PURE__*/_jsx("div", {
104
+ className: "libro-tooltip",
105
+ children: /*#__PURE__*/_jsx("span", {
106
+ className: "libro-tooltip-text",
107
+ children: l10n.t('重启并清空输出')
108
+ })
109
+ });
110
+ },
102
111
  showLabelInline: true,
103
112
  group: ['group2'],
104
113
  order: 'c-all'
@@ -106,112 +115,126 @@ export var LibroToolbarContribution = (_dec = singleton({
106
115
  registry.registerItem({
107
116
  id: DocumentCommands['FormatCell'].id,
108
117
  command: DocumentCommands['FormatCell'].id,
109
- tooltip: /*#__PURE__*/_jsxs("div", {
110
- className: "libro-side-tooltip",
111
- children: [/*#__PURE__*/_jsx("span", {
112
- className: "libro-tooltip-text",
113
- children: l10n.t('格式化代码')
114
- }), /*#__PURE__*/_jsx("span", {
115
- className: "libro-tooltip-keybind",
116
- children: "Shift+Option+F"
117
- })]
118
- }),
118
+ tooltip: function tooltip() {
119
+ return /*#__PURE__*/_jsxs("div", {
120
+ className: "libro-side-tooltip",
121
+ children: [/*#__PURE__*/_jsx("span", {
122
+ className: "libro-tooltip-text",
123
+ children: l10n.t('格式化代码')
124
+ }), /*#__PURE__*/_jsx("span", {
125
+ className: "libro-tooltip-keybind",
126
+ children: "Shift+".concat(isMacintosh ? 'Option' : 'Alt', "+F")
127
+ })]
128
+ });
129
+ },
119
130
  group: ['sidetoolbar1'],
120
131
  order: 'd'
121
132
  });
122
133
  registry.registerItem({
123
134
  id: NotebookCommands['MoveCellUp'].id,
124
135
  command: NotebookCommands['MoveCellUp'].id,
125
- tooltip: /*#__PURE__*/_jsxs("div", {
126
- className: "libro-side-tooltip",
127
- children: [/*#__PURE__*/_jsx("span", {
128
- className: "libro-tooltip-text",
129
- children: l10n.t('上移')
130
- }), /*#__PURE__*/_jsx("span", {
131
- className: "libro-tooltip-keybind",
132
- children: "Up"
133
- })]
134
- }),
136
+ tooltip: function tooltip() {
137
+ return /*#__PURE__*/_jsxs("div", {
138
+ className: "libro-side-tooltip",
139
+ children: [/*#__PURE__*/_jsx("span", {
140
+ className: "libro-tooltip-text",
141
+ children: l10n.t('上移')
142
+ }), /*#__PURE__*/_jsx("span", {
143
+ className: "libro-tooltip-keybind",
144
+ children: "Up"
145
+ })]
146
+ });
147
+ },
135
148
  group: ['sidetoolbar1'],
136
149
  order: 'e'
137
150
  });
138
151
  registry.registerItem({
139
152
  id: NotebookCommands['MoveCellDown'].id,
140
153
  command: NotebookCommands['MoveCellDown'].id,
141
- tooltip: /*#__PURE__*/_jsxs("div", {
142
- className: "libro-side-tooltip",
143
- children: [/*#__PURE__*/_jsx("span", {
144
- className: "libro-tooltip-text",
145
- children: l10n.t('下移')
146
- }), /*#__PURE__*/_jsx("span", {
147
- className: "libro-tooltip-keybind",
148
- children: "Down"
149
- })]
150
- }),
154
+ tooltip: function tooltip() {
155
+ return /*#__PURE__*/_jsxs("div", {
156
+ className: "libro-side-tooltip",
157
+ children: [/*#__PURE__*/_jsx("span", {
158
+ className: "libro-tooltip-text",
159
+ children: l10n.t('下移')
160
+ }), /*#__PURE__*/_jsx("span", {
161
+ className: "libro-tooltip-keybind",
162
+ children: "Down"
163
+ })]
164
+ });
165
+ },
151
166
  group: ['sidetoolbar1'],
152
167
  order: 'f'
153
168
  });
154
169
  registry.registerItem({
155
170
  id: NotebookCommands['InsertCellBelow'].id,
156
171
  command: NotebookCommands['InsertCellBelow'].id,
157
- tooltip: /*#__PURE__*/_jsxs("div", {
158
- className: "libro-side-tooltip",
159
- children: [/*#__PURE__*/_jsx("span", {
160
- className: "libro-tooltip-text",
161
- children: l10n.t('增加')
162
- }), /*#__PURE__*/_jsx("span", {
163
- className: "libro-tooltip-keybind",
164
- children: "B"
165
- })]
166
- }),
172
+ tooltip: function tooltip() {
173
+ return /*#__PURE__*/_jsxs("div", {
174
+ className: "libro-side-tooltip",
175
+ children: [/*#__PURE__*/_jsx("span", {
176
+ className: "libro-tooltip-text",
177
+ children: l10n.t('增加')
178
+ }), /*#__PURE__*/_jsx("span", {
179
+ className: "libro-tooltip-keybind",
180
+ children: "B"
181
+ })]
182
+ });
183
+ },
167
184
  group: ['sidetoolbar2'],
168
185
  order: 'g1'
169
186
  });
170
187
  registry.registerItem({
171
188
  id: NotebookCommands['DeleteCell'].id,
172
189
  command: NotebookCommands['DeleteCell'].id,
173
- tooltip: /*#__PURE__*/_jsxs("div", {
174
- className: "libro-side-tooltip",
175
- children: [/*#__PURE__*/_jsx("span", {
176
- className: "libro-tooltip-text",
177
- children: l10n.t('删除')
178
- }), /*#__PURE__*/_jsx("span", {
179
- className: "libro-tooltip-keybind",
180
- children: "D D"
181
- })]
182
- }),
190
+ tooltip: function tooltip() {
191
+ return /*#__PURE__*/_jsxs("div", {
192
+ className: "libro-side-tooltip",
193
+ children: [/*#__PURE__*/_jsx("span", {
194
+ className: "libro-tooltip-text",
195
+ children: l10n.t('删除')
196
+ }), /*#__PURE__*/_jsx("span", {
197
+ className: "libro-tooltip-keybind",
198
+ children: "D D"
199
+ })]
200
+ });
201
+ },
183
202
  group: ['sidetoolbar2'],
184
203
  order: 'g2'
185
204
  });
186
205
  registry.registerItem({
187
206
  id: NotebookCommands['UndoCellAction'].id,
188
207
  command: NotebookCommands['UndoCellAction'].id,
189
- tooltip: /*#__PURE__*/_jsxs("div", {
190
- className: "libro-tooltip",
191
- children: [/*#__PURE__*/_jsx("span", {
192
- className: "libro-tooltip-text",
193
- children: l10n.t('撤销')
194
- }), /*#__PURE__*/_jsx("span", {
195
- className: "libro-tooltip-keybind",
196
- children: "Z"
197
- })]
198
- }),
208
+ tooltip: function tooltip() {
209
+ return /*#__PURE__*/_jsxs("div", {
210
+ className: "libro-tooltip",
211
+ children: [/*#__PURE__*/_jsx("span", {
212
+ className: "libro-tooltip-text",
213
+ children: l10n.t('撤销')
214
+ }), /*#__PURE__*/_jsx("span", {
215
+ className: "libro-tooltip-keybind",
216
+ children: "Z"
217
+ })]
218
+ });
219
+ },
199
220
  group: ['group3'],
200
221
  order: 'h1'
201
222
  });
202
223
  registry.registerItem({
203
224
  id: NotebookCommands['RedoCellAction'].id,
204
225
  command: NotebookCommands['RedoCellAction'].id,
205
- tooltip: /*#__PURE__*/_jsxs("div", {
206
- className: "libro-tooltip",
207
- children: [/*#__PURE__*/_jsx("span", {
208
- className: "libro-tooltip-text",
209
- children: l10n.t('重做')
210
- }), /*#__PURE__*/_jsx("span", {
211
- className: "libro-tooltip-keybind",
212
- children: "Shift + Z"
213
- })]
214
- }),
226
+ tooltip: function tooltip() {
227
+ return /*#__PURE__*/_jsxs("div", {
228
+ className: "libro-tooltip",
229
+ children: [/*#__PURE__*/_jsx("span", {
230
+ className: "libro-tooltip-text",
231
+ children: l10n.t('重做')
232
+ }), /*#__PURE__*/_jsx("span", {
233
+ className: "libro-tooltip-keybind",
234
+ children: "Shift + Z"
235
+ })]
236
+ });
237
+ },
215
238
  group: ['group3'],
216
239
  order: 'h2'
217
240
  });
@@ -235,13 +258,15 @@ export var LibroToolbarContribution = (_dec = singleton({
235
258
  registry.registerItem({
236
259
  id: NotebookCommands['ClearAllCellOutput'].id,
237
260
  command: NotebookCommands['ClearAllCellOutput'].id,
238
- tooltip: /*#__PURE__*/_jsx("div", {
239
- className: "libro-tooltip",
240
- children: /*#__PURE__*/_jsx("span", {
241
- className: "libro-tooltip-text",
242
- children: l10n.t('清空输出')
243
- })
244
- }),
261
+ tooltip: function tooltip() {
262
+ return /*#__PURE__*/_jsx("div", {
263
+ className: "libro-tooltip",
264
+ children: /*#__PURE__*/_jsx("span", {
265
+ className: "libro-tooltip-text",
266
+ children: l10n.t('清空输出')
267
+ })
268
+ });
269
+ },
245
270
  group: ['group3'],
246
271
  order: 'j'
247
272
  });
@@ -1 +1 @@
1
- {"version":3,"file":"side-toolar-more-select.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolar-more-select.tsx"],"names":[],"mappings":";AA2FA,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAkE5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAazC,CAAC"}
1
+ {"version":3,"file":"side-toolar-more-select.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolar-more-select.tsx"],"names":[],"mappings":";AAoBA,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EA6I5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAazC,CAAC"}
@@ -4,6 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ import { isMacintosh } from '@difizen/mana-app';
7
8
  import { CommandRegistry, getOrigin, ToolbarInstance, useInject, useObserve } from '@difizen/mana-app';
8
9
  import { l10n } from '@difizen/mana-l10n';
9
10
  import { Menu, MenuContext } from '@difizen/mana-react';
@@ -12,88 +13,8 @@ import { ExecutableCellModel, ExecutableCellView } from "../cell/index.js";
12
13
  import { NotebookCommands } from "../command/index.js";
13
14
  import { MoreOutlined } from "../material-from-designer.js";
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
- import { Fragment as _Fragment } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
- var codeItems = [{
18
- id: NotebookCommands['HideCellCode'].id,
19
- label: /*#__PURE__*/_jsxs(_Fragment, {
20
- children: [/*#__PURE__*/_jsx("span", {
21
- className: "libro-menu-item-label",
22
- children: l10n.t('隐藏 Code')
23
- }), /*#__PURE__*/_jsx("span", {
24
- className: "libro-menu-item-keybind",
25
- children: "Cmd + '"
26
- })]
27
- })
28
- }, {
29
- id: NotebookCommands['ShowCellCode'].id,
30
- label: /*#__PURE__*/_jsxs(_Fragment, {
31
- children: [/*#__PURE__*/_jsx("span", {
32
- className: "libro-menu-item-label",
33
- children: l10n.t('显示 Code')
34
- }), /*#__PURE__*/_jsx("span", {
35
- className: "libro-menu-item-keybind",
36
- children: "Cmd + '"
37
- })]
38
- })
39
- }];
40
- var outputItems = [{
41
- id: NotebookCommands['HideCellOutputs'].id,
42
- label: /*#__PURE__*/_jsxs(_Fragment, {
43
- children: [/*#__PURE__*/_jsx("span", {
44
- className: "libro-menu-item-label",
45
- children: l10n.t('隐藏 Output')
46
- }), /*#__PURE__*/_jsx("span", {
47
- className: "libro-menu-item-keybind",
48
- children: "Cmd + O"
49
- })]
50
- })
51
- }, {
52
- id: NotebookCommands['ShowCellOutputs'].id,
53
- label: /*#__PURE__*/_jsxs(_Fragment, {
54
- children: [/*#__PURE__*/_jsx("span", {
55
- className: "libro-menu-item-label",
56
- children: l10n.t('显示 Output')
57
- }), /*#__PURE__*/_jsx("span", {
58
- className: "libro-menu-item-keybind",
59
- children: "Cmd + O"
60
- })]
61
- })
62
- }];
63
- var moreItems = [{
64
- id: NotebookCommands['CopyCell'].id,
65
- label: /*#__PURE__*/_jsxs(_Fragment, {
66
- children: [/*#__PURE__*/_jsx("span", {
67
- className: "libro-menu-item-label",
68
- children: l10n.t('复制')
69
- }), /*#__PURE__*/_jsx("span", {
70
- className: "libro-menu-item-keybind",
71
- children: "C"
72
- })]
73
- })
74
- }, {
75
- id: NotebookCommands['CutCell'].id,
76
- label: /*#__PURE__*/_jsxs(_Fragment, {
77
- children: [/*#__PURE__*/_jsx("span", {
78
- className: "libro-menu-item-label",
79
- children: l10n.t('剪切')
80
- }), /*#__PURE__*/_jsx("span", {
81
- className: "libro-menu-item-keybind",
82
- children: "X"
83
- })]
84
- })
85
- }, {
86
- id: NotebookCommands['PasteCellBelow'].id,
87
- label: /*#__PURE__*/_jsxs(_Fragment, {
88
- children: [/*#__PURE__*/_jsx("span", {
89
- className: "libro-menu-item-label",
90
- children: l10n.t('粘贴')
91
- }), /*#__PURE__*/_jsx("span", {
92
- className: "libro-menu-item-keybind",
93
- children: "V"
94
- })]
95
- })
96
- }];
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
97
18
  export var LibroSideToolbarMoreMenu = function LibroSideToolbarMoreMenu() {
98
19
  var _cell$outputArea;
99
20
  var command = useInject(CommandRegistry);
@@ -101,6 +22,86 @@ export var LibroSideToolbarMoreMenu = function LibroSideToolbarMoreMenu() {
101
22
  var data = toolbar.currentArgs;
102
23
  var args = getOrigin(data) || [];
103
24
  var cell = useObserve(args[0]);
25
+ var codeItems = [{
26
+ id: NotebookCommands['HideCellCode'].id,
27
+ label: /*#__PURE__*/_jsxs(_Fragment, {
28
+ children: [/*#__PURE__*/_jsx("span", {
29
+ className: "libro-menu-item-label",
30
+ children: l10n.t('隐藏 Code')
31
+ }), /*#__PURE__*/_jsxs("span", {
32
+ className: "libro-menu-item-keybind",
33
+ children: ["".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + "), "'"]
34
+ })]
35
+ })
36
+ }, {
37
+ id: NotebookCommands['ShowCellCode'].id,
38
+ label: /*#__PURE__*/_jsxs(_Fragment, {
39
+ children: [/*#__PURE__*/_jsx("span", {
40
+ className: "libro-menu-item-label",
41
+ children: l10n.t('显示 Code')
42
+ }), /*#__PURE__*/_jsxs("span", {
43
+ className: "libro-menu-item-keybind",
44
+ children: ["".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + "), "'"]
45
+ })]
46
+ })
47
+ }];
48
+ var outputItems = [{
49
+ id: NotebookCommands['HideCellOutputs'].id,
50
+ label: /*#__PURE__*/_jsxs(_Fragment, {
51
+ children: [/*#__PURE__*/_jsx("span", {
52
+ className: "libro-menu-item-label",
53
+ children: l10n.t('隐藏 Output')
54
+ }), /*#__PURE__*/_jsx("span", {
55
+ className: "libro-menu-item-keybind",
56
+ children: "".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + O")
57
+ })]
58
+ })
59
+ }, {
60
+ id: NotebookCommands['ShowCellOutputs'].id,
61
+ label: /*#__PURE__*/_jsxs(_Fragment, {
62
+ children: [/*#__PURE__*/_jsx("span", {
63
+ className: "libro-menu-item-label",
64
+ children: l10n.t('显示 Output')
65
+ }), /*#__PURE__*/_jsx("span", {
66
+ className: "libro-menu-item-keybind",
67
+ children: "".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + O")
68
+ })]
69
+ })
70
+ }];
71
+ var moreItems = [{
72
+ id: NotebookCommands['CopyCell'].id,
73
+ label: /*#__PURE__*/_jsxs(_Fragment, {
74
+ children: [/*#__PURE__*/_jsx("span", {
75
+ className: "libro-menu-item-label",
76
+ children: l10n.t('复制')
77
+ }), /*#__PURE__*/_jsx("span", {
78
+ className: "libro-menu-item-keybind",
79
+ children: "C"
80
+ })]
81
+ })
82
+ }, {
83
+ id: NotebookCommands['CutCell'].id,
84
+ label: /*#__PURE__*/_jsxs(_Fragment, {
85
+ children: [/*#__PURE__*/_jsx("span", {
86
+ className: "libro-menu-item-label",
87
+ children: l10n.t('剪切')
88
+ }), /*#__PURE__*/_jsx("span", {
89
+ className: "libro-menu-item-keybind",
90
+ children: "X"
91
+ })]
92
+ })
93
+ }, {
94
+ id: NotebookCommands['PasteCellBelow'].id,
95
+ label: /*#__PURE__*/_jsxs(_Fragment, {
96
+ children: [/*#__PURE__*/_jsx("span", {
97
+ className: "libro-menu-item-label",
98
+ children: l10n.t('粘贴')
99
+ }), /*#__PURE__*/_jsx("span", {
100
+ className: "libro-menu-item-keybind",
101
+ children: "V"
102
+ })]
103
+ })
104
+ }];
104
105
  if (!cell) {
105
106
  return null;
106
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-core",
3
- "version": "0.2.35-next.0",
3
+ "version": "0.2.36",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@ant-design/icons": "^5.1.0",
37
- "@difizen/libro-code-editor": "^0.2.35-next.0",
38
- "@difizen/libro-common": "^0.2.35-next.0",
39
- "@difizen/libro-shared-model": "^0.2.35-next.0",
40
- "@difizen/libro-virtualized": "^0.2.35-next.0",
37
+ "@difizen/libro-code-editor": "^0.2.35",
38
+ "@difizen/libro-common": "^0.2.35",
39
+ "@difizen/libro-shared-model": "^0.2.35",
40
+ "@difizen/libro-virtualized": "^0.2.35",
41
41
  "@difizen/mana-app": "latest",
42
42
  "@difizen/mana-l10n": "latest",
43
43
  "@difizen/mana-react": "latest",
@@ -36,29 +36,20 @@ export const LibroAddCell: React.FC = () => {
36
36
  };
37
37
  return (
38
38
  <div className="libro-add-cell-container default-add-cell-container">
39
- {instance
40
- .getCellList()
41
- .sort((a, b) => {
42
- if (a.order < b.order) {
43
- return -1;
44
- } else {
45
- return 1;
46
- }
47
- })
48
- .map((item: AddType) => {
49
- return (
50
- <Button
51
- className="libro-add-cell-container-item "
52
- key={item.name}
53
- onClick={() => {
54
- addCell(item.type);
55
- }}
56
- icon={<PlusOutlined className="libro-add-cell-icon" />}
57
- >
58
- {item.name}
59
- </Button>
60
- );
61
- })}
39
+ {instance.getCellList().map((item: AddType) => {
40
+ return (
41
+ <Button
42
+ className="libro-add-cell-container-item "
43
+ key={item.name}
44
+ onClick={() => {
45
+ addCell(item.type);
46
+ }}
47
+ icon={<PlusOutlined className="libro-add-cell-icon" />}
48
+ >
49
+ {item.name}
50
+ </Button>
51
+ );
52
+ })}
62
53
  </div>
63
54
  );
64
55
  };
@@ -57,6 +57,7 @@ export class LibroCellService implements CellService, ApplicationContribution {
57
57
  metas.push(item.cellMeta);
58
58
  }
59
59
  });
60
+ metas.sort((a, b) => a.order.localeCompare(b.order));
60
61
  this.cellsMeta = metas;
61
62
  }
62
63
 
@@ -25,7 +25,7 @@ export const KernelCommands: Record<string, Command & { keybind?: string }> = {
25
25
  },
26
26
  RestartKernel: {
27
27
  id: 'notebook:restart-kernel',
28
- label: l10n.t('Restart Kernel'),
28
+ label: l10n.t('Restart Kernel'),
29
29
  },
30
30
  ShutdownKernel: {
31
31
  id: 'notebook:shutdown-kernel',
@@ -365,16 +365,16 @@ export const NotebookCommands: Record<
365
365
  },
366
366
  RestartAndRunToSelected: {
367
367
  id: 'notebook:restart-and-run-to-selected',
368
- label: l10n.t('Restart and Run up to Selected Cell'),
368
+ label: l10n.t('Restart and Run up to Selected Cell'),
369
369
  },
370
370
  RestartClearOutput: {
371
371
  id: 'notebook:restart-clear-output',
372
- label: l10n.t('Restart and Clear Outputs of All Cells'),
372
+ label: l10n.t('Restart and Clear Outputs of All Cells'),
373
373
  icon: Reload,
374
374
  },
375
375
  RestartRunAll: {
376
376
  id: 'notebook:restart-run-all',
377
- label: l10n.t('Restart and Run All Cells'),
377
+ label: l10n.t('Restart and Run All Cells'),
378
378
  },
379
379
  RunAllAbove: {
380
380
  id: 'notebook:run-all-above',
@@ -10,6 +10,10 @@ export type CellInputBottonBlankProvider = FC<{ cell: CellView }>;
10
10
 
11
11
  export const CellInputBottonBlankProvider = Symbol('CellInputBottonBlankProvider');
12
12
 
13
+ export type CellOutputBottomBlankProvider = FC<{ cell: CellView }>;
14
+
15
+ export const CellOutputBottomBlankProvider = Symbol('CellOutputBottomBlankProvider');
16
+
13
17
  export type CellOutputVisulizationProvider = FC<{ cell: CellView }>;
14
18
 
15
19
  export const CellOutputVisulizationProvider = Symbol('CellOutputVisulizationProvider');