@tiptap/extension-list-keymap 3.0.0 → 3.0.1

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.
Files changed (198) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +5 -1
  3. package/dist/index.cjs +34 -285
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +2 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +10 -281
  8. package/dist/index.js.map +1 -1
  9. package/package.json +11 -9
  10. package/src/index.ts +3 -3
  11. package/dist/index.umd.js +0 -291
  12. package/dist/index.umd.js.map +0 -1
  13. package/dist/packages/core/src/CommandManager.d.ts +0 -20
  14. package/dist/packages/core/src/Editor.d.ts +0 -161
  15. package/dist/packages/core/src/EventEmitter.d.ts +0 -11
  16. package/dist/packages/core/src/Extension.d.ts +0 -343
  17. package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
  18. package/dist/packages/core/src/InputRule.d.ts +0 -42
  19. package/dist/packages/core/src/Mark.d.ts +0 -451
  20. package/dist/packages/core/src/Node.d.ts +0 -611
  21. package/dist/packages/core/src/NodePos.d.ts +0 -44
  22. package/dist/packages/core/src/NodeView.d.ts +0 -31
  23. package/dist/packages/core/src/PasteRule.d.ts +0 -50
  24. package/dist/packages/core/src/Tracker.d.ts +0 -11
  25. package/dist/packages/core/src/commands/blur.d.ts +0 -13
  26. package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
  27. package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
  28. package/dist/packages/core/src/commands/command.d.ts +0 -18
  29. package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
  30. package/dist/packages/core/src/commands/cut.d.ts +0 -20
  31. package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
  32. package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
  33. package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
  34. package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
  35. package/dist/packages/core/src/commands/enter.d.ts +0 -13
  36. package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
  37. package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
  38. package/dist/packages/core/src/commands/first.d.ts +0 -14
  39. package/dist/packages/core/src/commands/focus.d.ts +0 -27
  40. package/dist/packages/core/src/commands/forEach.d.ts +0 -14
  41. package/dist/packages/core/src/commands/index.d.ts +0 -55
  42. package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
  43. package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
  44. package/dist/packages/core/src/commands/join.d.ts +0 -41
  45. package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
  46. package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
  47. package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
  48. package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
  49. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
  50. package/dist/packages/core/src/commands/lift.d.ts +0 -17
  51. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
  52. package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
  53. package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
  54. package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
  55. package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
  56. package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
  57. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
  58. package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
  59. package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
  60. package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
  61. package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
  62. package/dist/packages/core/src/commands/setContent.d.ts +0 -40
  63. package/dist/packages/core/src/commands/setMark.d.ts +0 -15
  64. package/dist/packages/core/src/commands/setMeta.d.ts +0 -15
  65. package/dist/packages/core/src/commands/setNode.d.ts +0 -16
  66. package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
  67. package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
  68. package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
  69. package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
  70. package/dist/packages/core/src/commands/splitListItem.d.ts +0 -15
  71. package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
  72. package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
  73. package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
  74. package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
  75. package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
  76. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
  77. package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
  78. package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
  79. package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
  80. package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
  81. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
  82. package/dist/packages/core/src/extensions/commands.d.ts +0 -3
  83. package/dist/packages/core/src/extensions/editable.d.ts +0 -2
  84. package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
  85. package/dist/packages/core/src/extensions/index.d.ts +0 -6
  86. package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
  87. package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
  88. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
  89. package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
  90. package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
  91. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
  92. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
  93. package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
  94. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
  95. package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
  96. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
  97. package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
  98. package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
  99. package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
  100. package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
  101. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
  102. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
  103. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
  104. package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
  105. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
  106. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
  107. package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
  108. package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
  109. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
  110. package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
  111. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
  112. package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
  113. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
  114. package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
  115. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
  116. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
  117. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
  118. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
  119. package/dist/packages/core/src/helpers/getText.d.ts +0 -15
  120. package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
  121. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
  122. package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
  123. package/dist/packages/core/src/helpers/index.d.ts +0 -50
  124. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
  125. package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
  126. package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
  127. package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
  128. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
  129. package/dist/packages/core/src/helpers/isList.d.ts +0 -2
  130. package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
  131. package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
  132. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -2
  133. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
  134. package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
  135. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
  136. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
  137. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
  138. package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
  139. package/dist/packages/core/src/index.d.ts +0 -24
  140. package/dist/packages/core/src/inputRules/index.d.ts +0 -5
  141. package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
  142. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
  143. package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
  144. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
  145. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
  146. package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
  147. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
  148. package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -13
  149. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
  150. package/dist/packages/core/src/style.d.ts +0 -1
  151. package/dist/packages/core/src/types.d.ts +0 -255
  152. package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
  153. package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
  154. package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
  155. package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
  156. package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
  157. package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
  158. package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
  159. package/dist/packages/core/src/utilities/index.d.ts +0 -20
  160. package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
  161. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
  162. package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
  163. package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
  164. package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
  165. package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
  166. package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
  167. package/dist/packages/core/src/utilities/isString.d.ts +0 -1
  168. package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
  169. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
  170. package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
  171. package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
  172. package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
  173. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
  174. package/dist/packages/extension-list-keymap/src/index.d.ts +0 -4
  175. package/dist/packages/extension-list-keymap/src/list-keymap.d.ts +0 -20
  176. package/dist/packages/extension-list-keymap/src/listHelpers/findListItemPos.d.ts +0 -6
  177. package/dist/packages/extension-list-keymap/src/listHelpers/getNextListDepth.d.ts +0 -2
  178. package/dist/packages/extension-list-keymap/src/listHelpers/handleBackspace.d.ts +0 -2
  179. package/dist/packages/extension-list-keymap/src/listHelpers/handleDelete.d.ts +0 -2
  180. package/dist/packages/extension-list-keymap/src/listHelpers/hasListBefore.d.ts +0 -2
  181. package/dist/packages/extension-list-keymap/src/listHelpers/hasListItemAfter.d.ts +0 -2
  182. package/dist/packages/extension-list-keymap/src/listHelpers/hasListItemBefore.d.ts +0 -2
  183. package/dist/packages/extension-list-keymap/src/listHelpers/index.d.ts +0 -10
  184. package/dist/packages/extension-list-keymap/src/listHelpers/listItemHasSubList.d.ts +0 -3
  185. package/dist/packages/extension-list-keymap/src/listHelpers/nextListIsDeeper.d.ts +0 -2
  186. package/dist/packages/extension-list-keymap/src/listHelpers/nextListIsHigher.d.ts +0 -2
  187. package/src/list-keymap.ts +0 -106
  188. package/src/listHelpers/findListItemPos.ts +0 -30
  189. package/src/listHelpers/getNextListDepth.ts +0 -16
  190. package/src/listHelpers/handleBackspace.ts +0 -74
  191. package/src/listHelpers/handleDelete.ts +0 -37
  192. package/src/listHelpers/hasListBefore.ts +0 -15
  193. package/src/listHelpers/hasListItemAfter.ts +0 -17
  194. package/src/listHelpers/hasListItemBefore.ts +0 -17
  195. package/src/listHelpers/index.ts +0 -10
  196. package/src/listHelpers/listItemHasSubList.ts +0 -21
  197. package/src/listHelpers/nextListIsDeeper.ts +0 -19
  198. package/src/listHelpers/nextListIsHigher.ts +0 -19
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025, Tiptap GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # @tiptap/extension-list-keymap
2
+
2
3
  [![Version](https://img.shields.io/npm/v/@tiptap/extension-list-keymap.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-list-keymap)
3
4
  [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-list-keymap.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
4
5
  [![License](https://img.shields.io/npm/l/@tiptap/extension-list-keymap.svg)](https://www.npmjs.com/package/@tiptap/extension-list-keymap)
5
6
  [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
6
7
 
7
8
  ## Introduction
8
- Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
9
+
10
+ Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
9
11
 
10
12
  ## Official Documentation
13
+
11
14
  Documentation can be found on the [Tiptap website](https://tiptap.dev).
12
15
 
13
16
  ## License
17
+
14
18
  Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
package/dist/index.cjs CHANGED
@@ -1,287 +1,36 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var core = require('@tiptap/core');
6
-
7
- const findListItemPos = (typeOrName, state) => {
8
- const { $from } = state.selection;
9
- const nodeType = core.getNodeType(typeOrName, state.schema);
10
- let currentNode = null;
11
- let currentDepth = $from.depth;
12
- let currentPos = $from.pos;
13
- let targetDepth = null;
14
- while (currentDepth > 0 && targetDepth === null) {
15
- currentNode = $from.node(currentDepth);
16
- if (currentNode.type === nodeType) {
17
- targetDepth = currentDepth;
18
- }
19
- else {
20
- currentDepth -= 1;
21
- currentPos -= 1;
22
- }
23
- }
24
- if (targetDepth === null) {
25
- return null;
26
- }
27
- return { $pos: state.doc.resolve(currentPos), depth: targetDepth };
28
- };
29
-
30
- const getNextListDepth = (typeOrName, state) => {
31
- const listItemPos = findListItemPos(typeOrName, state);
32
- if (!listItemPos) {
33
- return false;
34
- }
35
- const [, depth] = core.getNodeAtPosition(state, typeOrName, listItemPos.$pos.pos + 4);
36
- return depth;
37
- };
38
-
39
- const hasListBefore = (editorState, name, parentListTypes) => {
40
- const { $anchor } = editorState.selection;
41
- const previousNodePos = Math.max(0, $anchor.pos - 2);
42
- const previousNode = editorState.doc.resolve(previousNodePos).node();
43
- if (!previousNode || !parentListTypes.includes(previousNode.type.name)) {
44
- return false;
45
- }
46
- return true;
47
- };
48
-
49
- const hasListItemBefore = (typeOrName, state) => {
50
- var _a;
51
- const { $anchor } = state.selection;
52
- const $targetPos = state.doc.resolve($anchor.pos - 2);
53
- if ($targetPos.index() === 0) {
54
- return false;
55
- }
56
- if (((_a = $targetPos.nodeBefore) === null || _a === void 0 ? void 0 : _a.type.name) !== typeOrName) {
57
- return false;
58
- }
59
- return true;
60
- };
61
-
62
- const listItemHasSubList = (typeOrName, state, node) => {
63
- if (!node) {
64
- return false;
65
- }
66
- const nodeType = core.getNodeType(typeOrName, state.schema);
67
- let hasSubList = false;
68
- node.descendants(child => {
69
- if (child.type === nodeType) {
70
- hasSubList = true;
71
- }
72
- });
73
- return hasSubList;
74
- };
75
-
76
- const handleBackspace = (editor, name, parentListTypes) => {
77
- // this is required to still handle the undo handling
78
- if (editor.commands.undoInputRule()) {
79
- return true;
80
- }
81
- // if the current item is NOT inside a list item &
82
- // the previous item is a list (orderedList or bulletList)
83
- // move the cursor into the list and delete the current item
84
- if (!core.isNodeActive(editor.state, name) && hasListBefore(editor.state, name, parentListTypes)) {
85
- const { $anchor } = editor.state.selection;
86
- const $listPos = editor.state.doc.resolve($anchor.before() - 1);
87
- const listDescendants = [];
88
- $listPos.node().descendants((node, pos) => {
89
- if (node.type.name === name) {
90
- listDescendants.push({ node, pos });
91
- }
92
- });
93
- const lastItem = listDescendants.at(-1);
94
- if (!lastItem) {
95
- return false;
96
- }
97
- const $lastItemPos = editor.state.doc.resolve($listPos.start() + lastItem.pos + 1);
98
- return editor.chain().cut({ from: $anchor.start() - 1, to: $anchor.end() + 1 }, $lastItemPos.end()).joinForward().run();
99
- }
100
- // if the cursor is not inside the current node type
101
- // do nothing and proceed
102
- if (!core.isNodeActive(editor.state, name)) {
103
- return false;
104
- }
105
- // if the cursor is not at the start of a node
106
- // do nothing and proceed
107
- if (!core.isAtStartOfNode(editor.state)) {
108
- return false;
109
- }
110
- const listItemPos = findListItemPos(name, editor.state);
111
- if (!listItemPos) {
112
- return false;
113
- }
114
- const $prev = editor.state.doc.resolve(listItemPos.$pos.pos - 2);
115
- const prevNode = $prev.node(listItemPos.depth);
116
- const previousListItemHasSubList = listItemHasSubList(name, editor.state, prevNode);
117
- // if the previous item is a list item and doesn't have a sublist, join the list items
118
- if (hasListItemBefore(name, editor.state) && !previousListItemHasSubList) {
119
- return editor.commands.joinItemBackward();
120
- }
121
- // otherwise in the end, a backspace should
122
- // always just lift the list item if
123
- // joining / merging is not possible
124
- return editor.chain().liftListItem(name).run();
125
- };
126
-
127
- const nextListIsDeeper = (typeOrName, state) => {
128
- const listDepth = getNextListDepth(typeOrName, state);
129
- const listItemPos = findListItemPos(typeOrName, state);
130
- if (!listItemPos || !listDepth) {
131
- return false;
132
- }
133
- if (listDepth > listItemPos.depth) {
134
- return true;
135
- }
136
- return false;
137
- };
138
-
139
- const nextListIsHigher = (typeOrName, state) => {
140
- const listDepth = getNextListDepth(typeOrName, state);
141
- const listItemPos = findListItemPos(typeOrName, state);
142
- if (!listItemPos || !listDepth) {
143
- return false;
144
- }
145
- if (listDepth < listItemPos.depth) {
146
- return true;
147
- }
148
- return false;
149
- };
150
-
151
- const handleDelete = (editor, name) => {
152
- // if the cursor is not inside the current node type
153
- // do nothing and proceed
154
- if (!core.isNodeActive(editor.state, name)) {
155
- return false;
156
- }
157
- // if the cursor is not at the end of a node
158
- // do nothing and proceed
159
- if (!core.isAtEndOfNode(editor.state, name)) {
160
- return false;
161
- }
162
- // check if the next node is a list with a deeper depth
163
- if (nextListIsDeeper(name, editor.state)) {
164
- return editor
165
- .chain()
166
- .focus(editor.state.selection.from + 4)
167
- .lift(name)
168
- .joinBackward()
169
- .run();
170
- }
171
- if (nextListIsHigher(name, editor.state)) {
172
- return editor.chain()
173
- .joinForward()
174
- .joinBackward()
175
- .run();
176
- }
177
- return editor.commands.joinItemForward();
178
- };
179
-
180
- const hasListItemAfter = (typeOrName, state) => {
181
- var _a;
182
- const { $anchor } = state.selection;
183
- const $targetPos = state.doc.resolve($anchor.pos - $anchor.parentOffset - 2);
184
- if ($targetPos.index() === $targetPos.parent.childCount - 1) {
185
- return false;
186
- }
187
- if (((_a = $targetPos.nodeAfter) === null || _a === void 0 ? void 0 : _a.type.name) !== typeOrName) {
188
- return false;
189
- }
190
- return true;
191
- };
192
-
193
- var index = /*#__PURE__*/Object.freeze({
194
- __proto__: null,
195
- findListItemPos: findListItemPos,
196
- getNextListDepth: getNextListDepth,
197
- handleBackspace: handleBackspace,
198
- handleDelete: handleDelete,
199
- hasListBefore: hasListBefore,
200
- hasListItemAfter: hasListItemAfter,
201
- hasListItemBefore: hasListItemBefore,
202
- listItemHasSubList: listItemHasSubList,
203
- nextListIsDeeper: nextListIsDeeper,
204
- nextListIsHigher: nextListIsHigher
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ListKeymap: () => import_extension_list2.ListKeymap,
24
+ default: () => index_default,
25
+ listHelpers: () => import_extension_list2.listHelpers
205
26
  });
206
-
207
- /**
208
- * This extension registers custom keymaps to change the behaviour of the backspace and delete keys.
209
- * By default Prosemirror keyhandling will always lift or sink items so paragraphs are joined into
210
- * the adjacent or previous list item. This extension will prevent this behaviour and instead will
211
- * try to join paragraphs from two list items into a single list item.
212
- * @see https://www.tiptap.dev/api/extensions/list-keymap
213
- */
214
- const ListKeymap = core.Extension.create({
215
- name: 'listKeymap',
216
- addOptions() {
217
- return {
218
- listTypes: [
219
- {
220
- itemName: 'listItem',
221
- wrapperNames: ['bulletList', 'orderedList'],
222
- },
223
- {
224
- itemName: 'taskItem',
225
- wrapperNames: ['taskList'],
226
- },
227
- ],
228
- };
229
- },
230
- addKeyboardShortcuts() {
231
- return {
232
- Delete: ({ editor }) => {
233
- let handled = false;
234
- this.options.listTypes.forEach(({ itemName }) => {
235
- if (editor.state.schema.nodes[itemName] === undefined) {
236
- return;
237
- }
238
- if (handleDelete(editor, itemName)) {
239
- handled = true;
240
- }
241
- });
242
- return handled;
243
- },
244
- 'Mod-Delete': ({ editor }) => {
245
- let handled = false;
246
- this.options.listTypes.forEach(({ itemName }) => {
247
- if (editor.state.schema.nodes[itemName] === undefined) {
248
- return;
249
- }
250
- if (handleDelete(editor, itemName)) {
251
- handled = true;
252
- }
253
- });
254
- return handled;
255
- },
256
- Backspace: ({ editor }) => {
257
- let handled = false;
258
- this.options.listTypes.forEach(({ itemName, wrapperNames }) => {
259
- if (editor.state.schema.nodes[itemName] === undefined) {
260
- return;
261
- }
262
- if (handleBackspace(editor, itemName, wrapperNames)) {
263
- handled = true;
264
- }
265
- });
266
- return handled;
267
- },
268
- 'Mod-Backspace': ({ editor }) => {
269
- let handled = false;
270
- this.options.listTypes.forEach(({ itemName, wrapperNames }) => {
271
- if (editor.state.schema.nodes[itemName] === undefined) {
272
- return;
273
- }
274
- if (handleBackspace(editor, itemName, wrapperNames)) {
275
- handled = true;
276
- }
277
- });
278
- return handled;
279
- },
280
- };
281
- },
27
+ module.exports = __toCommonJS(index_exports);
28
+ var import_extension_list = require("@tiptap/extension-list");
29
+ var import_extension_list2 = require("@tiptap/extension-list");
30
+ var index_default = import_extension_list.ListKeymap;
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ ListKeymap,
34
+ listHelpers
282
35
  });
283
-
284
- exports.ListKeymap = ListKeymap;
285
- exports.default = ListKeymap;
286
- exports.listHelpers = index;
287
- //# sourceMappingURL=index.cjs.map
36
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/listHelpers/findListItemPos.ts","../src/listHelpers/getNextListDepth.ts","../src/listHelpers/hasListBefore.ts","../src/listHelpers/hasListItemBefore.ts","../src/listHelpers/listItemHasSubList.ts","../src/listHelpers/handleBackspace.ts","../src/listHelpers/nextListIsDeeper.ts","../src/listHelpers/nextListIsHigher.ts","../src/listHelpers/handleDelete.ts","../src/listHelpers/hasListItemAfter.ts","../src/list-keymap.ts"],"sourcesContent":["import { getNodeType } from '@tiptap/core'\nimport { NodeType } from '@tiptap/pm/model'\nimport { EditorState } from '@tiptap/pm/state'\n\nexport const findListItemPos = (typeOrName: string | NodeType, state: EditorState) => {\n const { $from } = state.selection\n const nodeType = getNodeType(typeOrName, state.schema)\n\n let currentNode = null\n let currentDepth = $from.depth\n let currentPos = $from.pos\n let targetDepth: number | null = null\n\n while (currentDepth > 0 && targetDepth === null) {\n currentNode = $from.node(currentDepth)\n\n if (currentNode.type === nodeType) {\n targetDepth = currentDepth\n } else {\n currentDepth -= 1\n currentPos -= 1\n }\n }\n\n if (targetDepth === null) {\n return null\n }\n\n return { $pos: state.doc.resolve(currentPos), depth: targetDepth }\n}\n","import { getNodeAtPosition } from '@tiptap/core'\nimport { EditorState } from '@tiptap/pm/state'\n\nimport { findListItemPos } from './findListItemPos.js'\n\nexport const getNextListDepth = (typeOrName: string, state: EditorState) => {\n const listItemPos = findListItemPos(typeOrName, state)\n\n if (!listItemPos) {\n return false\n }\n\n const [, depth] = getNodeAtPosition(state, typeOrName, listItemPos.$pos.pos + 4)\n\n return depth\n}\n","import { EditorState } from '@tiptap/pm/state'\n\nexport const hasListBefore = (editorState: EditorState, name: string, parentListTypes: string[]) => {\n const { $anchor } = editorState.selection\n\n const previousNodePos = Math.max(0, $anchor.pos - 2)\n\n const previousNode = editorState.doc.resolve(previousNodePos).node()\n\n if (!previousNode || !parentListTypes.includes(previousNode.type.name)) {\n return false\n }\n\n return true\n}\n","import { EditorState } from '@tiptap/pm/state'\n\nexport const hasListItemBefore = (typeOrName: string, state: EditorState): boolean => {\n const { $anchor } = state.selection\n\n const $targetPos = state.doc.resolve($anchor.pos - 2)\n\n if ($targetPos.index() === 0) {\n return false\n }\n\n if ($targetPos.nodeBefore?.type.name !== typeOrName) {\n return false\n }\n\n return true\n}\n","import { getNodeType } from '@tiptap/core'\nimport { Node } from '@tiptap/pm/model'\nimport { EditorState } from '@tiptap/pm/state'\n\nexport const listItemHasSubList = (typeOrName: string, state: EditorState, node?: Node) => {\n if (!node) {\n return false\n }\n\n const nodeType = getNodeType(typeOrName, state.schema)\n\n let hasSubList = false\n\n node.descendants(child => {\n if (child.type === nodeType) {\n hasSubList = true\n }\n })\n\n return hasSubList\n}\n","import { Editor, isAtStartOfNode, isNodeActive } from '@tiptap/core'\nimport { Node } from '@tiptap/pm/model'\n\nimport { findListItemPos } from './findListItemPos.js'\nimport { hasListBefore } from './hasListBefore.js'\nimport { hasListItemBefore } from './hasListItemBefore.js'\nimport { listItemHasSubList } from './listItemHasSubList.js'\n\nexport const handleBackspace = (editor: Editor, name: string, parentListTypes: string[]) => {\n // this is required to still handle the undo handling\n if (editor.commands.undoInputRule()) {\n return true\n }\n\n // if the current item is NOT inside a list item &\n // the previous item is a list (orderedList or bulletList)\n // move the cursor into the list and delete the current item\n if (!isNodeActive(editor.state, name) && hasListBefore(editor.state, name, parentListTypes)) {\n const { $anchor } = editor.state.selection\n\n const $listPos = editor.state.doc.resolve($anchor.before() - 1)\n\n const listDescendants: Array<{ node: Node, pos: number }> = []\n\n $listPos.node().descendants((node, pos) => {\n if (node.type.name === name) {\n listDescendants.push({ node, pos })\n }\n })\n\n const lastItem = listDescendants.at(-1)\n\n if (!lastItem) {\n return false\n }\n\n const $lastItemPos = editor.state.doc.resolve($listPos.start() + lastItem.pos + 1)\n\n return editor.chain().cut({ from: $anchor.start() - 1, to: $anchor.end() + 1 }, $lastItemPos.end()).joinForward().run()\n }\n\n // if the cursor is not inside the current node type\n // do nothing and proceed\n if (!isNodeActive(editor.state, name)) {\n return false\n }\n\n // if the cursor is not at the start of a node\n // do nothing and proceed\n if (!isAtStartOfNode(editor.state)) {\n return false\n }\n\n const listItemPos = findListItemPos(name, editor.state)\n\n if (!listItemPos) {\n return false\n }\n\n const $prev = editor.state.doc.resolve(listItemPos.$pos.pos - 2)\n const prevNode = $prev.node(listItemPos.depth)\n\n const previousListItemHasSubList = listItemHasSubList(name, editor.state, prevNode)\n\n // if the previous item is a list item and doesn't have a sublist, join the list items\n if (hasListItemBefore(name, editor.state) && !previousListItemHasSubList) {\n return editor.commands.joinItemBackward()\n }\n\n // otherwise in the end, a backspace should\n // always just lift the list item if\n // joining / merging is not possible\n return editor.chain().liftListItem(name).run()\n}\n","import { EditorState } from '@tiptap/pm/state'\n\nimport { findListItemPos } from './findListItemPos.js'\nimport { getNextListDepth } from './getNextListDepth.js'\n\nexport const nextListIsDeeper = (typeOrName: string, state: EditorState) => {\n const listDepth = getNextListDepth(typeOrName, state)\n const listItemPos = findListItemPos(typeOrName, state)\n\n if (!listItemPos || !listDepth) {\n return false\n }\n\n if (listDepth > listItemPos.depth) {\n return true\n }\n\n return false\n}\n","import { EditorState } from '@tiptap/pm/state'\n\nimport { findListItemPos } from './findListItemPos.js'\nimport { getNextListDepth } from './getNextListDepth.js'\n\nexport const nextListIsHigher = (typeOrName: string, state: EditorState) => {\n const listDepth = getNextListDepth(typeOrName, state)\n const listItemPos = findListItemPos(typeOrName, state)\n\n if (!listItemPos || !listDepth) {\n return false\n }\n\n if (listDepth < listItemPos.depth) {\n return true\n }\n\n return false\n}\n","import { Editor, isAtEndOfNode, isNodeActive } from '@tiptap/core'\n\nimport { nextListIsDeeper } from './nextListIsDeeper.js'\nimport { nextListIsHigher } from './nextListIsHigher.js'\n\nexport const handleDelete = (editor: Editor, name: string) => {\n // if the cursor is not inside the current node type\n // do nothing and proceed\n if (!isNodeActive(editor.state, name)) {\n return false\n }\n\n // if the cursor is not at the end of a node\n // do nothing and proceed\n if (!isAtEndOfNode(editor.state, name)) {\n return false\n }\n\n // check if the next node is a list with a deeper depth\n if (nextListIsDeeper(name, editor.state)) {\n return editor\n .chain()\n .focus(editor.state.selection.from + 4)\n .lift(name)\n .joinBackward()\n .run()\n }\n\n if (nextListIsHigher(name, editor.state)) {\n return editor.chain()\n .joinForward()\n .joinBackward()\n .run()\n }\n\n return editor.commands.joinItemForward()\n}\n","import { EditorState } from '@tiptap/pm/state'\n\nexport const hasListItemAfter = (typeOrName: string, state: EditorState): boolean => {\n const { $anchor } = state.selection\n\n const $targetPos = state.doc.resolve($anchor.pos - $anchor.parentOffset - 2)\n\n if ($targetPos.index() === $targetPos.parent.childCount - 1) {\n return false\n }\n\n if ($targetPos.nodeAfter?.type.name !== typeOrName) {\n return false\n }\n\n return true\n}\n","import { Extension } from '@tiptap/core'\n\nimport { handleBackspace, handleDelete } from './listHelpers/index.js'\n\nexport type ListKeymapOptions = {\n /**\n * An array of list types. This is used for item and wrapper list matching.\n * @default []\n * @example [{ itemName: 'listItem', wrapperNames: ['bulletList', 'orderedList'] }]\n */\n listTypes: Array<{\n itemName: string,\n wrapperNames: string[],\n }>\n}\n\n/**\n * This extension registers custom keymaps to change the behaviour of the backspace and delete keys.\n * By default Prosemirror keyhandling will always lift or sink items so paragraphs are joined into\n * the adjacent or previous list item. This extension will prevent this behaviour and instead will\n * try to join paragraphs from two list items into a single list item.\n * @see https://www.tiptap.dev/api/extensions/list-keymap\n */\nexport const ListKeymap = Extension.create<ListKeymapOptions>({\n name: 'listKeymap',\n\n addOptions() {\n return {\n listTypes: [\n {\n itemName: 'listItem',\n wrapperNames: ['bulletList', 'orderedList'],\n },\n {\n itemName: 'taskItem',\n wrapperNames: ['taskList'],\n },\n ],\n }\n },\n\n addKeyboardShortcuts() {\n return {\n Delete: ({ editor }) => {\n let handled = false\n\n this.options.listTypes.forEach(({ itemName }) => {\n if (editor.state.schema.nodes[itemName] === undefined) {\n return\n }\n\n if (handleDelete(editor, itemName)) {\n handled = true\n }\n })\n\n return handled\n },\n 'Mod-Delete': ({ editor }) => {\n let handled = false\n\n this.options.listTypes.forEach(({ itemName }) => {\n if (editor.state.schema.nodes[itemName] === undefined) {\n return\n }\n\n if (handleDelete(editor, itemName)) {\n handled = true\n }\n })\n\n return handled\n },\n Backspace: ({ editor }) => {\n let handled = false\n\n this.options.listTypes.forEach(({ itemName, wrapperNames }) => {\n if (editor.state.schema.nodes[itemName] === undefined) {\n return\n }\n\n if (handleBackspace(editor, itemName, wrapperNames)) {\n handled = true\n }\n })\n\n return handled\n },\n 'Mod-Backspace': ({ editor }) => {\n let handled = false\n\n this.options.listTypes.forEach(({ itemName, wrapperNames }) => {\n if (editor.state.schema.nodes[itemName] === undefined) {\n return\n }\n\n if (handleBackspace(editor, itemName, wrapperNames)) {\n handled = true\n }\n })\n\n return handled\n },\n }\n },\n})\n"],"names":["getNodeType","getNodeAtPosition","isNodeActive","isAtStartOfNode","isAtEndOfNode","Extension"],"mappings":";;;;;;AAIO,MAAM,eAAe,GAAG,CAAC,UAA6B,EAAE,KAAkB,KAAI;AACnF,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,SAAS,CAAA;IACjC,MAAM,QAAQ,GAAGA,gBAAW,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAEtD,IAAI,WAAW,GAAG,IAAI,CAAA;AACtB,IAAA,IAAI,YAAY,GAAG,KAAK,CAAC,KAAK,CAAA;AAC9B,IAAA,IAAI,UAAU,GAAG,KAAK,CAAC,GAAG,CAAA;IAC1B,IAAI,WAAW,GAAkB,IAAI,CAAA;IAErC,OAAO,YAAY,GAAG,CAAC,IAAI,WAAW,KAAK,IAAI,EAAE;AAC/C,QAAA,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;AAEtC,QAAA,IAAI,WAAW,CAAC,IAAI,KAAK,QAAQ,EAAE;YACjC,WAAW,GAAG,YAAY,CAAA;SAC3B;aAAM;YACL,YAAY,IAAI,CAAC,CAAA;YACjB,UAAU,IAAI,CAAC,CAAA;SAChB;KACF;AAED,IAAA,IAAI,WAAW,KAAK,IAAI,EAAE;AACxB,QAAA,OAAO,IAAI,CAAA;KACZ;AAED,IAAA,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,OAA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;AAC5D,oBAAA,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;wBACrD,OAAM;qBACP;oBAED,IAAI,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE;wBACnD,OAAO,GAAG,IAAI,CAAA;qBACf;AACH,iBAAC,CAAC,CAAA;AAEF,gBAAA,OAAO,OAAO,CAAA;aACf;SACF,CAAA;KACF;AACF,CAAA;;;;;;"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { ListKeymap } from '@tiptap/extension-list'\n\nexport type { ListKeymapOptions } from '@tiptap/extension-list'\nexport { listHelpers, ListKeymap } from '@tiptap/extension-list'\n\nexport default ListKeymap\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA2B;AAG3B,IAAAA,yBAAwC;AAExC,IAAO,gBAAQ;","names":["import_extension_list"]}
@@ -0,0 +1,2 @@
1
+ import { ListKeymap } from '@tiptap/extension-list';
2
+ export { ListKeymap, ListKeymapOptions, ListKeymap as default, listHelpers } from '@tiptap/extension-list';
@@ -0,0 +1,2 @@
1
+ import { ListKeymap } from '@tiptap/extension-list';
2
+ export { ListKeymap, ListKeymapOptions, ListKeymap as default, listHelpers } from '@tiptap/extension-list';