@tiptap/core 2.0.0-beta.21 → 2.0.0-beta.210

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 (289) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +4311 -0
  3. package/dist/index.d.ts +2330 -0
  4. package/dist/index.js +4311 -0
  5. package/package.json +39 -25
  6. package/src/CommandManager.ts +76 -86
  7. package/src/Editor.ts +120 -81
  8. package/src/EventEmitter.ts +14 -4
  9. package/src/Extension.ts +280 -108
  10. package/src/ExtensionManager.ts +254 -108
  11. package/src/InputRule.ts +260 -0
  12. package/src/Mark.ts +398 -147
  13. package/src/Node.ts +437 -171
  14. package/src/NodeView.ts +132 -63
  15. package/src/PasteRule.ts +240 -0
  16. package/src/Tracker.ts +38 -0
  17. package/src/commands/blur.ts +12 -6
  18. package/src/commands/clearContent.ts +3 -3
  19. package/src/commands/clearNodes.ts +31 -19
  20. package/src/commands/command.ts +2 -2
  21. package/src/commands/createParagraphNear.ts +5 -4
  22. package/src/commands/deleteCurrentNode.ts +41 -0
  23. package/src/commands/deleteNode.ts +37 -0
  24. package/src/commands/deleteRange.ts +3 -3
  25. package/src/commands/deleteSelection.ts +5 -4
  26. package/src/commands/enter.ts +3 -3
  27. package/src/commands/exitCode.ts +5 -4
  28. package/src/commands/extendMarkRange.ts +16 -12
  29. package/src/commands/first.ts +3 -3
  30. package/src/commands/focus.ts +47 -44
  31. package/src/commands/forEach.ts +24 -0
  32. package/src/commands/index.ts +50 -0
  33. package/src/commands/insertContent.ts +17 -24
  34. package/src/commands/insertContentAt.ts +94 -0
  35. package/src/commands/join.ts +53 -0
  36. package/src/commands/keyboardShortcut.ts +6 -6
  37. package/src/commands/lift.ts +8 -7
  38. package/src/commands/liftEmptyBlock.ts +5 -4
  39. package/src/commands/liftListItem.ts +7 -6
  40. package/src/commands/newlineInCode.ts +5 -4
  41. package/src/commands/resetAttributes.ts +18 -12
  42. package/src/commands/scrollIntoView.ts +3 -3
  43. package/src/commands/selectAll.ts +8 -6
  44. package/src/commands/selectNodeBackward.ts +5 -4
  45. package/src/commands/selectNodeForward.ts +5 -4
  46. package/src/commands/selectParentNode.ts +5 -4
  47. package/src/commands/selectTextblockEnd.ts +20 -0
  48. package/src/commands/selectTextblockStart.ts +20 -0
  49. package/src/commands/setContent.ts +9 -16
  50. package/src/commands/setMark.ts +90 -14
  51. package/src/commands/setMeta.ts +18 -0
  52. package/src/commands/setNode.ts +32 -8
  53. package/src/commands/setNodeSelection.ts +27 -0
  54. package/src/commands/setTextSelection.ts +31 -0
  55. package/src/commands/sinkListItem.ts +7 -6
  56. package/src/commands/splitBlock.ts +31 -41
  57. package/src/commands/splitListItem.ts +46 -29
  58. package/src/commands/toggleList.ts +88 -20
  59. package/src/commands/toggleMark.ts +19 -8
  60. package/src/commands/toggleNode.ts +11 -6
  61. package/src/commands/toggleWrap.ts +10 -10
  62. package/src/commands/undoInputRule.ts +34 -5
  63. package/src/commands/unsetAllMarks.ts +7 -11
  64. package/src/commands/unsetMark.ts +36 -23
  65. package/src/commands/updateAttributes.ts +27 -15
  66. package/src/commands/wrapIn.ts +7 -12
  67. package/src/commands/wrapInList.ts +7 -6
  68. package/src/extensions/clipboardTextSerializer.ts +15 -36
  69. package/src/extensions/commands.ts +3 -147
  70. package/src/extensions/editable.ts +2 -1
  71. package/src/extensions/focusEvents.ts +4 -6
  72. package/src/extensions/index.ts +1 -0
  73. package/src/extensions/keymap.ts +106 -13
  74. package/src/extensions/tabindex.ts +18 -0
  75. package/src/helpers/combineTransactionSteps.ts +21 -0
  76. package/src/helpers/createChainableState.ts +38 -0
  77. package/src/helpers/createDocument.ts +5 -6
  78. package/src/helpers/createNodeFromContent.ts +20 -28
  79. package/src/helpers/defaultBlockAt.ts +13 -0
  80. package/src/helpers/findChildren.ts +18 -0
  81. package/src/helpers/findChildrenInRange.ts +36 -0
  82. package/src/helpers/findParentNode.ts +4 -3
  83. package/src/helpers/findParentNodeClosestToPos.ts +13 -7
  84. package/src/helpers/generateHTML.ts +7 -6
  85. package/src/helpers/generateJSON.ts +12 -0
  86. package/src/helpers/generateText.ts +27 -0
  87. package/src/helpers/getAttributes.ts +26 -0
  88. package/src/helpers/getAttributesFromExtensions.ts +42 -14
  89. package/src/helpers/getChangedRanges.ts +83 -0
  90. package/src/helpers/getDebugJSON.ts +54 -0
  91. package/src/helpers/getExtensionField.ts +25 -0
  92. package/src/helpers/getHTMLFromFragment.ts +5 -6
  93. package/src/helpers/getMarkAttributes.ts +18 -11
  94. package/src/helpers/getMarkRange.ts +41 -8
  95. package/src/helpers/getMarkType.ts +8 -2
  96. package/src/helpers/getMarksBetween.ts +34 -10
  97. package/src/helpers/getNodeAttributes.ts +14 -13
  98. package/src/helpers/getNodeType.ts +8 -2
  99. package/src/helpers/getRenderedAttributes.ts +9 -7
  100. package/src/helpers/getSchema.ts +7 -133
  101. package/src/helpers/getSchemaByResolvedExtensions.ts +192 -0
  102. package/src/helpers/getSchemaTypeByName.ts +3 -11
  103. package/src/helpers/getSchemaTypeNameByName.ts +2 -2
  104. package/src/helpers/getSplittedAttributes.ts +4 -4
  105. package/src/helpers/getText.ts +19 -0
  106. package/src/helpers/getTextBetween.ts +46 -0
  107. package/src/helpers/getTextContentFromNodes.ts +26 -0
  108. package/src/helpers/getTextSerializersFromSchema.ts +11 -0
  109. package/src/helpers/index.ts +33 -0
  110. package/src/helpers/injectExtensionAttributesToParseRule.ts +22 -23
  111. package/src/helpers/isActive.ts +10 -6
  112. package/src/helpers/isExtensionRulesEnabled.ts +15 -0
  113. package/src/helpers/isList.ts +14 -7
  114. package/src/helpers/isMarkActive.ts +49 -27
  115. package/src/helpers/isNodeActive.ts +29 -39
  116. package/src/helpers/isNodeEmpty.ts +2 -2
  117. package/src/helpers/isNodeSelection.ts +3 -4
  118. package/src/helpers/isTextSelection.ts +3 -4
  119. package/src/helpers/posToDOMRect.ts +35 -0
  120. package/src/helpers/resolveFocusPosition.ts +42 -0
  121. package/src/helpers/selectionToInsertionEnd.ts +3 -3
  122. package/src/helpers/splitExtensions.ts +3 -3
  123. package/src/index.ts +15 -24
  124. package/src/inputRules/index.ts +5 -0
  125. package/src/inputRules/markInputRule.ts +59 -40
  126. package/src/inputRules/nodeInputRule.ts +45 -12
  127. package/src/inputRules/textInputRule.ts +35 -0
  128. package/src/inputRules/textblockTypeInputRule.ts +37 -0
  129. package/src/inputRules/wrappingInputRule.ts +59 -0
  130. package/src/pasteRules/index.ts +3 -0
  131. package/src/pasteRules/markPasteRule.ts +61 -53
  132. package/src/pasteRules/nodePasteRule.ts +37 -0
  133. package/src/pasteRules/textPasteRule.ts +35 -0
  134. package/src/style.ts +16 -3
  135. package/src/types.ts +170 -97
  136. package/src/utilities/callOrReturn.ts +6 -3
  137. package/src/utilities/createStyleTag.ts +12 -1
  138. package/src/utilities/deleteProps.ts +2 -4
  139. package/src/utilities/elementFromString.ts +4 -5
  140. package/src/utilities/escapeForRegEx.ts +4 -0
  141. package/src/utilities/findDuplicates.ts +5 -0
  142. package/src/utilities/fromString.ts +2 -2
  143. package/src/utilities/index.ts +20 -0
  144. package/src/utilities/isEmptyObject.ts +2 -2
  145. package/src/utilities/isFunction.ts +3 -0
  146. package/src/utilities/isMacOS.ts +5 -0
  147. package/src/utilities/isNumber.ts +3 -0
  148. package/src/utilities/isPlainObject.ts +8 -5
  149. package/src/utilities/isRegExp.ts +3 -0
  150. package/src/utilities/isString.ts +3 -0
  151. package/src/utilities/isiOS.ts +12 -0
  152. package/src/utilities/mergeAttributes.ts +2 -3
  153. package/src/utilities/mergeDeep.ts +2 -3
  154. package/src/utilities/minMax.ts +1 -1
  155. package/src/utilities/objectIncludes.ts +17 -5
  156. package/src/utilities/removeDuplicates.ts +15 -0
  157. package/CHANGELOG.md +0 -365
  158. package/LICENSE.md +0 -21
  159. package/dist/packages/core/src/CommandManager.d.ts +0 -13
  160. package/dist/packages/core/src/Editor.d.ts +0 -142
  161. package/dist/packages/core/src/EventEmitter.d.ts +0 -7
  162. package/dist/packages/core/src/Extension.d.ts +0 -148
  163. package/dist/packages/core/src/ExtensionManager.d.ts +0 -24
  164. package/dist/packages/core/src/Mark.d.ts +0 -211
  165. package/dist/packages/core/src/Node.d.ts +0 -265
  166. package/dist/packages/core/src/NodeView.d.ts +0 -31
  167. package/dist/packages/core/src/commands/blur.d.ts +0 -12
  168. package/dist/packages/core/src/commands/clearContent.d.ts +0 -12
  169. package/dist/packages/core/src/commands/clearNodes.d.ts +0 -12
  170. package/dist/packages/core/src/commands/command.d.ts +0 -12
  171. package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -12
  172. package/dist/packages/core/src/commands/deleteRange.d.ts +0 -12
  173. package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -12
  174. package/dist/packages/core/src/commands/enter.d.ts +0 -12
  175. package/dist/packages/core/src/commands/exitCode.d.ts +0 -12
  176. package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -13
  177. package/dist/packages/core/src/commands/first.d.ts +0 -12
  178. package/dist/packages/core/src/commands/focus.d.ts +0 -12
  179. package/dist/packages/core/src/commands/insertContent.d.ts +0 -12
  180. package/dist/packages/core/src/commands/insertHTML.d.ts +0 -12
  181. package/dist/packages/core/src/commands/insertNode.d.ts +0 -13
  182. package/dist/packages/core/src/commands/insertText.d.ts +0 -12
  183. package/dist/packages/core/src/commands/joinBackward.d.ts +0 -12
  184. package/dist/packages/core/src/commands/joinForward.d.ts +0 -12
  185. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -12
  186. package/dist/packages/core/src/commands/lift.d.ts +0 -13
  187. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -12
  188. package/dist/packages/core/src/commands/liftListItem.d.ts +0 -13
  189. package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -12
  190. package/dist/packages/core/src/commands/replace.d.ts +0 -13
  191. package/dist/packages/core/src/commands/replaceRange.d.ts +0 -13
  192. package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -13
  193. package/dist/packages/core/src/commands/resetNodeAttributes.d.ts +0 -13
  194. package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -12
  195. package/dist/packages/core/src/commands/selectAll.d.ts +0 -12
  196. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -12
  197. package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -12
  198. package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -12
  199. package/dist/packages/core/src/commands/setContent.d.ts +0 -12
  200. package/dist/packages/core/src/commands/setMark.d.ts +0 -13
  201. package/dist/packages/core/src/commands/setNode.d.ts +0 -13
  202. package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -13
  203. package/dist/packages/core/src/commands/splitBlock.d.ts +0 -14
  204. package/dist/packages/core/src/commands/splitListItem.d.ts +0 -13
  205. package/dist/packages/core/src/commands/toggleList.d.ts +0 -13
  206. package/dist/packages/core/src/commands/toggleMark.d.ts +0 -13
  207. package/dist/packages/core/src/commands/toggleNode.d.ts +0 -13
  208. package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -13
  209. package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -12
  210. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -12
  211. package/dist/packages/core/src/commands/unsetMark.d.ts +0 -13
  212. package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -13
  213. package/dist/packages/core/src/commands/updateNodeAttributes.d.ts +0 -13
  214. package/dist/packages/core/src/commands/wrapIn.d.ts +0 -13
  215. package/dist/packages/core/src/commands/wrapInList.d.ts +0 -13
  216. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -2
  217. package/dist/packages/core/src/extensions/commands.d.ts +0 -100
  218. package/dist/packages/core/src/extensions/editable.d.ts +0 -2
  219. package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
  220. package/dist/packages/core/src/extensions/index.d.ts +0 -5
  221. package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
  222. package/dist/packages/core/src/helpers/createDocument.d.ts +0 -4
  223. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -8
  224. package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -9
  225. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -8
  226. package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -2
  227. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
  228. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
  229. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -4
  230. package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
  231. package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
  232. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
  233. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -4
  234. package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
  235. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
  236. package/dist/packages/core/src/helpers/getSchema.d.ts +0 -3
  237. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -2
  238. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -2
  239. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -2
  240. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
  241. package/dist/packages/core/src/helpers/isActive.d.ts +0 -3
  242. package/dist/packages/core/src/helpers/isList.d.ts +0 -2
  243. package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -4
  244. package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -4
  245. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -2
  246. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
  247. package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
  248. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
  249. package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
  250. package/dist/packages/core/src/index.d.ts +0 -30
  251. package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -3
  252. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -3
  253. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -3
  254. package/dist/packages/core/src/style.d.ts +0 -2
  255. package/dist/packages/core/src/types.d.ts +0 -154
  256. package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -8
  257. package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
  258. package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -7
  259. package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
  260. package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
  261. package/dist/packages/core/src/utilities/isClass.d.ts +0 -1
  262. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
  263. package/dist/packages/core/src/utilities/isObject.d.ts +0 -1
  264. package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
  265. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -2
  266. package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -2
  267. package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
  268. package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -7
  269. package/dist/packages/core/src/utilities/removeElement.d.ts +0 -1
  270. package/dist/tiptap-core.bundle.umd.min.js +0 -17
  271. package/dist/tiptap-core.bundle.umd.min.js.map +0 -1
  272. package/dist/tiptap-core.cjs.js +0 -3027
  273. package/dist/tiptap-core.cjs.js.map +0 -1
  274. package/dist/tiptap-core.esm.js +0 -3002
  275. package/dist/tiptap-core.esm.js.map +0 -1
  276. package/dist/tiptap-core.umd.js +0 -3024
  277. package/dist/tiptap-core.umd.js.map +0 -1
  278. package/src/commands/insertHTML.ts +0 -30
  279. package/src/commands/insertNode.ts +0 -33
  280. package/src/commands/insertText.ts +0 -22
  281. package/src/commands/joinBackward.ts +0 -17
  282. package/src/commands/joinForward.ts +0 -17
  283. package/src/commands/replace.ts +0 -20
  284. package/src/commands/replaceRange.ts +0 -36
  285. package/src/commands/resetNodeAttributes.ts +0 -33
  286. package/src/commands/updateNodeAttributes.ts +0 -35
  287. package/src/utilities/isClass.ts +0 -7
  288. package/src/utilities/isObject.ts +0 -10
  289. package/src/utilities/removeElement.ts +0 -5
