@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
@@ -1,9 +1,9 @@
1
- import type { HighlighterOptions, HighlighterResult } from './shiki-highlighter-chunk'
1
+ import type { HighlighterOptions, HighlighterResult } from './shiki-highlighter-chunk.ts'
2
2
 
3
3
  let loaded: ((options: HighlighterOptions) => HighlighterResult) | undefined
4
4
 
5
5
  async function load() {
6
- const { createOrGetHighlighter } = await import('./shiki-highlighter-chunk')
6
+ const { createOrGetHighlighter } = await import('./shiki-highlighter-chunk.ts')
7
7
  loaded = createOrGetHighlighter
8
8
  }
9
9
 
@@ -1,8 +1,8 @@
1
1
  import type { Parser } from 'prosemirror-highlight'
2
2
  import { createParser } from 'prosemirror-highlight/shiki'
3
3
 
4
- import type { ShikiBundledLanguage } from './shiki-bundle'
5
- import { createOrGetHighlighter, type HighlighterOptions } from './shiki-highlighter'
4
+ import type { ShikiBundledLanguage } from './shiki-bundle.ts'
5
+ import { createOrGetHighlighter, type HighlighterOptions } from './shiki-highlighter.ts'
6
6
 
7
7
  /**
8
8
  * @internal
@@ -1 +1 @@
1
- export { defineDropCursor, type DropCursorExtension, type DropCursorOptions } from './drop-cursor'
1
+ export { defineDropCursor, type DropCursorExtension, type DropCursorOptions } from './drop-cursor.ts'
@@ -1,7 +1,7 @@
1
1
  import type { PlainExtension } from '@prosekit/core'
2
2
  import type { DropIndicatorPluginOptions } from 'prosemirror-drop-indicator'
3
3
 
4
- import { defineDropIndicatorPayload } from './drop-indicator-facet'
4
+ import { defineDropIndicatorPayload } from './drop-indicator-facet.ts'
5
5
 
6
6
  /**
7
7
  * @internal
@@ -7,4 +7,4 @@ export type {
7
7
  ShowHandlerOptions,
8
8
  ViewDragging,
9
9
  } from 'prosemirror-drop-indicator'
10
- export { defineDropIndicator, type DropIndicatorExtension, type DropIndicatorOptions } from './drop-indicator'
10
+ export { defineDropIndicator, type DropIndicatorExtension, type DropIndicatorOptions } from './drop-indicator.ts'
@@ -5,7 +5,7 @@ import {
5
5
  type EnterRule,
6
6
  type EnterRuleHandler,
7
7
  type EnterRuleHandlerOptions,
8
- type TextBlockEnterRuleOptions as _TextBlockEnterRuleOptions,
8
+ type TextBlockEnterRuleOptions as TextBlockEnterRuleOptionsBase,
9
9
  } from 'prosemirror-enter-rules'
10
10
 
11
11
  export type { EnterRuleHandler, EnterRuleHandlerOptions }
@@ -15,14 +15,14 @@ export type { EnterRuleHandler, EnterRuleHandlerOptions }
15
15
  *
16
16
  * @public
17
17
  */
18
- export type EnterRuleOptions = EnterRule
18
+ export interface EnterRuleOptions extends EnterRule {}
19
19
 
20
20
  /**
21
21
  * Options for {@link defineTextBlockEnterRule}.
22
22
  *
23
23
  * @public
24
24
  */
25
- export type TextBlockEnterRuleOptions = _TextBlockEnterRuleOptions
25
+ export interface TextBlockEnterRuleOptions extends TextBlockEnterRuleOptionsBase {}
26
26
 
