@difizen/libro-markdown-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.
@@ -101,7 +101,7 @@ export var MarkdownCellView = (_dec = transient(), _dec2 = view('libro-markdown-
101
101
  key: "isEdit",
102
102
  get: function get() {
103
103
  var _this$editorView;
104
- return ((_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.view) && this.cellmodel.isEdit && !this.parent.model.readOnly;
104
+ return ((_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.view) && this.cellmodel.isEdit && this.parent.model.inputEditable;
105
105
  }
106
106
  }, {
107
107
  key: "cellmodel",
@@ -115,8 +115,8 @@ export var MarkdownCellView = (_dec = transient(), _dec2 = view('libro-markdown-
115
115
  if (this.cellmodel.isEdit) {
116
116
  this.createEditor();
117
117
  }
118
- watch(this.parent.model, 'readOnly', function () {
119
- if (_this2.parent.model.readOnly === true) {
118
+ watch(this.parent.model, 'inputEditable', function () {
119
+ if (!_this2.parent.model.inputEditable) {
120
120
  _this2.cellmodel.isEdit = false;
121
121
  }
122
122
  });
@@ -7,7 +7,7 @@ export var MarkdownPreview = function MarkdownPreview(_ref) {
7
7
  // const instance = useInject<MarkdownCellView>(ViewInstance);
8
8
 
9
9
  var enterEdit = useCallback(function (e) {
10
- if (instance.parent.model.readOnly) {
10
+ if (!instance.parent.model.inputEditable) {
11
11
  return;
12
12
  }
13
13
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-markdown-cell",
3
- "version": "0.1.37",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -39,10 +39,10 @@
39
39
  "@types/react": "^18.2.25"
40
40
  },
41
41
  "dependencies": {
42
- "@difizen/libro-core": "^0.1.37",
43
- "@difizen/libro-common": "^0.1.37",
44
- "@difizen/libro-code-editor": "^0.1.37",
45
- "@difizen/libro-markdown": "^0.1.37",
42
+ "@difizen/libro-core": "^0.2.1",
43
+ "@difizen/libro-common": "^0.2.1",
44
+ "@difizen/libro-code-editor": "^0.2.1",
45
+ "@difizen/libro-markdown": "^0.2.1",
46
46
  "@difizen/mana-app": "latest",
47
47
  "@types/markdown-it": "^12.2.3",
48
48
  "markdown-it": "^13.0.1",
@@ -97,7 +97,7 @@ export class MarkdownCellView extends LibroEditorCellView implements CellCollaps
97
97
 
98
98
  get isEdit() {
99
99
  return (
100
- this.editorView?.view && this.cellmodel.isEdit && !this.parent.model.readOnly
100
+ this.editorView?.view && this.cellmodel.isEdit && this.parent.model.inputEditable
101
101
  );
102
102
  }
103
103
 
@@ -125,8 +125,8 @@ export class MarkdownCellView extends LibroEditorCellView implements CellCollaps
125
125
  if (this.cellmodel.isEdit) {
126
126
  this.createEditor();
127
127
  }
128
- watch(this.parent.model, 'readOnly', () => {
129
- if (this.parent.model.readOnly === true) {
128
+ watch(this.parent.model, 'inputEditable', () => {
129
+ if (!this.parent.model.inputEditable) {
130
130
  this.cellmodel.isEdit = false;
131
131
  }
132
132
  });
@@ -10,7 +10,7 @@ export const MarkdownPreview: FC<{ instance: MarkdownCellView }> = ({ instance }
10
10
 
11
11
  const enterEdit: React.MouseEventHandler<HTMLDivElement> = useCallback(
12
12
  (e) => {
13
- if (instance.parent.model.readOnly) {
13
+ if (!instance.parent.model.inputEditable) {
14
14
  return;
15
15
  }
16
16
  e.preventDefault();