@domternal/core 0.5.1 → 0.6.0

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 (387) hide show
  1. package/README.md +5 -4
  2. package/dist/index.cjs +16 -0
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +1 -0
  5. package/dist/index.d.ts +5845 -23
  6. package/dist/index.js +16 -0
  7. package/dist/index.js.map +1 -1
  8. package/package.json +14 -12
  9. package/dist/CanChecker.d.ts +0 -79
  10. package/dist/CanChecker.d.ts.map +0 -1
  11. package/dist/CanChecker.test.d.ts +0 -2
  12. package/dist/CanChecker.test.d.ts.map +0 -1
  13. package/dist/ChainBuilder.d.ts +0 -119
  14. package/dist/ChainBuilder.d.ts.map +0 -1
  15. package/dist/ChainBuilder.test.d.ts +0 -2
  16. package/dist/ChainBuilder.test.d.ts.map +0 -1
  17. package/dist/CommandManager.d.ts +0 -86
  18. package/dist/CommandManager.d.ts.map +0 -1
  19. package/dist/CommandManager.test.d.ts +0 -2
  20. package/dist/CommandManager.test.d.ts.map +0 -1
  21. package/dist/Editor.d.ts +0 -262
  22. package/dist/Editor.d.ts.map +0 -1
  23. package/dist/Editor.test.d.ts +0 -2
  24. package/dist/Editor.test.d.ts.map +0 -1
  25. package/dist/EventEmitter.d.ts +0 -57
  26. package/dist/EventEmitter.d.ts.map +0 -1
  27. package/dist/EventEmitter.test.d.ts +0 -2
  28. package/dist/EventEmitter.test.d.ts.map +0 -1
  29. package/dist/Extension.d.ts +0 -171
  30. package/dist/Extension.d.ts.map +0 -1
  31. package/dist/Extension.test.d.ts +0 -2
  32. package/dist/Extension.test.d.ts.map +0 -1
  33. package/dist/ExtensionManager.d.ts +0 -283
  34. package/dist/ExtensionManager.d.ts.map +0 -1
  35. package/dist/ExtensionManager.test.d.ts +0 -2
  36. package/dist/ExtensionManager.test.d.ts.map +0 -1
  37. package/dist/Mark.d.ts +0 -164
  38. package/dist/Mark.d.ts.map +0 -1
  39. package/dist/Mark.test.d.ts +0 -5
  40. package/dist/Mark.test.d.ts.map +0 -1
  41. package/dist/Node.d.ts +0 -153
  42. package/dist/Node.d.ts.map +0 -1
  43. package/dist/Node.test.d.ts +0 -2
  44. package/dist/Node.test.d.ts.map +0 -1
  45. package/dist/ToolbarController.d.ts +0 -169
  46. package/dist/ToolbarController.d.ts.map +0 -1
  47. package/dist/ToolbarController.test.d.ts +0 -2
  48. package/dist/ToolbarController.test.d.ts.map +0 -1
  49. package/dist/commandPropsBuilder.d.ts +0 -70
  50. package/dist/commandPropsBuilder.d.ts.map +0 -1
  51. package/dist/commandPropsBuilder.test.d.ts +0 -2
  52. package/dist/commandPropsBuilder.test.d.ts.map +0 -1
  53. package/dist/commands/attributeCommands.d.ts +0 -24
  54. package/dist/commands/attributeCommands.d.ts.map +0 -1
  55. package/dist/commands/attributeCommands.test.d.ts +0 -2
  56. package/dist/commands/attributeCommands.test.d.ts.map +0 -1
  57. package/dist/commands/builtIn.test.d.ts +0 -2
  58. package/dist/commands/builtIn.test.d.ts.map +0 -1
  59. package/dist/commands/contentCommands.d.ts +0 -52
  60. package/dist/commands/contentCommands.d.ts.map +0 -1
  61. package/dist/commands/contentCommands.test.d.ts +0 -2
  62. package/dist/commands/contentCommands.test.d.ts.map +0 -1
  63. package/dist/commands/index.d.ts +0 -43
  64. package/dist/commands/index.d.ts.map +0 -1
  65. package/dist/commands/listCommands.d.ts +0 -15
  66. package/dist/commands/listCommands.d.ts.map +0 -1
  67. package/dist/commands/listCommands.test.d.ts +0 -2
  68. package/dist/commands/listCommands.test.d.ts.map +0 -1
  69. package/dist/commands/markCommands.d.ts +0 -40
  70. package/dist/commands/markCommands.d.ts.map +0 -1
  71. package/dist/commands/markCommands.test.d.ts +0 -2
  72. package/dist/commands/markCommands.test.d.ts.map +0 -1
  73. package/dist/commands/nodeCommands.d.ts +0 -53
  74. package/dist/commands/nodeCommands.d.ts.map +0 -1
  75. package/dist/commands/nodeCommands.test.d.ts +0 -2
  76. package/dist/commands/nodeCommands.test.d.ts.map +0 -1
  77. package/dist/commands/selectionCommands.d.ts +0 -37
  78. package/dist/commands/selectionCommands.d.ts.map +0 -1
  79. package/dist/commands/selectionCommands.test.d.ts +0 -2
  80. package/dist/commands/selectionCommands.test.d.ts.map +0 -1
  81. package/dist/extensions/BaseKeymap.d.ts +0 -36
  82. package/dist/extensions/BaseKeymap.d.ts.map +0 -1
  83. package/dist/extensions/BaseKeymap.test.d.ts +0 -2
  84. package/dist/extensions/BaseKeymap.test.d.ts.map +0 -1
  85. package/dist/extensions/BubbleMenu.d.ts +0 -85
  86. package/dist/extensions/BubbleMenu.d.ts.map +0 -1
  87. package/dist/extensions/BubbleMenu.test.d.ts +0 -2
  88. package/dist/extensions/BubbleMenu.test.d.ts.map +0 -1
  89. package/dist/extensions/CharacterCount.d.ts +0 -60
  90. package/dist/extensions/CharacterCount.d.ts.map +0 -1
  91. package/dist/extensions/CharacterCount.test.d.ts +0 -2
  92. package/dist/extensions/CharacterCount.test.d.ts.map +0 -1
  93. package/dist/extensions/ClearFormatting.d.ts +0 -25
  94. package/dist/extensions/ClearFormatting.d.ts.map +0 -1
  95. package/dist/extensions/ClearFormatting.test.d.ts +0 -2
  96. package/dist/extensions/ClearFormatting.test.d.ts.map +0 -1
  97. package/dist/extensions/Dropcursor.d.ts +0 -20
  98. package/dist/extensions/Dropcursor.d.ts.map +0 -1
  99. package/dist/extensions/Dropcursor.test.d.ts +0 -2
  100. package/dist/extensions/Dropcursor.test.d.ts.map +0 -1
  101. package/dist/extensions/FloatingMenu.d.ts +0 -74
  102. package/dist/extensions/FloatingMenu.d.ts.map +0 -1
  103. package/dist/extensions/FloatingMenu.test.d.ts +0 -2
  104. package/dist/extensions/FloatingMenu.test.d.ts.map +0 -1
  105. package/dist/extensions/Focus.d.ts +0 -26
  106. package/dist/extensions/Focus.d.ts.map +0 -1
  107. package/dist/extensions/Focus.test.d.ts +0 -2
  108. package/dist/extensions/Focus.test.d.ts.map +0 -1
  109. package/dist/extensions/FontFamily.d.ts +0 -41
  110. package/dist/extensions/FontFamily.d.ts.map +0 -1
  111. package/dist/extensions/FontFamily.test.d.ts +0 -2
  112. package/dist/extensions/FontFamily.test.d.ts.map +0 -1
  113. package/dist/extensions/FontSize.d.ts +0 -46
  114. package/dist/extensions/FontSize.d.ts.map +0 -1
  115. package/dist/extensions/FontSize.test.d.ts +0 -2
  116. package/dist/extensions/FontSize.test.d.ts.map +0 -1
  117. package/dist/extensions/Gapcursor.d.ts +0 -3
  118. package/dist/extensions/Gapcursor.d.ts.map +0 -1
  119. package/dist/extensions/Gapcursor.test.d.ts +0 -2
  120. package/dist/extensions/Gapcursor.test.d.ts.map +0 -1
  121. package/dist/extensions/Highlight.d.ts +0 -61
  122. package/dist/extensions/Highlight.d.ts.map +0 -1
  123. package/dist/extensions/Highlight.test.d.ts +0 -2
  124. package/dist/extensions/Highlight.test.d.ts.map +0 -1
  125. package/dist/extensions/History.d.ts +0 -22
  126. package/dist/extensions/History.d.ts.map +0 -1
  127. package/dist/extensions/History.test.d.ts +0 -2
  128. package/dist/extensions/History.test.d.ts.map +0 -1
  129. package/dist/extensions/InvisibleChars.d.ts +0 -86
  130. package/dist/extensions/InvisibleChars.d.ts.map +0 -1
  131. package/dist/extensions/InvisibleChars.test.d.ts +0 -2
  132. package/dist/extensions/InvisibleChars.test.d.ts.map +0 -1
  133. package/dist/extensions/LineHeight.d.ts +0 -50
  134. package/dist/extensions/LineHeight.d.ts.map +0 -1
  135. package/dist/extensions/LineHeight.test.d.ts +0 -2
  136. package/dist/extensions/LineHeight.test.d.ts.map +0 -1
  137. package/dist/extensions/LinkPopover.d.ts +0 -10
  138. package/dist/extensions/LinkPopover.d.ts.map +0 -1
  139. package/dist/extensions/ListKeymap.d.ts +0 -10
  140. package/dist/extensions/ListKeymap.d.ts.map +0 -1
  141. package/dist/extensions/ListKeymap.test.d.ts +0 -2
  142. package/dist/extensions/ListKeymap.test.d.ts.map +0 -1
  143. package/dist/extensions/Placeholder.d.ts +0 -47
  144. package/dist/extensions/Placeholder.d.ts.map +0 -1
  145. package/dist/extensions/Placeholder.test.d.ts +0 -2
  146. package/dist/extensions/Placeholder.test.d.ts.map +0 -1
  147. package/dist/extensions/Selection.d.ts +0 -71
  148. package/dist/extensions/Selection.d.ts.map +0 -1
  149. package/dist/extensions/Selection.test.d.ts +0 -2
  150. package/dist/extensions/Selection.test.d.ts.map +0 -1
  151. package/dist/extensions/SelectionDecoration.d.ts +0 -18
  152. package/dist/extensions/SelectionDecoration.d.ts.map +0 -1
  153. package/dist/extensions/SelectionDecoration.test.d.ts +0 -2
  154. package/dist/extensions/SelectionDecoration.test.d.ts.map +0 -1
  155. package/dist/extensions/StarterKit.d.ts +0 -144
  156. package/dist/extensions/StarterKit.d.ts.map +0 -1
  157. package/dist/extensions/StarterKit.test.d.ts +0 -2
  158. package/dist/extensions/StarterKit.test.d.ts.map +0 -1
  159. package/dist/extensions/TextAlign.d.ts +0 -32
  160. package/dist/extensions/TextAlign.d.ts.map +0 -1
  161. package/dist/extensions/TextAlign.test.d.ts +0 -2
  162. package/dist/extensions/TextAlign.test.d.ts.map +0 -1
  163. package/dist/extensions/TextColor.d.ts +0 -55
  164. package/dist/extensions/TextColor.d.ts.map +0 -1
  165. package/dist/extensions/TextColor.test.d.ts +0 -2
  166. package/dist/extensions/TextColor.test.d.ts.map +0 -1
  167. package/dist/extensions/TrailingNode.d.ts +0 -16
  168. package/dist/extensions/TrailingNode.d.ts.map +0 -1
  169. package/dist/extensions/TrailingNode.test.d.ts +0 -2
  170. package/dist/extensions/TrailingNode.test.d.ts.map +0 -1
  171. package/dist/extensions/Typography.d.ts +0 -65
  172. package/dist/extensions/Typography.d.ts.map +0 -1
  173. package/dist/extensions/Typography.test.d.ts +0 -2
  174. package/dist/extensions/Typography.test.d.ts.map +0 -1
  175. package/dist/extensions/UniqueID.d.ts +0 -48
  176. package/dist/extensions/UniqueID.d.ts.map +0 -1
  177. package/dist/extensions/UniqueID.test.d.ts +0 -2
  178. package/dist/extensions/UniqueID.test.d.ts.map +0 -1
  179. package/dist/extensions/index.d.ts +0 -29
  180. package/dist/extensions/index.d.ts.map +0 -1
  181. package/dist/extensions/isActive-markExclusion.test.d.ts +0 -2
  182. package/dist/extensions/isActive-markExclusion.test.d.ts.map +0 -1
  183. package/dist/helpers/callOrReturn.d.ts +0 -30
  184. package/dist/helpers/callOrReturn.d.ts.map +0 -1
  185. package/dist/helpers/callOrReturn.test.d.ts +0 -2
  186. package/dist/helpers/callOrReturn.test.d.ts.map +0 -1
  187. package/dist/helpers/createDocument.d.ts +0 -48
  188. package/dist/helpers/createDocument.d.ts.map +0 -1
  189. package/dist/helpers/createDocument.test.d.ts +0 -2
  190. package/dist/helpers/createDocument.test.d.ts.map +0 -1
  191. package/dist/helpers/defaultBlockAt.d.ts +0 -15
  192. package/dist/helpers/defaultBlockAt.d.ts.map +0 -1
  193. package/dist/helpers/defaultBlockAt.test.d.ts +0 -2
  194. package/dist/helpers/defaultBlockAt.test.d.ts.map +0 -1
  195. package/dist/helpers/findChildren.d.ts +0 -13
  196. package/dist/helpers/findChildren.d.ts.map +0 -1
  197. package/dist/helpers/findChildren.test.d.ts +0 -2
  198. package/dist/helpers/findChildren.test.d.ts.map +0 -1
  199. package/dist/helpers/findParentNode.d.ts +0 -21
  200. package/dist/helpers/findParentNode.d.ts.map +0 -1
  201. package/dist/helpers/findParentNode.test.d.ts +0 -2
  202. package/dist/helpers/findParentNode.test.d.ts.map +0 -1
  203. package/dist/helpers/getMarkRange.d.ts +0 -17
  204. package/dist/helpers/getMarkRange.d.ts.map +0 -1
  205. package/dist/helpers/getMarkRange.test.d.ts +0 -2
  206. package/dist/helpers/getMarkRange.test.d.ts.map +0 -1
  207. package/dist/helpers/index.d.ts +0 -18
  208. package/dist/helpers/index.d.ts.map +0 -1
  209. package/dist/helpers/inputRulesPlugin.d.ts +0 -26
  210. package/dist/helpers/inputRulesPlugin.d.ts.map +0 -1
  211. package/dist/helpers/isNodeEmpty.d.ts +0 -52
  212. package/dist/helpers/isNodeEmpty.d.ts.map +0 -1
  213. package/dist/helpers/isNodeEmpty.test.d.ts +0 -2
  214. package/dist/helpers/isNodeEmpty.test.d.ts.map +0 -1
  215. package/dist/helpers/isValidUrl.d.ts +0 -31
  216. package/dist/helpers/isValidUrl.d.ts.map +0 -1
  217. package/dist/helpers/isValidUrl.test.d.ts +0 -2
  218. package/dist/helpers/isValidUrl.test.d.ts.map +0 -1
  219. package/dist/helpers/markInputRule.d.ts +0 -88
  220. package/dist/helpers/markInputRule.d.ts.map +0 -1
  221. package/dist/helpers/markInputRule.test.d.ts +0 -2
  222. package/dist/helpers/markInputRule.test.d.ts.map +0 -1
  223. package/dist/helpers/nodeInputRule.d.ts +0 -41
  224. package/dist/helpers/nodeInputRule.d.ts.map +0 -1
  225. package/dist/helpers/normalizeColor.d.ts +0 -7
  226. package/dist/helpers/normalizeColor.d.ts.map +0 -1
  227. package/dist/helpers/normalizeColor.test.d.ts +0 -2
  228. package/dist/helpers/normalizeColor.test.d.ts.map +0 -1
  229. package/dist/helpers/specBuilder.d.ts +0 -28
  230. package/dist/helpers/specBuilder.d.ts.map +0 -1
  231. package/dist/helpers/specBuilder.test.d.ts +0 -2
  232. package/dist/helpers/specBuilder.test.d.ts.map +0 -1
  233. package/dist/helpers/ssr.d.ts +0 -80
  234. package/dist/helpers/ssr.d.ts.map +0 -1
  235. package/dist/helpers/ssr.test.d.ts +0 -2
  236. package/dist/helpers/ssr.test.d.ts.map +0 -1
  237. package/dist/helpers/textInputRule.d.ts +0 -34
  238. package/dist/helpers/textInputRule.d.ts.map +0 -1
  239. package/dist/helpers/textblockTypeInputRule.d.ts +0 -41
  240. package/dist/helpers/textblockTypeInputRule.d.ts.map +0 -1
  241. package/dist/helpers/wrappingInputRule.d.ts +0 -66
  242. package/dist/helpers/wrappingInputRule.d.ts.map +0 -1
  243. package/dist/icons/index.d.ts +0 -2
  244. package/dist/icons/index.d.ts.map +0 -1
  245. package/dist/icons/phosphor.d.ts +0 -3
  246. package/dist/icons/phosphor.d.ts.map +0 -1
  247. package/dist/index.d.ts.map +0 -1
  248. package/dist/index.test.d.ts +0 -2
  249. package/dist/index.test.d.ts.map +0 -1
  250. package/dist/marks/Bold.d.ts +0 -40
  251. package/dist/marks/Bold.d.ts.map +0 -1
  252. package/dist/marks/Bold.test.d.ts +0 -2
  253. package/dist/marks/Bold.test.d.ts.map +0 -1
  254. package/dist/marks/Code.d.ts +0 -40
  255. package/dist/marks/Code.d.ts.map +0 -1
  256. package/dist/marks/Code.test.d.ts +0 -2
  257. package/dist/marks/Code.test.d.ts.map +0 -1
  258. package/dist/marks/Italic.d.ts +0 -40
  259. package/dist/marks/Italic.d.ts.map +0 -1
  260. package/dist/marks/Italic.test.d.ts +0 -2
  261. package/dist/marks/Italic.test.d.ts.map +0 -1
  262. package/dist/marks/Link.d.ts +0 -75
  263. package/dist/marks/Link.d.ts.map +0 -1
  264. package/dist/marks/Link.test.d.ts +0 -2
  265. package/dist/marks/Link.test.d.ts.map +0 -1
  266. package/dist/marks/Strike.d.ts +0 -39
  267. package/dist/marks/Strike.d.ts.map +0 -1
  268. package/dist/marks/Strike.test.d.ts +0 -2
  269. package/dist/marks/Strike.test.d.ts.map +0 -1
  270. package/dist/marks/Subscript.d.ts +0 -38
  271. package/dist/marks/Subscript.d.ts.map +0 -1
  272. package/dist/marks/Subscript.test.d.ts +0 -2
  273. package/dist/marks/Subscript.test.d.ts.map +0 -1
  274. package/dist/marks/Superscript.d.ts +0 -38
  275. package/dist/marks/Superscript.d.ts.map +0 -1
  276. package/dist/marks/Superscript.test.d.ts +0 -2
  277. package/dist/marks/Superscript.test.d.ts.map +0 -1
  278. package/dist/marks/TextStyle.d.ts +0 -41
  279. package/dist/marks/TextStyle.d.ts.map +0 -1
  280. package/dist/marks/TextStyle.test.d.ts +0 -2
  281. package/dist/marks/TextStyle.test.d.ts.map +0 -1
  282. package/dist/marks/Underline.d.ts +0 -38
  283. package/dist/marks/Underline.d.ts.map +0 -1
  284. package/dist/marks/Underline.test.d.ts +0 -2
  285. package/dist/marks/Underline.test.d.ts.map +0 -1
  286. package/dist/marks/helpers/autolinkPlugin.d.ts +0 -48
  287. package/dist/marks/helpers/autolinkPlugin.d.ts.map +0 -1
  288. package/dist/marks/helpers/autolinkPlugin.test.d.ts +0 -2
  289. package/dist/marks/helpers/autolinkPlugin.test.d.ts.map +0 -1
  290. package/dist/marks/helpers/index.d.ts +0 -10
  291. package/dist/marks/helpers/index.d.ts.map +0 -1
  292. package/dist/marks/helpers/linkClickPlugin.d.ts +0 -43
  293. package/dist/marks/helpers/linkClickPlugin.d.ts.map +0 -1
  294. package/dist/marks/helpers/linkClickPlugin.test.d.ts +0 -2
  295. package/dist/marks/helpers/linkClickPlugin.test.d.ts.map +0 -1
  296. package/dist/marks/helpers/linkExitPlugin.d.ts +0 -37
  297. package/dist/marks/helpers/linkExitPlugin.d.ts.map +0 -1
  298. package/dist/marks/helpers/linkExitPlugin.test.d.ts +0 -2
  299. package/dist/marks/helpers/linkExitPlugin.test.d.ts.map +0 -1
  300. package/dist/marks/helpers/linkPastePlugin.d.ts +0 -44
  301. package/dist/marks/helpers/linkPastePlugin.d.ts.map +0 -1
  302. package/dist/marks/helpers/linkPastePlugin.test.d.ts +0 -2
  303. package/dist/marks/helpers/linkPastePlugin.test.d.ts.map +0 -1
  304. package/dist/marks/index.d.ts +0 -16
  305. package/dist/marks/index.d.ts.map +0 -1
  306. package/dist/nodes/Blockquote.d.ts +0 -19
  307. package/dist/nodes/Blockquote.d.ts.map +0 -1
  308. package/dist/nodes/Blockquote.test.d.ts +0 -2
  309. package/dist/nodes/Blockquote.test.d.ts.map +0 -1
  310. package/dist/nodes/BulletList.d.ts +0 -18
  311. package/dist/nodes/BulletList.d.ts.map +0 -1
  312. package/dist/nodes/BulletList.test.d.ts +0 -2
  313. package/dist/nodes/BulletList.test.d.ts.map +0 -1
  314. package/dist/nodes/CodeBlock.d.ts +0 -29
  315. package/dist/nodes/CodeBlock.d.ts.map +0 -1
  316. package/dist/nodes/CodeBlock.test.d.ts +0 -2
  317. package/dist/nodes/CodeBlock.test.d.ts.map +0 -1
  318. package/dist/nodes/Document.d.ts +0 -9
  319. package/dist/nodes/Document.d.ts.map +0 -1
  320. package/dist/nodes/Document.test.d.ts +0 -2
  321. package/dist/nodes/Document.test.d.ts.map +0 -1
  322. package/dist/nodes/HardBreak.d.ts +0 -18
  323. package/dist/nodes/HardBreak.d.ts.map +0 -1
  324. package/dist/nodes/HardBreak.test.d.ts +0 -2
  325. package/dist/nodes/HardBreak.test.d.ts.map +0 -1
  326. package/dist/nodes/Heading.d.ts +0 -23
  327. package/dist/nodes/Heading.d.ts.map +0 -1
  328. package/dist/nodes/Heading.test.d.ts +0 -2
  329. package/dist/nodes/Heading.test.d.ts.map +0 -1
  330. package/dist/nodes/HorizontalRule.d.ts +0 -17
  331. package/dist/nodes/HorizontalRule.d.ts.map +0 -1
  332. package/dist/nodes/HorizontalRule.test.d.ts +0 -2
  333. package/dist/nodes/HorizontalRule.test.d.ts.map +0 -1
  334. package/dist/nodes/ListItem.d.ts +0 -16
  335. package/dist/nodes/ListItem.d.ts.map +0 -1
  336. package/dist/nodes/ListItem.test.d.ts +0 -2
  337. package/dist/nodes/ListItem.test.d.ts.map +0 -1
  338. package/dist/nodes/OrderedList.d.ts +0 -18
  339. package/dist/nodes/OrderedList.d.ts.map +0 -1
  340. package/dist/nodes/OrderedList.test.d.ts +0 -2
  341. package/dist/nodes/OrderedList.test.d.ts.map +0 -1
  342. package/dist/nodes/Paragraph.d.ts +0 -17
  343. package/dist/nodes/Paragraph.d.ts.map +0 -1
  344. package/dist/nodes/Paragraph.test.d.ts +0 -2
  345. package/dist/nodes/Paragraph.test.d.ts.map +0 -1
  346. package/dist/nodes/TaskItem.d.ts +0 -24
  347. package/dist/nodes/TaskItem.d.ts.map +0 -1
  348. package/dist/nodes/TaskItem.test.d.ts +0 -2
  349. package/dist/nodes/TaskItem.test.d.ts.map +0 -1
  350. package/dist/nodes/TaskList.d.ts +0 -18
  351. package/dist/nodes/TaskList.d.ts.map +0 -1
  352. package/dist/nodes/TaskList.test.d.ts +0 -2
  353. package/dist/nodes/TaskList.test.d.ts.map +0 -1
  354. package/dist/nodes/Text.d.ts +0 -9
  355. package/dist/nodes/Text.d.ts.map +0 -1
  356. package/dist/nodes/Text.test.d.ts +0 -2
  357. package/dist/nodes/Text.test.d.ts.map +0 -1
  358. package/dist/nodes/index.d.ts +0 -19
  359. package/dist/nodes/index.d.ts.map +0 -1
  360. package/dist/nodes/integration.test.d.ts +0 -7
  361. package/dist/nodes/integration.test.d.ts.map +0 -1
  362. package/dist/types/AttributeSpec.d.ts +0 -78
  363. package/dist/types/AttributeSpec.d.ts.map +0 -1
  364. package/dist/types/Commands.d.ts +0 -125
  365. package/dist/types/Commands.d.ts.map +0 -1
  366. package/dist/types/Content.d.ts +0 -40
  367. package/dist/types/Content.d.ts.map +0 -1
  368. package/dist/types/EditorEvents.d.ts +0 -131
  369. package/dist/types/EditorEvents.d.ts.map +0 -1
  370. package/dist/types/EditorOptions.d.ts +0 -139
  371. package/dist/types/EditorOptions.d.ts.map +0 -1
  372. package/dist/types/ExtensionConfig.d.ts +0 -271
  373. package/dist/types/ExtensionConfig.d.ts.map +0 -1
  374. package/dist/types/MarkConfig.d.ts +0 -206
  375. package/dist/types/MarkConfig.d.ts.map +0 -1
  376. package/dist/types/NodeConfig.d.ts +0 -263
  377. package/dist/types/NodeConfig.d.ts.map +0 -1
  378. package/dist/types/Toolbar.d.ts +0 -172
  379. package/dist/types/Toolbar.d.ts.map +0 -1
  380. package/dist/types/index.d.ts +0 -13
  381. package/dist/types/index.d.ts.map +0 -1
  382. package/dist/utils/inlineStyles.d.ts +0 -83
  383. package/dist/utils/inlineStyles.d.ts.map +0 -1
  384. package/dist/utils/inlineStyles.test.d.ts +0 -2
  385. package/dist/utils/inlineStyles.test.d.ts.map +0 -1
  386. package/dist/utils/positionFloating.d.ts +0 -74
  387. package/dist/utils/positionFloating.d.ts.map +0 -1
@@ -1,48 +0,0 @@
1
- /**
2
- * Create a ProseMirror document from content
3
- *
4
- * Supports JSON and HTML content formats (AD-11).
5
- * Plain text is NOT supported - use HTML or JSON explicitly.
6
- */
7
- import type { Schema } from '@domternal/pm/model';
8
- import { Node as PMNode, DOMParser } from '@domternal/pm/model';
9
- import type { Content } from '../types/index.js';
10
- /**
11
- * Options for createDocument
12
- */
13
- export interface CreateDocumentOptions {
14
- /**
15
- * Parse options passed to DOMParser
16
- */
17
- parseOptions?: Parameters<DOMParser['parse']>[1];
18
- }
19
- /**
20
- * Creates a ProseMirror document from content
21
- *
22
- * **Security:** Content is NOT sanitized. If accepting user-provided HTML,
23
- * sanitize it first (e.g., using DOMPurify) to prevent XSS attacks.
24
- *
25
- * @param content - JSON content object, HTML string, or null/undefined
26
- * @param schema - ProseMirror schema to use
27
- * @param options - Optional parse options
28
- * @returns ProseMirror Node (document)
29
- *
30
- * @throws Error if content format is invalid (plain text without HTML tags)
31
- *
32
- * @example
33
- * ```ts
34
- * // JSON content
35
- * const doc = createDocument(
36
- * { type: 'doc', content: [{ type: 'paragraph' }] },
37
- * schema
38
- * );
39
- *
40
- * // HTML content
41
- * const doc = createDocument('<p>Hello world</p>', schema);
42
- *
43
- * // Empty document
44
- * const doc = createDocument(null, schema);
45
- * ```
46
- */
47
- export declare function createDocument(content: Content | null | undefined, schema: Schema, options?: CreateDocumentOptions): PMNode;
48
- //# sourceMappingURL=createDocument.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDocument.d.ts","sourceRoot":"","sources":["../../src/helpers/createDocument.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClD;AA+DD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EACnC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CA6BR"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=createDocument.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDocument.test.d.ts","sourceRoot":"","sources":["../../src/helpers/createDocument.test.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- /**
2
- * Get the default block type at a given content match position
3
- *
4
- * Finds the first textblock type that can be created without required attributes.
5
- * Useful for creating new empty blocks (e.g., paragraph after details).
6
- *
7
- * @example
8
- * const type = defaultBlockAt(parent.contentMatchAt(index));
9
- * if (type) {
10
- * const node = type.createAndFill();
11
- * }
12
- */
13
- import type { ContentMatch, NodeType } from '@domternal/pm/model';
14
- export declare const defaultBlockAt: (match: ContentMatch) => NodeType | null;
15
- //# sourceMappingURL=defaultBlockAt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaultBlockAt.d.ts","sourceRoot":"","sources":["../../src/helpers/defaultBlockAt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAElE,eAAO,MAAM,cAAc,GAAI,OAAO,YAAY,KAAG,QAAQ,GAAG,IAU/D,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=defaultBlockAt.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaultBlockAt.test.d.ts","sourceRoot":"","sources":["../../src/helpers/defaultBlockAt.test.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- /**
2
- * Find all children of a node matching a predicate
3
- *
4
- * @example
5
- * const summaries = findChildren(detailsNode, node => node.type.name === 'detailsSummary');
6
- */
7
- import type { Node as PMNode } from '@domternal/pm/model';
8
- export interface FindChildResult {
9
- node: PMNode;
10
- pos: number;
11
- }
12
- export declare const findChildren: (node: PMNode, predicate: (node: PMNode) => boolean) => FindChildResult[];
13
- //# sourceMappingURL=findChildren.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findChildren.d.ts","sourceRoot":"","sources":["../../src/helpers/findChildren.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,WAAW,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,KACnC,eAAe,EAUjB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=findChildren.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findChildren.test.d.ts","sourceRoot":"","sources":["../../src/helpers/findChildren.test.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- /**
2
- * Find the closest parent node matching a predicate
3
- *
4
- * Returns a curried function: findParentNode(predicate)(selection)
5
- *
6
- * @example
7
- * const details = findParentNode(node => node.type.name === 'details')(selection);
8
- * if (details) {
9
- * console.log(details.pos, details.node);
10
- * }
11
- */
12
- import type { Node as PMNode } from '@domternal/pm/model';
13
- import type { Selection } from '@domternal/pm/state';
14
- export interface FindParentNodeResult {
15
- pos: number;
16
- start: number;
17
- depth: number;
18
- node: PMNode;
19
- }
20
- export declare const findParentNode: (predicate: (node: PMNode) => boolean) => (selection: Selection) => FindParentNodeResult | undefined;
21
- //# sourceMappingURL=findParentNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findParentNode.d.ts","sourceRoot":"","sources":["../../src/helpers/findParentNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,GACxB,WAAW,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,MACpC,WAAW,SAAS,KAAG,oBAAoB,GAAG,SAiB9C,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=findParentNode.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findParentNode.test.d.ts","sourceRoot":"","sources":["../../src/helpers/findParentNode.test.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- /**
2
- * Get the range of a mark at a resolved position.
3
- *
4
- * Walks backward and forward from the position to find contiguous
5
- * text nodes that share the same mark type, returning the full range.
6
- */
7
- import type { MarkType, ResolvedPos } from '@domternal/pm/model';
8
- export interface MarkRange {
9
- from: number;
10
- to: number;
11
- }
12
- /**
13
- * Returns the contiguous range of a mark around the given resolved position.
14
- * Returns undefined if the mark is not present at the position.
15
- */
16
- export declare function getMarkRange($pos: ResolvedPos, type: MarkType): MarkRange | undefined;
17
- //# sourceMappingURL=getMarkRange.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getMarkRange.d.ts","sourceRoot":"","sources":["../../src/helpers/getMarkRange.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,QAAQ,GACb,SAAS,GAAG,SAAS,CAgCvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=getMarkRange.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getMarkRange.test.d.ts","sourceRoot":"","sources":["../../src/helpers/getMarkRange.test.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- /**
2
- * Helper utilities for @domternal/core
3
- */
4
- export { createDocument, type CreateDocumentOptions } from './createDocument.js';
5
- export { isNodeEmpty, isDocumentEmpty, type IsNodeEmptyOptions, } from './isNodeEmpty.js';
6
- export { callOrReturn } from './callOrReturn.js';
7
- export { markInputRule, markInputRulePatterns, type MarkInputRuleOptions, } from './markInputRule.js';
8
- export { wrappingInputRule, notInsideList, type WrappingInputRuleOptions, } from './wrappingInputRule.js';
9
- export { textblockTypeInputRule, type TextblockTypeInputRuleOptions, } from './textblockTypeInputRule.js';
10
- export { textInputRule, type TextInputRuleOptions, } from './textInputRule.js';
11
- export { nodeInputRule, type NodeInputRuleOptions, } from './nodeInputRule.js';
12
- export { isValidUrl, type IsValidUrlOptions, } from './isValidUrl.js';
13
- export { generateHTML, generateJSON, generateText, type GenerateHTMLOptions, type GenerateJSONOptions, type GenerateTextOptions, } from './ssr.js';
14
- export { getMarkRange, type MarkRange } from './getMarkRange.js';
15
- export { findParentNode, type FindParentNodeResult, } from './findParentNode.js';
16
- export { findChildren, type FindChildResult } from './findChildren.js';
17
- export { defaultBlockAt } from './defaultBlockAt.js';
18
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,WAAW,EACX,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,wBAAwB,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Custom inputRules plugin with built-in Backspace undo.
3
- *
4
- * Two enhancements over ProseMirror's built-in inputRules plugin:
5
- *
6
- * 1. Preserves undo state across appendTransaction (e.g. TrailingNode).
7
- * PM's plugin clears state on any docChanged transaction, so
8
- * appendTransaction handlers that fire after an input rule erase the
9
- * undo info before the user can press Backspace.
10
- *
11
- * 2. Handles Backspace directly via handleKeyDown (highest priority in
12
- * ProseMirror's event dispatch) so no other keymap can intercept it
13
- * first. If the plugin has stored undo state, Backspace inverts the
14
- * input rule steps and restores the original typed text.
15
- */
16
- import { Plugin } from '@domternal/pm/state';
17
- import type { InputRule } from '@domternal/pm/inputrules';
18
- /**
19
- * Creates an input rules plugin with built-in Backspace undo.
20
- *
21
- * Drop-in replacement for ProseMirror's `inputRules({ rules })`.
22
- */
23
- export declare function inputRulesPlugin({ rules }: {
24
- rules: InputRule[];
25
- }): Plugin;
26
- //# sourceMappingURL=inputRulesPlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inputRulesPlugin.d.ts","sourceRoot":"","sources":["../../src/helpers/inputRulesPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA6G1D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,MAAM,CA4C1E"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Check if a ProseMirror node is empty
3
- */
4
- import type { Node as PMNode } from '@domternal/pm/model';
5
- /**
6
- * Options for isNodeEmpty check
7
- */
8
- export interface IsNodeEmptyOptions {
9
- /**
10
- * Check child nodes recursively
11
- * @default true
12
- */
13
- checkChildren?: boolean;
14
- /**
15
- * Ignore hardBreak nodes when checking emptiness
16
- * @default true
17
- */
18
- ignoreHardBreaks?: boolean;
19
- }
20
- /**
21
- * Checks if a ProseMirror node is considered empty
22
- *
23
- * A node is considered empty if:
24
- * - It has no content (childCount === 0)
25
- * - It only contains empty child nodes (when checkChildren is true)
26
- * - It only contains hardBreaks (when ignoreHardBreaks is true)
27
- *
28
- * @param node - ProseMirror node to check
29
- * @param options - Options for emptiness check
30
- * @returns true if node is empty
31
- *
32
- * @example
33
- * ```ts
34
- * // Check if document is empty
35
- * const empty = isNodeEmpty(editor.state.doc);
36
- *
37
- * // Check without recursion
38
- * const empty = isNodeEmpty(node, { checkChildren: false });
39
- * ```
40
- */
41
- export declare function isNodeEmpty(node: PMNode, options?: IsNodeEmptyOptions): boolean;
42
- /**
43
- * Checks if a document node is empty
44
- *
45
- * Convenience wrapper for isNodeEmpty with document-specific defaults.
46
- * A document is empty if it only contains empty paragraphs or no content.
47
- *
48
- * @param doc - Document node to check
49
- * @returns true if document is empty
50
- */
51
- export declare function isDocumentEmpty(doc: PMNode): boolean;
52
- //# sourceMappingURL=isNodeEmpty.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isNodeEmpty.d.ts","sourceRoot":"","sources":["../../src/helpers/isNodeEmpty.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAqCT;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKpD"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=isNodeEmpty.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isNodeEmpty.test.d.ts","sourceRoot":"","sources":["../../src/helpers/isNodeEmpty.test.ts"],"names":[],"mappings":""}
@@ -1,31 +0,0 @@
1
- /**
2
- * URL Validation Helper
3
- *
4
- * Provides a utility for validating URLs.
5
- */
6
- /**
7
- * Options for URL validation
8
- */
9
- export interface IsValidUrlOptions {
10
- /**
11
- * List of allowed URL protocols
12
- * @default ['http:', 'https:']
13
- */
14
- protocols?: string[];
15
- }
16
- /**
17
- * Checks if a string is a valid URL
18
- *
19
- * @param url - The string to validate
20
- * @param options - Validation options
21
- * @returns True if the string is a valid URL with an allowed protocol
22
- *
23
- * @example
24
- * ```ts
25
- * isValidUrl('https://example.com'); // true
26
- * isValidUrl('javascript:alert(1)'); // false (protocol not allowed)
27
- * isValidUrl('not a url'); // false
28
- * ```
29
- */
30
- export declare function isValidUrl(url: string, options?: IsValidUrlOptions): boolean;
31
- //# sourceMappingURL=isValidUrl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isValidUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/isValidUrl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAST"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=isValidUrl.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isValidUrl.test.d.ts","sourceRoot":"","sources":["../../src/helpers/isValidUrl.test.ts"],"names":[],"mappings":""}
@@ -1,88 +0,0 @@
1
- /**
2
- * Mark Input Rule Helper
3
- *
4
- * Creates input rules for applying marks based on regex patterns.
5
- * Used for markdown-style shortcuts like **bold**, *italic*, ~~strike~~, etc.
6
- */
7
- import { InputRule } from '@domternal/pm/inputrules';
8
- import type { MarkType } from '@domternal/pm/model';
9
- /**
10
- * Options for creating a mark input rule
11
- */
12
- export interface MarkInputRuleOptions {
13
- /**
14
- * The regex pattern to match.
15
- * Must have a capture group for the content to be marked.
16
- *
17
- * @example
18
- * // Match **text**
19
- * /(?:\*\*)([^*]+)(?:\*\*)$/
20
- */
21
- find: RegExp;
22
- /**
23
- * The mark type to apply
24
- */
25
- type: MarkType;
26
- /**
27
- * Whether Backspace can undo this input rule immediately after it fires.
28
- * @default true
29
- */
30
- undoable?: boolean;
31
- /**
32
- * Optional: get attributes from the match
33
- *
34
- * @param match - The regex match array
35
- * @returns Mark attributes or null to skip
36
- */
37
- getAttributes?: (match: RegExpMatchArray) => Record<string, unknown> | null;
38
- }
39
- /**
40
- * Creates an input rule that applies a mark to matched text.
41
- *
42
- * When the user types text matching the pattern, the delimiters are removed
43
- * and the mark is applied to the content.
44
- *
45
- * @example
46
- * // **text** → applies bold mark to "text"
47
- * markInputRule({
48
- * find: /(?:\*\*)([^*]+)(?:\*\*)$/,
49
- * type: schema.marks.bold,
50
- * });
51
- *
52
- * @example
53
- * // `text` → applies code mark to "text"
54
- * markInputRule({
55
- * find: /(?:`)([^`]+)(?:`)$/,
56
- * type: schema.marks.code,
57
- * });
58
- *
59
- * @param options - Configuration options
60
- * @returns ProseMirror InputRule
61
- */
62
- export declare function markInputRule(options: MarkInputRuleOptions): InputRule;
63
- /**
64
- * Pre-built regex patterns for common mark input rules
65
- */
66
- export declare const markInputRulePatterns: {
67
- /**
68
- * Bold: **text** or __text__
69
- * Matches text wrapped in double asterisks or underscores
70
- */
71
- readonly bold: RegExp;
72
- /**
73
- * Strike: ~~text~~
74
- * Matches text wrapped in double tildes
75
- */
76
- readonly strike: RegExp;
77
- /**
78
- * Code: `text`
79
- * Matches text wrapped in backticks
80
- */
81
- readonly code: RegExp;
82
- /**
83
- * Highlight: ==text==
84
- * Matches text wrapped in double equals
85
- */
86
- readonly highlight: RegExp;
87
- };
88
- //# sourceMappingURL=markInputRule.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markInputRule.d.ts","sourceRoot":"","sources":["../../src/helpers/markInputRule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAmCtE;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;IAChC;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;CAEK,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=markInputRule.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markInputRule.test.d.ts","sourceRoot":"","sources":["../../src/helpers/markInputRule.test.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- /**
2
- * Node Input Rule Helper
3
- *
4
- * Creates input rules that replace matched text with a node.
5
- * Used for nodes like HorizontalRule, Image, Emoji, etc.
6
- */
7
- import { InputRule } from '@domternal/pm/inputrules';
8
- import type { NodeType, Attrs } from '@domternal/pm/model';
9
- import type { EditorState } from '@domternal/pm/state';
10
- export interface NodeInputRuleOptions {
11
- /**
12
- * The regex pattern to match.
13
- */
14
- find: RegExp;
15
- /**
16
- * The node type to insert.
17
- */
18
- type: NodeType;
19
- /**
20
- * Whether Backspace can undo this input rule immediately after it fires.
21
- * @default true
22
- */
23
- undoable?: boolean;
24
- /**
25
- * Node attributes, or a function that computes them from the match.
26
- */
27
- getAttributes?: Attrs | null | ((match: RegExpMatchArray, state: EditorState) => Attrs | null);
28
- }
29
- /**
30
- * Creates an input rule that replaces matched text with a node.
31
- *
32
- * @example
33
- * // `:smile:` inserts an emoji node
34
- * nodeInputRule({
35
- * find: /:([a-zA-Z0-9_+-]+):$/,
36
- * type: schema.nodes.emoji,
37
- * getAttributes: (match) => ({ name: match[1] }),
38
- * });
39
- */
40
- export declare function nodeInputRule(options: NodeInputRuleOptions): InputRule;
41
- //# sourceMappingURL=nodeInputRule.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodeInputRule.d.ts","sourceRoot":"","sources":["../../src/helpers/nodeInputRule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;CAChG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAYtE"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Normalizes browser-computed color values (rgb/rgba) to hex format.
3
- * Browsers convert hex colors to rgb() in element.style, causing
4
- * isActive mismatches when comparing stored values after HTML re-parsing.
5
- */
6
- export declare function normalizeColor(color: string): string;
7
- //# sourceMappingURL=normalizeColor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeColor.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASpD"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=normalizeColor.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeColor.test.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.test.ts"],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- /**
2
- * Shared helpers for building ProseMirror node/mark specs.
3
- *
4
- * Used by both Node.createNodeSpec() and Mark.createMarkSpec() to
5
- * eliminate duplicated attribute conversion and HTML attribute building.
6
- */
7
- import type { AttributeSpecs } from '../types/AttributeSpec.js';
8
- /**
9
- * Converts extension AttributeSpecs to ProseMirror-compatible `attrs` object.
10
- *
11
- * @example
12
- * spec.attrs = buildProseMirrorAttrs(attributeSpecs);
13
- */
14
- export declare function buildProseMirrorAttrs(attributeSpecs: AttributeSpecs): Record<string, {
15
- default?: unknown;
16
- }>;
17
- /**
18
- * Builds an HTML attributes object from a node/mark's attrs using the
19
- * attribute specs' renderHTML functions.
20
- *
21
- * Used inside toDOM wrappers for both nodes and marks.
22
- *
23
- * @example
24
- * const htmlAttrs = buildHTMLAttributes(node.attrs, attrSpecs);
25
- * return renderFn.call(instance, { node, HTMLAttributes: htmlAttrs });
26
- */
27
- export declare function buildHTMLAttributes(attrs: Record<string, unknown>, attrSpecs: AttributeSpecs): Record<string, unknown>;
28
- //# sourceMappingURL=specBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specBuilder.d.ts","sourceRoot":"","sources":["../../src/helpers/specBuilder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,cAAc,GAC7B,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAevC;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,SAAS,EAAE,cAAc,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=specBuilder.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"specBuilder.test.d.ts","sourceRoot":"","sources":["../../src/helpers/specBuilder.test.ts"],"names":[],"mappings":""}
@@ -1,80 +0,0 @@
1
- import type { AnyExtension, JSONContent } from '../types/index.js';
2
- export interface GenerateHTMLOptions {
3
- /**
4
- * Custom document implementation. If not provided, uses native document
5
- * in browser or linkedom in Node.js.
6
- */
7
- document?: Document;
8
- }
9
- /**
10
- * Generate HTML string from JSON content.
11
- *
12
- * @param content - The JSON content to convert
13
- * @param extensions - Extensions that define the schema
14
- * @param options - Optional configuration
15
- * @returns HTML string
16
- *
17
- * @example
18
- * ```ts
19
- * const html = generateHTML(
20
- * { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }] },
21
- * [Document, Paragraph, Text]
22
- * );
23
- * // Returns: '<p>Hello</p>'
24
- * ```
25
- */
26
- export declare function generateHTML(content: JSONContent, extensions: AnyExtension[], options?: GenerateHTMLOptions): string;
27
- export interface GenerateJSONOptions {
28
- /**
29
- * Custom document implementation. If not provided, uses native document
30
- * in browser or linkedom in Node.js.
31
- */
32
- document?: Document;
33
- }
34
- /**
35
- * Generate JSON content from HTML string.
36
- *
37
- * @param html - The HTML string to convert
38
- * @param extensions - Extensions that define the schema
39
- * @param options - Optional configuration
40
- * @returns JSON content object
41
- *
42
- * @example
43
- * ```ts
44
- * const json = generateJSON(
45
- * '<p>Hello</p>',
46
- * [Document, Paragraph, Text]
47
- * );
48
- * // Returns: { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }] }
49
- * ```
50
- */
51
- export declare function generateJSON(html: string, extensions: AnyExtension[], options?: GenerateJSONOptions): JSONContent;
52
- export interface GenerateTextOptions {
53
- /**
54
- * Separator between block elements.
55
- * @default '\n\n'
56
- */
57
- blockSeparator?: string;
58
- }
59
- /**
60
- * Generate plain text from JSON content.
61
- *
62
- * @param content - The JSON content to extract text from
63
- * @param extensions - Extensions that define the schema
64
- * @param options - Optional configuration
65
- * @returns Plain text string
66
- *
67
- * @example
68
- * ```ts
69
- * const text = generateText(
70
- * { type: 'doc', content: [
71
- * { type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] },
72
- * { type: 'paragraph', content: [{ type: 'text', text: 'World' }] }
73
- * ]},
74
- * [Document, Paragraph, Text]
75
- * );
76
- * // Returns: 'Hello\n\nWorld'
77
- * ```
78
- */
79
- export declare function generateText(content: JSONContent, extensions: AnyExtension[], options?: GenerateTextOptions): string;
80
- //# sourceMappingURL=ssr.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/helpers/ssr.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiDnE,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAcR;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,mBAAwB,GAChC,WAAW,CAab;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAMR"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ssr.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr.test.d.ts","sourceRoot":"","sources":["../../src/helpers/ssr.test.ts"],"names":[],"mappings":""}