package/CHANGELOG.md DELETED
@@ -1,365 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.0.0-beta.21](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.20...@tiptap/core@2.0.0-beta.21) (2021-04-08)
7
-
8
- **Note:** Version bump only for package @tiptap/core
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0-beta.20](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.19...@tiptap/core@2.0.0-beta.20) (2021-04-07)
15
-
16
-
17
- ### Features
18
-
19
- * add resetAttributes() command, deprecate resetNodeAttributes() ([3334d93](https://github.com/ueberdosis/tiptap-next/commit/3334d930f30bd4acb5c314b4ec1934b6a1e0b712))
20
-
21
-
22
-
23
-
24
-
25
- # [2.0.0-beta.19](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.18...@tiptap/core@2.0.0-beta.19) (2021-04-07)
26
-
27
-
28
- ### Features
29
-
30
- * add updateAttributes() command, deprecate updateNodeAttributes(), fix [#254](https://github.com/ueberdosis/tiptap-next/issues/254) ([aac32b4](https://github.com/ueberdosis/tiptap-next/commit/aac32b4df6a1dfd93500e09d3433fcd8acad5fbe))
31
-
32
-
33
-
34
-
35
-
36
- # [2.0.0-beta.18](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.17...@tiptap/core@2.0.0-beta.18) (2021-04-07)
37
-
38
-
39
- ### Features
40
-
41
- * add priority option to extensions ([bb1ae65](https://github.com/ueberdosis/tiptap-next/commit/bb1ae659a463e97a7ada15af711347b5c004897a))
42
-
43
-
44
-
45
-
46
-
47
- # [2.0.0-beta.17](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.16...@tiptap/core@2.0.0-beta.17) (2021-04-07)
48
-
49
-
50
- ### Bug Fixes
51
-
52
- * remove debug log ([beb96c5](https://github.com/ueberdosis/tiptap-next/commit/beb96c5cbfdb81869763e23f82f5ab270c30f0ea))
53
-
54
-
55
-
56
-
57
-
58
- # [2.0.0-beta.16](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.15...@tiptap/core@2.0.0-beta.16) (2021-04-07)
59
-
60
-
61
- ### Features
62
-
63
- * add insertContent() command, deprecate insertText(), insertHTML() and insertNode() ([b8d9b7d](https://github.com/ueberdosis/tiptap-next/commit/b8d9b7d4c70b38fb9eec3c079be8243d30166e5e))
64
-
65
-
66
-
67
-
68
-
69
- # [2.0.0-beta.15](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.14...@tiptap/core@2.0.0-beta.15) (2021-04-06)
70
-
71
- **Note:** Version bump only for package @tiptap/core
72
-
73
-
74
-
75
-
76
-
77
- # [2.0.0-beta.14](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.13...@tiptap/core@2.0.0-beta.14) (2021-04-04)
78
-
79
- **Note:** Version bump only for package @tiptap/core
80
-
81
-
82
-
83
-
84
-
85
- # [2.0.0-beta.13](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.12...@tiptap/core@2.0.0-beta.13) (2021-04-02)
86
-
87
- **Note:** Version bump only for package @tiptap/core
88
-
89
-
90
-
91
-
92
-
93
- # [2.0.0-beta.12](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.11...@tiptap/core@2.0.0-beta.12) (2021-04-01)
94
-
95
- **Note:** Version bump only for package @tiptap/core
96
-
97
-
98
-
99
-
100
-
101
- # [2.0.0-beta.11](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.10...@tiptap/core@2.0.0-beta.11) (2021-04-01)
102
-
103
- **Note:** Version bump only for package @tiptap/core
104
-
105
-
106
-
107
-
108
-
109
- # [2.0.0-beta.10](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.9...@tiptap/core@2.0.0-beta.10) (2021-03-31)
110
-
111
- **Note:** Version bump only for package @tiptap/core
112
-
113
-
114
-
115
-
116
-
117
- # [2.0.0-beta.9](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.8...@tiptap/core@2.0.0-beta.9) (2021-03-28)
118
-
119
- **Note:** Version bump only for package @tiptap/core
120
-
121
-
122
-
123
-
124
-
125
- # [2.0.0-beta.8](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.7...@tiptap/core@2.0.0-beta.8) (2021-03-28)
126
-
127
- **Note:** Version bump only for package @tiptap/core
128
-
129
-
130
-
131
-
132
-
133
- # [2.0.0-beta.7](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.6...@tiptap/core@2.0.0-beta.7) (2021-03-28)
134
-
135
- **Note:** Version bump only for package @tiptap/core
136
-
137
-
138
-
139
-
140
-
141
- # [2.0.0-beta.6](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.5...@tiptap/core@2.0.0-beta.6) (2021-03-24)
142
-
143
- **Note:** Version bump only for package @tiptap/core
144
-
145
-
146
-
147
-
148
-
149
- # [2.0.0-beta.5](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.4...@tiptap/core@2.0.0-beta.5) (2021-03-18)
150
-
151
- **Note:** Version bump only for package @tiptap/core
152
-
153
-
154
-
155
-
156
-
157
- # [2.0.0-beta.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.3...@tiptap/core@2.0.0-beta.4) (2021-03-18)
158
-
159
- **Note:** Version bump only for package @tiptap/core
160
-
161
-
162
-
163
-
164
-
165
- # [2.0.0-beta.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.2...@tiptap/core@2.0.0-beta.3) (2021-03-16)
166
-
167
- **Note:** Version bump only for package @tiptap/core
168
-
169
-
170
-
171
-
172
-
173
- # [2.0.0-beta.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-beta.1...@tiptap/core@2.0.0-beta.2) (2021-03-09)
174
-
175
- **Note:** Version bump only for package @tiptap/core
176
-
177
-
178
-
179
-
180
-
181
- # [2.0.0-beta.1](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.22...@tiptap/core@2.0.0-beta.1) (2021-03-05)
182
-
183
- **Note:** Version bump only for package @tiptap/core
184
-
185
-
186
-
187
-
188
-
189
- # [2.0.0-alpha.22](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.21...@tiptap/core@2.0.0-alpha.22) (2021-02-28)
190
-
191
- **Note:** Version bump only for package @tiptap/core
192
-
193
-
194
-
195
-
196
-
197
- # [2.0.0-alpha.21](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.20...@tiptap/core@2.0.0-alpha.21) (2021-02-26)
198
-
199
- **Note:** Version bump only for package @tiptap/core
200
-
201
-
202
-
203
-
204
-
205
- # [2.0.0-alpha.20](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.19...@tiptap/core@2.0.0-alpha.20) (2021-02-26)
206
-
207
- **Note:** Version bump only for package @tiptap/core
208
-
209
-
210
-
211
-
212
-
213
- # [2.0.0-alpha.19](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.18...@tiptap/core@2.0.0-alpha.19) (2021-02-18)
214
-
215
- **Note:** Version bump only for package @tiptap/core
216
-
217
-
218
-
219
-
220
-
221
- # [2.0.0-alpha.18](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.17...@tiptap/core@2.0.0-alpha.18) (2021-02-16)
222
-
223
- **Note:** Version bump only for package @tiptap/core
224
-
225
-
226
-
227
-
228
-
229
- # [2.0.0-alpha.17](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.16...@tiptap/core@2.0.0-alpha.17) (2021-02-16)
230
-
231
- **Note:** Version bump only for package @tiptap/core
232
-
233
-
234
-
235
-
236
-
237
- # [2.0.0-alpha.16](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.15...@tiptap/core@2.0.0-alpha.16) (2021-02-07)
238
-
239
- **Note:** Version bump only for package @tiptap/core
240
-
241
-
242
-
243
-
244
-
245
- # [2.0.0-alpha.15](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.14...@tiptap/core@2.0.0-alpha.15) (2021-02-05)
246
-
247
- **Note:** Version bump only for package @tiptap/core
248
-
249
-
250
-
251
-
252
-
253
- # [2.0.0-alpha.14](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.13...@tiptap/core@2.0.0-alpha.14) (2021-01-29)
254
-
255
- **Note:** Version bump only for package @tiptap/core
256
-
257
-
258
-
259
-
260
-
261
- # [2.0.0-alpha.13](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.12...@tiptap/core@2.0.0-alpha.13) (2021-01-29)
262
-
263
- **Note:** Version bump only for package @tiptap/core
264
-
265
-
266
-
267
-
268
-
269
- # [2.0.0-alpha.12](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.11...@tiptap/core@2.0.0-alpha.12) (2021-01-28)
270
-
271
- **Note:** Version bump only for package @tiptap/core
272
-
273
-
274
-
275
-
276
-
277
- # [2.0.0-alpha.11](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.10...@tiptap/core@2.0.0-alpha.11) (2021-01-28)
278
-
279
-
280
- ### Bug Fixes
281
-
282
- * don’t merge classes ([dba0c1a](https://github.com/ueberdosis/tiptap-next/commit/dba0c1ac15e9beda3ebd027c67c969a4fe7ae7c7))
283
-
284
-
285
-
286
-
287
-
288
- # [2.0.0-alpha.10](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.9...@tiptap/core@2.0.0-alpha.10) (2021-01-06)
289
-
290
- **Note:** Version bump only for package @tiptap/core
291
-
292
-
293
-
294
-
295
-
296
- # [2.0.0-alpha.9](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.8...@tiptap/core@2.0.0-alpha.9) (2020-12-18)
297
-
298
- **Note:** Version bump only for package @tiptap/core
299
-
300
-
301
-
302
-
303
-
304
- # [2.0.0-alpha.8](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.7...@tiptap/core@2.0.0-alpha.8) (2020-12-18)
305
-
306
- **Note:** Version bump only for package @tiptap/core
307
-
308
-
309
-
310
-
311
-
312
- # [2.0.0-alpha.7](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.6...@tiptap/core@2.0.0-alpha.7) (2020-12-02)
313
-
314
- **Note:** Version bump only for package @tiptap/core
315
-
316
-
317
-
318
-
319
-
320
- # [2.0.0-alpha.6](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.5...@tiptap/core@2.0.0-alpha.6) (2020-11-19)
321
-
322
- **Note:** Version bump only for package @tiptap/core
323
-
324
-
325
-
326
-
327
-
328
- # [2.0.0-alpha.5](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.4...@tiptap/core@2.0.0-alpha.5) (2020-11-18)
329
-
330
- **Note:** Version bump only for package @tiptap/core
331
-
332
-
333
-
334
-
335
-
336
- # [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.3...@tiptap/core@2.0.0-alpha.4) (2020-11-16)
337
-
338
- **Note:** Version bump only for package @tiptap/core
339
-
340
-
341
-
342
-
343
-
344
- # [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.2...@tiptap/core@2.0.0-alpha.3) (2020-11-16)
345
-
346
-
347
- ### Reverts
348
-
349
- * Revert "use global namespace" ([0c9ce26](https://github.com/ueberdosis/tiptap-next/commit/0c9ce26c02c07d88a757c01b0a9d7f9e2b0b7502))
350
-
351
-
352
-
353
-
354
-
355
- # [2.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.1...@tiptap/core@2.0.0-alpha.2) (2020-11-16)
356
-
357
- **Note:** Version bump only for package @tiptap/core
358
-
359
-
360
-
361
-
362
-
363
- # [2.0.0-alpha.1](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/core@2.0.0-alpha.0...@tiptap/core@2.0.0-alpha.1) (2020-11-16)
364
-
365
- **Note:** Version bump only for package @tiptap/core
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020, überdosis GbR
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.
@@ -1,13 +0,0 @@
1
- import { EditorState, Transaction } from 'prosemirror-state';
2
- import { Editor } from './Editor';
3
- import { SingleCommands, ChainedCommands, CanCommands, RawCommands, CommandProps } from './types';
4
- export default class CommandManager {
5
- editor: Editor;
6
- commands: RawCommands;
7
- constructor(editor: Editor, commands: RawCommands);
8
- createCommands(): SingleCommands;
9
- createChain(startTr?: Transaction, shouldDispatch?: boolean): ChainedCommands;
10
- createCan(startTr?: Transaction): CanCommands;
11
- buildProps(tr: Transaction, shouldDispatch?: boolean): CommandProps;
12
- chainableState(tr: Transaction, state: EditorState): EditorState;
13
- }
@@ -1,142 +0,0 @@
1
- import { EditorState, Plugin, PluginKey, Transaction } from 'prosemirror-state';
2
- import { EditorView } from 'prosemirror-view';
3
- import { Schema } from 'prosemirror-model';
4
- import ExtensionManager from './ExtensionManager';
5
- import EventEmitter from './EventEmitter';
6
- import { EditorOptions, CanCommands, ChainedCommands, SingleCommands, AnyObject } from './types';
7
- import * as extensions from './extensions';
8
- export { extensions };
9
- export interface HTMLElement {
10
- editor?: Editor;
11
- }
12
- export declare class Editor extends EventEmitter {
13
- private commandManager;
14
- extensionManager: ExtensionManager;
15
- private css;
16
- schema: Schema;
17
- view: EditorView;
18
- isFocused: boolean;
19
- private resizeObserver;
20
- options: EditorOptions;
21
- constructor(options?: Partial<EditorOptions>);
22
- /**
23
- * An object of all registered commands.
24
- */
25
- get commands(): SingleCommands;
26
- /**
27
- * Create a command chain to call multiple commands at once.
28
- */
29
- chain(): ChainedCommands;
30
- /**
31
- * Check if a command or a command chain can be executed. Without executing it.
32
- */
33
- can(): CanCommands;
34
- /**
35
- * Inject CSS styles.
36
- */
37
- private injectCSS;
38
- /**
39
- * Update editor options.
40
- *
41
- * @param options A list of options
42
- */
43
- setOptions(options?: Partial<EditorOptions>): void;
44
- /**
45
- * Update editable state of the editor.
46
- */
47
- setEditable(editable: boolean): void;
48
- /**
49
- * Returns whether the editor is editable.
50
- */
51
- get isEditable(): boolean;
52
- /**
53
- * Returns the editor state.
54
- */
55
- get state(): EditorState;
56
- /**
57
- * Register a ProseMirror plugin.
58
- *
59
- * @param plugin A ProseMirror plugin
60
- * @param handlePlugins Control how to merge the plugin into the existing plugins.
61
- */
62
- registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void;
63
- /**
64
- * Unregister a ProseMirror plugin.
65
- *
66
- * @param name The plugins name
67
- */
68
- unregisterPlugin(nameOrPluginKey: string | PluginKey): void;
69
- /**
70
- * Creates an extension manager.
71
- */
72
- private createExtensionManager;
73
- /**
74
- * Creates an command manager.
75
- */
76
- private createCommandManager;
77
- /**
78
- * Creates a ProseMirror schema.
79
- */
80
- private createSchema;
81
- /**
82
- * Creates a ProseMirror view.
83
- */
84
- private createView;
85
- /**
86
- * Creates all node views.
87
- */
88
- createNodeViews(): void;
89
- isCapturingTransaction: boolean;
90
- private capturedTransaction;
91
- captureTransaction(fn: Function): Transaction<any> | null;
92
- /**
93
- * The callback over which to send transactions (state updates) produced by the view.
94
- *
95
- * @param transaction An editor state transaction
96
- */
97
- private dispatchTransaction;
98
- /**
99
- * Get attributes of the currently selected node.
100
- *
101
- * @param name Name of the node
102
- */
103
- getNodeAttributes(name: string): AnyObject;
104
- /**
105
- * Get attributes of the currently selected mark.
106
- *
107
- * @param name Name of the mark
108
- */
109
- getMarkAttributes(name: string): AnyObject;
110
- /**
111
- * Returns if the currently selected node or mark is active.
112
- *
113
- * @param name Name of the node or mark
114
- * @param attributes Attributes of the node or mark
115
- */
116
- isActive(name: string, attributes?: {}): boolean;
117
- isActive(attributes: {}): boolean;
118
- /**
119
- * Get the document as JSON.
120
- */
121
- getJSON(): AnyObject;
122
- /**
123
- * Get the document as HTML.
124
- */
125
- getHTML(): string;
126
- /**
127
- * Check if there is no content.
128
- */
129
- get isEmpty(): boolean;
130
- /**
131
- * Get the number of characters for the current document.
132
- */
133
- getCharacterCount(): number;
134
- /**
135
- * Destroy the editor.
136
- */
137
- destroy(): void;
138
- /**
139
- * Check if the editor is already destroyed.
140
- */
141
- get isDestroyed(): boolean;
142
- }
@@ -1,7 +0,0 @@
1
- export default class EventEmitter {
2
- private callbacks;
3
- on(event: string, fn: Function): this;
4
- protected emit(event: string, ...args: any): this;
5
- off(event: string, fn?: Function): this;
6
- protected removeAllListeners(): void;
7
- }
@@ -1,148 +0,0 @@
1
- import { Plugin, Transaction } from 'prosemirror-state';
2
- import { Command as ProseMirrorCommand } from 'prosemirror-commands';
3
- import { InputRule } from 'prosemirror-inputrules';
4
- import { Editor } from './Editor';
5
- import { Node } from './Node';
6
- import { GlobalAttributes, RawCommands } from './types';
7
- import { ExtensionConfig } from '.';
8
- declare module '@tiptap/core' {
9
- interface ExtensionConfig<Options = any> {
10
- [key: string]: any;
11
- /**
12
- * Name
13
- */
14
- name: string;
15
- /**
16
- * Priority
17
- */
18
- priority?: number;
19
- /**
20
- * Default options
21
- */
22
- defaultOptions?: Options;
23
- /**
24
- * Global attributes
25
- */
26
- addGlobalAttributes?: (this: {
27
- options: Options;
28
- }) => GlobalAttributes | {};
29
- /**
30
- * Raw
31
- */
32
- addCommands?: (this: {
33
- options: Options;
34
- editor: Editor;
35
- }) => Partial<RawCommands>;
36
- /**
37
- * Keyboard shortcuts
38
- */
39
- addKeyboardShortcuts?: (this: {
40
- options: Options;
41
- editor: Editor;
42
- }) => {
43
- [key: string]: ProseMirrorCommand;
44
- };
45
- /**
46
- * Input rules
47
- */
48
- addInputRules?: (this: {
49
- options: Options;
50
- editor: Editor;
51
- }) => InputRule[];
52
- /**
53
- * Paste rules
54
- */
55
- addPasteRules?: (this: {
56
- options: Options;
57
- editor: Editor;
58
- }) => Plugin[];
59
- /**
60
- * ProseMirror plugins
61
- */
62
- addProseMirrorPlugins?: (this: {
63
- options: Options;
64
- editor: Editor;
65
- }) => Plugin[];
66
- /**
67
- * Extend Node Schema
68
- */
69
- extendNodeSchema?: ((this: {
70
- options: Options;
71
- }, extension: Node) => {
72
- [key: string]: any;
73
- }) | null;
74
- /**
75
- * Extend Mark Schema
76
- */
77
- extendMarkSchema?: ((this: {
78
- options: Options;
79
- }, extension: Node) => {
80
- [key: string]: any;
81
- }) | null;
82
- /**
83
- * The editor is ready.
84
- */
85
- onCreate?: ((this: {
86
- options: Options;
87
- editor: Editor;
88
- }) => void) | null;
89
- /**
90
- * The content has changed.
91
- */
92
- onUpdate?: ((this: {
93
- options: Options;
94
- editor: Editor;
95
- }) => void) | null;
96
- /**
97
- * The selection has changed.
98
- */
99
- onSelectionUpdate?: ((this: {
100
- options: Options;
101
- editor: Editor;
102
- }) => void) | null;
103
- /**
104
- * The editor state has changed.
105
- */
106
- onTransaction?: ((this: {
107
- options: Options;
108
- editor: Editor;
109
- }, props: {
110
- transaction: Transaction;
111
- }) => void) | null;
112
- /**
113
- * The editor is focused.
114
- */
115
- onFocus?: ((this: {
116
- options: Options;
117
- editor: Editor;
118
- }, props: {
119
- event: FocusEvent;
120
- }) => void) | null;
121
- /**
122
- * The editor isn’t focused anymore.
123
- */
124
- onBlur?: ((this: {
125
- options: Options;
126
- editor: Editor;
127
- }, props: {
128
- event: FocusEvent;
129
- }) => void) | null;
130
- /**
131
- * The editor is destroyed.
132
- */
133
- onDestroy?: ((this: {
134
- options: Options;
135
- editor: Editor;
136
- }) => void) | null;
137
- }
138
- }
139
- export declare class Extension<Options = any> {
140
- #private;
141
- type: string;
142
- config: ExtensionConfig;
143
- options: Options;
144
- constructor(config: ExtensionConfig<Options>);
145
- static create<O>(config: ExtensionConfig<O>): Extension<O>;
146
- configure(options?: Partial<Options>): Extension<Options>;
147
- extend<ExtendedOptions = Options>(extendedConfig: Partial<ExtensionConfig<ExtendedOptions>>): Extension<ExtendedOptions>;
148
- }