@difizen/libro-raw-cell 0.1.37 → 0.2.1
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/raw-cell-view.js +5 -5
- package/package.json +4 -4
- package/src/raw-cell-view.tsx +5 -5
package/es/raw-cell-view.js
CHANGED
|
@@ -107,8 +107,8 @@ export var LibroRawCellView = (_dec = transient(), _dec2 = view('raw-cell-view')
|
|
|
107
107
|
editorHostId: this.parent.id + this.id,
|
|
108
108
|
model: this.model,
|
|
109
109
|
config: {
|
|
110
|
-
readOnly: this.parent.model.
|
|
111
|
-
editable:
|
|
110
|
+
readOnly: !this.parent.model.inputEditable,
|
|
111
|
+
editable: this.parent.model.inputEditable,
|
|
112
112
|
lineNumbers: false,
|
|
113
113
|
foldGutter: false,
|
|
114
114
|
lineWrap: 'on',
|
|
@@ -153,9 +153,9 @@ export var LibroRawCellView = (_dec = transient(), _dec2 = view('raw-cell-view')
|
|
|
153
153
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
154
154
|
while (1) switch (_context2.prev = _context2.next) {
|
|
155
155
|
case 0:
|
|
156
|
-
watch(this.parent.model, '
|
|
156
|
+
watch(this.parent.model, 'inputEditable', function () {
|
|
157
157
|
var _this2$editorView;
|
|
158
|
-
(_this2$editorView = _this2.editorView) === null || _this2$editorView === void 0 || _this2$editorView.editor.setOption('readOnly', _this2.parent.model.
|
|
158
|
+
(_this2$editorView = _this2.editorView) === null || _this2$editorView === void 0 || _this2$editorView.editor.setOption('readOnly', !_this2.parent.model.inputEditable);
|
|
159
159
|
});
|
|
160
160
|
case 1:
|
|
161
161
|
case "end":
|
|
@@ -181,7 +181,7 @@ export var LibroRawCellView = (_dec = transient(), _dec2 = view('raw-cell-view')
|
|
|
181
181
|
//选中cell、编辑模式、非只读时才focus
|
|
182
182
|
if ((_this$editorView = this.editorView) !== null && _this$editorView !== void 0 && _this$editorView.editor && this.editorView.editorStatus === 'ready' && ((_this$parent$model$ac2 = this.parent.model.active) === null || _this$parent$model$ac2 === void 0 ? void 0 : _this$parent$model$ac2.id) === this.id && !this.parent.model.commandMode && this.libroContextKey.commandModeEnabled === true &&
|
|
183
183
|
// 排除弹窗等情况
|
|
184
|
-
this.parent.model.
|
|
184
|
+
this.parent.model.inputEditable) {
|
|
185
185
|
var _this$editorView2, _this$editorView3, _this$editorView4;
|
|
186
186
|
(_this$editorView2 = this.editorView) === null || _this$editorView2 === void 0 || _this$editorView2.editor.setOption('styleActiveLine', true);
|
|
187
187
|
(_this$editorView3 = this.editorView) === null || _this$editorView3 === void 0 || _this$editorView3.editor.setOption('highlightActiveLineGutter', true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-raw-cell",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"src"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@difizen/libro-code-editor": "^0.1
|
|
36
|
-
"@difizen/libro-common": "^0.1
|
|
37
|
-
"@difizen/libro-core": "^0.1
|
|
35
|
+
"@difizen/libro-code-editor": "^0.2.1",
|
|
36
|
+
"@difizen/libro-common": "^0.2.1",
|
|
37
|
+
"@difizen/libro-core": "^0.2.1",
|
|
38
38
|
"@difizen/mana-app": "latest"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/raw-cell-view.tsx
CHANGED
|
@@ -80,8 +80,8 @@ export class LibroRawCellView extends LibroEditorCellView {
|
|
|
80
80
|
editorHostId: this.parent.id + this.id,
|
|
81
81
|
model: this.model,
|
|
82
82
|
config: {
|
|
83
|
-
readOnly: this.parent.model.
|
|
84
|
-
editable:
|
|
83
|
+
readOnly: !this.parent.model.inputEditable,
|
|
84
|
+
editable: this.parent.model.inputEditable,
|
|
85
85
|
lineNumbers: false,
|
|
86
86
|
foldGutter: false,
|
|
87
87
|
lineWrap: 'on',
|
|
@@ -102,8 +102,8 @@ export class LibroRawCellView extends LibroEditorCellView {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
protected async afterEditorReady() {
|
|
105
|
-
watch(this.parent.model, '
|
|
106
|
-
this.editorView?.editor.setOption('readOnly', this.parent.model.
|
|
105
|
+
watch(this.parent.model, 'inputEditable', () => {
|
|
106
|
+
this.editorView?.editor.setOption('readOnly', !this.parent.model.inputEditable);
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -127,7 +127,7 @@ export class LibroRawCellView extends LibroEditorCellView {
|
|
|
127
127
|
this.parent.model.active?.id === this.id &&
|
|
128
128
|
!this.parent.model.commandMode &&
|
|
129
129
|
this.libroContextKey.commandModeEnabled === true && // 排除弹窗等情况
|
|
130
|
-
this.parent.model.
|
|
130
|
+
this.parent.model.inputEditable
|
|
131
131
|
) {
|
|
132
132
|
this.editorView?.editor.setOption('styleActiveLine', true);
|
|
133
133
|
this.editorView?.editor.setOption('highlightActiveLineGutter', true);
|