@bigbinary/neeto-editor 1.38.3 → 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.
@@ -5726,7 +5726,7 @@ var SORTED_LANGUAGE_LIST = [].concat(_toConsumableArray__default["default"](core
5726
5726
  var Menu$3 = neetoui.Dropdown.Menu,
5727
5727
  MenuItem$1 = neetoui.Dropdown.MenuItem;
5728
5728
  var CodeBlockComponent = function CodeBlockComponent(_ref) {
5729
- var _node$attrs3, _node$content;
5729
+ var _node$attrs2, _node$content;
5730
5730
  var node = _ref.node,
5731
5731
  editor = _ref.editor,
5732
5732
  updateAttributes = _ref.updateAttributes;
@@ -5748,13 +5748,15 @@ var CodeBlockComponent = function CodeBlockComponent(_ref) {
5748
5748
  editor === null || editor === void 0 || (_editor$commands = editor.commands) === null || _editor$commands === void 0 || _editor$commands.focus();
5749
5749
  };
5750
5750
  React.useEffect(function () {
5751
- var _node$attrs, _node$attrs2;
5752
- ramda.isNil((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language) && updateAttributes({
5753
- language: "plaintext"
5754
- });
5755
- ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.language) === "javascriptreact" && updateAttributes({
5756
- language: "javascript"
5757
- });
5751
+ var _node$attrs;
5752
+ if (ramda.isNil((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language)) {
5753
+ // https://github.com/bigbinary/neeto-kb-web/issues/6429
5754
+ setTimeout(function () {
5755
+ return updateAttributes({
5756
+ language: "plaintext"
5757
+ });
5758
+ }, 0);
5759
+ }
5758
5760
  }, []);
5759
5761
  return /*#__PURE__*/React__default["default"].createElement(Menu$4.NodeViewWrapper, {
5760
5762
  "data-cy": "neeto-editor-code-block"
@@ -5768,7 +5770,7 @@ var CodeBlockComponent = function CodeBlockComponent(_ref) {
5768
5770
  buttonSize: "small",
5769
5771
  buttonStyle: "secondary",
5770
5772
  icon: neetoIcons.Down,
5771
- label: ((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.language) || t("neetoEditor.common.auto"),
5773
+ label: ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.language) || t("neetoEditor.common.auto"),
5772
5774
  strategy: "fixed",
5773
5775
  zIndex: 99999
5774
5776
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {