@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.
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
  }
@@ -19294,9 +19343,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19294
19343
  document: false,
19295
19344
  codeBlock: false,
19296
19345
  code: false,
19346
+ bulletList: false,
19297
19347
  blockquote: options.includes(EDITOR_OPTIONS.BLOCKQUOTE),
19298
19348
  orderedList: options.includes(EDITOR_OPTIONS.LIST_ORDERED),
19299
- bulletList: options.includes(EDITOR_OPTIONS.LIST_BULLETS),
19300
19349
  history: !collaborationProvider
19301
19350
  }), TextStyle$2, Underline, KeyboardShortcuts$1.configure({
19302
19351
  onSubmit: onSubmit,
@@ -19314,6 +19363,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19314
19363
  if (options.includes(EDITOR_OPTIONS.TEXT_COLOR)) {
19315
19364
  customExtensions.push(Color);
19316
19365
  }
19366
+ if (options.includes(EDITOR_OPTIONS.LIST_BULLETS)) {
19367
+ customExtensions.push(BulletList);
19368
+ }
19317
19369
  if (isSlashCommandsActive) {
19318
19370
  customExtensions.push(SlashCommands.configure({
19319
19371
  options: options,