27
27
  /**
28
28
  * Defines an enter rule. An enter rule applies when the text directly in front of
@@ -8,7 +8,7 @@ import {
8
8
  } from '@prosekit/core'
9
9
  import type { EditorView } from '@prosekit/pm/view'
10
10
 
11
- import { handleEvent } from './helpers'
11
+ import { handleEvent } from './helpers.ts'
12
12
 
13
13
  export interface FileDropHandlerOptions {
14
14
  /**
@@ -1,10 +1,10 @@
1
1
  import { Priority, union, withPriority } from '@prosekit/core'
2
2
  import { beforeEach, describe, expect, it, vi } from 'vitest'
3
3
 
4
- import { defineTestExtension, setupTestFromExtension } from '../testing'
5
- import { pasteFiles } from '../testing/clipboard'
4
+ import { pasteFiles } from '../testing/clipboard.ts'
5
+ import { defineTestExtension, setupTestFromExtension } from '../testing/index.ts'
6
6
 
7
- import { defineFilePasteHandler } from './file-paste-handler'
7
+ import { defineFilePasteHandler } from './file-paste-handler.ts'
8
8
 
9
9
  function definePngPasteHandler(handler: VoidFunction) {
10
10
  const extension = defineFilePasteHandler((options) => {
@@ -8,7 +8,7 @@ import {
8
8
  } from '@prosekit/core'
9
9
  import type { EditorView } from '@prosekit/pm/view'
10
10
 
11
- import { handleEvent } from './helpers'
11
+ import { handleEvent } from './helpers.ts'
12
12
 
13
13
  export interface FilePasteHandlerOptions {
14
14
  /**
package/src/file/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { defineFileDropHandler, type FileDropHandler, type FileDropHandlerOptions } from './file-drop-handler'
2
- export { defineFilePasteHandler, type FilePasteHandler, type FilePasteHandlerOptions } from './file-paste-handler'
3
- export { UploadTask, type Uploader, type UploaderOptions, type UploadProgress } from './file-upload'
1
+ export { defineFileDropHandler, type FileDropHandler, type FileDropHandlerOptions } from './file-drop-handler.ts'
2
+ export { defineFilePasteHandler, type FilePasteHandler, type FilePasteHandlerOptions } from './file-paste-handler.ts'
3
+ export { UploadTask, type Uploader, type UploaderOptions, type UploadProgress } from './file-upload.ts'
@@ -1 +1 @@
1
- export { defineGapCursor, type GapCursorExtension } from './gap-cursor'
1
+ export { defineGapCursor, type GapCursorExtension } from './gap-cursor.ts'
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
  import { keyboard } from 'vitest-browser-commands/playwright'
3
3
 
4
- import { setupTest } from '../testing'
5
- import { inputText } from '../testing/keyboard'
4
+ import { setupTest } from '../testing/index.ts'
5
+ import { inputText } from '../testing/keyboard.ts'
6
6
 
7
7
  describe('defineHardBreakKeymap', () => {
8
8
  it('should insert hard break', async () => {
@@ -1,6 +1,6 @@
1
1
  import { defineKeymap, type PlainExtension } from '@prosekit/core'
2
2
 
3
- import { insertHardBreak } from './hard-break-commands'
3
+ import { insertHardBreak } from './hard-break-commands.ts'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -1,8 +1,8 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineHardBreakCommands, type HardBreakCommandsExtension } from './hard-break-commands'
4
- import { defineHardBreakKeymap } from './hard-break-keymap'
5
- import { defineHardBreakSpec, type HardBreakSpecExtension } from './hard-break-spec'
3
+ import { defineHardBreakCommands, type HardBreakCommandsExtension } from './hard-break-commands.ts'
4
+ import { defineHardBreakKeymap } from './hard-break-keymap.ts'
5
+ import { defineHardBreakSpec, type HardBreakSpecExtension } from './hard-break-spec.ts'
6
6
 
7
7
  /**
8
8
  * @internal
@@ -1,4 +1,4 @@
1
- export { defineHardBreak, type HardBreakExtension } from './hard-break'
2
- export { defineHardBreakCommands, type HardBreakCommandsExtension } from './hard-break-commands'
3
- export { defineHardBreakKeymap } from './hard-break-keymap'
4
- export { defineHardBreakSpec, type HardBreakSpecExtension } from './hard-break-spec'
1
+ export { defineHardBreakCommands, type HardBreakCommandsExtension } from './hard-break-commands.ts'
2
+ export { defineHardBreakKeymap } from './hard-break-keymap.ts'
3
+ export { defineHardBreakSpec, type HardBreakSpecExtension } from './hard-break-spec.ts'
4
+ export { defineHardBreak, type HardBreakExtension } from './hard-break.ts'
@@ -1,6 +1,6 @@
1
1
  import { defineCommands, insertNode, setBlockType, toggleNode, type Extension } from '@prosekit/core'
2
2
 
3
- import type { HeadingAttrs } from './heading-types'
3
+ import type { HeadingAttrs } from './heading-types.ts'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -1,8 +1,8 @@
1
1
  import type { PlainExtension } from '@prosekit/core'
2
2
 
3
- import { defineTextBlockInputRule } from '../input-rule'
3
+ import { defineTextBlockInputRule } from '../input-rule/index.ts'
4
4
 
5
- import type { HeadingAttrs } from './heading-types'
5
+ import type { HeadingAttrs } from './heading-types.ts'
6
6
 
7
7
  /**
8
8
  * Converts the text block to a heading when `#` is typed at the start of a new
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
  import { keyboard } from 'vitest-browser-commands/playwright'
3
3
 
4
- import { setupTest } from '../testing'
4
+ import { setupTest } from '../testing/index.ts'
5
5
 
6
6
  describe('defineHeadingKeymap', () => {
7
7
  it('should toggle heading', async () => {
@@ -1,6 +1,6 @@
1
1
  import { defineNodeSpec, type Extension } from '@prosekit/core'
2
2
 
3
- import type { HeadingAttrs } from './heading-types'
3
+ import type { HeadingAttrs } from './heading-types.ts'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -1,9 +1,9 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineHeadingCommands, type HeadingCommandsExtension } from './heading-commands'
4
- import { defineHeadingInputRule } from './heading-input-rule'
5
- import { defineHeadingKeymap } from './heading-keymap'
6
- import { defineHeadingSpec, type HeadingSpecExtension } from './heading-spec'
3
+ import { defineHeadingCommands, type HeadingCommandsExtension } from './heading-commands.ts'
4
+ import { defineHeadingInputRule } from './heading-input-rule.ts'
5
+ import { defineHeadingKeymap } from './heading-keymap.ts'
6
+ import { defineHeadingSpec, type HeadingSpecExtension } from './heading-spec.ts'
7
7
 
8
8
  /**
9
9
  * @internal
@@ -1,6 +1,6 @@
1
- export { defineHeading, type HeadingExtension } from './heading'
2
- export { defineHeadingCommands, type HeadingCommandsExtension } from './heading-commands'
3
- export { defineHeadingInputRule } from './heading-input-rule'
4
- export { defineHeadingKeymap } from './heading-keymap'
5
- export { defineHeadingSpec, type HeadingSpecExtension } from './heading-spec'
6
- export type { HeadingAttrs } from './heading-types'
1
+ export { defineHeadingCommands, type HeadingCommandsExtension } from './heading-commands.ts'
2
+ export { defineHeadingInputRule } from './heading-input-rule.ts'
3
+ export { defineHeadingKeymap } from './heading-keymap.ts'
4
+ export { defineHeadingSpec, type HeadingSpecExtension } from './heading-spec.ts'
5
+ export type { HeadingAttrs } from './heading-types.ts'
6
+ export { defineHeading, type HeadingExtension } from './heading.ts'
@@ -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('insertHorizontalRule', () => {
6
6
  const { editor, n } = setupTest()
@@ -8,21 +8,23 @@ export type HorizontalRuleCommandsExtension = Extension<{
8
8
  }
9
9
  }>
10
10
 
11
+ const insertHorizontalRuleCommand: Command = (state, dispatch): boolean => {
12
+ if (!dispatch) return true
13
+
14
+ const { schema, tr } = state
15
+ const type = getNodeType(schema, 'horizontalRule')
16
+ const node = type.createChecked()
17
+ const pos = tr.selection.anchor
18
+ tr.replaceRange(pos, pos, new Slice(Fragment.from(node), 0, 0))
19
+ dispatch(tr)
20
+ return true
21
+ }
22
+
11
23
  /**
12
24
  * Returns a command that inserts a horizontal rule at the current selection.
13
25
  */
