@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.
@@ -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,