@worktile/theia 3.0.0-next.3 → 3.0.0-next.4

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.
@@ -4749,18 +4749,21 @@
4749
4749
  enumerable: false,
4750
4750
  configurable: true
4751
4751
  });
4752
+ Object.defineProperty(TheTodoItemComponent.prototype, "editableWithReadonly", {
4753
+ get: function () {
4754
+ var _a;
4755
+ return (_a = getPluginOptions(this.editor, exports.PluginKeys.checkItem)) === null || _a === void 0 ? void 0 : _a.editableWithReadonly;
4756
+ },
4757
+ enumerable: false,
4758
+ configurable: true
4759
+ });
4752
4760
  TheTodoItemComponent.prototype.ngOnInit = function () {
4753
4761
  _super.prototype.ngOnInit.call(this);
4754
4762
  };
4755
4763
  TheTodoItemComponent.prototype.onCheck = function (checked) {
4756
- var options = this.ctxService.getTheOptions();
4757
- var noBindReadonly = options.noBindReadonlyPlugins && options.noBindReadonlyPlugins.includes(exports.ElementKinds.checkItem);
4758
- if (!noBindReadonly && this.readonly) {
4764
+ if (this.readonly && !this.editableWithReadonly) {
4759
4765
  return false;
4760
4766
  }
4761
- else {
4762
- setNode(this.editor, { checked: checked }, this.element);
4763
- }
4764
4767
  setNode(this.editor, { checked: checked }, this.element);
4765
4768
  };
4766
4769
  return TheTodoItemComponent;
@@ -4876,7 +4879,8 @@
4876
4879
  }
4877
4880
  ],
4878
4881
  options: {
4879
- allowParentTypes: [exports.ElementKinds.tableCell, exports.ElementKinds.blockquote]
4882
+ allowParentTypes: [exports.ElementKinds.tableCell, exports.ElementKinds.blockquote],
4883
+ editableWithReadonly: false
4880
4884
  }
4881
4885
  });
4882
4886
 
@@ -6651,10 +6655,9 @@
6651
6655
  }
6652
6656
  ];
6653
6657
 
6654
- var mergAutoFormateRules = function (extraAutoFormatRules) {
6655
- var combinationData = __spreadArray(__spreadArray([], __read(defaultAutoFormatRules)), __read(extraAutoFormatRules));
6658
+ var mergAutoFormateRules = function (rules) {
6656
6659
  var dataInfo = {};
6657
- combinationData.forEach(function (item) {
6660
+ rules.forEach(function (item) {
6658
6661
  if (!dataInfo[item.type + item.key]) {
6659
6662
  dataInfo[item.type + item.key] = Object.assign({}, item);
6660
6663
  }
@@ -6667,11 +6670,9 @@
6667
6670
  editor.insertText = function (text) {
6668
6671
  var e_1, _d;
6669
6672
  var _a, _b;
6670
- var autoFormatRules = defaultAutoFormatRules;
6671
- if ((_a = editor.extraAutoFormatRules) === null || _a === void 0 ? void 0 : _a.length) {
6672
- var extraRules = mergAutoFormateRules(editor.extraAutoFormatRules);
6673
- autoFormatRules = Object.values(extraRules);
6674
- }
6673
+ var autoFormatRules = (_a = getPluginOptions(editor, exports.PluginKeys.autoFormat)) === null || _a === void 0 ? void 0 : _a.autoFormatRules;
6674
+ var extraRules = mergAutoFormateRules(autoFormatRules);
6675
+ autoFormatRules = Object.values(extraRules);
6675
6676
  if (!isCollapsed(editor.selection)) {
6676
6677
  return insertText(text);
6677
6678
  }
@@ -6765,7 +6766,10 @@
6765
6766
  };
6766
6767
  var createAutoFormatPlugin = createPluginFactory({
6767
6768
  key: exports.PluginKeys.autoFormat,
6768
- withOverrides: withAutoFormat
6769
+ withOverrides: withAutoFormat,
6770
+ options: {
6771
+ autoFormatRules: defaultAutoFormatRules
6772
+ }
6769
6773
  });
6770
6774
 
6771
6775
  var withTransforms = function (editor) {
@@ -12318,10 +12322,10 @@
12318
12322
  var onKeydown = editor.onKeydown, deleteBackward = editor.deleteBackward, onChange = editor.onChange;
12319
12323
  var presseingQuickInsertHotkey = false;
12320
12324
  editor.onKeydown = function (event) {
12321
- var _a, _b;
12322
- var hotkey = (_a = getPluginOptions(editor, exports.PluginKeys.quickInsert)) === null || _a === void 0 ? void 0 : _a.hotkey;
12325
+ var options = getPluginOptions(editor, exports.PluginKeys.quickInsert);
12326
+ var hotkey = options.hotkey, allowHotkeyInTypes = options.allowHotkeyInTypes;
12323
12327
  if (event.key === hotkey) {
12324
- var types = __spreadArray([], __read((((_b = editor.options) === null || _b === void 0 ? void 0 : _b.allowContainerOperateTypes) || [])));
12328
+ var types = __spreadArray([], __read((allowHotkeyInTypes || [])));
12325
12329
  var _c = __read(getBlockAbove(editor), 1), block = _c[0];
12326
12330
  if (isPureEmptyParagraph(editor, block) && allowOpenQuickToolbar(editor, types)) {
12327
12331
  presseingQuickInsertHotkey = true;
@@ -14167,13 +14171,12 @@
14167
14171
  };
14168
14172
  TheEditorComponent.prototype.initialize = function () {
14169
14173
  var _this = this;
14170
- var _a, _b, _c;
14174
+ var _a, _b;
14171
14175
  var plugins = __spreadArray(__spreadArray([], __read(internalPlugins)), __read(this.thePlugins));
14172
14176
  this.editor = withTheia(slateHistory.withHistory(i1.withAngular(slate.createEditor(), CLIPBOARD_FORMAT_KEY)), plugins);
14173
14177
  this.generateDecorate();
14174
14178
  this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
14175
14179
  this.editor.extraElementOptions = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.extraElementOptions;
14176
- this.editor.extraAutoFormatRules = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.extraAutoFormatRules;
14177
14180
  this.editor.options = this.theOptions;
14178
14181
  setEditorUUID(this.editor, idCreator());
14179
14182
  this.theContextService.initialize({