@prosekit/extensions 0.14.1 → 0.14.2

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 (220) hide show
  1. package/dist/drop-indicator-DJq8pF92.js.map +1 -1
  2. package/dist/file-upload-I9m1EJAM.js.map +1 -1
  3. package/dist/{mark-paste-rule-n_2Ehmb5.js → mark-paste-rule--F1QPUcU.js} +2 -2
  4. package/dist/mark-paste-rule--F1QPUcU.js.map +1 -0
  5. package/dist/{mark-rule-CUnXwBuy.js → mark-rule-Bqdm49Eq.js} +2 -2
  6. package/dist/mark-rule-Bqdm49Eq.js.map +1 -0
  7. package/dist/prosekit-extensions-autocomplete.d.ts +1 -1
  8. package/dist/prosekit-extensions-autocomplete.js +17 -17
  9. package/dist/prosekit-extensions-autocomplete.js.map +1 -1
  10. package/dist/prosekit-extensions-background-color.d.ts +1 -1
  11. package/dist/prosekit-extensions-background-color.js.map +1 -1
  12. package/dist/prosekit-extensions-blockquote.d.ts +13 -13
  13. package/dist/prosekit-extensions-blockquote.d.ts.map +1 -1
  14. package/dist/prosekit-extensions-blockquote.js +5 -4
  15. package/dist/prosekit-extensions-blockquote.js.map +1 -1
  16. package/dist/prosekit-extensions-bold.d.ts +12 -12
  17. package/dist/prosekit-extensions-bold.d.ts.map +1 -1
  18. package/dist/prosekit-extensions-bold.js.map +1 -1
  19. package/dist/prosekit-extensions-code-block.d.ts +52 -35
  20. package/dist/prosekit-extensions-code-block.d.ts.map +1 -1
  21. package/dist/prosekit-extensions-code-block.js +76 -70
  22. package/dist/prosekit-extensions-code-block.js.map +1 -1
  23. package/dist/prosekit-extensions-code.d.ts +12 -12
  24. package/dist/prosekit-extensions-code.d.ts.map +1 -1
  25. package/dist/prosekit-extensions-code.js.map +1 -1
  26. package/dist/prosekit-extensions-commit.d.ts +1 -1
  27. package/dist/prosekit-extensions-commit.js +1 -1
  28. package/dist/prosekit-extensions-enter-rule.d.ts +2 -2
  29. package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
  30. package/dist/prosekit-extensions-enter-rule.js.map +1 -1
  31. package/dist/prosekit-extensions-hard-break.d.ts +7 -7
  32. package/dist/prosekit-extensions-hard-break.d.ts.map +1 -1
  33. package/dist/prosekit-extensions-hard-break.js.map +1 -1
  34. package/dist/prosekit-extensions-heading.d.ts +15 -15
  35. package/dist/prosekit-extensions-heading.d.ts.map +1 -1
  36. package/dist/prosekit-extensions-heading.js.map +1 -1
  37. package/dist/prosekit-extensions-horizontal-rule.d.ts +7 -7
  38. package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -1
  39. package/dist/prosekit-extensions-horizontal-rule.js +10 -9
  40. package/dist/prosekit-extensions-horizontal-rule.js.map +1 -1
  41. package/dist/prosekit-extensions-image.d.ts +11 -11
  42. package/dist/prosekit-extensions-image.d.ts.map +1 -1
  43. package/dist/prosekit-extensions-image.js +9 -9
  44. package/dist/prosekit-extensions-image.js.map +1 -1
  45. package/dist/prosekit-extensions-italic.d.ts +12 -12
  46. package/dist/prosekit-extensions-italic.d.ts.map +1 -1
  47. package/dist/prosekit-extensions-italic.js.map +1 -1
  48. package/dist/prosekit-extensions-link.js +2 -2
  49. package/dist/prosekit-extensions-link.js.map +1 -1
  50. package/dist/prosekit-extensions-list.d.ts +26 -26
  51. package/dist/prosekit-extensions-list.d.ts.map +1 -1
  52. package/dist/prosekit-extensions-list.js +25 -25
  53. package/dist/prosekit-extensions-list.js.map +1 -1
  54. package/dist/prosekit-extensions-loro.d.ts +16 -16
  55. package/dist/prosekit-extensions-loro.d.ts.map +1 -1
  56. package/dist/prosekit-extensions-loro.js.map +1 -1
  57. package/dist/prosekit-extensions-mark-rule.js +1 -1
  58. package/dist/prosekit-extensions-math.d.ts +3 -3
  59. package/dist/prosekit-extensions-math.d.ts.map +1 -1
  60. package/dist/prosekit-extensions-math.js +4 -0
  61. package/dist/prosekit-extensions-math.js.map +1 -1
  62. package/dist/prosekit-extensions-mod-click-prevention.js +1 -1
  63. package/dist/prosekit-extensions-paragraph.d.ts +7 -7
  64. package/dist/prosekit-extensions-paragraph.d.ts.map +1 -1
  65. package/dist/prosekit-extensions-paragraph.js.map +1 -1
  66. package/dist/prosekit-extensions-paste-rule.js +1 -1
  67. package/dist/prosekit-extensions-placeholder.d.ts +1 -1
  68. package/dist/prosekit-extensions-placeholder.js +2 -2
  69. package/dist/prosekit-extensions-placeholder.js.map +1 -1
  70. package/dist/prosekit-extensions-readonly.js +1 -1
  71. package/dist/prosekit-extensions-strike.js.map +1 -1
  72. package/dist/prosekit-extensions-table.d.ts +47 -47
  73. package/dist/prosekit-extensions-table.d.ts.map +1 -1
  74. package/dist/prosekit-extensions-table.js +1 -1
  75. package/dist/prosekit-extensions-text-align.d.ts +1 -1
  76. package/dist/prosekit-extensions-text-color.d.ts +1 -1
  77. package/dist/prosekit-extensions-text-color.js.map +1 -1
  78. package/dist/prosekit-extensions-virtual-selection.js +1 -1
  79. package/dist/prosekit-extensions-yjs.d.ts +3 -3
  80. package/dist/prosekit-extensions-yjs.d.ts.map +1 -1
  81. package/dist/prosekit-extensions-yjs.js.map +1 -1
  82. package/dist/{table-UJVYsrB7.js → table-B81i9oH9.js} +28 -28
  83. package/dist/table-B81i9oH9.js.map +1 -0
  84. package/package.json +8 -7
  85. package/src/autocomplete/autocomplete-helpers.ts +1 -1
  86. package/src/autocomplete/autocomplete-plugin.ts +2 -2
  87. package/src/autocomplete/autocomplete-rule.ts +1 -1
  88. package/src/autocomplete/autocomplete.spec.ts +4 -4
  89. package/src/autocomplete/autocomplete.ts +2 -2
  90. package/src/autocomplete/index.ts +2 -2
  91. package/src/background-color/background-color-commands.spec.ts +1 -1
  92. package/src/background-color/background-color-commands.ts +1 -1
  93. package/src/background-color/background-color-spec.spec.ts +1 -1
  94. package/src/background-color/background-color.ts +2 -2
  95. package/src/background-color/index.ts +3 -3
  96. package/src/blockquote/blockquote-input-rule.ts +1 -1
  97. package/src/blockquote/blockquote-keymap.spec.ts +1 -1
  98. package/src/blockquote/blockquote-keymap.ts +9 -7
  99. package/src/blockquote/blockquote.ts +4 -4
  100. package/src/blockquote/index.ts +5 -5
  101. package/src/bold/bold-input-rule.spec.ts +2 -2
  102. package/src/bold/bold-input-rule.ts +1 -1
  103. package/src/bold/bold.ts +4 -4
  104. package/src/bold/index.ts +5 -5
  105. package/src/code/code-input-rule.ts +1 -1
  106. package/src/code/code.ts +4 -4
  107. package/src/code/index.ts +5 -5
  108. package/src/code-block/code-block-commands.ts +1 -1
  109. package/src/code-block/code-block-highlight.ts +11 -1
  110. package/src/code-block/code-block-input-rule.ts +3 -3
  111. package/src/code-block/code-block-shiki.ts +13 -5
  112. package/src/code-block/code-block-spec.spec.ts +2 -2
  113. package/src/code-block/code-block-spec.ts +1 -1
  114. package/src/code-block/code-block.ts +4 -4
  115. package/src/code-block/index.ts +9 -9
  116. package/src/code-block/shiki-highlighter.ts +2 -2
  117. package/src/code-block/shiki-parser.ts +2 -2
  118. package/src/drop-cursor/index.ts +1 -1
  119. package/src/drop-indicator/drop-indicator.ts +1 -1
  120. package/src/drop-indicator/index.ts +1 -1
  121. package/src/enter-rule/index.ts +3 -3
  122. package/src/file/file-drop-handler.ts +1 -1
  123. package/src/file/file-paste-handler.spec.ts +3 -3
  124. package/src/file/file-paste-handler.ts +1 -1
  125. package/src/file/index.ts +3 -3
  126. package/src/gap-cursor/index.ts +1 -1
  127. package/src/hard-break/hard-break-keymap.spec.ts +2 -2
  128. package/src/hard-break/hard-break-keymap.ts +1 -1
  129. package/src/hard-break/hard-break.ts +3 -3
  130. package/src/hard-break/index.ts +4 -4
  131. package/src/heading/heading-commands.ts +1 -1
  132. package/src/heading/heading-input-rule.ts +2 -2
  133. package/src/heading/heading-keymap.spec.ts +1 -1
  134. package/src/heading/heading-spec.ts +1 -1
  135. package/src/heading/heading.ts +4 -4
  136. package/src/heading/index.ts +6 -6
  137. package/src/horizontal-rule/horizontal-rule-commands.spec.ts +1 -1
  138. package/src/horizontal-rule/horizontal-rule-commands.ts +13 -11
  139. package/src/horizontal-rule/horizontal-rule-input-rule.spec.ts +2 -2
  140. package/src/horizontal-rule/horizontal-rule-input-rule.ts +1 -1
  141. package/src/horizontal-rule/horizontal-rule.ts +3 -3
  142. package/src/horizontal-rule/index.ts +4 -4
  143. package/src/image/image-commands/insert-image.ts +1 -1
  144. package/src/image/image-commands/upload-image.spec.ts +4 -4
  145. package/src/image/image-commands/upload-image.ts +2 -2
  146. package/src/image/image-commands.ts +3 -3
  147. package/src/image/image-upload-handler.ts +2 -2
  148. package/src/image/image.ts +2 -2
  149. package/src/image/index.ts +6 -6
  150. package/src/italic/index.ts +5 -5
  151. package/src/italic/italic-commands.spec.ts +4 -4
  152. package/src/italic/italic-input-rule.spec.ts +2 -2
  153. package/src/italic/italic-input-rule.ts +1 -1
  154. package/src/italic/italic.ts +4 -4
  155. package/src/link/index.spec.ts +2 -2
  156. package/src/link/index.ts +6 -6
  157. package/src/link/link-paste-rule.spec.ts +2 -2
  158. package/src/link/link-paste-rule.ts +3 -3
  159. package/src/link/link-regex.spec.ts +1 -1
  160. package/src/list/index.ts +8 -8
  161. package/src/list/list-drop-indicator.ts +2 -2
  162. package/src/list/list-input-rules.ts +1 -1
  163. package/src/list/list-keymap.spec.ts +1 -1
  164. package/src/list/list-spec.ts +1 -1
  165. package/src/list/list-types.spec.ts +2 -2
  166. package/src/list/list.spec.ts +6 -6
  167. package/src/list/list.ts +7 -7
  168. package/src/loro/index.ts +6 -6
  169. package/src/loro/loro.ts +5 -5
  170. package/src/mark-rule/apply.ts +2 -2
  171. package/src/mark-rule/index.ts +2 -2
  172. package/src/mark-rule/mark-rule.spec.ts +4 -4
  173. package/src/mark-rule/mark-rule.ts +2 -2
  174. package/src/math/index.ts +4 -4
  175. package/src/math/math-block.ts +8 -1
  176. package/src/math/math-inline.ts +1 -1
  177. package/src/math/math.ts +3 -3
  178. package/src/paragraph/index.ts +7 -7
  179. package/src/paragraph/paragraph-keymap.ts +1 -1
  180. package/src/paragraph/paragraph.ts +3 -3
  181. package/src/paste-rule/index.ts +2 -2
  182. package/src/paste-rule/mark-paste-rule.spec.ts +8 -8
  183. package/src/paste-rule/mark-paste-rule.ts +2 -2
  184. package/src/paste-rule/paste-rule.spec.ts +2 -2
  185. package/src/paste-rule/paste-rule.ts +1 -1
  186. package/src/paste-rule/split-text-by-regex.spec.ts +1 -1
  187. package/src/placeholder/index.ts +1 -1
  188. package/src/strike/index.ts +1 -1
  189. package/src/table/index.ts +14 -14
  190. package/src/table/table-commands/delete-cell-selection.spec.ts +3 -3
  191. package/src/table/table-commands/exit-table.spec.ts +2 -2
  192. package/src/table/table-commands/insert-table.spec.ts +1 -1
  193. package/src/table/table-commands/move-table-column.spec.ts +2 -2
  194. package/src/table/table-commands/move-table-row.spec.ts +2 -2
  195. package/src/table/table-commands/select-table-cell.spec.ts +3 -3
  196. package/src/table/table-commands/select-table-cell.ts +1 -1
  197. package/src/table/table-commands/select-table-column.spec.ts +2 -2
  198. package/src/table/table-commands/select-table-column.ts +1 -1
  199. package/src/table/table-commands/select-table-row.spec.ts +2 -2
  200. package/src/table/table-commands/select-table-row.ts +1 -1
  201. package/src/table/table-commands/select-table.spec.ts +2 -2
  202. package/src/table/table-commands/select-table.ts +1 -1
  203. package/src/table/table-commands.ts +9 -9
  204. package/src/table/table-drop-indicator.ts +2 -2
  205. package/src/table/table-spec.spec.ts +4 -4
  206. package/src/table/table.ts +4 -4
  207. package/src/table/test-utils.ts +1 -1
  208. package/src/testing/index.ts +24 -24
  209. package/src/text-color/index.ts +3 -3
  210. package/src/text-color/text-color-commands.spec.ts +1 -1
  211. package/src/text-color/text-color-commands.ts +1 -1
  212. package/src/text-color/text-color-spec.spec.ts +1 -1
  213. package/src/text-color/text-color.ts +2 -2
  214. package/src/yjs/index.ts +7 -7
  215. package/src/yjs/yjs-cursor-plugin.ts +1 -1
  216. package/src/yjs/yjs-undo-plugin.ts +3 -2
  217. package/src/yjs/yjs.ts +6 -6
  218. package/dist/mark-paste-rule-n_2Ehmb5.js.map +0 -1
  219. package/dist/mark-rule-CUnXwBuy.js.map +0 -1
  220. package/dist/table-UJVYsrB7.js.map +0 -1
