@bigbinary/neeto-editor 1.43.6 → 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
  }
@@ -19370,9 +19419,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19370
19419
  document: false,
19371
19420
  codeBlock: false,
19372
19421
  code: false,
19422
+ bulletList: false,
19373
19423
  blockquote: options.includes(constants.EDITOR_OPTIONS.BLOCKQUOTE),
19374
19424
  orderedList: options.includes(constants.EDITOR_OPTIONS.LIST_ORDERED),
19375
- bulletList: options.includes(constants.EDITOR_OPTIONS.LIST_BULLETS),
19376
19425
  history: !collaborationProvider
19377
19426
  }), TextStyle$2, Underline, KeyboardShortcuts$1.configure({
19378
19427
  onSubmit: onSubmit,
@@ -19390,6 +19439,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19390
19439
  if (options.includes(constants.EDITOR_OPTIONS.TEXT_COLOR)) {
19391
19440
  customExtensions.push(Color);
19392
19441
  }
19442
+ if (options.includes(constants.EDITOR_OPTIONS.LIST_BULLETS)) {
19443
+ customExtensions.push(BulletList);
19444
+ }
19393
19445
  if (isSlashCommandsActive) {
19394
19446
  customExtensions.push(SlashCommands.configure({
19395
19447
  options: options,