Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support virtual list & monaco editor #10

Merged
merged 13 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions packages/libro-code-cell/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
platform: 'browser',
esm: {
output: 'es',
},
extraBabelPlugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-flow-strip-types', { allowDeclareFields: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
['@babel/plugin-transform-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
['babel-plugin-parameter-decorator'],
],
extraBabelPresets: [['@babel/preset-typescript', { onlyRemoveTypeImports: true }]],
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-codemirror-raw-cell",
"version": "0.1.1",
"name": "@difizen/libro-code-cell",
"version": "0.1.0",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -45,10 +45,9 @@
"lint:tsc": "tsc --noEmit"
},
"dependencies": {
"@difizen/libro-code-editor": "^0.1.1",
"@difizen/libro-codemirror": "^0.1.1",
"@difizen/libro-common": "^0.1.1",
"@difizen/libro-core": "^0.1.1",
"@difizen/libro-code-editor": "^0.1.0",
"@difizen/libro-common": "^0.1.0",
"@difizen/libro-core": "^0.1.0",
"@difizen/mana-app": "latest"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inject, singleton } from '@difizen/mana-app';
import type { CellMeta, CellModel, CellOptions } from '@difizen/libro-core';
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
import type { CellMeta, CellModel, CellOptions } from '@difizen/libro-core';
import { inject, singleton } from '@difizen/mana-app';

import { CodeCellModelFactory } from './code-cell-protocol.js';
import { LibroCodeCellView } from './code-cell-view.js';
Expand All @@ -9,12 +9,7 @@ import { LibroCodeCellView } from './code-cell-view.js';
export class CodeEditorCellContribution
implements CellModelContribution, CellViewContribution
{
protected libroCellModelFactory: CodeCellModelFactory;
constructor(
@inject(CodeCellModelFactory) libroCellModelFactory: CodeCellModelFactory,
) {
this.libroCellModelFactory = libroCellModelFactory;
}
@inject(CodeCellModelFactory) libroCellModelFactory: CodeCellModelFactory;

cellMeta: CellMeta = {
type: 'code',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ICodeCell } from '@difizen/libro-common';
import type { ExecutionCount } from '@difizen/libro-common';
import { LibroCellModel, CellOptions } from '@difizen/libro-core';
import type { ICodeCell } from '@difizen/libro-common';
import type { ExecutableCellModel } from '@difizen/libro-core';
import { CellOptions, LibroCellModel } from '@difizen/libro-core';
import type { Event as ManaEvent } from '@difizen/mana-app';
import { inject, prop, transient, ViewManager } from '@difizen/mana-app';
import { Emitter } from '@difizen/mana-app';
import { prop, ViewManager, inject, transient } from '@difizen/mana-app';

/**
* 基础的可执行代码的cell, 带有执行能力
Expand All @@ -20,6 +20,8 @@ export class LibroCodeCellModel extends LibroCellModel implements ExecutableCell
@prop()
hasOutputsScrolled: boolean;

declare libroFormatType: string;

viewManager: ViewManager;

// Emitter Msg
Expand Down Expand Up @@ -48,7 +50,7 @@ export class LibroCodeCellModel extends LibroCellModel implements ExecutableCell
return {
id: this.id,
cell_type: this.type,
source: this.value,
source: this.source,
metadata: this.metadata,
execution_count: this.executeCount,
// outputs: this.outputs,
Expand Down
Loading