Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @difizen/libro-docs

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-terminal@0.3.49
- @difizen/libro-jupyter@0.3.49
- @difizen/libro-core@0.3.49
- @difizen/libro-lab@0.3.49

## 0.3.48

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-docs",
"version": "0.3.48",
"version": "0.3.49",
"private": true,
"license": "MIT",
"description": "Document site for mana",
Expand All @@ -23,10 +23,10 @@
"packageManager": "pnpm@8.4.0",
"dependencies": {
"@ant-design/icons": "^5.4.0",
"@difizen/libro-core": "^0.3.48",
"@difizen/libro-jupyter": "^0.3.48",
"@difizen/libro-lab": "^0.3.48",
"@difizen/libro-terminal": "^0.3.48",
"@difizen/libro-core": "^0.3.49",
"@difizen/libro-jupyter": "^0.3.49",
"@difizen/libro-lab": "^0.3.49",
"@difizen/libro-terminal": "^0.3.49",
"@difizen/mana-app": "latest",
"@difizen/mana-l10n": "latest",
"@difizen/mana-react": "latest",
Expand Down
10 changes: 10 additions & 0 deletions packages/libro-ai-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @difizen/libro-output

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-code-editor@0.3.49
- @difizen/libro-jupyter@0.3.49

## 0.3.48

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/libro-ai-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-ai-native",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -46,8 +46,8 @@
},
"dependencies": {
"@ant-design/icons": "^5.4.0",
"@difizen/libro-code-editor": "^0.3.48",
"@difizen/libro-jupyter": "^0.3.48",
"@difizen/libro-code-editor": "^0.3.49",
"@difizen/libro-jupyter": "^0.3.49",
"@difizen/magent-chat": "^0.1.27",
"@difizen/magent-core": "^0.1.27",
"@difizen/magent-libro": "^0.1.27",
Expand Down
9 changes: 9 additions & 0 deletions packages/libro-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @difizen/libro-output

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-jupyter@0.3.49

## 0.3.48

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/libro-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-app",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -45,7 +45,7 @@
"typecheck:tsc": "tsc --noEmit"
},
"dependencies": {
"@difizen/libro-jupyter": "^0.3.48",
"@difizen/libro-jupyter": "^0.3.49",
"@ant-design/icons": "^5.4.0",
"@difizen/mana-app": "latest",
"@difizen/mana-l10n": "latest"
Expand Down
11 changes: 11 additions & 0 deletions packages/libro-code-cell/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @difizen/libro-codemirror-code-cell

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-code-editor@0.3.49
- @difizen/libro-common@0.3.49
- @difizen/libro-core@0.3.49

## 0.3.48

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/libro-code-cell/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-code-cell",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -45,9 +45,9 @@
"typecheck:tsc": "tsc --noEmit"
},
"dependencies": {
"@difizen/libro-code-editor": "^0.3.48",
"@difizen/libro-common": "^0.3.48",
"@difizen/libro-core": "^0.3.48",
"@difizen/libro-code-editor": "^0.3.49",
"@difizen/libro-common": "^0.3.49",
"@difizen/libro-core": "^0.3.49",
"@difizen/mana-app": "latest",
"@difizen/mana-l10n": "latest",
"highlight.js": "^11.11.1"
Expand Down
9 changes: 9 additions & 0 deletions packages/libro-code-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @difizen/libro-code-editor

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-common@0.3.49

## 0.3.48

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/libro-code-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-code-editor",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -45,7 +45,7 @@
"typecheck:tsc": "tsc --noEmit"
},
"dependencies": {
"@difizen/libro-common": "^0.3.48",
"@difizen/libro-common": "^0.3.49",
"@difizen/mana-app": "latest",
"@difizen/mana-l10n": "latest",
"uuid": "^9.0.1"
Expand Down
17 changes: 10 additions & 7 deletions packages/libro-code-editor/src/code-editor-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ export class CodeEditorView extends BaseView {
};

override onViewUnmount = () => {
if (this.editor.hasFocus()) {
if (this.editor?.hasFocus()) {
// 保存编辑器状态
const editorState = this.editor.getState();
this.codeEditorStateManager.updateEditorState(this.options.uuid, editorState);
// focus 到 host 避免进入命令模式
this.editorHostRef = this.getEditorHost();
this.editorHostRef?.current?.focus();
}
this.editor.dispose();
this.editor?.dispose();

const prevState = this.editorStatus;
this.editorStatus = 'disposed';
Expand All @@ -219,7 +219,7 @@ export class CodeEditorView extends BaseView {
* Get the model used by the widget.
*/
get model(): IModel {
return this.editor.model;
return this.editor?.model || this.options.model;
}

/**
Expand All @@ -230,19 +230,19 @@ export class CodeEditorView extends BaseView {
return;
}
super.dispose();
this.editor.dispose();
this.editor?.dispose();
}

protected onViewActive = (): void => {
this.editor.focus();
this.editor?.focus();
};

/**
* A message handler invoked on a `'resize'` message.
*/
protected onResize(): void {
if (this.isVisible) {
this.editor.resizeToFit();
this.editor?.resizeToFit();
}
}

Expand All @@ -261,6 +261,9 @@ export class CodeEditorView extends BaseView {
* Handle a change in model selections.
*/
protected _onSelectionsChanged(): void {
if (!this.editor) {
return;
}
const { start, end } = this.editor.getSelection();

if (start.column !== end.column || start.line !== end.line) {
Expand All @@ -285,7 +288,7 @@ export class CodeEditorView extends BaseView {
* Handle the `'lm-dragenter'` event for the widget.
*/
protected _evtDragEnter = (event: DragEvent): void => {
if (this.editor.getOption('readOnly') === true) {
if (this.editor?.getOption('readOnly') === true) {
return;
}
const data = findTextData(event);
Expand Down
12 changes: 12 additions & 0 deletions packages/libro-codemirror/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @difizen/libro-codemirror

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-code-editor@0.3.49
- @difizen/libro-rendermime@0.3.49
- @difizen/libro-common@0.3.49
- @difizen/libro-lsp@0.3.49

## 0.3.48

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/libro-codemirror/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-codemirror",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -54,10 +54,10 @@
"@codemirror/search": "^6.0.0",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.23.0",
"@difizen/libro-code-editor": "^0.3.48",
"@difizen/libro-common": "^0.3.48",
"@difizen/libro-lsp": "^0.3.48",
"@difizen/libro-rendermime": "^0.3.48",
"@difizen/libro-code-editor": "^0.3.49",
"@difizen/libro-common": "^0.3.49",
"@difizen/libro-lsp": "^0.3.49",
"@difizen/libro-rendermime": "^0.3.49",
"@difizen/mana-l10n": "latest",
"@difizen/mana-app": "latest",
"@lezer/common": "^1.2.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/libro-cofine-editor-contribution/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @difizen/libro-codemirror-markdown-cell

## 0.3.49

### Patch Changes

- fix editor instance is undefined

## 0.3.48

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/libro-cofine-editor-contribution/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-cofine-editor-contribution",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down
9 changes: 9 additions & 0 deletions packages/libro-cofine-editor-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @difizen/libro-codemirror-markdown-cell

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-cofine-editor-contribution@0.3.49

## 0.3.48

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/libro-cofine-editor-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-cofine-editor-core",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -48,7 +48,7 @@
"typecheck:tsc": "tsc --noEmit"
},
"dependencies": {
"@difizen/libro-cofine-editor-contribution": "^0.3.48",
"@difizen/libro-cofine-editor-contribution": "^0.3.49",
"@difizen/mana-app": "latest",
"@difizen/monaco-editor-core": "0.39.4",
"debug": "^4.3.2",
Expand Down
14 changes: 14 additions & 0 deletions packages/libro-cofine-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @difizen/libro-codemirror-markdown-cell

## 0.3.49

### Patch Changes

- fix editor instance is undefined

- Updated dependencies []:
- @difizen/libro-cofine-editor-core@0.3.49
- @difizen/libro-cofine-textmate@0.3.49
- @difizen/libro-code-editor@0.3.49
- @difizen/libro-common@0.3.49
- @difizen/libro-core@0.3.49
- @difizen/libro-lsp@0.3.49

## 0.3.48

### Patch Changes
Expand Down
14 changes: 7 additions & 7 deletions packages/libro-cofine-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@difizen/libro-cofine-editor",
"version": "0.3.48",
"version": "0.3.49",
"description": "",
"keywords": [
"libro",
Expand Down Expand Up @@ -46,12 +46,12 @@
},
"dependencies": {
"@difizen/monaco-editor-core": "0.39.4",
"@difizen/libro-cofine-editor-core": "^0.3.48",
"@difizen/libro-cofine-textmate": "^0.3.48",
"@difizen/libro-lsp": "^0.3.48",
"@difizen/libro-code-editor": "^0.3.48",
"@difizen/libro-common": "^0.3.48",
"@difizen/libro-core": "^0.3.48",
"@difizen/libro-cofine-editor-core": "^0.3.49",
"@difizen/libro-cofine-textmate": "^0.3.49",
"@difizen/libro-lsp": "^0.3.49",
"@difizen/libro-code-editor": "^0.3.49",
"@difizen/libro-common": "^0.3.49",
"@difizen/libro-core": "^0.3.49",
"@difizen/mana-app": "latest",
"resize-observer-polyfill": "^1.5.1",
"vscode-languageserver-protocol": "^3.17.4",
Expand Down
Loading
Loading