@prosekit/extensions 0.12.2 → 0.14.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/{drop-indicator-B1QHFb5m.js → drop-indicator-B_oMfeVP.js} +11 -10
- package/dist/drop-indicator-B_oMfeVP.js.map +1 -0
- package/dist/{enter-rule-CzWOZF_Z.js → enter-rule-D-p4ykfv.js} +1 -1
- package/dist/enter-rule-D-p4ykfv.js.map +1 -0
- package/dist/{file-DrfcSid-.js → file-iLVR0eM0.js} +3 -3
- package/dist/file-iLVR0eM0.js.map +1 -0
- package/dist/{index-oIc1a2f2.d.ts → index-cp1u4e0e.d.ts} +1 -1
- package/dist/index-cp1u4e0e.d.ts.map +1 -0
- package/dist/{input-rule-dmsb3j6w.js → input-rule-COGr_GBb.js} +1 -1
- package/dist/input-rule-COGr_GBb.js.map +1 -0
- package/dist/list/style.css +5 -5
- package/dist/list/style.css.map +1 -1
- package/dist/{mark-rule-BcLB4Uv2.js → mark-rule-CYe8zk4q.js} +6 -6
- package/dist/mark-rule-CYe8zk4q.js.map +1 -0
- package/dist/{paste-rule-pVb4sqvJ.js → paste-rule-BaDghcaU.js} +7 -7
- package/dist/paste-rule-BaDghcaU.js.map +1 -0
- package/dist/prosekit-extensions-autocomplete.d.ts +11 -3
- package/dist/prosekit-extensions-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-extensions-autocomplete.js +171 -60
- package/dist/prosekit-extensions-autocomplete.js.map +1 -1
- package/dist/prosekit-extensions-background-color.d.ts +62 -0
- package/dist/prosekit-extensions-background-color.d.ts.map +1 -0
- package/dist/prosekit-extensions-background-color.js +76 -0
- package/dist/prosekit-extensions-background-color.js.map +1 -0
- package/dist/prosekit-extensions-blockquote.d.ts.map +1 -1
- package/dist/prosekit-extensions-blockquote.js +2 -2
- package/dist/prosekit-extensions-blockquote.js.map +1 -1
- package/dist/prosekit-extensions-bold.d.ts.map +1 -1
- package/dist/prosekit-extensions-bold.js +1 -1
- package/dist/prosekit-extensions-bold.js.map +1 -1
- package/dist/prosekit-extensions-code-block.d.ts +1 -1
- package/dist/prosekit-extensions-code-block.d.ts.map +1 -1
- package/dist/prosekit-extensions-code-block.js +4 -4
- package/dist/prosekit-extensions-code-block.js.map +1 -1
- package/dist/prosekit-extensions-code.d.ts.map +1 -1
- package/dist/prosekit-extensions-code.js +1 -1
- package/dist/prosekit-extensions-code.js.map +1 -1
- package/dist/prosekit-extensions-commit.d.ts +0 -1
- package/dist/prosekit-extensions-commit.d.ts.map +1 -1
- package/dist/prosekit-extensions-commit.js +1 -1
- package/dist/prosekit-extensions-commit.js.map +1 -1
- package/dist/prosekit-extensions-doc.d.ts +0 -1
- package/dist/prosekit-extensions-doc.d.ts.map +1 -1
- package/dist/prosekit-extensions-doc.js.map +1 -1
- package/dist/prosekit-extensions-drop-cursor.d.ts.map +1 -1
- package/dist/prosekit-extensions-drop-cursor.js.map +1 -1
- package/dist/prosekit-extensions-drop-indicator.d.ts +0 -1
- package/dist/prosekit-extensions-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-extensions-drop-indicator.js +1 -1
- package/dist/prosekit-extensions-enter-rule.d.ts +0 -1
- package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-enter-rule.js +1 -1
- package/dist/prosekit-extensions-file.d.ts +1 -1
- package/dist/prosekit-extensions-file.js +1 -1
- package/dist/prosekit-extensions-gap-cursor.d.ts +0 -1
- package/dist/prosekit-extensions-gap-cursor.d.ts.map +1 -1
- package/dist/prosekit-extensions-gap-cursor.js.map +1 -1
- package/dist/prosekit-extensions-hard-break.d.ts.map +1 -1
- package/dist/prosekit-extensions-hard-break.js.map +1 -1
- package/dist/prosekit-extensions-heading.d.ts.map +1 -1
- package/dist/prosekit-extensions-heading.js +7 -7
- package/dist/prosekit-extensions-heading.js.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.js +1 -1
- package/dist/prosekit-extensions-horizontal-rule.js.map +1 -1
- package/dist/prosekit-extensions-image.d.ts +9 -2
- package/dist/prosekit-extensions-image.d.ts.map +1 -1
- package/dist/prosekit-extensions-image.js +17 -4
- package/dist/prosekit-extensions-image.js.map +1 -1
- package/dist/prosekit-extensions-input-rule.d.ts +0 -1
- package/dist/prosekit-extensions-input-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-input-rule.js +1 -1
- package/dist/prosekit-extensions-italic.d.ts.map +1 -1
- package/dist/prosekit-extensions-italic.js +1 -1
- package/dist/prosekit-extensions-italic.js.map +1 -1
- package/dist/prosekit-extensions-link.d.ts +0 -1
- package/dist/prosekit-extensions-link.d.ts.map +1 -1
- package/dist/prosekit-extensions-link.js +4 -4
- package/dist/prosekit-extensions-link.js.map +1 -1
- package/dist/prosekit-extensions-list.d.ts +0 -1
- package/dist/prosekit-extensions-list.d.ts.map +1 -1
- package/dist/prosekit-extensions-list.js +3 -3
- package/dist/prosekit-extensions-list.js.map +1 -1
- package/dist/prosekit-extensions-loro.d.ts +16 -17
- package/dist/prosekit-extensions-loro.d.ts.map +1 -1
- package/dist/prosekit-extensions-loro.js +14 -7
- package/dist/prosekit-extensions-loro.js.map +1 -1
- package/dist/prosekit-extensions-mark-rule.d.ts +0 -1
- package/dist/prosekit-extensions-mark-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-mark-rule.js +1 -1
- package/dist/prosekit-extensions-mention.d.ts.map +1 -1
- package/dist/prosekit-extensions-mention.js.map +1 -1
- package/dist/prosekit-extensions-mod-click-prevention.d.ts +0 -1
- package/dist/prosekit-extensions-mod-click-prevention.d.ts.map +1 -1
- package/dist/prosekit-extensions-mod-click-prevention.js.map +1 -1
- package/dist/prosekit-extensions-paragraph.d.ts.map +1 -1
- package/dist/prosekit-extensions-paragraph.js +1 -1
- package/dist/prosekit-extensions-paragraph.js.map +1 -1
- package/dist/prosekit-extensions-paste-rule.d.ts +0 -1
- package/dist/prosekit-extensions-paste-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-paste-rule.js +1 -1
- package/dist/prosekit-extensions-placeholder.d.ts.map +1 -1
- package/dist/prosekit-extensions-placeholder.js +3 -4
- package/dist/prosekit-extensions-placeholder.js.map +1 -1
- package/dist/prosekit-extensions-readonly.d.ts +0 -1
- package/dist/prosekit-extensions-readonly.d.ts.map +1 -1
- package/dist/prosekit-extensions-readonly.js.map +1 -1
- package/dist/prosekit-extensions-search.d.ts +0 -1
- package/dist/prosekit-extensions-search.d.ts.map +1 -1
- package/dist/prosekit-extensions-search.js.map +1 -1
- package/dist/prosekit-extensions-strike.d.ts +0 -1
- package/dist/prosekit-extensions-strike.d.ts.map +1 -1
- package/dist/prosekit-extensions-strike.js +3 -3
- package/dist/prosekit-extensions-strike.js.map +1 -1
- package/dist/prosekit-extensions-table.d.ts.map +1 -1
- package/dist/prosekit-extensions-table.js +1 -2
- package/dist/prosekit-extensions-text-align.d.ts +0 -1
- package/dist/prosekit-extensions-text-align.d.ts.map +1 -1
- package/dist/prosekit-extensions-text-align.js +6 -6
- package/dist/prosekit-extensions-text-align.js.map +1 -1
- package/dist/prosekit-extensions-text-color.d.ts +62 -0
- package/dist/prosekit-extensions-text-color.d.ts.map +1 -0
- package/dist/prosekit-extensions-text-color.js +76 -0
- package/dist/prosekit-extensions-text-color.js.map +1 -0
- package/dist/prosekit-extensions-text.d.ts +0 -1
- package/dist/prosekit-extensions-text.d.ts.map +1 -1
- package/dist/prosekit-extensions-text.js.map +1 -1
- package/dist/prosekit-extensions-underline.d.ts +0 -1
- package/dist/prosekit-extensions-underline.d.ts.map +1 -1
- package/dist/prosekit-extensions-virtual-selection.d.ts +0 -1
- package/dist/prosekit-extensions-virtual-selection.d.ts.map +1 -1
- package/dist/prosekit-extensions-virtual-selection.js.map +1 -1
- package/dist/prosekit-extensions-yjs.d.ts +9 -2
- package/dist/prosekit-extensions-yjs.d.ts.map +1 -1
- package/dist/prosekit-extensions-yjs.js +1 -1
- package/dist/prosekit-extensions-yjs.js.map +1 -1
- package/dist/{shiki-highlighter-chunk-rkzofy4z.d.ts → shiki-highlighter-chunk-DNNm2Vow.d.ts} +1 -1
- package/dist/shiki-highlighter-chunk-DNNm2Vow.d.ts.map +1 -0
- package/dist/shiki-highlighter-chunk.d.ts +1 -1
- package/dist/shiki-highlighter-chunk.js.map +1 -1
- package/dist/{table-BRDh_9mG.js → table-4oHfV-Ql.js} +2 -2
- package/dist/table-4oHfV-Ql.js.map +1 -0
- package/package.json +33 -18
- package/src/autocomplete/autocomplete-helpers.ts +19 -14
- package/src/autocomplete/autocomplete-plugin.ts +260 -126
- package/src/autocomplete/autocomplete-rule.ts +3 -3
- package/src/autocomplete/autocomplete.spec.ts +244 -40
- package/src/autocomplete/autocomplete.ts +9 -7
- package/src/background-color/background-color-commands.spec.ts +71 -0
- package/src/background-color/background-color-commands.ts +35 -0
- package/src/background-color/background-color-spec.spec.ts +286 -0
- package/src/background-color/background-color-spec.ts +58 -0
- package/src/background-color/background-color.ts +21 -0
- package/src/background-color/index.ts +8 -0
- package/src/blockquote/blockquote-commands.ts +1 -7
- package/src/blockquote/blockquote-keymap.spec.ts +5 -9
- package/src/blockquote/blockquote-keymap.ts +2 -7
- package/src/blockquote/blockquote-spec.ts +1 -4
- package/src/blockquote/blockquote.ts +3 -12
- package/src/blockquote/index.ts +3 -12
- package/src/bold/bold-commands.ts +1 -5
- package/src/bold/bold-input-rule.spec.ts +1 -5
- package/src/bold/bold-input-rule.ts +1 -4
- package/src/bold/bold-keymap.ts +1 -5
- package/src/bold/bold-spec.ts +1 -4
- package/src/bold/bold.ts +3 -12
- package/src/bold/index.ts +3 -12
- package/src/code/code-commands.ts +1 -5
- package/src/code/code-input-rule.ts +1 -4
- package/src/code/code-keymap.ts +1 -5
- package/src/code/code-spec.ts +1 -4
- package/src/code/code.ts +3 -12
- package/src/code/index.ts +3 -12
- package/src/code-block/code-block-commands.ts +1 -8
- package/src/code-block/code-block-highlight.ts +2 -8
- package/src/code-block/code-block-keymap.ts +2 -9
- package/src/code-block/code-block-shiki.ts +1 -4
- package/src/code-block/code-block-spec.spec.ts +4 -11
- package/src/code-block/code-block-spec.ts +1 -4
- package/src/code-block/code-block.ts +4 -16
- package/src/code-block/index.ts +5 -21
- package/src/code-block/shiki-highlighter-chunk.ts +1 -7
- package/src/code-block/shiki-highlighter.ts +1 -4
- package/src/code-block/shiki-parser.ts +1 -4
- package/src/commit/index.ts +7 -36
- package/src/doc/index.ts +1 -4
- package/src/drop-cursor/drop-cursor.ts +1 -4
- package/src/drop-cursor/index.ts +1 -5
- package/src/drop-indicator/drop-indicator-facet.ts +12 -21
- package/src/drop-indicator/index.ts +1 -5
- package/src/enter-rule/index.ts +2 -11
- package/src/file/file-paste-handler.spec.ts +3 -16
- package/src/file/index.ts +3 -16
- package/src/gap-cursor/gap-cursor.ts +1 -4
- package/src/gap-cursor/index.ts +1 -4
- package/src/hard-break/hard-break-commands.ts +1 -5
- package/src/hard-break/hard-break-keymap.spec.ts +6 -12
- package/src/hard-break/hard-break-keymap.ts +1 -4
- package/src/hard-break/hard-break-spec.ts +1 -4
- package/src/hard-break/hard-break.ts +3 -12
- package/src/hard-break/index.ts +3 -12
- package/src/heading/heading-commands.ts +1 -7
- package/src/heading/heading-keymap.spec.ts +8 -12
- package/src/heading/heading-keymap.ts +7 -14
- package/src/heading/heading-spec.ts +1 -4
- package/src/heading/heading.ts +3 -12
- package/src/heading/index.ts +3 -12
- package/src/horizontal-rule/horizontal-rule-commands.spec.ts +1 -5
- package/src/horizontal-rule/horizontal-rule-commands.ts +2 -9
- package/src/horizontal-rule/horizontal-rule-input-rule.spec.ts +5 -9
- package/src/horizontal-rule/horizontal-rule-input-rule.ts +1 -5
- package/src/horizontal-rule/horizontal-rule-spec.ts +1 -4
- package/src/horizontal-rule/horizontal-rule.ts +3 -12
- package/src/horizontal-rule/index.ts +3 -13
- package/src/image/image-commands/upload-image.spec.ts +245 -0
- package/src/image/image-commands/upload-image.ts +46 -11
- package/src/image/image-commands.ts +2 -8
- package/src/image/image-spec.ts +1 -4
- package/src/image/image-upload-handler.ts +2 -8
- package/src/image/image.ts +3 -12
- package/src/image/index.ts +3 -13
- package/src/input-rule/index.ts +2 -13
- package/src/italic/index.ts +3 -12
- package/src/italic/italic-commands.spec.ts +2 -10
- package/src/italic/italic-commands.ts +1 -5
- package/src/italic/italic-input-rule.spec.ts +1 -5
- package/src/italic/italic-input-rule.ts +1 -4
- package/src/italic/italic-keymap.ts +1 -5
- package/src/italic/italic-spec.ts +1 -4
- package/src/italic/italic.ts +3 -12
- package/src/link/index.spec.ts +10 -13
- package/src/link/index.ts +1 -5
- package/src/link/link-paste-rule.spec.ts +2 -9
- package/src/link/link-regex.spec.ts +1 -5
- package/src/list/index.ts +3 -12
- package/src/list/list-commands.ts +1 -5
- package/src/list/list-input-rules.ts +1 -4
- package/src/list/list-keymap.spec.ts +6 -10
- package/src/list/list-keymap.ts +2 -8
- package/src/list/list-plugins.ts +1 -4
- package/src/list/list-serializer.ts +2 -9
- package/src/list/list-spec.ts +3 -13
- package/src/list/list.spec.ts +10 -21
- package/src/list/list.ts +3 -12
- package/src/list/style.css +5 -5
- package/src/loro/index.ts +3 -13
- package/src/loro/loro-commands.ts +2 -8
- package/src/loro/loro-cursor-plugin.ts +21 -21
- package/src/loro/loro-keymap.ts +3 -11
- package/src/loro/loro-sync-plugin.ts +2 -8
- package/src/loro/loro-undo-plugin.ts +2 -8
- package/src/loro/loro.ts +16 -21
- package/src/mark-rule/apply.ts +3 -13
- package/src/mark-rule/mark-rule.spec.ts +2 -13
- package/src/mark-rule/mark-rule.ts +2 -13
- package/src/mark-rule/range.ts +2 -8
- package/src/mark-rule/types.ts +1 -4
- package/src/mention/index.ts +1 -8
- package/src/mod-click-prevention/index.ts +2 -9
- package/src/paragraph/paragraph-commands.ts +1 -5
- package/src/paragraph/paragraph-keymap.ts +2 -5
- package/src/paragraph/paragraph-spec.ts +1 -4
- package/src/paragraph/paragraph.ts +3 -14
- package/src/paste-rule/index.ts +2 -10
- package/src/paste-rule/mark-paste-rule.spec.ts +3 -13
- package/src/paste-rule/mark-paste-rule.ts +4 -14
- package/src/paste-rule/paste-rule-plugin.ts +2 -11
- package/src/paste-rule/paste-rule.spec.ts +4 -19
- package/src/paste-rule/split-text-by-regex.spec.ts +1 -5
- package/src/placeholder/index.ts +4 -16
- package/src/readonly/index.ts +2 -8
- package/src/search/index.ts +1 -6
- package/src/strike/index.ts +2 -2
- package/src/table/index.ts +10 -40
- package/src/table/table-commands/delete-cell-selection.spec.ts +1 -5
- package/src/table/table-commands/exit-table.spec.ts +1 -5
- package/src/table/table-commands/insert-table.spec.ts +1 -5
- package/src/table/table-commands/insert-table.ts +1 -4
- package/src/table/table-commands/move-table-column.spec.ts +1 -5
- package/src/table/table-commands/move-table-column.ts +1 -4
- package/src/table/table-commands/move-table-row.spec.ts +1 -5
- package/src/table/table-commands/move-table-row.ts +1 -4
- package/src/table/table-commands/select-table-cell.spec.ts +1 -5
- package/src/table/table-commands/select-table-column.spec.ts +1 -5
- package/src/table/table-commands/select-table-row.spec.ts +1 -5
- package/src/table/table-commands/select-table.spec.ts +1 -5
- package/src/table/table-commands/select-table.ts +1 -4
- package/src/table/table-commands.ts +8 -32
- package/src/table/table-plugins.ts +2 -8
- package/src/table/table-spec.spec.ts +2 -11
- package/src/table/table-spec.ts +2 -8
- package/src/table/table-utils.ts +2 -6
- package/src/table/table.ts +2 -8
- package/src/table/test-utils.ts +1 -4
- package/src/testing/clipboard.ts +1 -2
- package/src/testing/index.ts +9 -14
- package/src/testing/keyboard.ts +0 -30
- package/src/text/index.ts +1 -4
- package/src/text-align/index.ts +6 -6
- package/src/text-color/index.ts +3 -0
- package/src/text-color/text-color-commands.spec.ts +71 -0
- package/src/text-color/text-color-commands.ts +35 -0
- package/src/text-color/text-color-spec.spec.ts +297 -0
- package/src/text-color/text-color-spec.ts +58 -0
- package/src/text-color/text-color.ts +21 -0
- package/src/virtual-selection/index.ts +3 -14
- package/src/yjs/index.ts +5 -20
- package/src/yjs/yjs-commands.ts +2 -8
- package/src/yjs/yjs-cursor-plugin.ts +3 -5
- package/src/yjs/yjs-keymap.ts +3 -11
- package/src/yjs/yjs-sync-plugin.ts +1 -4
- package/src/yjs/yjs-types.ts +10 -0
- package/src/yjs/yjs-undo-plugin.ts +2 -8
- package/src/yjs/yjs.ts +6 -24
- package/dist/drop-indicator-B1QHFb5m.js.map +0 -1
- package/dist/enter-rule-CzWOZF_Z.js.map +0 -1
- package/dist/file-DrfcSid-.js.map +0 -1
- package/dist/index-oIc1a2f2.d.ts.map +0 -1
- package/dist/input-rule-dmsb3j6w.js.map +0 -1
- package/dist/mark-rule-BcLB4Uv2.js.map +0 -1
- package/dist/paste-rule-pVb4sqvJ.js.map +0 -1
- package/dist/shiki-highlighter-chunk-rkzofy4z.d.ts.map +0 -1
- package/dist/table-BRDh_9mG.js.map +0 -1
- package/src/testing/format-html.ts +0 -5
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineCommands,
|
|
3
|
-
insertNode,
|
|
4
|
-
setBlockType,
|
|
5
|
-
setNodeAttrs,
|
|
6
|
-
toggleNode,
|
|
7
|
-
type Extension,
|
|
8
|
-
} from '@prosekit/core'
|
|
1
|
+
import { defineCommands, insertNode, setBlockType, setNodeAttrs, toggleNode, type Extension } from '@prosekit/core'
|
|
9
2
|
|
|
10
3
|
import type { CodeBlockAttrs } from './code-block-types'
|
|
11
4
|
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type Extension,
|
|
4
|
-
} from '@prosekit/core'
|
|
5
|
-
import {
|
|
6
|
-
createHighlightPlugin,
|
|
7
|
-
type Parser,
|
|
8
|
-
} from 'prosemirror-highlight'
|
|
1
|
+
import { definePlugin, type Extension } from '@prosekit/core'
|
|
2
|
+
import { createHighlightPlugin, type Parser } from 'prosemirror-highlight'
|
|
9
3
|
|
|
10
4
|
/**
|
|
11
5
|
* @public
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
defineKeymap,
|
|
4
|
-
type PlainExtension,
|
|
5
|
-
} from '@prosekit/core'
|
|
6
|
-
import {
|
|
7
|
-
TextSelection,
|
|
8
|
-
type Command,
|
|
9
|
-
} from '@prosekit/pm/state'
|
|
1
|
+
import { defaultBlockAt, defineKeymap, type PlainExtension } from '@prosekit/core'
|
|
2
|
+
import { TextSelection, type Command } from '@prosekit/pm/state'
|
|
10
3
|
|
|
11
4
|
/**
|
|
12
5
|
* Defines the keymap for code blocks.
|
|
@@ -2,10 +2,7 @@ import type { Extension } from '@prosekit/core'
|
|
|
2
2
|
import type { SpecialLanguage } from 'shiki'
|
|
3
3
|
|
|
4
4
|
import { defineCodeBlockHighlight } from './code-block-highlight'
|
|
5
|
-
import type {
|
|
6
|
-
ShikiBundledLanguage,
|
|
7
|
-
ShikiBundledTheme,
|
|
8
|
-
} from './shiki-bundle'
|
|
5
|
+
import type { ShikiBundledLanguage, ShikiBundledTheme } from './shiki-bundle'
|
|
9
6
|
import type { ShikiHighlighterOptions } from './shiki-highlighter-chunk'
|
|
10
7
|
import { createLazyParser } from './shiki-parser'
|
|
11
8
|
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { jsonFromHTML } from '@prosekit/core'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
expect,
|
|
5
|
-
it,
|
|
6
|
-
} from 'vitest'
|
|
2
|
+
import { formatHTML } from 'diffable-html-snapshot'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
7
4
|
|
|
8
5
|
import { setupTest } from '../testing'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
htmlFromMarkdown,
|
|
12
|
-
markdownFromHTML,
|
|
13
|
-
} from '../testing/markdown'
|
|
6
|
+
import { htmlFromMarkdown, markdownFromHTML } from '../testing/markdown'
|
|
14
7
|
|
|
15
8
|
describe('defineCodeBlockSpec', () => {
|
|
16
9
|
it('can parse and serialize code blocks', () => {
|
|
@@ -152,7 +145,7 @@ describe('defineCodeBlockSpec', () => {
|
|
|
152
145
|
editor.set(n.doc(n.codeBlock({ language: 'javascript' }, '123')))
|
|
153
146
|
const html = editor.getDocHTML()
|
|
154
147
|
expect(html).toMatchInlineSnapshot(`"<div><pre data-language="javascript"><code class="language-javascript">123</code></pre></div>"`)
|
|
155
|
-
|
|
148
|
+
const markdown = markdownFromHTML(html)
|
|
156
149
|
expect(markdown).toMatchInlineSnapshot(`
|
|
157
150
|
"\`\`\`javascript
|
|
158
151
|
123
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
union,
|
|
3
|
-
type Union,
|
|
4
|
-
} from '@prosekit/core'
|
|
1
|
+
import { union, type Union } from '@prosekit/core'
|
|
5
2
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
type CodeBlockCommandsExtension,
|
|
9
|
-
} from './code-block-commands'
|
|
10
|
-
import {
|
|
11
|
-
defineCodeBlockEnterRule,
|
|
12
|
-
defineCodeBlockInputRule,
|
|
13
|
-
} from './code-block-input-rule'
|
|
3
|
+
import { defineCodeBlockCommands, type CodeBlockCommandsExtension } from './code-block-commands'
|
|
4
|
+
import { defineCodeBlockEnterRule, defineCodeBlockInputRule } from './code-block-input-rule'
|
|
14
5
|
import { defineCodeBlockKeymap } from './code-block-keymap'
|
|
15
|
-
import {
|
|
16
|
-
defineCodeBlockSpec,
|
|
17
|
-
type CodeBlockSpecExtension,
|
|
18
|
-
} from './code-block-spec'
|
|
6
|
+
import { defineCodeBlockSpec, type CodeBlockSpecExtension } from './code-block-spec'
|
|
19
7
|
|
|
20
8
|
/**
|
|
21
9
|
* @internal
|
package/src/code-block/index.ts
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from './code-block'
|
|
5
|
-
export {
|
|
6
|
-
defineCodeBlockCommands,
|
|
7
|
-
type CodeBlockCommandsExtension,
|
|
8
|
-
} from './code-block-commands'
|
|
9
|
-
export {
|
|
10
|
-
defineCodeBlockHighlight,
|
|
11
|
-
type CodeBlockHighlightOptions,
|
|
12
|
-
type HighlightParser,
|
|
13
|
-
} from './code-block-highlight'
|
|
14
|
-
export {
|
|
15
|
-
defineCodeBlockEnterRule,
|
|
16
|
-
defineCodeBlockInputRule,
|
|
17
|
-
} from './code-block-input-rule'
|
|
1
|
+
export { defineCodeBlock, type CodeBlockExtension } from './code-block'
|
|
2
|
+
export { defineCodeBlockCommands, type CodeBlockCommandsExtension } from './code-block-commands'
|
|
3
|
+
export { defineCodeBlockHighlight, type CodeBlockHighlightOptions, type HighlightParser } from './code-block-highlight'
|
|
4
|
+
export { defineCodeBlockEnterRule, defineCodeBlockInputRule } from './code-block-input-rule'
|
|
18
5
|
export { defineCodeBlockKeymap } from './code-block-keymap'
|
|
19
6
|
export { defineCodeBlockShiki } from './code-block-shiki'
|
|
20
|
-
export {
|
|
21
|
-
defineCodeBlockSpec,
|
|
22
|
-
type CodeBlockSpecExtension,
|
|
23
|
-
} from './code-block-spec'
|
|
7
|
+
export { defineCodeBlockSpec, type CodeBlockSpecExtension } from './code-block-spec'
|
|
24
8
|
export type { CodeBlockAttrs } from './code-block-types'
|
|
25
9
|
export {
|
|
26
10
|
shikiBundledLanguagesInfo,
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BundledHighlighterOptions,
|
|
3
|
-
BundledLanguage,
|
|
4
|
-
BundledTheme,
|
|
5
|
-
Highlighter,
|
|
6
|
-
SpecialLanguage,
|
|
7
|
-
} from 'shiki'
|
|
1
|
+
import type { BundledHighlighterOptions, BundledLanguage, BundledTheme, Highlighter, SpecialLanguage } from 'shiki'
|
|
8
2
|
import { createHighlighter } from 'shiki/bundle/full'
|
|
9
3
|
import { createJavaScriptRegexEngine } from 'shiki/engine/javascript'
|
|
10
4
|
|
|
@@ -2,10 +2,7 @@ import type { Parser } from 'prosemirror-highlight'
|
|
|
2
2
|
import { createParser } from 'prosemirror-highlight/shiki'
|
|
3
3
|
|
|
4
4
|
import type { ShikiBundledLanguage } from './shiki-bundle'
|
|
5
|
-
import {
|
|
6
|
-
createOrGetHighlighter,
|
|
7
|
-
type HighlighterOptions,
|
|
8
|
-
} from './shiki-highlighter'
|
|
5
|
+
import { createOrGetHighlighter, type HighlighterOptions } from './shiki-highlighter'
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* @internal
|
package/src/commit/index.ts
CHANGED
|
@@ -1,33 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
jsonFromNode,
|
|
5
|
-
union,
|
|
6
|
-
type NodeJSON,
|
|
7
|
-
type PlainExtension,
|
|
8
|
-
type StepJSON,
|
|
9
|
-
} from '@prosekit/core'
|
|
10
|
-
import {
|
|
11
|
-
DOMSerializer,
|
|
12
|
-
Fragment,
|
|
13
|
-
Slice,
|
|
14
|
-
type ProseMirrorNode,
|
|
15
|
-
} from '@prosekit/pm/model'
|
|
16
|
-
import {
|
|
17
|
-
PluginKey,
|
|
18
|
-
ProseMirrorPlugin,
|
|
19
|
-
type Transaction,
|
|
20
|
-
} from '@prosekit/pm/state'
|
|
1
|
+
import { defineDefaultState, definePlugin, jsonFromNode, union, type NodeJSON, type PlainExtension, type StepJSON } from '@prosekit/core'
|
|
2
|
+
import { DOMSerializer, Fragment, Slice, type ProseMirrorNode } from '@prosekit/pm/model'
|
|
3
|
+
import { PluginKey, ProseMirrorPlugin, type Transaction } from '@prosekit/pm/state'
|
|
21
4
|
import { Step } from '@prosekit/pm/transform'
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
DecorationSet,
|
|
25
|
-
type EditorView,
|
|
26
|
-
} from '@prosekit/pm/view'
|
|
27
|
-
import {
|
|
28
|
-
ChangeSet,
|
|
29
|
-
type Change,
|
|
30
|
-
} from 'prosemirror-changeset'
|
|
5
|
+
import { Decoration, DecorationSet, type EditorView } from '@prosekit/pm/view'
|
|
6
|
+
import { ChangeSet, type Change } from 'prosemirror-changeset'
|
|
31
7
|
|
|
32
8
|
/**
|
|
33
9
|
* A JSON representation of a commit.
|
|
@@ -250,7 +226,7 @@ function defineCommitDecoration(commit: Commit): PlainExtension {
|
|
|
250
226
|
*/
|
|
251
227
|
function defineCommitViewer(commit: Commit): PlainExtension {
|
|
252
228
|
return union(
|
|
253
|
-
defineDefaultState({
|
|
229
|
+
defineDefaultState({ defaultContent: commit.doc }),
|
|
254
230
|
defineCommitDecoration(commit),
|
|
255
231
|
)
|
|
256
232
|
}
|
|
@@ -322,9 +298,4 @@ function defineCommitRecorder(commitRecorder: CommitRecorder): PlainExtension {
|
|
|
322
298
|
)
|
|
323
299
|
}
|
|
324
300
|
|
|
325
|
-
export {
|
|
326
|
-
CommitRecorder,
|
|
327
|
-
defineCommitRecorder,
|
|
328
|
-
defineCommitViewer,
|
|
329
|
-
type Commit,
|
|
330
|
-
}
|
|
301
|
+
export { CommitRecorder, defineCommitRecorder, defineCommitViewer, type Commit }
|
package/src/doc/index.ts
CHANGED
package/src/drop-cursor/index.ts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
pluginFacet,
|
|
5
|
-
type PlainExtension,
|
|
6
|
-
type PluginPayload,
|
|
7
|
-
} from '@prosekit/core'
|
|
8
|
-
import type {
|
|
9
|
-
DragEventHandler,
|
|
10
|
-
DropIndicatorPluginOptions,
|
|
11
|
-
ShowHandler,
|
|
12
|
-
} from 'prosemirror-drop-indicator'
|
|
1
|
+
import { isNotNullish } from '@ocavue/utils'
|
|
2
|
+
import { defineFacet, defineFacetPayload, pluginFacet, type PlainExtension, type PluginPayload } from '@prosekit/core'
|
|
3
|
+
import type { DragEventHandler, DropIndicatorPluginOptions, ShowHandler } from 'prosemirror-drop-indicator'
|
|
13
4
|
import { createDropIndicatorPlugin } from 'prosemirror-drop-indicator'
|
|
14
5
|
|
|
15
6
|
/**
|
|
@@ -25,24 +16,24 @@ const dropIndicatorFacet = defineFacet<DropIndicatorPluginOptions, PluginPayload
|
|
|
25
16
|
parent: pluginFacet,
|
|
26
17
|
singleton: true,
|
|
27
18
|
reducer: (payloads: DropIndicatorPluginOptions[]): PluginPayload => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
const showHandlers = payloads.map(p => p.onShow).filter(isNotNullish)
|
|
20
|
+
const hideHandlers = payloads.map(p => p.onHide).filter(isNotNullish)
|
|
21
|
+
const dragHandlers = payloads.map(p => p.onDrag).filter(isNotNullish)
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
for (
|
|
23
|
+
const showHandler: ShowHandler = (options) => {
|
|
24
|
+
for (const fn of showHandlers) {
|
|
34
25
|
fn(options)
|
|
35
26
|
}
|
|
36
27
|
}
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
for (
|
|
29
|
+
const hideHandler: VoidFunction = () => {
|
|
30
|
+
for (const fn of hideHandlers) {
|
|
40
31
|
fn()
|
|
41
32
|
}
|
|
42
33
|
}
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
for (
|
|
35
|
+
const dragHandler: DragEventHandler = (options): boolean => {
|
|
36
|
+
for (const fn of dragHandlers) {
|
|
46
37
|
if (fn(options) === false) return false
|
|
47
38
|
}
|
|
48
39
|
return true
|
|
@@ -7,8 +7,4 @@ export type {
|
|
|
7
7
|
ShowHandlerOptions,
|
|
8
8
|
ViewDragging,
|
|
9
9
|
} from 'prosemirror-drop-indicator'
|
|
10
|
-
export {
|
|
11
|
-
defineDropIndicator,
|
|
12
|
-
type DropIndicatorExtension,
|
|
13
|
-
type DropIndicatorOptions,
|
|
14
|
-
} from './drop-indicator'
|
|
10
|
+
export { defineDropIndicator, type DropIndicatorExtension, type DropIndicatorOptions } from './drop-indicator'
|
package/src/enter-rule/index.ts
CHANGED
|
@@ -10,17 +10,8 @@ import {
|
|
|
10
10
|
type PluginPayload,
|
|
11
11
|
} from '@prosekit/core'
|
|
12
12
|
import { keydownHandler } from '@prosekit/pm/keymap'
|
|
13
|
-
import type {
|
|
14
|
-
|
|
15
|
-
NodeType,
|
|
16
|
-
} from '@prosekit/pm/model'
|
|
17
|
-
import {
|
|
18
|
-
PluginKey,
|
|
19
|
-
ProseMirrorPlugin,
|
|
20
|
-
type Command,
|
|
21
|
-
type EditorState,
|
|
22
|
-
type Transaction,
|
|
23
|
-
} from '@prosekit/pm/state'
|
|
13
|
+
import type { Attrs, NodeType } from '@prosekit/pm/model'
|
|
14
|
+
import { PluginKey, ProseMirrorPlugin, type Command, type EditorState, type Transaction } from '@prosekit/pm/state'
|
|
24
15
|
import type { EditorView } from '@prosekit/pm/view'
|
|
25
16
|
|
|
26
17
|
/**
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
union,
|
|
4
|
-
withPriority,
|
|
5
|
-
} from '@prosekit/core'
|
|
6
|
-
import {
|
|
7
|
-
beforeEach,
|
|
8
|
-
describe,
|
|
9
|
-
expect,
|
|
10
|
-
it,
|
|
11
|
-
vi,
|
|
12
|
-
} from 'vitest'
|
|
1
|
+
import { Priority, union, withPriority } from '@prosekit/core'
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
13
3
|
|
|
14
|
-
import {
|
|
15
|
-
defineTestExtension,
|
|
16
|
-
setupTestFromExtension,
|
|
17
|
-
} from '../testing'
|
|
4
|
+
import { defineTestExtension, setupTestFromExtension } from '../testing'
|
|
18
5
|
import { pasteFiles } from '../testing/clipboard'
|
|
19
6
|
|
|
20
7
|
import { defineFilePasteHandler } from './file-paste-handler'
|
package/src/file/index.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type FileDropHandlerOptions,
|
|
5
|
-
} from './file-drop-handler'
|
|
6
|
-
export {
|
|
7
|
-
defineFilePasteHandler,
|
|
8
|
-
type FilePasteHandler,
|
|
9
|
-
type FilePasteHandlerOptions,
|
|
10
|
-
} from './file-paste-handler'
|
|
11
|
-
export {
|
|
12
|
-
UploadTask,
|
|
13
|
-
type Uploader,
|
|
14
|
-
type UploaderOptions,
|
|
15
|
-
type UploadProgress,
|
|
16
|
-
} from './file-upload'
|
|
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'
|
package/src/gap-cursor/index.ts
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
expect,
|
|
4
|
-
it,
|
|
5
|
-
} from 'vitest'
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { keyboard } from 'vitest-browser-commands/playwright'
|
|
6
3
|
|
|
7
4
|
import { setupTest } from '../testing'
|
|
8
|
-
import {
|
|
9
|
-
inputText,
|
|
10
|
-
pressKey,
|
|
11
|
-
} from '../testing/keyboard'
|
|
5
|
+
import { inputText } from '../testing/keyboard'
|
|
12
6
|
|
|
13
7
|
describe('defineHardBreakKeymap', () => {
|
|
14
8
|
it('should insert hard break', async () => {
|
|
@@ -19,12 +13,12 @@ describe('defineHardBreakKeymap', () => {
|
|
|
19
13
|
|
|
20
14
|
editor.set(doc1)
|
|
21
15
|
expect(editor.state.doc.toJSON()).toEqual(doc1.toJSON())
|
|
22
|
-
await
|
|
16
|
+
await keyboard.press('Shift+Enter')
|
|
23
17
|
expect(editor.state.doc.toJSON()).toEqual(doc2.toJSON())
|
|
24
18
|
|
|
25
19
|
editor.set(doc1)
|
|
26
20
|
expect(editor.state.doc.toJSON()).toEqual(doc1.toJSON())
|
|
27
|
-
await
|
|
21
|
+
await keyboard.press('ControlOrMeta+Enter')
|
|
28
22
|
expect(editor.state.doc.toJSON()).toEqual(doc2.toJSON())
|
|
29
23
|
})
|
|
30
24
|
|
|
@@ -37,7 +31,7 @@ describe('defineHardBreakKeymap', () => {
|
|
|
37
31
|
|
|
38
32
|
editor.set(doc1)
|
|
39
33
|
expect(editor.state.doc.toJSON()).toEqual(doc1.toJSON())
|
|
40
|
-
await
|
|
34
|
+
await keyboard.press('Shift+Enter')
|
|
41
35
|
expect(editor.state.doc.toJSON()).toEqual(doc2.toJSON())
|
|
42
36
|
await inputText('baz')
|
|
43
37
|
expect(editor.state.doc.toJSON()).toEqual(doc3.toJSON())
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
union,
|
|
3
|
-
type Union,
|
|
4
|
-
} from '@prosekit/core'
|
|
1
|
+
import { union, type Union } from '@prosekit/core'
|
|
5
2
|
|
|
6
|
-
import {
|
|
7
|
-
defineHardBreakCommands,
|
|
8
|
-
type HardBreakCommandsExtension,
|
|
9
|
-
} from './hard-break-commands'
|
|
3
|
+
import { defineHardBreakCommands, type HardBreakCommandsExtension } from './hard-break-commands'
|
|
10
4
|
import { defineHardBreakKeymap } from './hard-break-keymap'
|
|
11
|
-
import {
|
|
12
|
-
defineHardBreakSpec,
|
|
13
|
-
type HardBreakSpecExtension,
|
|
14
|
-
} from './hard-break-spec'
|
|
5
|
+
import { defineHardBreakSpec, type HardBreakSpecExtension } from './hard-break-spec'
|
|
15
6
|
|
|
16
7
|
/**
|
|
17
8
|
* @internal
|
package/src/hard-break/index.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
type HardBreakExtension,
|
|
4
|
-
} from './hard-break'
|
|
5
|
-
export {
|
|
6
|
-
defineHardBreakCommands,
|
|
7
|
-
type HardBreakCommandsExtension,
|
|
8
|
-
} from './hard-break-commands'
|
|
1
|
+
export { defineHardBreak, type HardBreakExtension } from './hard-break'
|
|
2
|
+
export { defineHardBreakCommands, type HardBreakCommandsExtension } from './hard-break-commands'
|
|
9
3
|
export { defineHardBreakKeymap } from './hard-break-keymap'
|
|
10
|
-
export {
|
|
11
|
-
defineHardBreakSpec,
|
|
12
|
-
type HardBreakSpecExtension,
|
|
13
|
-
} from './hard-break-spec'
|
|
4
|
+
export { defineHardBreakSpec, type HardBreakSpecExtension } from './hard-break-spec'
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineCommands,
|
|
3
|
-
insertNode,
|
|
4
|
-
setBlockType,
|
|
5
|
-
toggleNode,
|
|
6
|
-
type Extension,
|
|
7
|
-
} from '@prosekit/core'
|
|
1
|
+
import { defineCommands, insertNode, setBlockType, toggleNode, type Extension } from '@prosekit/core'
|
|
8
2
|
|
|
9
3
|
import type { HeadingAttrs } from './heading-types'
|
|
10
4
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
expect,
|
|
4
|
-
it,
|
|
5
|
-
} from 'vitest'
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { keyboard } from 'vitest-browser-commands/playwright'
|
|
6
3
|
|
|
7
4
|
import { setupTest } from '../testing'
|
|
8
|
-
import { pressKey } from '../testing/keyboard'
|
|
9
5
|
|
|
10
6
|
describe('defineHeadingKeymap', () => {
|
|
11
7
|
it('should toggle heading', async () => {
|
|
@@ -17,13 +13,13 @@ describe('defineHeadingKeymap', () => {
|
|
|
17
13
|
|
|
18
14
|
editor.set(doc)
|
|
19
15
|
expect(editor.state.doc.toJSON()).toEqual(doc.toJSON())
|
|
20
|
-
await
|
|
16
|
+
await keyboard.press('ControlOrMeta+Alt+1')
|
|
21
17
|
expect(editor.state.doc.toJSON()).toEqual(docH1.toJSON())
|
|
22
|
-
await
|
|
18
|
+
await keyboard.press('ControlOrMeta+Alt+1')
|
|
23
19
|
expect(editor.state.doc.toJSON()).toEqual(doc.toJSON())
|
|
24
|
-
await
|
|
20
|
+
await keyboard.press('ControlOrMeta+Alt+3')
|
|
25
21
|
expect(editor.state.doc.toJSON()).toEqual(docH3.toJSON())
|
|
26
|
-
await
|
|
22
|
+
await keyboard.press('ControlOrMeta+Alt+1')
|
|
27
23
|
expect(editor.state.doc.toJSON()).toEqual(docH1.toJSON())
|
|
28
24
|
})
|
|
29
25
|
|
|
@@ -35,7 +31,7 @@ describe('defineHeadingKeymap', () => {
|
|
|
35
31
|
|
|
36
32
|
editor.set(doc1)
|
|
37
33
|
expect(editor.state.doc.toJSON()).toEqual(doc1.toJSON())
|
|
38
|
-
await
|
|
34
|
+
await keyboard.press('Backspace')
|
|
39
35
|
expect(editor.state.doc.toJSON()).toEqual(doc2.toJSON())
|
|
40
36
|
})
|
|
41
37
|
|
|
@@ -47,7 +43,7 @@ describe('defineHeadingKeymap', () => {
|
|
|
47
43
|
|
|
48
44
|
editor.set(doc1)
|
|
49
45
|
expect(editor.state.doc.toJSON()).toEqual(doc1.toJSON())
|
|
50
|
-
await
|
|
46
|
+
await keyboard.press('Backspace')
|
|
51
47
|
expect(editor.state.doc.toJSON()).toEqual(doc2.toJSON())
|
|
52
48
|
})
|
|
53
49
|
})
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineKeymap,
|
|
3
|
-
isAtBlockStart,
|
|
4
|
-
toggleNode,
|
|
5
|
-
unsetBlockType,
|
|
6
|
-
withSkipCodeBlock,
|
|
7
|
-
type PlainExtension,
|
|
8
|
-
} from '@prosekit/core'
|
|
1
|
+
import { defineKeymap, isAtBlockStart, toggleNode, unsetBlockType, withSkipCodeBlock, type PlainExtension } from '@prosekit/core'
|
|
9
2
|
import type { Command } from '@prosekit/pm/state'
|
|
10
3
|
|
|
11
4
|
function toggleHeadingKeybinding(level: number): Command {
|
|
@@ -29,12 +22,12 @@ const backspaceUnsetHeading: Command = (state, dispatch, view) => {
|
|
|
29
22
|
*/
|
|
30
23
|
export function defineHeadingKeymap(): PlainExtension {
|
|
31
24
|
return defineKeymap({
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
25
|
+
'Mod-Alt-1': toggleHeadingKeybinding(1),
|
|
26
|
+
'Mod-Alt-2': toggleHeadingKeybinding(2),
|
|
27
|
+
'Mod-Alt-3': toggleHeadingKeybinding(3),
|
|
28
|
+
'Mod-Alt-4': toggleHeadingKeybinding(4),
|
|
29
|
+
'Mod-Alt-5': toggleHeadingKeybinding(5),
|
|
30
|
+
'Mod-Alt-6': toggleHeadingKeybinding(6),
|
|
38
31
|
'Backspace': backspaceUnsetHeading,
|
|
39
32
|
})
|
|
40
33
|
}
|