@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.
@@ -3870,7 +3870,7 @@ const inputRegex$2 = /^\s*([-+*])\s$/;
3870
3870
  * @see https://tiptap.dev/api/nodes/bullet-list
3871
3871
  * @see https://tiptap.dev/api/nodes/list-item.
3872
3872
  */
3873
- const BulletList = Menu$3.Node.create({
3873
+ const BulletList$1 = Menu$3.Node.create({
3874
3874
  name: 'bulletList',
3875
3875
  addOptions() {
3876
3876
  return {
@@ -5870,7 +5870,7 @@ const StarterKit = Menu$3.Extension.create({
5870
5870
  extensions.push(Blockquote.configure((_b = this.options) === null || _b === void 0 ? void 0 : _b.blockquote));
5871
5871
  }
5872
5872
  if (this.options.bulletList !== false) {
5873
- extensions.push(BulletList.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
5873
+ extensions.push(BulletList$1.configure((_c = this.options) === null || _c === void 0 ? void 0 : _c.bulletList));
5874
5874
  }
5875
5875
  if (this.options.code !== false) {
5876
5876
  extensions.push(Code.configure((_d = this.options) === null || _d === void 0 ? void 0 : _d.code));
@@ -5971,6 +5971,55 @@ var HighlightInternal = Menu$3.Extension.create({
5971
5971
  }
5972
5972
  });
5973
5973
 
5974
+ function isListNode(node) {
5975
+ return node.type.name === "bulletList" || node.type.name === "orderedList";
5976
+ }
5977
+ var BulletList = BulletList$1.extend({
5978
+ addKeyboardShortcuts: function addKeyboardShortcuts() {
5979
+ var _this = this;
5980
+ return {
5981
+ Backspace: function Backspace() {
5982
+ return _this.editor.commands.command(function (_ref) {
5983
+ var state = _ref.state,
5984
+ commands = _ref.commands;
5985
+ var _state$selection = state.selection,
5986
+ $from = _state$selection.$from,
5987
+ empty = _state$selection.empty;
5988
+ if (!empty) return false;
5989
+ var node = $from.node();
5990
+ if (node.type.name !== "paragraph" || node.content.size !== 0) {
5991
+ return false;
5992
+ }
5993
+ var $listItem = $from.node($from.depth - 1);
5994
+ if ($listItem.type.name !== "listItem") {
5995
+ return commands.deleteCurrentNode();
5996
+ }
5997
+ var currentIndex = $from.index($from.depth - 1);
5998
+
5999
+ // lift the block if the the list item is empty.
6000
+ if (currentIndex === $listItem.childCount - 1) {
6001
+ return commands.liftEmptyBlock();
6002
+ }
6003
+ var nextNode = $listItem.child(currentIndex + 1);
6004
+ if (!isListNode(nextNode)) {
6005
+ return commands.deleteCurrentNode();
6006
+ }
6007
+ if (currentIndex === 0) {
6008
+ return commands.joinBackward();
6009
+ }
6010
+
6011
+ // Delete the empty paragraph node between the two lists.
6012
+ var prevNode = $listItem.child(currentIndex - 1);
6013
+ if (isListNode(prevNode)) {
6014
+ return commands.deleteCurrentNode();
6015
+ }
6016
+ return commands.joinBackward();
6017
+ });
6018
+ }
6019
+ };
6020
+ }
6021
+ });
6022
+
5974
6023
  function getDefaultExportFromCjs (x) {
5975
6024
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5976
6025
  }
@@ -13385,12 +13434,17 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
13385
13434
  var selectedIndex = _this.state.selectedIndex;
13386
13435
  _this.selectItem(selectedIndex);
13387
13436
  });
13437
+ _defineProperty__default["default"](_this, "tabHandler", function () {
13438
+ var selectedIndex = _this.state.selectedIndex;
13439
+ _this.selectItem(selectedIndex);
13440
+ });
13388
13441
  _defineProperty__default["default"](_this, "onKeyDown", function (_ref) {
13389
13442
  var event = _ref.event;
13390
13443
  var keyDownHandlers = {
13391
13444
  ArrowUp: _this.upHandler,
13392
13445
  ArrowDown: _this.downHandler,
13393
- Enter: _this.enterHandler
13446
+ Enter: _this.enterHandler,
13447
+ Tab: _this.tabHandler
13394
13448
  };
13395
13449
  if (Object.prototype.hasOwnProperty.call(keyDownHandlers, event.key)) {
13396
13450
  keyDownHandlers[event.key]();
@@ -19365,9 +19419,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19365
19419
  document: false,
19366
19420
  codeBlock: false,
19367
19421
  code: false,
19422
+ bulletList: false,
19368
19423
  blockquote: options.includes(constants.EDITOR_OPTIONS.BLOCKQUOTE),
19369
19424
  orderedList: options.includes(constants.EDITOR_OPTIONS.LIST_ORDERED),
19370
- bulletList: options.includes(constants.EDITOR_OPTIONS.LIST_BULLETS),
19371
19425
  history: !collaborationProvider
19372
19426
  }), TextStyle$2, Underline, KeyboardShortcuts$1.configure({
19373
19427
  onSubmit: onSubmit,
@@ -19385,6 +19439,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19385
19439
  if (options.includes(constants.EDITOR_OPTIONS.TEXT_COLOR)) {
19386
19440
  customExtensions.push(Color);
19387
19441
  }
19442
+ if (options.includes(constants.EDITOR_OPTIONS.LIST_BULLETS)) {
19443
+ customExtensions.push(BulletList);
19444
+ }
19388
19445
  if (isSlashCommandsActive) {
19389
19446
  customExtensions.push(SlashCommands.configure({
19390
19447
  options: options,