@difizen/libro-code-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.
@@ -244,8 +244,8 @@ export var LibroCodeCellView = (_dec = transient(), _dec2 = view('code-editor-ce
244
244
  editorHostId: this.parent.id + this.id,
245
245
  model: this.model,
246
246
  config: {
247
- readOnly: this.parent.model.readOnly,
248
- editable: !this.parent.model.readOnly,
247
+ readOnly: !this.parent.model.inputEditable,
248
+ editable: this.parent.model.inputEditable,
249
249
  placeholder: '请输入代码'
250
250
  }
251
251
  };
@@ -310,9 +310,9 @@ export var LibroCodeCellView = (_dec = transient(), _dec2 = view('code-editor-ce
310
310
  while (1) switch (_context3.prev = _context3.next) {
311
311
  case 0:
312
312
  this.focusEditor();
313
- this.toDisposeOnEditor.push(watch(this.parent.model, 'readOnly', function () {
313
+ this.toDisposeOnEditor.push(watch(this.parent.model, 'inputEditable', function () {
314
314
  var _this4$editorView;
315
- (_this4$editorView = _this4.editorView) === null || _this4$editorView === void 0 || (_this4$editorView = _this4$editorView.editor) === null || _this4$editorView === void 0 || _this4$editorView.setOption('readOnly', getOrigin(_this4.parent.model.readOnly));
315
+ (_this4$editorView = _this4.editorView) === null || _this4$editorView === void 0 || (_this4$editorView = _this4$editorView.editor) === null || _this4$editorView === void 0 || _this4$editorView.setOption('readOnly', getOrigin(!_this4.parent.model.inputEditable));
316
316
  }));
317
317
  this.toDisposeOnEditor.push((_this$editorView$onMo = (_this$editorView3 = this.editorView) === null || _this$editorView3 === void 0 ? void 0 : _this$editorView3.onModalChange(function (val) {
318
318
  return _this4.hasModal = val;
@@ -341,7 +341,7 @@ export var LibroCodeCellView = (_dec = transient(), _dec2 = view('code-editor-ce
341
341
  //选中cell、编辑模式、非只读时才focus
342
342
  if ((_this$editorView4 = this.editorView) !== null && _this$editorView4 !== void 0 && _this$editorView4.editor && this.editorView.editorStatus === 'ready' && ((_this$parent$model$ac = this.parent.model.active) === null || _this$parent$model$ac === void 0 ? void 0 : _this$parent$model$ac.id) === this.id && !this.parent.model.commandMode && this.libroContextKey.commandModeEnabled === true &&
343
343
  // 排除弹窗等情况
344
- this.parent.model.readOnly === false) {
344
+ this.parent.model.inputEditable) {
345
345
  var _this$editorView5, _this$editorView6, _this$editorView7;
346
346
  (_this$editorView5 = this.editorView) === null || _this$editorView5 === void 0 || _this$editorView5.editor.setOption('styleActiveLine', true);
347
347
  (_this$editorView6 = this.editorView) === null || _this$editorView6 === void 0 || _this$editorView6.editor.setOption('highlightActiveLineGutter', true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-code-cell",
3
- "version": "0.1.37",
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.37",
36
- "@difizen/libro-common": "^0.1.37",
37
- "@difizen/libro-core": "^0.1.37",
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": {
@@ -231,8 +231,8 @@ export class LibroCodeCellView extends LibroExecutableCellView {
231
231
  editorHostId: this.parent.id + this.id,
232
232
  model: this.model,
233
233
  config: {
234
- readOnly: this.parent.model.readOnly,
235
- editable: !this.parent.model.readOnly,
234
+ readOnly: !this.parent.model.inputEditable,
235
+ editable: this.parent.model.inputEditable,
236
236
  placeholder: '请输入代码',
237
237
  },
238
238
  };
@@ -268,10 +268,10 @@ export class LibroCodeCellView extends LibroExecutableCellView {
268
268
  protected async afterEditorReady() {
269
269
  this.focusEditor();
270
270
  this.toDisposeOnEditor.push(
271
- watch(this.parent.model, 'readOnly', () => {
271
+ watch(this.parent.model, 'inputEditable', () => {
272
272
  this.editorView?.editor?.setOption(
273
273
  'readOnly',
274
- getOrigin(this.parent.model.readOnly),
274
+ getOrigin(!this.parent.model.inputEditable),
275
275
  );
276
276
  }),
277
277
  );
@@ -293,7 +293,7 @@ export class LibroCodeCellView extends LibroExecutableCellView {
293
293
  this.parent.model.active?.id === this.id &&
294
294
  !this.parent.model.commandMode &&
295
295
  this.libroContextKey.commandModeEnabled === true && // 排除弹窗等情况
296
- this.parent.model.readOnly === false
296
+ this.parent.model.inputEditable
297
297
  ) {
298
298
  this.editorView?.editor.setOption('styleActiveLine', true);
299
299
  this.editorView?.editor.setOption('highlightActiveLineGutter', true);