@bigbinary/neeto-editor 1.38.2 → 1.38.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.
package/dist/Editor.js CHANGED
@@ -5686,7 +5686,7 @@ var SORTED_LANGUAGE_LIST = [].concat(_toConsumableArray(lowlight.listLanguages()
5686
5686
  var Menu$3 = Dropdown.Menu,
5687
5687
  MenuItem$1 = Dropdown.MenuItem;
5688
5688
  var CodeBlockComponent = function CodeBlockComponent(_ref) {
5689
- var _node$attrs3, _node$content;
5689
+ var _node$attrs2, _node$content;
5690
5690
  var node = _ref.node,
5691
5691
  editor = _ref.editor,
5692
5692
  updateAttributes = _ref.updateAttributes;
@@ -5708,13 +5708,15 @@ var CodeBlockComponent = function CodeBlockComponent(_ref) {
5708
5708
  editor === null || editor === void 0 || (_editor$commands = editor.commands) === null || _editor$commands === void 0 || _editor$commands.focus();
5709
5709
  };
5710
5710
  useEffect(function () {
5711
- var _node$attrs, _node$attrs2;
5712
- isNil((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language) && updateAttributes({
5713
- language: "plaintext"
5714
- });
5715
- ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.language) === "javascriptreact" && updateAttributes({
5716
- language: "javascript"
5717
- });
5711
+ var _node$attrs;
5712
+ if (isNil((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language)) {
5713
+ // https://github.com/bigbinary/neeto-kb-web/issues/6429
5714
+ setTimeout(function () {
5715
+ return updateAttributes({
5716
+ language: "plaintext"
5717
+ });
5718
+ }, 0);
5719
+ }
5718
5720
  }, []);
5719
5721
  return /*#__PURE__*/React__default.createElement(NodeViewWrapper, {
5720
5722
  "data-cy": "neeto-editor-code-block"
@@ -5728,7 +5730,7 @@ var CodeBlockComponent = function CodeBlockComponent(_ref) {
5728
5730
  buttonSize: "small",
5729
5731
  buttonStyle: "secondary",
5730
5732
  icon: Down,
5731
- label: ((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.language) || t("neetoEditor.common.auto"),
5733
+ label: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.language) || t("neetoEditor.common.auto"),
5732
5734
  strategy: "fixed",
5733
5735
  zIndex: 99999
5734
5736
  }, /*#__PURE__*/React__default.createElement(Input, {
@@ -9947,9 +9949,14 @@ var linkInputRule = function linkInputRule(config) {
9947
9949
  return new InputRule({
9948
9950
  find: config.find,
9949
9951
  handler: function handler(props) {
9950
- var tr = props.state.tr;
9951
- defaultMarkInputRule.handler(props);
9952
- tr.setMeta("preventAutolink", true);
9952
+ try {
9953
+ var tr = props.state.tr;
9954
+ defaultMarkInputRule.handler(props);
9955
+ tr.setMeta("preventAutolink", true);
9956
+ } catch (error) {
9957
+ // https://app.honeybadger.io/projects/94805/faults/108936285
9958
+ if (!(error instanceof RangeError)) throw error;
9959
+ }
9953
9960
  }
9954
9961
  });
9955
9962
  };