14
26
  export function insertHorizontalRule(): Command {
15
- return (state, dispatch) => {
16
- if (!dispatch) return true
17
-
18
- const { schema, tr } = state
19
- const type = getNodeType(schema, 'horizontalRule')
20
- const node = type.createChecked()
21
- const pos = tr.selection.anchor
22
- tr.replaceRange(pos, pos, new Slice(Fragment.from(node), 0, 0))
23
- dispatch(tr)
24
- return true
25
- }
27
+ return insertHorizontalRuleCommand
26
28
  }
27
29
 
28
30
  export function defineHorizontalRuleCommands(): HorizontalRuleCommandsExtension {
@@ -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('defineHorizontalRuleInputRule', () => {
7
7
  const { editor, n } = setupTest()
@@ -1,7 +1,7 @@
1
1
  import { getNodeType, union, type PlainExtension } from '@prosekit/core'
2
2
  import { InputRule } from '@prosekit/pm/inputrules'
3
3
 
4
- import { defineInputRule } from '../input-rule'
4
+ import { defineInputRule } from '../input-rule/index.ts'
5
5
 
6
6
  /**
7
7
  * @public
@@ -1,8 +1,8 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineHorizontalRuleCommands, type HorizontalRuleCommandsExtension } from './horizontal-rule-commands'
4
- import { defineHorizontalRuleInputRule } from './horizontal-rule-input-rule'
5
- import { defineHorizontalRuleSpec, type HorizontalRuleSpecExtension } from './horizontal-rule-spec'
3
+ import { defineHorizontalRuleCommands, type HorizontalRuleCommandsExtension } from './horizontal-rule-commands.ts'
4
+ import { defineHorizontalRuleInputRule } from './horizontal-rule-input-rule.ts'
5
+ import { defineHorizontalRuleSpec, type HorizontalRuleSpecExtension } from './horizontal-rule-spec.ts'
6
6
 
7
7
  export type HorizontalRuleExtension = Union<
8
8
  [HorizontalRuleSpecExtension, HorizontalRuleCommandsExtension]
@@ -1,4 +1,4 @@
1
- export { defineHorizontalRule, type HorizontalRuleExtension } from './horizontal-rule'
2
- export { defineHorizontalRuleCommands, insertHorizontalRule, type HorizontalRuleCommandsExtension } from './horizontal-rule-commands'
3
- export { defineHorizontalRuleInputRule } from './horizontal-rule-input-rule'
4
- export { defineHorizontalRuleSpec, type HorizontalRuleSpecExtension } from './horizontal-rule-spec'
1
+ export { defineHorizontalRuleCommands, insertHorizontalRule, type HorizontalRuleCommandsExtension } from './horizontal-rule-commands.ts'
2
+ export { defineHorizontalRuleInputRule } from './horizontal-rule-input-rule.ts'
3
+ export { defineHorizontalRuleSpec, type HorizontalRuleSpecExtension } from './horizontal-rule-spec.ts'
4
+ export { defineHorizontalRule, type HorizontalRuleExtension } from './horizontal-rule.ts'
@@ -1,7 +1,7 @@
1
1
  import { insertNode } from '@prosekit/core'
2
2
  import type { Command } from '@prosekit/pm/state'
3
3
 
4
- import type { ImageAttrs } from '../image-spec'
4
+ import type { ImageAttrs } from '../image-spec.ts'
5
5
 
6
6
  /**
7
7
  * Returns a command that inserts an image node with the given attributes at the
@@ -3,11 +3,11 @@ import { findNode, findNodes } from '@prosekit/core'
3
3
  import type { ProseMirrorNode } from '@prosekit/pm/model'
4
4
  import { describe, expect, it, vi } from 'vitest'
5
5
 
6
- import type { Uploader } from '../../file'
7
- import { setupTest } from '../../testing'
8
- import type { ImageAttrs } from '../image-spec'
6
+ import type { Uploader } from '../../file/index.ts'
7
+ import { setupTest } from '../../testing/index.ts'
8
+ import type { ImageAttrs } from '../image-spec.ts'
9
9
 
10
- import { replaceImageURL, uploadImage, type ImageUploadErrorHandler } from './upload-image'
10
+ import { replaceImageURL, uploadImage, type ImageUploadErrorHandler } from './upload-image.ts'
11
11
 
12
12
  describe('uploadImage', () => {
13
13
  it('should insert image at current selection by default', async () => {
@@ -2,8 +2,8 @@ import { insertNode, ProseKitError } from '@prosekit/core'
2
2
  import type { Command, EditorState, Transaction } from '@prosekit/pm/state'
3
3
  import type { EditorView } from '@prosekit/pm/view'
4
4
 
5
- import { UploadTask, type Uploader } from '../../file'
6
- import type { ImageAttrs } from '../image-spec'
5
+ import { UploadTask, type Uploader } from '../../file/index.ts'
6
+ import type { ImageAttrs } from '../image-spec.ts'
7
7
 
8
8
  /**
9
9
  * Options for {@link uploadImage}.
@@ -1,8 +1,8 @@
1
1
  import { defineCommands, type Extension } from '@prosekit/core'
2
2
 
3
- import { insertImage } from './image-commands/insert-image'
4
- import { uploadImage, type UploadImageOptions } from './image-commands/upload-image'
5
- import type { ImageAttrs } from './image-spec'
3
+ import { insertImage } from './image-commands/insert-image.ts'
4
+ import { uploadImage, type UploadImageOptions } from './image-commands/upload-image.ts'
5
+ import type { ImageAttrs } from './image-spec.ts'
6
6
 
7
7
  /**
8
8
  * @internal
@@ -8,9 +8,9 @@ import {
8
8
  type FilePasteHandler,
9
9
  type FilePasteHandlerOptions,
10
10
  type Uploader,
11
- } from '../file'
11
+ } from '../file/index.ts'
12
12
 
13
- import { uploadImage, type ImageUploadErrorHandler } from './image-commands/upload-image'
13
+ import { uploadImage, type ImageUploadErrorHandler } from './image-commands/upload-image.ts'
14
14
 
15
15
  /**
16
16
  * A predicate to determine if the pasted file should be uploaded and inserted as an image.
@@ -1,7 +1,7 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineImageCommands, type ImageCommandsExtension } from './image-commands'
4
- import { defineImageSpec, type ImageSpecExtension } from './image-spec'
3
+ import { defineImageCommands, type ImageCommandsExtension } from './image-commands.ts'
4
+ import { defineImageSpec, type ImageSpecExtension } from './image-spec.ts'
5
5
 
6
6
  /**
7
7
  * @internal
@@ -1,17 +1,17 @@
1
- export { defineImage, type ImageExtension } from './image'
2
- export { defineImageCommands, type ImageCommandsExtension } from './image-commands'
3
- export { insertImage } from './image-commands/insert-image'
1
+ export { defineImageCommands, type ImageCommandsExtension } from './image-commands.ts'
2
+ export { insertImage } from './image-commands/insert-image.ts'
4
3
  export {
5
4
  replaceImageURL,
6
5
  uploadImage,
7
6
  type ImageUploadErrorHandler,
8
7
  type ImageUploadErrorHandlerOptions,
9
8
  type UploadImageOptions,
10
- } from './image-commands/upload-image'
11
- export { defineImageSpec, type ImageAttrs, type ImageSpecExtension } from './image-spec'
9
+ } from './image-commands/upload-image.ts'
10
+ export { defineImageSpec, type ImageAttrs, type ImageSpecExtension } from './image-spec.ts'
12
11
  export {
13
12
  defineImageUploadHandler,
14
13
  type ImageCanDropPredicate,
15
14
  type ImageCanPastePredicate,
16
15
  type ImageUploadHandlerOptions,
17
- } from './image-upload-handler'
16
+ } from './image-upload-handler.ts'
17
+ export { defineImage, type ImageExtension } from './image.ts'
@@ -1,5 +1,5 @@
1
- export { defineItalic, type ItalicExtension } from './italic'
2
- export { defineItalicCommands, type ItalicCommandsExtension } from './italic-commands'
3
- export { defineItalicInputRule } from './italic-input-rule'
4
- export { defineItalicKeymap } from './italic-keymap'
5
- export { defineItalicSpec, type ItalicSpecExtension } from './italic-spec'
1
+ export { defineItalicCommands, type ItalicCommandsExtension } from './italic-commands.ts'
2
+ export { defineItalicInputRule } from './italic-input-rule.ts'
3
+ export { defineItalicKeymap } from './italic-keymap.ts'
4
+ export { defineItalicSpec, type ItalicSpecExtension } from './italic-spec.ts'
5
+ export { defineItalic, type ItalicExtension } from './italic.ts'
@@ -1,11 +1,11 @@
1
1
  import { createEditor, defineBaseCommands, union } from '@prosekit/core'
2
2
  import { describe, expect, it } from 'vitest'
3
3
 
4
- import { defineDoc } from '../doc'
5
- import { defineParagraph } from '../paragraph'
6
- import { defineText } from '../text'
4
+ import { defineDoc } from '../doc/index.ts'
5
+ import { defineParagraph } from '../paragraph/index.ts'
6
+ import { defineText } from '../text/index.ts'
7
7
 
8
- import { defineItalic } from './index'
8
+ import { defineItalic } from './index.ts'
9
9
 
10
10
  describe('command', () => {
11
11
  const extension = union(
@@ -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('defineItalicInputRule', () => {
7
7
  const { editor, n, m } = setupTest()
@@ -1,6 +1,6 @@
1
1
  import { canUseRegexLookbehind, type PlainExtension } from '@prosekit/core'
2
2
 
3
- import { defineMarkInputRule } from '../input-rule'
3
+ import { defineMarkInputRule } from '../input-rule/index.ts'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -1,9 +1,9 @@
1
1
  import { union, type Union } from '@prosekit/core'
2
2
 
3
- import { defineItalicCommands, type ItalicCommandsExtension } from './italic-commands'
4
- import { defineItalicInputRule } from './italic-input-rule'
5
- import { defineItalicKeymap } from './italic-keymap'
6
- import { defineItalicSpec, type ItalicSpecExtension } from './italic-spec'
3
+ import { defineItalicCommands, type ItalicCommandsExtension } from './italic-commands.ts'
4
+ import { defineItalicInputRule } from './italic-input-rule.ts'
5
+ import { defineItalicKeymap } from './italic-keymap.ts'
6
+ import { defineItalicSpec, type ItalicSpecExtension } from './italic-spec.ts'
7
7
 
8
8
  /**
9
9
  * @internal
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
  import { keyboard } from 'vitest-browser-commands/playwright'
3
3
 
4
- import { setupTest } from '../testing'
5
- import { inputText } from '../testing/keyboard'
4
+ import { setupTest } from '../testing/index.ts'
5
+ import { inputText } from '../testing/keyboard.ts'
6
6
 
7
7
  describe('defineLinkCommands', () => {
8
8
  const { editor, n, m } = setupTest()
package/src/link/index.ts CHANGED
@@ -12,13 +12,13 @@ import {
12
12
  } from '@prosekit/core'
13
13
  import { InputRule } from '@prosekit/pm/inputrules'
14
14
 
15
- import { defineEnterRule } from '../enter-rule'
16
- import { defineInputRule } from '../input-rule'
17
- import { defineMarkRule } from '../mark-rule'
15
+ import { defineEnterRule } from '../enter-rule/index.ts'
16
+ import { defineInputRule } from '../input-rule/index.ts'
17
+ import { defineMarkRule } from '../mark-rule/index.ts'
18
18
 
19
- import { defineLinkPasteRule } from './link-paste-rule'
20
- import { LINK_ENTER_RE, LINK_INPUT_RE, LINK_MARK_RE } from './link-regex'
21
- import type { LinkAttrs } from './link-types'
19
+ import { defineLinkPasteRule } from './link-paste-rule.ts'
20
+ import { LINK_ENTER_RE, LINK_INPUT_RE, LINK_MARK_RE } from './link-regex.ts'
21
+ import type { LinkAttrs } from './link-types.ts'
22
22
 
23
23
  export { defineLinkPasteRule }
24
24
  export type { LinkAttrs }
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { setupTest } from '../testing'
4
- import { pasteHTML, pasteText } from '../testing/clipboard'
3
+ import { pasteHTML, pasteText } from '../testing/clipboard.ts'
4
+ import { setupTest } from '../testing/index.ts'
5
5
 
6
6
  describe('defineLinkPasteRule', () => {
7
7
  const { editor, n, m } = setupTest()
@@ -1,9 +1,9 @@
1
1
  import type { PlainExtension } from '@prosekit/core'
2
2
 
3
- import { defineMarkPasteRule } from '../paste-rule'
3
+ import { defineMarkPasteRule } from '../paste-rule/index.ts'
4
4
 
5
- import { LINK_MARK_RE } from './link-regex'
6
- import type { LinkAttrs } from './link-types'
5
+ import { LINK_MARK_RE } from './link-regex.ts'
6
+ import type { LinkAttrs } from './link-types.ts'
7
7
 
8
8
  /**
9
9
  * @internal
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
- import { LINK_MARK_RE } from './link-regex'
3
+ import { LINK_MARK_RE } from './link-regex.ts'
4
4
 
5
5
  describe('LINK_MARK_RE', () => {
6
6
  const cases = [
package/src/list/index.ts CHANGED
@@ -6,11 +6,11 @@ export type {
6
6
  UnwrapListOptions,
7
7
  WrapInListGetAttrs,
8
8
  } from 'prosemirror-flat-list'
9
- export { defineList, type ListExtension } from './list'
10
- export { defineListCommands, type ListCommandsExtension } from './list-commands'
11
- export { defineListInputRules } from './list-input-rules'
12
- export { defineListKeymap } from './list-keymap'
13
- export { defineListPlugins } from './list-plugins'
14
- export { defineListSerializer } from './list-serializer'
15
- export { defineListSpec, type ListSpecExtension } from './list-spec'
16
- export type { ListAttrs } from './list-types'
9
+ export { defineListCommands, type ListCommandsExtension } from './list-commands.ts'
10
+ export { defineListInputRules } from './list-input-rules.ts'
11
+ export { defineListKeymap } from './list-keymap.ts'
12
+ export { defineListPlugins } from './list-plugins.ts'
13
+ export { defineListSerializer } from './list-serializer.ts'
14
+ export { defineListSpec, type ListSpecExtension } from './list-spec.ts'
15
+ export type { ListAttrs } from './list-types.ts'
16
+ export { defineList, type ListExtension } from './list.ts'
@@ -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
  * Configures drop indicator to avoid unexpected drop point.
@@ -1,7 +1,7 @@
1
1
  import { union, type Extension } from '@prosekit/core'
2
2
  import { listInputRules } from 'prosemirror-flat-list'
3
3
 
4
- import { defineInputRule } from '../input-rule'
4
+ import { defineInputRule } from '../input-rule/index.ts'
5
5
 
6
6
  /**
7
7
  * @internal
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
  import { keyboard } from 'vitest-browser-commands/playwright'
3
3
 
4
- import { setupTest } from '../testing'
4
+ import { setupTest } from '../testing/index.ts'
5
5
 
6
6
  describe('keymap', () => {
7
7
  const { editor, n } = setupTest()