@bigbinary/neeto-editor 1.43.5 → 1.43.7

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
@@ -3794,7 +3794,7 @@ const inputRegex$2 = /^\s*([-+*])\s$/;
3794
3794
  * @see https://tiptap.dev/api/nodes/bullet-list
3795
3795
  * @see https://tiptap.dev/api/nodes/list-item.
3796
3796
  */
3797
- const BulletList = Node.create({
3797
+ const BulletList$1 = Node.create({
3798
3798
  name: 'bulletList',
3799
3799
  addOptions() {
3800
3800
  return {
@@ -5794,7 +5794,7 @@ const StarterKit = Extension.create({
5794
5794
  extensions.push(Blockquote.configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.blockquote));
5795
5795
  }
5796
5796
  if (this.options.bulletList !== false) {
5797
- extensions.push(BulletList.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
5797
+ extensions.push(BulletList$1.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
5798
5798
  }
5799
5799
  if (this.options.code !== false) {
5800
5800
  extensions.push(Code.configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code));
@@ -5895,6 +5895,55 @@ var HighlightInternal = Extension.create({
5895
5895
  }
5896
5896
  });
5897
5897
 
5898
+ function isListNode(node) {
5899
+ return node.type.name === "bulletList" || node.type.name === "orderedList";
5900
+ }
5901
+ var BulletList = BulletList$1.extend({
5902
+ addKeyboardShortcuts: function addKeyboardShortcuts() {
5903
+ var _this = this;
5904
+ return {
5905
+ Backspace: function Backspace() {
5906
+ return _this.editor.commands.command(function (_ref) {
5907
+ var state = _ref.state,
5908
+ commands = _ref.commands;
5909
+ var _state$selection = state.selection,
5910
+ $from = _state$selection.$from,
5911
+ empty = _state$selection.empty;
5912
+ if (!empty) return false;
5913
+ var node = $from.node();
5914
+ if (node.type.name !== "paragraph" || node.content.size !== 0) {
5915
+ return false;
5916
+ }
5917
+ var $listItem = $from.node($from.depth - 1);
5918
+ if ($listItem.type.name !== "listItem") {
5919
+ return commands.deleteCurrentNode();
5920
+ }
5921
+ var currentIndex = $from.index($from.depth - 1);
5922
+
5923
+ // lift the block if the the list item is empty.
5924
+ if (currentIndex === $listItem.childCount - 1) {
5925
+ return commands.liftEmptyBlock();
5926
+ }
5927
+ var nextNode = $listItem.child(currentIndex + 1);
5928
+ if (!isListNode(nextNode)) {
5929
+ return commands.deleteCurrentNode();
5930
+ }
5931
+ if (currentIndex === 0) {
5932
+ return commands.joinBackward();
5933
+ }
5934
+
5935
+ // Delete the empty paragraph node between the two lists.
5936
+ var prevNode = $listItem.child(currentIndex - 1);
5937
+ if (isListNode(prevNode)) {
5938
+ return commands.deleteCurrentNode();
5939
+ }
5940
+ return commands.joinBackward();
5941
+ });
5942
+ }
5943
+ };
5944
+ }
5945
+ });
5946
+
5898
5947
  function getDefaultExportFromCjs (x) {
5899
5948
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5900
5949
  }
@@ -13309,12 +13358,17 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
13309
13358
  var selectedIndex = _this.state.selectedIndex;
13310
13359
  _this.selectItem(selectedIndex);
13311
13360
  });
13361
+ _defineProperty(_this, "tabHandler", function () {
13362
+ var selectedIndex = _this.state.selectedIndex;
13363
+ _this.selectItem(selectedIndex);
13364
+ });
13312
13365
  _defineProperty(_this, "onKeyDown", function (_ref) {
13313
13366
  var event = _ref.event;
13314
13367
  var keyDownHandlers = {
13315
13368
  ArrowUp: _this.upHandler,
13316
13369
  ArrowDown: _this.downHandler,
13317
- Enter: _this.enterHandler
13370
+ Enter: _this.enterHandler,
13371
+ Tab: _this.tabHandler
13318
13372
  };
13319
13373
  if (Object.prototype.hasOwnProperty.call(keyDownHandlers, event.key)) {
13320
13374
  keyDownHandlers[event.key]();
@@ -19289,9 +19343,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19289
19343
  document: false,
19290
19344
  codeBlock: false,
19291
19345
  code: false,
19346
+ bulletList: false,
19292
19347
  blockquote: options.includes(EDITOR_OPTIONS.BLOCKQUOTE),
19293
19348
  orderedList: options.includes(EDITOR_OPTIONS.LIST_ORDERED),
19294
- bulletList: options.includes(EDITOR_OPTIONS.LIST_BULLETS),
19295
19349
  history: !collaborationProvider
19296
19350
  }), TextStyle$2, Underline, KeyboardShortcuts$1.configure({
19297
19351
  onSubmit: onSubmit,
@@ -19309,6 +19363,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19309
19363
  if (options.includes(EDITOR_OPTIONS.TEXT_COLOR)) {
19310
19364
  customExtensions.push(Color);
19311
19365
  }
19366
+ if (options.includes(EDITOR_OPTIONS.LIST_BULLETS)) {
19367
+ customExtensions.push(BulletList);
19368
+ }
19312
19369
  if (isSlashCommandsActive) {
19313
19370
  customExtensions.push(SlashCommands.configure({
19314
19371
  options: options,