@difizen/libro-core 0.1.18 → 0.1.19
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.
- package/es/cell/libro-cell-view.js +2 -2
- package/es/command/document-commands.d.ts.map +1 -1
- package/es/command/document-commands.js +6 -1
- package/es/command/libro-command-contribution.d.ts.map +1 -1
- package/es/command/libro-command-contribution.js +75 -45
- package/es/libro-model.d.ts +6 -6
- package/es/libro-model.d.ts.map +1 -1
- package/es/libro-model.js +18 -9
- package/es/libro-protocol.d.ts +26 -3
- package/es/libro-protocol.d.ts.map +1 -1
- package/es/libro-service.d.ts +36 -3
- package/es/libro-service.d.ts.map +1 -1
- package/es/libro-service.js +97 -2
- package/es/libro-view.d.ts +5 -0
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +13 -2
- package/es/toolbar/libro-toolbar.d.ts.map +1 -1
- package/es/toolbar/libro-toolbar.js +16 -0
- package/package.json +5 -5
- package/src/cell/libro-cell-view.tsx +2 -2
- package/src/command/document-commands.ts +6 -1
- package/src/command/libro-command-contribution.ts +20 -1
- package/src/libro-model.ts +16 -8
- package/src/libro-protocol.ts +29 -4
- package/src/libro-service.ts +109 -3
- package/src/libro-view.tsx +9 -1
- package/src/toolbar/libro-toolbar.tsx +13 -0
package/src/libro-view.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ToTopOutlined } from '@ant-design/icons';
|
|
2
|
+
import type { IModelContentChange } from '@difizen/libro-code-editor';
|
|
2
3
|
import {
|
|
3
4
|
concatMultilineString,
|
|
4
5
|
copy2clipboard,
|
|
@@ -281,6 +282,10 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
281
282
|
get onCellCreate() {
|
|
282
283
|
return this.onCellCreateEmitter.event;
|
|
283
284
|
}
|
|
285
|
+
protected onCellDeleteEmitter: Emitter<CellView> = new Emitter();
|
|
286
|
+
get onCellDelete() {
|
|
287
|
+
return this.onCellDeleteEmitter.event;
|
|
288
|
+
}
|
|
284
289
|
|
|
285
290
|
onBlurEmitter: Emitter = new Emitter();
|
|
286
291
|
get onBlur() {
|
|
@@ -318,6 +323,10 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
318
323
|
get onSave() {
|
|
319
324
|
return this.onSaveEmitter.event;
|
|
320
325
|
}
|
|
326
|
+
onCellContentChangedEmitter: Emitter<IModelContentChange[]> = new Emitter();
|
|
327
|
+
get onCellContentChanged() {
|
|
328
|
+
return this.onCellContentChangedEmitter.event;
|
|
329
|
+
}
|
|
321
330
|
|
|
322
331
|
runCellEmitter: Emitter<CellView> = new Emitter();
|
|
323
332
|
get onRunCell() {
|
|
@@ -411,7 +420,6 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
411
420
|
this.toDispose.push(
|
|
412
421
|
watch(this.model, 'cells', () => {
|
|
413
422
|
this.model.onChange?.();
|
|
414
|
-
this.model.onSourceChange?.();
|
|
415
423
|
}),
|
|
416
424
|
);
|
|
417
425
|
this.initializedDefer.resolve();
|
|
@@ -94,6 +94,19 @@ export class LibroToolbarContribution implements ToolbarContribution {
|
|
|
94
94
|
group: ['group2'],
|
|
95
95
|
order: 'c-all',
|
|
96
96
|
});
|
|
97
|
+
registry.registerItem({
|
|
98
|
+
id: DocumentCommands['FormatCell'].id,
|
|
99
|
+
command: DocumentCommands['FormatCell'].id,
|
|
100
|
+
tooltip: (
|
|
101
|
+
<div className="libro-side-tooltip">
|
|
102
|
+
<span className="libro-tooltip-text">{l10n.t('格式化代码')}</span>
|
|
103
|
+
<span className="libro-tooltip-keybind">Shift+Option+F</span>
|
|
104
|
+
</div>
|
|
105
|
+
),
|
|
106
|
+
|
|
107
|
+
group: ['sidetoolbar1'],
|
|
108
|
+
order: 'd',
|
|
109
|
+
});
|
|
97
110
|
registry.registerItem({
|
|
98
111
|
id: NotebookCommands['MoveCellUp'].id,
|
|
99
112
|
command: NotebookCommands['MoveCellUp'].id,
|