@prosekit/extensions 0.14.1 → 0.15.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.
- package/dist/commit/style.css +1 -3
- package/dist/{drop-indicator-DJq8pF92.js → drop-indicator.js} +2 -4
- package/dist/drop-indicator.js.map +1 -0
- package/dist/{file-upload-I9m1EJAM.js → file.js} +2 -6
- package/dist/file.js.map +1 -0
- package/dist/gap-cursor/style.css +5 -8
- package/dist/{file-upload-dr3IXUty.d.ts → index.d.ts} +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/list/style.css +79 -110
- package/dist/loro/style.css +18 -21
- package/dist/{mark-rule-CUnXwBuy.js → mark-rule.js} +3 -6
- package/dist/mark-rule.js.map +1 -0
- package/dist/page/style.css +43 -0
- package/dist/{mark-paste-rule-n_2Ehmb5.js → paste-rule.js} +3 -7
- package/dist/paste-rule.js.map +1 -0
- package/dist/placeholder/style.css +4 -7
- package/dist/prosekit-extensions-autocomplete.d.ts +1 -1
- package/dist/prosekit-extensions-autocomplete.js +17 -21
- package/dist/prosekit-extensions-autocomplete.js.map +1 -1
- package/dist/prosekit-extensions-background-color.d.ts +1 -1
- package/dist/prosekit-extensions-background-color.js +1 -4
- package/dist/prosekit-extensions-background-color.js.map +1 -1
- package/dist/prosekit-extensions-blockquote.d.ts +13 -13
- package/dist/prosekit-extensions-blockquote.d.ts.map +1 -1
- package/dist/prosekit-extensions-blockquote.js +6 -10
- package/dist/prosekit-extensions-blockquote.js.map +1 -1
- package/dist/prosekit-extensions-bold.d.ts +12 -12
- package/dist/prosekit-extensions-bold.d.ts.map +1 -1
- package/dist/prosekit-extensions-bold.js +1 -6
- package/dist/prosekit-extensions-bold.js.map +1 -1
- package/dist/prosekit-extensions-code-block.d.ts +56 -37
- package/dist/prosekit-extensions-code-block.d.ts.map +1 -1
- package/dist/prosekit-extensions-code-block.js +73 -76
- package/dist/prosekit-extensions-code-block.js.map +1 -1
- package/dist/prosekit-extensions-code.d.ts +12 -12
- package/dist/prosekit-extensions-code.d.ts.map +1 -1
- package/dist/prosekit-extensions-code.js +1 -6
- package/dist/prosekit-extensions-code.js.map +1 -1
- package/dist/prosekit-extensions-commit.d.ts +1 -1
- package/dist/prosekit-extensions-commit.js +2 -3
- package/dist/prosekit-extensions-commit.js.map +1 -1
- package/dist/prosekit-extensions-doc.js +1 -2
- package/dist/prosekit-extensions-doc.js.map +1 -1
- package/dist/prosekit-extensions-drop-cursor.js +1 -2
- package/dist/prosekit-extensions-drop-cursor.js.map +1 -1
- package/dist/prosekit-extensions-drop-indicator.js +2 -3
- package/dist/prosekit-extensions-enter-rule.d.ts +2 -2
- package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-enter-rule.js +1 -2
- package/dist/prosekit-extensions-enter-rule.js.map +1 -1
- package/dist/prosekit-extensions-file.d.ts +2 -2
- package/dist/prosekit-extensions-file.js +2 -3
- package/dist/prosekit-extensions-gap-cursor.js +1 -2
- package/dist/prosekit-extensions-gap-cursor.js.map +1 -1
- package/dist/prosekit-extensions-hard-break.d.ts +7 -7
- package/dist/prosekit-extensions-hard-break.d.ts.map +1 -1
- package/dist/prosekit-extensions-hard-break.js +1 -5
- package/dist/prosekit-extensions-hard-break.js.map +1 -1
- package/dist/prosekit-extensions-heading.d.ts +15 -15
- package/dist/prosekit-extensions-heading.d.ts.map +1 -1
- package/dist/prosekit-extensions-heading.js +1 -6
- package/dist/prosekit-extensions-heading.js.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.d.ts +7 -7
- package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.js +12 -14
- package/dist/prosekit-extensions-horizontal-rule.js.map +1 -1
- package/dist/prosekit-extensions-image.d.ts +12 -13
- package/dist/prosekit-extensions-image.d.ts.map +1 -1
- package/dist/prosekit-extensions-image.js +10 -16
- package/dist/prosekit-extensions-image.js.map +1 -1
- package/dist/prosekit-extensions-input-rule.js +1 -2
- package/dist/prosekit-extensions-input-rule.js.map +1 -1
- package/dist/prosekit-extensions-italic.d.ts +12 -12
- package/dist/prosekit-extensions-italic.d.ts.map +1 -1
- package/dist/prosekit-extensions-italic.js +1 -6
- package/dist/prosekit-extensions-italic.js.map +1 -1
- package/dist/prosekit-extensions-link.js +3 -6
- package/dist/prosekit-extensions-link.js.map +1 -1
- package/dist/prosekit-extensions-list.d.ts +26 -26
- package/dist/prosekit-extensions-list.d.ts.map +1 -1
- package/dist/prosekit-extensions-list.js +26 -34
- package/dist/prosekit-extensions-list.js.map +1 -1
- package/dist/prosekit-extensions-loro.d.ts +16 -16
- package/dist/prosekit-extensions-loro.d.ts.map +1 -1
- package/dist/prosekit-extensions-loro.js +3 -9
- package/dist/prosekit-extensions-loro.js.map +1 -1
- package/dist/prosekit-extensions-mark-rule.js +2 -3
- package/dist/prosekit-extensions-math.d.ts +3 -3
- package/dist/prosekit-extensions-math.d.ts.map +1 -1
- package/dist/prosekit-extensions-math.js +5 -5
- package/dist/prosekit-extensions-math.js.map +1 -1
- package/dist/prosekit-extensions-mention.js +1 -2
- package/dist/prosekit-extensions-mention.js.map +1 -1
- package/dist/prosekit-extensions-mod-click-prevention.js +2 -3
- package/dist/prosekit-extensions-mod-click-prevention.js.map +1 -1
- package/dist/prosekit-extensions-page.d.ts +114 -0
- package/dist/prosekit-extensions-page.d.ts.map +1 -0
- package/dist/prosekit-extensions-page.js +324 -0
- package/dist/prosekit-extensions-page.js.map +1 -0
- package/dist/prosekit-extensions-paragraph.d.ts +7 -7
- package/dist/prosekit-extensions-paragraph.d.ts.map +1 -1
- package/dist/prosekit-extensions-paragraph.js +3 -7
- package/dist/prosekit-extensions-paragraph.js.map +1 -1
- package/dist/prosekit-extensions-paste-rule.js +2 -3
- package/dist/prosekit-extensions-placeholder.d.ts +1 -1
- package/dist/prosekit-extensions-placeholder.js +3 -4
- package/dist/prosekit-extensions-placeholder.js.map +1 -1
- package/dist/prosekit-extensions-readonly.js +2 -3
- package/dist/prosekit-extensions-readonly.js.map +1 -1
- package/dist/prosekit-extensions-search.js +1 -2
- package/dist/prosekit-extensions-search.js.map +1 -1
- package/dist/prosekit-extensions-strike.js +1 -2
- package/dist/prosekit-extensions-strike.js.map +1 -1
- package/dist/prosekit-extensions-table.d.ts +47 -47
- package/dist/prosekit-extensions-table.d.ts.map +1 -1
- package/dist/prosekit-extensions-table.js +2 -3
- package/dist/prosekit-extensions-text-align.d.ts +1 -1
- package/dist/prosekit-extensions-text-align.js +1 -2
- package/dist/prosekit-extensions-text-align.js.map +1 -1
- package/dist/prosekit-extensions-text-color.d.ts +1 -1
- package/dist/prosekit-extensions-text-color.js +1 -4
- package/dist/prosekit-extensions-text-color.js.map +1 -1
- package/dist/prosekit-extensions-text.js +1 -2
- package/dist/prosekit-extensions-text.js.map +1 -1
- package/dist/prosekit-extensions-underline.js +1 -2
- package/dist/prosekit-extensions-underline.js.map +1 -1
- package/dist/prosekit-extensions-virtual-selection.js +2 -3
- package/dist/prosekit-extensions-virtual-selection.js.map +1 -1
- package/dist/prosekit-extensions-yjs.d.ts +3 -3
- package/dist/prosekit-extensions-yjs.d.ts.map +1 -1
- package/dist/prosekit-extensions-yjs.js +3 -9
- package/dist/prosekit-extensions-yjs.js.map +1 -1
- package/dist/prosekit-extensions.js +1 -1
- package/dist/search/style.css +4 -8
- package/dist/shiki-highlighter-chunk.js +1 -2
- package/dist/shiki-highlighter-chunk.js.map +1 -1
- package/dist/table/style.css +16 -16
- package/dist/{table-UJVYsrB7.js → table.js} +29 -41
- package/dist/table.js.map +1 -0
- package/dist/virtual-selection/style.css +1 -4
- package/dist/yjs/style.css +14 -20
- package/package.json +30 -16
- package/src/autocomplete/autocomplete-helpers.ts +1 -1
- package/src/autocomplete/autocomplete-plugin.ts +2 -2
- package/src/autocomplete/autocomplete-rule.ts +1 -1
- package/src/autocomplete/autocomplete.spec.ts +4 -4
- package/src/autocomplete/autocomplete.ts +2 -2
- package/src/autocomplete/index.ts +2 -2
- package/src/background-color/background-color-commands.spec.ts +1 -1
- package/src/background-color/background-color-commands.ts +1 -1
- package/src/background-color/background-color-spec.spec.ts +1 -1
- package/src/background-color/background-color.ts +2 -2
- package/src/background-color/index.ts +3 -3
- package/src/blockquote/blockquote-input-rule.ts +1 -1
- package/src/blockquote/blockquote-keymap.spec.ts +1 -1
- package/src/blockquote/blockquote-keymap.ts +9 -7
- package/src/blockquote/blockquote.ts +4 -4
- package/src/blockquote/index.ts +5 -5
- package/src/bold/bold-input-rule.spec.ts +2 -2
- package/src/bold/bold-input-rule.ts +1 -1
- package/src/bold/bold.ts +4 -4
- package/src/bold/index.ts +5 -5
- package/src/code/code-input-rule.ts +1 -1
- package/src/code/code.ts +4 -4
- package/src/code/index.ts +5 -5
- package/src/code-block/code-block-commands.ts +1 -1
- package/src/code-block/code-block-highlight.ts +11 -1
- package/src/code-block/code-block-input-rule.ts +3 -3
- package/src/code-block/code-block-shiki.ts +13 -5
- package/src/code-block/code-block-spec.spec.ts +2 -2
- package/src/code-block/code-block-spec.ts +1 -1
- package/src/code-block/code-block.ts +4 -4
- package/src/code-block/index.ts +9 -9
- package/src/code-block/shiki-highlighter.ts +2 -2
- package/src/code-block/shiki-parser.ts +2 -2
- package/src/drop-cursor/index.ts +1 -1
- package/src/drop-indicator/drop-indicator.ts +1 -1
- package/src/drop-indicator/index.ts +1 -1
- package/src/enter-rule/index.ts +3 -3
- package/src/file/file-drop-handler.ts +1 -1
- package/src/file/file-paste-handler.spec.ts +3 -3
- package/src/file/file-paste-handler.ts +1 -1
- package/src/file/index.ts +3 -3
- package/src/gap-cursor/index.ts +1 -1
- package/src/hard-break/hard-break-keymap.spec.ts +2 -2
- package/src/hard-break/hard-break-keymap.ts +1 -1
- package/src/hard-break/hard-break.ts +3 -3
- package/src/hard-break/index.ts +4 -4
- package/src/heading/heading-commands.ts +1 -1
- package/src/heading/heading-input-rule.ts +2 -2
- package/src/heading/heading-keymap.spec.ts +1 -1
- package/src/heading/heading-spec.ts +1 -1
- package/src/heading/heading.ts +4 -4
- package/src/heading/index.ts +6 -6
- package/src/horizontal-rule/horizontal-rule-commands.spec.ts +1 -1
- package/src/horizontal-rule/horizontal-rule-commands.ts +14 -11
- package/src/horizontal-rule/horizontal-rule-input-rule.spec.ts +2 -2
- package/src/horizontal-rule/horizontal-rule-input-rule.ts +1 -1
- package/src/horizontal-rule/horizontal-rule.ts +3 -3
- package/src/horizontal-rule/index.ts +4 -4
- package/src/image/image-commands/insert-image.ts +1 -1
- package/src/image/image-commands/upload-image.spec.ts +4 -4
- package/src/image/image-commands/upload-image.ts +2 -2
- package/src/image/image-commands.ts +3 -3
- package/src/image/image-upload-handler.ts +2 -2
- package/src/image/image.ts +2 -2
- package/src/image/index.ts +6 -6
- package/src/italic/index.ts +5 -5
- package/src/italic/italic-commands.spec.ts +4 -4
- package/src/italic/italic-input-rule.spec.ts +2 -2
- package/src/italic/italic-input-rule.ts +1 -1
- package/src/italic/italic.ts +4 -4
- package/src/link/index.spec.ts +2 -2
- package/src/link/index.ts +6 -6
- package/src/link/link-paste-rule.spec.ts +2 -2
- package/src/link/link-paste-rule.ts +3 -3
- package/src/link/link-regex.spec.ts +1 -1
- package/src/list/index.ts +8 -8
- package/src/list/list-drop-indicator.ts +2 -2
- package/src/list/list-input-rules.ts +1 -1
- package/src/list/list-keymap.spec.ts +1 -1
- package/src/list/list-spec.ts +1 -1
- package/src/list/list-types.spec.ts +2 -2
- package/src/list/list.spec.ts +6 -6
- package/src/list/list.ts +7 -7
- package/src/loro/index.ts +6 -6
- package/src/loro/loro.ts +8 -7
- package/src/mark-rule/apply.ts +2 -2
- package/src/mark-rule/index.ts +2 -2
- package/src/mark-rule/mark-rule.spec.ts +4 -4
- package/src/mark-rule/mark-rule.ts +2 -2
- package/src/math/index.ts +4 -4
- package/src/math/math-block.ts +8 -1
- package/src/math/math-inline.ts +1 -1
- package/src/math/math.ts +3 -3
- package/src/page/index.ts +5 -0
- package/src/page/page-break-commands.spec.ts +61 -0
- package/src/page/page-break-commands.ts +41 -0
- package/src/page/page-break-keymap.ts +17 -0
- package/src/page/page-break-spec.ts +33 -0
- package/src/page/page-break.ts +23 -0
- package/src/page/page-element.ts +246 -0
- package/src/page/page-rendering.ts +164 -0
- package/src/page/style.css +43 -0
- package/src/paragraph/index.ts +7 -7
- package/src/paragraph/paragraph-keymap.ts +1 -1
- package/src/paragraph/paragraph.ts +6 -5
- package/src/paste-rule/index.ts +2 -2
- package/src/paste-rule/mark-paste-rule.spec.ts +8 -8
- package/src/paste-rule/mark-paste-rule.ts +2 -2
- package/src/paste-rule/paste-rule.spec.ts +2 -2
- package/src/paste-rule/paste-rule.ts +1 -1
- package/src/paste-rule/split-text-by-regex.spec.ts +1 -1
- package/src/placeholder/index.ts +1 -1
- package/src/strike/index.ts +1 -1
- package/src/table/index.ts +14 -14
- package/src/table/table-commands/delete-cell-selection.spec.ts +3 -3
- package/src/table/table-commands/exit-table.spec.ts +2 -2
- package/src/table/table-commands/insert-table.spec.ts +1 -1
- package/src/table/table-commands/move-table-column.spec.ts +2 -2
- package/src/table/table-commands/move-table-row.spec.ts +2 -2
- package/src/table/table-commands/select-table-cell.spec.ts +3 -3
- package/src/table/table-commands/select-table-cell.ts +1 -1
- package/src/table/table-commands/select-table-column.spec.ts +2 -2
- package/src/table/table-commands/select-table-column.ts +1 -1
- package/src/table/table-commands/select-table-row.spec.ts +2 -2
- package/src/table/table-commands/select-table-row.ts +1 -1
- package/src/table/table-commands/select-table.spec.ts +2 -2
- package/src/table/table-commands/select-table.ts +1 -1
- package/src/table/table-commands.ts +9 -9
- package/src/table/table-drop-indicator.ts +2 -2
- package/src/table/table-spec.spec.ts +4 -4
- package/src/table/table.ts +4 -4
- package/src/table/test-utils.ts +1 -1
- package/src/testing/index.ts +24 -24
- package/src/text-color/index.ts +3 -3
- package/src/text-color/text-color-commands.spec.ts +1 -1
- package/src/text-color/text-color-commands.ts +1 -1
- package/src/text-color/text-color-spec.spec.ts +1 -1
- package/src/text-color/text-color.ts +2 -2
- package/src/yjs/index.ts +7 -7
- package/src/yjs/yjs-cursor-plugin.ts +1 -1
- package/src/yjs/yjs-undo-plugin.ts +3 -2
- package/src/yjs/yjs.ts +9 -8
- package/dist/commit/style.css.map +0 -1
- package/dist/commit/style.js +0 -1
- package/dist/drop-indicator-DJq8pF92.js.map +0 -1
- package/dist/file-upload-I9m1EJAM.js.map +0 -1
- package/dist/file-upload-dr3IXUty.d.ts.map +0 -1
- package/dist/gap-cursor/style.css.map +0 -1
- package/dist/gap-cursor/style.js +0 -1
- package/dist/list/style.css.map +0 -1
- package/dist/list/style.js +0 -1
- package/dist/loro/style.css.map +0 -1
- package/dist/loro/style.js +0 -1
- package/dist/mark-paste-rule-n_2Ehmb5.js.map +0 -1
- package/dist/mark-rule-CUnXwBuy.js.map +0 -1
- package/dist/placeholder/style.css.map +0 -1
- package/dist/placeholder/style.js +0 -1
- package/dist/search/style.css.map +0 -1
- package/dist/search/style.js +0 -1
- package/dist/shiki-highlighter-chunk.d.ts +0 -19
- package/dist/shiki-highlighter-chunk.d.ts.map +0 -1
- package/dist/table/style.css.map +0 -1
- package/dist/table/style.js +0 -1
- package/dist/table-UJVYsrB7.js.map +0 -1
- package/dist/virtual-selection/style.css.map +0 -1
- package/dist/virtual-selection/style.js +0 -1
- package/dist/yjs/style.css.map +0 -1
- package/dist/yjs/style.js +0 -1
|
@@ -2,11 +2,11 @@ import { canUseRegexLookbehind, union } from '@prosekit/core'
|
|
|
2
2
|
import { describe, expect, it, vi } from 'vitest'
|
|
3
3
|
import { keyboard } from 'vitest-browser-commands/playwright'
|
|
4
4
|
|
|
5
|
-
import { defineTestExtension, setupTestFromExtension } from '../testing'
|
|
6
|
-
import { inputText } from '../testing/keyboard'
|
|
5
|
+
import { defineTestExtension, setupTestFromExtension } from '../testing/index.ts'
|
|
6
|
+
import { inputText } from '../testing/keyboard.ts'
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { AutocompleteRule, type MatchHandler, type MatchHandlerOptions } from './autocomplete-rule.ts'
|
|
9
|
+
import { defineAutocomplete } from './autocomplete.ts'
|
|
10
10
|
|
|
11
11
|
function setupSlashMenu() {
|
|
12
12
|
const regex = canUseRegexLookbehind() ? /(?<!\S)\/(\S.*)?$/u : /\/(\S.*)?$/u
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineFacet, defineFacetPayload, pluginFacet, type Extension, type PluginPayload } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { createAutocompletePlugin } from './autocomplete-plugin'
|
|
4
|
-
import type { AutocompleteRule } from './autocomplete-rule'
|
|
3
|
+
import { createAutocompletePlugin } from './autocomplete-plugin.ts'
|
|
4
|
+
import type { AutocompleteRule } from './autocomplete-rule.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Defines an autocomplete extension that executes logic when the text before
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { defineAutocomplete } from './autocomplete'
|
|
2
1
|
export {
|
|
3
2
|
AutocompleteRule,
|
|
4
3
|
type AutocompleteRuleOptions,
|
|
@@ -6,4 +5,5 @@ export {
|
|
|
6
5
|
type CanMatchPredicate,
|
|
7
6
|
type MatchHandler,
|
|
8
7
|
type MatchHandlerOptions,
|
|
9
|
-
} from './autocomplete-rule'
|
|
8
|
+
} from './autocomplete-rule.ts'
|
|
9
|
+
export { defineAutocomplete } from './autocomplete.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addMark, defineCommands, removeMark, type Extension } from '@prosekit/core'
|
|
2
2
|
import type { Command } from '@prosekit/pm/state'
|
|
3
3
|
|
|
4
|
-
import type { BackgroundColorAttrs } from './background-color-spec'
|
|
4
|
+
import type { BackgroundColorAttrs } from './background-color-spec.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatHTML } from 'diffable-html-snapshot'
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import { setupTest } from '../testing'
|
|
4
|
+
import { setupTest } from '../testing/index.ts'
|
|
5
5
|
|
|
6
6
|
describe('defineBackgroundColorSpec', () => {
|
|
7
7
|
it('should render background color as inline span with style attribute', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineBackgroundColorCommands, type BackgroundColorCommandsExtension } from './background-color-commands'
|
|
4
|
-
import { defineBackgroundColorSpec, type BackgroundColorSpecExtension } from './background-color-spec'
|
|
3
|
+
import { defineBackgroundColorCommands, type BackgroundColorCommandsExtension } from './background-color-commands.ts'
|
|
4
|
+
import { defineBackgroundColorSpec, type BackgroundColorSpecExtension } from './background-color-spec.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { defineBackgroundColor, type BackgroundColorExtension } from './background-color'
|
|
2
1
|
export {
|
|
3
2
|
addBackgroundColor,
|
|
4
3
|
defineBackgroundColorCommands,
|
|
5
4
|
removeBackgroundColor,
|
|
6
5
|
type BackgroundColorCommandsExtension,
|
|
7
|
-
} from './background-color-commands'
|
|
8
|
-
export { defineBackgroundColorSpec, type BackgroundColorAttrs, type BackgroundColorSpecExtension } from './background-color-spec'
|
|
6
|
+
} from './background-color-commands.ts'
|
|
7
|
+
export { defineBackgroundColorSpec, type BackgroundColorAttrs, type BackgroundColorSpecExtension } from './background-color-spec.ts'
|
|
8
|
+
export { defineBackgroundColor, type BackgroundColorExtension } from './background-color.ts'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PlainExtension } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineWrappingInputRule } from '../input-rule'
|
|
3
|
+
import { defineWrappingInputRule } from '../input-rule/index.ts'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Wraps the text block in a blockquote 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('blockquote keymap', () => {
|
|
7
7
|
it('should wrap paragraph into blockquote with shortcut', async () => {
|
|
@@ -6,14 +6,16 @@ function toggleBlockquoteKeybinding(): Command {
|
|
|
6
6
|
return toggleWrap({ type: 'blockquote' })
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return joinBackward(state, dispatch, view)
|
|
14
|
-
}
|
|
15
|
-
return false
|
|
9
|
+
const backspaceUnsetBlockquoteCommand: Command = (state, dispatch, view): boolean => {
|
|
10
|
+
const $pos = isAtBlockStart(state, view)
|
|
11
|
+
if ($pos?.node(-1).type.name === 'blockquote') {
|
|
12
|
+
return joinBackward(state, dispatch, view)
|
|
16
13
|
}
|
|
14
|
+
return false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function backspaceUnsetBlockquote(): Command {
|
|
18
|
+
return backspaceUnsetBlockquoteCommand
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* @internal
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineBlockquoteCommands, type BlockquoteCommandsExtension } from './blockquote-commands'
|
|
4
|
-
import { defineBlockquoteInputRule } from './blockquote-input-rule'
|
|
5
|
-
import { defineBlockquoteKeymap } from './blockquote-keymap'
|
|
6
|
-
import { defineBlockquoteSpec, type BlockquoteSpecExtension } from './blockquote-spec'
|
|
3
|
+
import { defineBlockquoteCommands, type BlockquoteCommandsExtension } from './blockquote-commands.ts'
|
|
4
|
+
import { defineBlockquoteInputRule } from './blockquote-input-rule.ts'
|
|
5
|
+
import { defineBlockquoteKeymap } from './blockquote-keymap.ts'
|
|
6
|
+
import { defineBlockquoteSpec, type BlockquoteSpecExtension } from './blockquote-spec.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
package/src/blockquote/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { defineBlockquoteCommands, type BlockquoteCommandsExtension } from './blockquote-commands.ts'
|
|
2
|
+
export { defineBlockquoteInputRule } from './blockquote-input-rule.ts'
|
|
3
|
+
export { defineBlockquoteKeymap } from './blockquote-keymap.ts'
|
|
4
|
+
export { defineBlockquoteSpec, type BlockquoteSpecExtension } from './blockquote-spec.ts'
|
|
5
|
+
export { defineBlockquote, type BlockquoteExtension } from './blockquote.ts'
|
|
@@ -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('defineBoldInputRule', () => {
|
|
7
7
|
const { editor, n, m } = setupTest()
|
package/src/bold/bold.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineBoldCommands, type BoldCommandsExtension } from './bold-commands'
|
|
4
|
-
import { defineBoldInputRule } from './bold-input-rule'
|
|
5
|
-
import { defineBoldKeymap } from './bold-keymap'
|
|
6
|
-
import { defineBoldSpec, type BoldSpecExtension } from './bold-spec'
|
|
3
|
+
import { defineBoldCommands, type BoldCommandsExtension } from './bold-commands.ts'
|
|
4
|
+
import { defineBoldInputRule } from './bold-input-rule.ts'
|
|
5
|
+
import { defineBoldKeymap } from './bold-keymap.ts'
|
|
6
|
+
import { defineBoldSpec, type BoldSpecExtension } from './bold-spec.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
package/src/bold/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { defineBoldCommands, type BoldCommandsExtension } from './bold-commands.ts'
|
|
2
|
+
export { defineBoldInputRule } from './bold-input-rule.ts'
|
|
3
|
+
export { defineBoldKeymap } from './bold-keymap.ts'
|
|
4
|
+
export { defineBoldSpec, type BoldSpecExtension } from './bold-spec.ts'
|
|
5
|
+
export { defineBold, type BoldExtension } from './bold.ts'
|
package/src/code/code.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineCodeCommands, type CodeCommandsExtension } from './code-commands'
|
|
4
|
-
import { defineCodeInputRule } from './code-input-rule'
|
|
5
|
-
import { defineCodeKeymap } from './code-keymap'
|
|
6
|
-
import { defineCodeSpec, type CodeSpecExtension } from './code-spec'
|
|
3
|
+
import { defineCodeCommands, type CodeCommandsExtension } from './code-commands.ts'
|
|
4
|
+
import { defineCodeInputRule } from './code-input-rule.ts'
|
|
5
|
+
import { defineCodeKeymap } from './code-keymap.ts'
|
|
6
|
+
import { defineCodeSpec, type CodeSpecExtension } from './code-spec.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
package/src/code/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { defineCodeCommands, type CodeCommandsExtension } from './code-commands.ts'
|
|
2
|
+
export { defineCodeInputRule } from './code-input-rule.ts'
|
|
3
|
+
export { defineCodeKeymap } from './code-keymap.ts'
|
|
4
|
+
export { defineCodeSpec, type CodeSpecExtension } from './code-spec.ts'
|
|
5
|
+
export { defineCode, type CodeExtension } from './code.ts'
|
|
@@ -12,7 +12,16 @@ export type HighlightParser = Parser
|
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
14
|
export type CodeBlockHighlightOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* A parser instance from the `prosemirror-highlight` package.
|
|
17
|
+
*/
|
|
15
18
|
parser: HighlightParser
|
|
19
|
+
/**
|
|
20
|
+
* ProseMirror node types to highlight.
|
|
21
|
+
*
|
|
22
|
+
* @default ['codeBlock', 'mathBlock']
|
|
23
|
+
*/
|
|
24
|
+
nodeTypes?: string[]
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
/**
|
|
@@ -27,8 +36,9 @@ export type CodeBlockHighlightOptions = {
|
|
|
27
36
|
*/
|
|
28
37
|
export function defineCodeBlockHighlight({
|
|
29
38
|
parser,
|
|
39
|
+
nodeTypes = ['codeBlock', 'mathBlock'],
|
|
30
40
|
}: CodeBlockHighlightOptions): Extension {
|
|
31
41
|
return definePlugin(
|
|
32
|
-
createHighlightPlugin({ parser }),
|
|
42
|
+
createHighlightPlugin({ parser, nodeTypes }),
|
|
33
43
|
)
|
|
34
44
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PlainExtension } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineTextBlockEnterRule } from '../enter-rule'
|
|
4
|
-
import { defineTextBlockInputRule } from '../input-rule'
|
|
3
|
+
import { defineTextBlockEnterRule } from '../enter-rule/index.ts'
|
|
4
|
+
import { defineTextBlockInputRule } from '../input-rule/index.ts'
|
|
5
5
|
|
|
6
|
-
import type { CodeBlockAttrs } from './code-block-types'
|
|
6
|
+
import type { CodeBlockAttrs } from './code-block-types.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Adds input rules for `codeBlock` nodes.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Extension } from '@prosekit/core'
|
|
2
2
|
import type { SpecialLanguage } from 'shiki'
|
|
3
3
|
|
|
4
|
-
import { defineCodeBlockHighlight } from './code-block-highlight'
|
|
5
|
-
import type { ShikiBundledLanguage, ShikiBundledTheme } from './shiki-bundle'
|
|
6
|
-
import type { ShikiHighlighterOptions } from './shiki-highlighter-chunk'
|
|
7
|
-
import { createLazyParser } from './shiki-parser'
|
|
4
|
+
import { defineCodeBlockHighlight } from './code-block-highlight.ts'
|
|
5
|
+
import type { ShikiBundledLanguage, ShikiBundledTheme } from './shiki-bundle.ts'
|
|
6
|
+
import type { ShikiHighlighterOptions } from './shiki-highlighter-chunk.ts'
|
|
7
|
+
import { createLazyParser } from './shiki-parser.ts'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The options to configure the Shiki highlighter.
|
|
@@ -12,6 +12,13 @@ import { createLazyParser } from './shiki-parser'
|
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
14
|
export interface CodeBlockShikiOptions extends Omit<ShikiHighlighterOptions, 'themes' | 'langs' | 'engine'> {
|
|
15
|
+
/**
|
|
16
|
+
* ProseMirror node types to highlight.
|
|
17
|
+
*
|
|
18
|
+
* @default ['codeBlock', 'mathBlock']
|
|
19
|
+
*/
|
|
20
|
+
nodeTypes?: string[]
|
|
21
|
+
|
|
15
22
|
/**
|
|
16
23
|
* A list of Shiki themes to pre-load. The first theme in the list will be
|
|
17
24
|
* used to render the code block.
|
|
@@ -46,10 +53,11 @@ export interface CodeBlockShikiOptions extends Omit<ShikiHighlighterOptions, 'th
|
|
|
46
53
|
* @public
|
|
47
54
|
*/
|
|
48
55
|
export function defineCodeBlockShiki({
|
|
56
|
+
nodeTypes,
|
|
49
57
|
themes = ['one-dark-pro'],
|
|
50
58
|
langs = ['text'],
|
|
51
59
|
...rest
|
|
52
60
|
}: CodeBlockShikiOptions = {}): Extension {
|
|
53
61
|
const parser = createLazyParser({ themes, langs, ...rest })
|
|
54
|
-
return defineCodeBlockHighlight({ parser })
|
|
62
|
+
return defineCodeBlockHighlight({ parser, nodeTypes })
|
|
55
63
|
}
|
|
@@ -2,8 +2,8 @@ import { jsonFromHTML } from '@prosekit/core'
|
|
|
2
2
|
import { formatHTML } from 'diffable-html-snapshot'
|
|
3
3
|
import { describe, expect, it } from 'vitest'
|
|
4
4
|
|
|
5
|
-
import { setupTest } from '../testing'
|
|
6
|
-
import { htmlFromMarkdown, markdownFromHTML } from '../testing/markdown'
|
|
5
|
+
import { setupTest } from '../testing/index.ts'
|
|
6
|
+
import { htmlFromMarkdown, markdownFromHTML } from '../testing/markdown.ts'
|
|
7
7
|
|
|
8
8
|
describe('defineCodeBlockSpec', () => {
|
|
9
9
|
it('can parse and serialize code blocks', () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineCodeBlockCommands, type CodeBlockCommandsExtension } from './code-block-commands'
|
|
4
|
-
import { defineCodeBlockEnterRule, defineCodeBlockInputRule } from './code-block-input-rule'
|
|
5
|
-
import { defineCodeBlockKeymap } from './code-block-keymap'
|
|
6
|
-
import { defineCodeBlockSpec, type CodeBlockSpecExtension } from './code-block-spec'
|
|
3
|
+
import { defineCodeBlockCommands, type CodeBlockCommandsExtension } from './code-block-commands.ts'
|
|
4
|
+
import { defineCodeBlockEnterRule, defineCodeBlockInputRule } from './code-block-input-rule.ts'
|
|
5
|
+
import { defineCodeBlockKeymap } from './code-block-keymap.ts'
|
|
6
|
+
import { defineCodeBlockSpec, type CodeBlockSpecExtension } from './code-block-spec.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
package/src/code-block/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export type
|
|
1
|
+
export { defineCodeBlockCommands, type CodeBlockCommandsExtension } from './code-block-commands.ts'
|
|
2
|
+
export { defineCodeBlockHighlight, type CodeBlockHighlightOptions, type HighlightParser } from './code-block-highlight.ts'
|
|
3
|
+
export { defineCodeBlockEnterRule, defineCodeBlockInputRule } from './code-block-input-rule.ts'
|
|
4
|
+
export { defineCodeBlockKeymap } from './code-block-keymap.ts'
|
|
5
|
+
export { defineCodeBlockShiki } from './code-block-shiki.ts'
|
|
6
|
+
export { defineCodeBlockSpec, type CodeBlockSpecExtension } from './code-block-spec.ts'
|
|
7
|
+
export type { CodeBlockAttrs } from './code-block-types.ts'
|
|
8
|
+
export { defineCodeBlock, type CodeBlockExtension } from './code-block.ts'
|
|
9
9
|
export {
|
|
10
10
|
shikiBundledLanguagesInfo,
|
|
11
11
|
shikiBundledThemesInfo,
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
type ShikiBundledLanguageInfo,
|
|
14
14
|
type ShikiBundledTheme,
|
|
15
15
|
type ShikiBundledThemeInfo,
|
|
16
|
-
} from './shiki-bundle'
|
|
16
|
+
} from './shiki-bundle.ts'
|
|
@@ -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
|
package/src/drop-cursor/index.ts
CHANGED
|
@@ -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'
|
package/src/enter-rule/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
type EnterRule,
|
|
6
6
|
type EnterRuleHandler,
|
|
7
7
|
type EnterRuleHandlerOptions,
|
|
8
|
-
type TextBlockEnterRuleOptions as
|
|
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
|
|
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
|
|
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
|
|
@@ -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 {
|
|
5
|
-
import {
|
|
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) => {
|
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'
|
package/src/gap-cursor/index.ts
CHANGED
|
@@ -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,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
|
package/src/hard-break/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
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,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 () => {
|