@@ -2,7 +2,7 @@ import { defineNodeSpec, type Extension } from '@prosekit/core'
2
2
  import type { DOMOutputSpec, ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import { createListSpec, listToDOM, type ListAttributes } from 'prosemirror-flat-list'
4
4
 
5
- import type { ListAttrs } from './list-types'
5
+ import type { ListAttrs } from './list-types.ts'
6
6
 
7
7
  /**
8
8
  * @internal
@@ -1,9 +1,9 @@
1
1
  import type { ListAttributes } from 'prosemirror-flat-list'
2
2
  import { test } from 'vitest'
3
3
 
4
- import { assertTypeEqual } from '../types/assert-type-equal'
4
+ import { assertTypeEqual } from '../types/assert-type-equal.ts'
5
5
 
6
- import type { ListAttrs } from './list-types'
6
+ import type { ListAttrs } from './list-types.ts'
7
7
 
8
8
  test('ListAttrs', () => {
9
9
  assertTypeEqual<keyof ListAttrs, keyof ListAttributes>(true)
@@ -3,13 +3,13 @@ import type { ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import { formatHTML } from 'diffable-html-snapshot'
4
4
  import { describe, expect, it } from 'vitest'
5
5
 
6
- import { defineDoc } from '../doc'
7
- import { defineParagraph } from '../paragraph'
8
- import { setupTest } from '../testing'
9
- import { htmlFromMarkdown, markdownFromHTML } from '../testing/markdown'
10
- import { defineText } from '../text'
6
+ import { defineDoc } from '../doc/index.ts'
7
+ import { defineParagraph } from '../paragraph/index.ts'
8
+ import { setupTest } from '../testing/index.ts'
9
+ import { htmlFromMarkdown, markdownFromHTML } from '../testing/markdown.ts'
10
+ import { defineText } from '../text/index.ts'
11
11
 
12
- import { defineList } from './index'
12
+ import { defineList } from './index.ts'
13
13
 
14
14
  describe('defineList', () => {
15
15
  it('can add list node', () => {
package/src/list/list.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineListCommands, type ListCommandsExtension } from './list-commands'
4
- import { defineListDropIndicator } from './list-drop-indicator'
5
- import { defineListInputRules } from './list-input-rules'
6
- import { defineListKeymap } from './list-keymap'
7
- import { defineListPlugins } from './list-plugins'
8
- import { defineListSerializer } from './list-serializer'
9
- import { defineListSpec, type ListSpecExtension } from './list-spec'
3
+ import { defineListCommands, type ListCommandsExtension } from './list-commands.ts'
4
+ import { defineListDropIndicator } from './list-drop-indicator.ts'
5
+ import { defineListInputRules } from './list-input-rules.ts'
6
+ import { defineListKeymap } from './list-keymap.ts'
7
+ import { defineListPlugins } from './list-plugins.ts'
8
+ import { defineListSerializer } from './list-serializer.ts'
9
+ import { defineListSpec, type ListSpecExtension } from './list-spec.ts'
10
10
 
11
11
  /**
12
12
  * @internal
package/src/loro/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export type { LoroSyncPluginProps, LoroUndoPluginProps } from 'loro-prosemirror'
2
- export { defineLoro, type LoroExtension, type LoroOptions } from './loro'
3
- export { defineLoroCommands } from './loro-commands'
4
- export { defineLoroCursorPlugin, type LoroCursorOptions } from './loro-cursor-plugin'
5
- export { defineLoroKeymap } from './loro-keymap'
6
- export { defineLoroSyncPlugin } from './loro-sync-plugin'
7
- export { defineLoroUndoPlugin } from './loro-undo-plugin'
2
+ export { defineLoroCommands } from './loro-commands.ts'
3
+ export { defineLoroCursorPlugin, type LoroCursorOptions } from './loro-cursor-plugin.ts'
4
+ export { defineLoroKeymap } from './loro-keymap.ts'
5
+ export { defineLoroSyncPlugin } from './loro-sync-plugin.ts'
6
+ export { defineLoroUndoPlugin } from './loro-undo-plugin.ts'
7
+ export { defineLoro, type LoroExtension, type LoroOptions } from './loro.ts'
package/src/loro/loro.ts CHANGED
@@ -8,11 +8,11 @@ import type {
8
8
  LoroUndoPluginProps,
9
9
  } from 'loro-prosemirror'
10
10
 
11
- import { defineLoroCommands, type LoroCommandsExtension } from './loro-commands'
12
- import { defineLoroCursorPlugin } from './loro-cursor-plugin'
13
- import { defineLoroKeymap } from './loro-keymap'
14
- import { defineLoroSyncPlugin } from './loro-sync-plugin'
15
- import { defineLoroUndoPlugin } from './loro-undo-plugin'
11
+ import { defineLoroCommands, type LoroCommandsExtension } from './loro-commands.ts'
12
+ import { defineLoroCursorPlugin } from './loro-cursor-plugin.ts'
13
+ import { defineLoroKeymap } from './loro-keymap.ts'
14
+ import { defineLoroSyncPlugin } from './loro-sync-plugin.ts'
15
+ import { defineLoroUndoPlugin } from './loro-undo-plugin.ts'
16
16
 
17
17
  export interface LoroOptions {
18
18
  /**
@@ -2,8 +2,8 @@ import { getMarkType, maybeRun, OBJECT_REPLACEMENT_CHARACTER } from '@prosekit/c
2
2
  import type { Mark, ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import type { EditorState, Transaction } from '@prosekit/pm/state'
4
4
 
5
- import { getCheckRanges } from './range'
6
- import type { MarkRuleOptions } from './types'
5
+ import { getCheckRanges } from './range.ts'
6
+ import type { MarkRuleOptions } from './types.ts'
7
7
 
8
8
  type MarkRange = [from: number, to: number, mark: Mark]
9
9
 
@@ -1,2 +1,2 @@
1
- export { defineMarkRule } from './mark-rule'
2
- export type { MarkRuleOptions } from './types'
1
+ export { defineMarkRule } from './mark-rule.ts'
2
+ export type { MarkRuleOptions } from './types.ts'
@@ -2,11 +2,11 @@ import { createEditor, defineBaseCommands, defineMarkSpec, elementFromNode, unio
2
2
  import type { ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import { describe, expect, it } from 'vitest'
4
4
 
5
- import { defineDoc } from '../doc'
6
- import { defineParagraph } from '../paragraph'
7
- import { defineText } from '../text'
5
+ import { defineDoc } from '../doc/index.ts'
6
+ import { defineParagraph } from '../paragraph/index.ts'
7
+ import { defineText } from '../text/index.ts'
8
8
 
9
- import { defineMarkRule } from './index'
9
+ import { defineMarkRule } from './index.ts'
10
10
 
11
11
  describe('defineMarkRule', () => {
12
12
  const editor = createEditor({
@@ -1,8 +1,8 @@
1
1
  import { defineFacet, defineFacetPayload, pluginFacet, type PlainExtension, type PluginPayload } from '@prosekit/core'
2
2
  import { PluginKey, ProseMirrorPlugin, type EditorState, type Transaction } from '@prosekit/pm/state'
3
3
 
4
- import { applyMarkRules } from './apply'
5
- import type { MarkRuleOptions } from './types'
4
+ import { applyMarkRules } from './apply.ts'
5
+ import type { MarkRuleOptions } from './types.ts'
6
6
 
7
7
  /**
8
8
  * A mark rule is something that can automatically apply marks to text if it
package/src/math/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { defineMath, type MathExtension, type MathOptions } from './math'
2
1
  export {
3
2
  defineMathBlock,
4
3
  defineMathBlockEnterRule,
@@ -8,7 +7,7 @@ export {
8
7
  type MathBlockOptions,
9
8
  type MathBlockSpecExtension,
10
9
  type MathBlockViewOptions,
11
- } from './math-block'
10
+ } from './math-block.ts'
12
11
  export {
13
12
  defineMathInline,
14
13
  defineMathInlineInputRule,
@@ -18,5 +17,6 @@ export {
18
17
  type MathInlineOptions,
19
18
  type MathInlineSpecExtension,
20
19
  type MathInlineViewOptions,
21
- } from './math-inline'
22
- export { defineMathPlugin } from './math-plugin'
20
+ } from './math-inline.ts'
21
+ export { defineMathPlugin } from './math-plugin.ts'
22
+ export { defineMath, type MathExtension, type MathOptions } from './math.ts'
@@ -2,7 +2,7 @@ import { defineNodeSpec, defineNodeView, union, type Extension, type PlainExtens
2
2
  import type { Attrs } from '@prosekit/pm/model'
3
3
  import { createMathBlockView, mathBlockEnterRule, mathBlockSpec, type RenderMathBlock } from 'prosemirror-math'
4
4
 
5
- import { defineEnterRule } from '../enter-rule'
5
+ import { defineEnterRule } from '../enter-rule/index.ts'
6
6
 
7
7
  /**
8
8
  * @internal
@@ -19,6 +19,13 @@ export type MathBlockSpecExtension = Extension<{
19
19
  export function defineMathBlockSpec(): MathBlockSpecExtension {
20
20
  return defineNodeSpec<'mathBlock', Attrs>({
21
21
  ...mathBlockSpec,
22
+ attrs: {
23
+ // The language in the `mathBlock` node, useful for syntax highlighting.
24
+ // This library doesn't focus on using the TeX language in a `mathBlock` node,
25
+ // but this is the most common language used for math blocks in rich text
26
+ // editors, so 'tex' is set as the default value.
27
+ language: { default: 'tex', validate: 'string' },
28
+ },
22
29
  name: 'mathBlock',
23
30
  })
24
31
  }
@@ -2,7 +2,7 @@ import { defineNodeSpec, defineNodeView, union, type Extension, type PlainExtens
2
2
  import type { Attrs } from '@prosekit/pm/model'
3
3
  import { createMathInlineInputRule, createMathInlineView, mathInlineSpec, type RenderMathInline } from 'prosemirror-math'
4
4
 
5
- import { defineInputRule } from '../input-rule'
5
+ import { defineInputRule } from '../input-rule/index.ts'
6
6
 
7
7
  /**
8
8
  * @internal
package/src/math/math.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
  import type { RenderMathBlock, RenderMathInline } from 'prosemirror-math'
3
3
 
4
- import { defineMathBlock, type MathBlockExtension } from './math-block'
5
- import { defineMathInline, type MathInlineExtension } from './math-inline'
6
- import { defineMathPlugin } from './math-plugin'
4
+ import { defineMathBlock, type MathBlockExtension } from './math-block.ts'
5
+ import { defineMathInline, type MathInlineExtension } from './math-inline.ts'
6
+ import { defineMathPlugin } from './math-plugin.ts'
7
7
 
8
8
  /**
9
9
  * @public
@@ -1,7 +1,7 @@
1
- export { defineParagraph } from './paragraph'
2
- export type { ParagraphExtension } from './paragraph'
3
- export { defineParagraphCommands } from './paragraph-commands'
4
- export type { ParagraphCommandsExtension } from './paragraph-commands'
5
- export { defineParagraphKeymap } from './paragraph-keymap'
6
- export { defineParagraphSpec } from './paragraph-spec'
7
- export type { ParagraphSpecExtension } from './paragraph-spec'
1
+ export { defineParagraphCommands } from './paragraph-commands.ts'
2
+ export type { ParagraphCommandsExtension } from './paragraph-commands.ts'
3
+ export { defineParagraphKeymap } from './paragraph-keymap.ts'
4
+ export { defineParagraphSpec } from './paragraph-spec.ts'
5
+ export type { ParagraphSpecExtension } from './paragraph-spec.ts'
6
+ export { defineParagraph } from './paragraph.ts'
7
+ export type { ParagraphExtension } from './paragraph.ts'
@@ -1,6 +1,6 @@
1
1
  import { defineKeymap, type PlainExtension } from '@prosekit/core'
2
2
 
3
- import { setParagraph } from './paragraph-commands'
3
+ import { setParagraph } from './paragraph-commands.ts'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -1,8 +1,8 @@
1
1
  import { Priority, union, withPriority, type Union } from '@prosekit/core'
2
2
 
3
- import { defineParagraphCommands, type ParagraphCommandsExtension } from './paragraph-commands'
4
- import { defineParagraphKeymap } from './paragraph-keymap'
5
- import { defineParagraphSpec, type ParagraphSpecExtension } from './paragraph-spec'
3
+ import { defineParagraphCommands, type ParagraphCommandsExtension } from './paragraph-commands.ts'
4
+ import { defineParagraphKeymap } from './paragraph-keymap.ts'
5
+ import { defineParagraphSpec, type ParagraphSpecExtension } from './paragraph-spec.ts'
6
6
 
7
7
  /**
8
8
  * @internal
@@ -1,2 +1,2 @@
1
- export { defineMarkPasteRule, type MarkPasteRuleOptions } from './mark-paste-rule'
2
- export { definePasteRule, type PasteRuleHandler, type PasteRuleHandlerOptions, type PasteRuleOptions } from './paste-rule'
1
+ export { defineMarkPasteRule, type MarkPasteRuleOptions } from './mark-paste-rule.ts'
2
+ export { definePasteRule, type PasteRuleHandler, type PasteRuleHandlerOptions, type PasteRuleOptions } from './paste-rule.ts'
@@ -1,15 +1,15 @@
1
1
  import { defineMarkSpec, union } from '@prosekit/core'
2
2
  import { describe, expect, it } from 'vitest'
3
3
 
4
- import { defineBold } from '../bold'
5
- import { defineDoc } from '../doc'
6
- import { defineParagraph } from '../paragraph'
7
- import { setupTestFromExtension } from '../testing'
8
- import { pasteHTML, pasteText } from '../testing/clipboard'
9
- import { defineText } from '../text'
4
+ import { defineBold } from '../bold/index.ts'
5
+ import { defineDoc } from '../doc/index.ts'
6
+ import { defineParagraph } from '../paragraph/index.ts'
7
+ import { pasteHTML, pasteText } from '../testing/clipboard.ts'
8
+ import { setupTestFromExtension } from '../testing/index.ts'
9
+ import { defineText } from '../text/index.ts'
10
10
 
11
- import type { MarkPasteRuleOptions } from './mark-paste-rule'
12
- import { defineMarkPasteRule } from './mark-paste-rule'
11
+ import type { MarkPasteRuleOptions } from './mark-paste-rule.ts'
12
+ import { defineMarkPasteRule } from './mark-paste-rule.ts'
13
13
 
14
14
  function setup(options?: Partial<MarkPasteRuleOptions>) {
15
15
  return setupTestFromExtension(union(
@@ -2,8 +2,8 @@ import { getMarkType, type PlainExtension } from '@prosekit/core'
2
2
  import type { Attrs, MarkType, ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import { Fragment, Slice } from '@prosekit/pm/model'
4
4
 
5
- import { definePasteRule } from './paste-rule'
6
- import { splitTextByRegex } from './split-text-by-regex'
5
+ import { definePasteRule } from './paste-rule.ts'
6
+ import { splitTextByRegex } from './split-text-by-regex.ts'
7
7
 
8
8
  /**
9
9
  * The options for {@link defineMarkPasteRule}.
@@ -3,9 +3,9 @@ import type { ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import { Fragment, Slice } from '@prosekit/pm/model'
4
4
  import { describe, expect, it } from 'vitest'
5
5
 
6
- import { defineTestExtension, setupTestFromExtension } from '../testing'
6
+ import { defineTestExtension, setupTestFromExtension } from '../testing/index.ts'
7
7
 
8
- import { definePasteRule } from './paste-rule'
8
+ import { definePasteRule } from './paste-rule.ts'
9
9
 
10
10
  function replaceTextInSlice(slice: Slice, from: string, to: string): Slice {
11
11
  return new Slice(
@@ -2,7 +2,7 @@ import type { PlainExtension } from '@prosekit/core'
2
2
  import type { Slice } from '@prosekit/pm/model'
3
3
  import type { EditorView } from '@prosekit/pm/view'
4
4
 
5
- import { definePasteRulePlugin } from './paste-rule-plugin'
5
+ import { definePasteRulePlugin } from './paste-rule-plugin.ts'
6
6
 
7
7
  /**
8
8
  * @public
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { splitTextByRegex } from './split-text-by-regex'
3
+ import { splitTextByRegex } from './split-text-by-regex.ts'
4
4
 
5
5
  describe('splitTextByRegex', () => {
6
6
  it('should return undefined when no matches are found', () => {
@@ -3,7 +3,7 @@ import type { ProseMirrorNode } from '@prosekit/pm/model'
3
3
  import { Plugin, PluginKey, type EditorState } from '@prosekit/pm/state'
4
4
  import { Decoration, DecorationSet } from '@prosekit/pm/view'
5
5
 
6
- import { findTable } from '../table'
6
+ import { findTable } from '../table/index.ts'
7
7
 
8
8
  export interface PlaceholderOptions {
9
9
  /**
@@ -11,7 +11,7 @@ import {
11
11
  } from '@prosekit/core'
12
12
  import type { Attrs } from '@prosekit/pm/model'
13
13
 
14
- import { defineMarkInputRule } from '../input-rule'
14
+ import { defineMarkInputRule } from '../input-rule/index.ts'
15
15
 
16
16
  /**
17
17
  * @internal
@@ -1,15 +1,14 @@
1
- export { defineTable, type TableExtension } from './table'
2
- export { defineTableCommands, type TableCommandsExtension } from './table-commands'
3
- export { exitTable } from './table-commands/exit-table'
4
- export { insertTable, type InsertTableOptions } from './table-commands/insert-table'
5
- export { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column'
6
- export { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row'
7
- export { selectTable, type SelectTableOptions } from './table-commands/select-table'
8
- export { selectTableCell, type SelectTableCellOptions } from './table-commands/select-table-cell'
9
- export { selectTableColumn, type SelectTableColumnOptions } from './table-commands/select-table-column'
10
- export { selectTableRow, type SelectTableRowOptions } from './table-commands/select-table-row'
11
- export { defineTableDropIndicator } from './table-drop-indicator'
12
- export { defineTablePlugins } from './table-plugins'
1
+ export { defineTableCommands, type TableCommandsExtension } from './table-commands.ts'
2
+ export { exitTable } from './table-commands/exit-table.ts'
3
+ export { insertTable, type InsertTableOptions } from './table-commands/insert-table.ts'
4
+ export { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column.ts'
5
+ export { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row.ts'
6
+ export { selectTableCell, type SelectTableCellOptions } from './table-commands/select-table-cell.ts'
7
+ export { selectTableColumn, type SelectTableColumnOptions } from './table-commands/select-table-column.ts'
8
+ export { selectTableRow, type SelectTableRowOptions } from './table-commands/select-table-row.ts'
9
+ export { selectTable, type SelectTableOptions } from './table-commands/select-table.ts'
10
+ export { defineTableDropIndicator } from './table-drop-indicator.ts'
11
+ export { defineTablePlugins } from './table-plugins.ts'
13
12
  export {
14
13
  defineTableCellSpec,
15
14
  defineTableHeaderCellSpec,
@@ -19,5 +18,6 @@ export {
19
18
  type TableHeaderCellSpecExtension,
20
19
  type TableRowSpecExtension,
21
20
  type TableSpecExtension,
22
- } from './table-spec'
23
- export { findTable, isCellSelection } from './table-utils'
21
+ } from './table-spec.ts'
22
+ export { findTable, isCellSelection } from './table-utils.ts'
23
+ export { defineTable, type TableExtension } from './table.ts'
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
4
- import { isCellSelection } from '../table-utils'
5
- import { setCellSelection } from '../test-utils'
3
+ import { setupTest } from '../../testing/index.ts'
4
+ import { isCellSelection } from '../table-utils.ts'
5
+ import { setCellSelection } from '../test-utils.ts'
6
6
 
7
7
  describe('deleteCellSelection', () => {
8
8
  it('can clear the content in the selected table cells', () => {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
4
- import { inputText } from '../../testing/keyboard'
3
+ import { setupTest } from '../../testing/index.ts'
4
+ import { inputText } from '../../testing/keyboard.ts'
5
5
 
6
6
  describe('exitTable', () => {
7
7
  it('can exist a table', async () => {
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
3
+ import { setupTest } from '../../testing/index.ts'
4
4
 
5
5
  describe('insertTable', () => {
6
6
  it('can insert a table', () => {
@@ -2,9 +2,9 @@ import type { Command } from '@prosekit/pm/state'
2
2
  import { CellSelection } from 'prosemirror-tables'
3
3
  import { describe, expect, it } from 'vitest'
4
4
 
5
- import { setupTest } from '../../testing'
5
+ import { setupTest } from '../../testing/index.ts'
6
6
 
7
- import { moveTableColumn } from './move-table-column'
7
+ import { moveTableColumn } from './move-table-column.ts'
8
8
 
9
9
  function setup() {
10
10
  const { editor, n } = setupTest()
@@ -2,9 +2,9 @@ import type { Command } from '@prosekit/pm/state'
2
2
  import { CellSelection } from 'prosemirror-tables'
3
3
  import { describe, expect, it } from 'vitest'
4
4
 
5
- import { setupTest } from '../../testing'
5
+ import { setupTest } from '../../testing/index.ts'
6
6
 
7
- import { moveTableRow } from './move-table-row'
7
+ import { moveTableRow } from './move-table-row.ts'
8
8
 
9
9
  function setup() {
10
10
  const { editor, n } = setupTest()
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
4
- import { isCellSelection } from '../table-utils'
5
- import { inspectSelectedCells } from '../test-utils'
3
+ import { setupTest } from '../../testing/index.ts'
4
+ import { isCellSelection } from '../table-utils.ts'
5
+ import { inspectSelectedCells } from '../test-utils.ts'
6
6
 
7
7
  describe('selectTableCell', () => {
8
8
  it('can select a table cell', () => {
@@ -1,7 +1,7 @@
1
1
  import type { Command } from '@prosekit/pm/state'
2
2
  import { CellSelection } from 'prosemirror-tables'
3
3
 
4
- import { findCellPos } from '../table-utils'
4
+ import { findCellPos } from '../table-utils.ts'
5
5
 
6
6
  /**
7
7
  * @public
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
4
- import { inspectSelectedCells } from '../test-utils'
3
+ import { setupTest } from '../../testing/index.ts'
4
+ import { inspectSelectedCells } from '../test-utils.ts'
5
5
 
6
6
  describe('selectTableColumn', () => {
7
7
  it('can select the whole table column', () => {
@@ -1,7 +1,7 @@
1
1
  import type { Command } from '@prosekit/pm/state'
2
2
  import { CellSelection } from 'prosemirror-tables'
3
3
 
4
- import { findCellRange } from '../table-utils'
4
+ import { findCellRange } from '../table-utils.ts'
5
5
 
6
6
  /**
7
7
  * @public
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
4
- import { inspectSelectedCells } from '../test-utils'
3
+ import { setupTest } from '../../testing/index.ts'
4
+ import { inspectSelectedCells } from '../test-utils.ts'
5
5
 
6
6
  describe('selectTableRow', () => {
7
7
  it('can select the whole table row', () => {
@@ -1,7 +1,7 @@
1
1
  import type { Command } from '@prosekit/pm/state'
2
2
  import { CellSelection } from 'prosemirror-tables'
3
3
 
4
- import { findCellRange } from '../table-utils'
4
+ import { findCellRange } from '../table-utils.ts'
5
5
 
6
6
  /**
7
7
  * @public
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../../testing'
4
- import { inspectSelectedCells } from '../test-utils'
3
+ import { setupTest } from '../../testing/index.ts'
4
+ import { inspectSelectedCells } from '../test-utils.ts'
5
5
 
6
6
  describe('selectTable', () => {
7
7
  it('can select the whole table', () => {
@@ -1,7 +1,7 @@
1
1
  import type { Command } from '@prosekit/pm/state'
2
2
  import { CellSelection, TableMap } from 'prosemirror-tables'
3
3
 
4
- import { findTable } from '../table-utils'
4
+ import { findTable } from '../table-utils.ts'
5
5
 
6
6
  /**
7
7
  * @public
@@ -11,15 +11,15 @@ import {
11
11
  splitCell,
12
12
  } from 'prosemirror-tables'
13
13
 
14
- import { deleteCellSelection } from './table-commands/delete-cell-selection'
15
- import { exitTable } from './table-commands/exit-table'
16
- import { insertTable, type InsertTableOptions } from './table-commands/insert-table'
17
- import { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column'
18
- import { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row'
19
- import { selectTable, type SelectTableOptions } from './table-commands/select-table'
20
- import { selectTableCell, type SelectTableCellOptions } from './table-commands/select-table-cell'
21
- import { selectTableColumn, type SelectTableColumnOptions } from './table-commands/select-table-column'
22
- import { selectTableRow, type SelectTableRowOptions } from './table-commands/select-table-row'
14
+ import { deleteCellSelection } from './table-commands/delete-cell-selection.ts'
15
+ import { exitTable } from './table-commands/exit-table.ts'
16
+ import { insertTable, type InsertTableOptions } from './table-commands/insert-table.ts'
17
+ import { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column.ts'
18
+ import { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row.ts'
19
+ import { selectTableCell, type SelectTableCellOptions } from './table-commands/select-table-cell.ts'
20
+ import { selectTableColumn, type SelectTableColumnOptions } from './table-commands/select-table-column.ts'
21
+ import { selectTableRow, type SelectTableRowOptions } from './table-commands/select-table-row.ts'
22
+ import { selectTable, type SelectTableOptions } from './table-commands/select-table.ts'
23
23
 
24
24
  /**
25
25
  * @internal
@@ -1,7 +1,7 @@
1
1
  import type { PlainExtension } from '@prosekit/core'
2
2
 
3
- import type { DragEventHandler } from '../drop-indicator'
4
- import { defineDropIndicator } from '../drop-indicator'
3
+ import type { DragEventHandler } from '../drop-indicator/index.ts'
4
+ import { defineDropIndicator } from '../drop-indicator/index.ts'
5
5
 
6
6
  /**
7
7
  * Hides the drop indicator when dragging a table column or row by using the
@@ -2,11 +2,11 @@ import { union } from '@prosekit/core'
2
2
  import pick from 'just-pick'
3
3
  import { describe, expect, it } from 'vitest'
4
4
 
5
- import { defineDoc } from '../doc'
6
- import { defineParagraph } from '../paragraph'
7
- import { defineText } from '../text'
5
+ import { defineDoc } from '../doc/index.ts'
6
+ import { defineParagraph } from '../paragraph/index.ts'
7
+ import { defineText } from '../text/index.ts'
8
8
 
9
- import { defineTableCellSpec, defineTableHeaderCellSpec, defineTableRowSpec, defineTableSpec } from './table-spec'
9
+ import { defineTableCellSpec, defineTableHeaderCellSpec, defineTableRowSpec, defineTableSpec } from './table-spec.ts'
10
10
 
11
11
  describe('table spec', () => {
12
12
  it('should be defined', () => {
@@ -1,8 +1,8 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineTableCommands, type TableCommandsExtension } from './table-commands'
4
- import { defineTableDropIndicator } from './table-drop-indicator'
5
- import { defineTablePlugins } from './table-plugins'
3
+ import { defineTableCommands, type TableCommandsExtension } from './table-commands.ts'
4
+ import { defineTableDropIndicator } from './table-drop-indicator.ts'
5
+ import { defineTablePlugins } from './table-plugins.ts'
6
6
  import {
7
7
  defineTableCellSpec,
8
8
  defineTableHeaderCellSpec,
@@ -12,7 +12,7 @@ import {
12
12
  type TableHeaderCellSpecExtension,
13
13
  type TableRowSpecExtension,
14
14
  type TableSpecExtension,
15
- } from './table-spec'
15
+ } from './table-spec.ts'
16
16
 
17
17
  /**
18
18
  * @internal