@prosekit/extensions 0.13.0 → 0.14.1
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-DJq8pF92.js} +11 -10
- package/dist/drop-indicator-DJq8pF92.js.map +1 -0
- package/dist/{file-DrfcSid-.js → file-upload-I9m1EJAM.js} +3 -3
- package/dist/file-upload-I9m1EJAM.js.map +1 -0
- package/dist/{index-oIc1a2f2.d.ts → file-upload-dr3IXUty.d.ts} +1 -1
- package/dist/file-upload-dr3IXUty.d.ts.map +1 -0
- package/dist/{paste-rule-pVb4sqvJ.js → mark-paste-rule-n_2Ehmb5.js} +7 -7
- package/dist/mark-paste-rule-n_2Ehmb5.js.map +1 -0
- package/dist/{mark-rule-BcLB4Uv2.js → mark-rule-CUnXwBuy.js} +6 -6
- package/dist/mark-rule-CUnXwBuy.js.map +1 -0
- package/dist/prosekit-extensions-autocomplete.d.ts.map +1 -1
- 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 +1 -1
- 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.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 +6 -79
- package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-enter-rule.js +37 -2
- package/dist/prosekit-extensions-enter-rule.js.map +1 -0
- package/dist/prosekit-extensions-file.d.ts +2 -2
- 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 +1 -1
- 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 +10 -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 +89 -2
- package/dist/prosekit-extensions-input-rule.js.map +1 -0
- 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.map +1 -1
- package/dist/prosekit-extensions-loro.js +2 -2
- 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-math.d.ts +154 -0
- package/dist/prosekit-extensions-math.d.ts.map +1 -0
- package/dist/prosekit-extensions-math.js +104 -0
- package/dist/prosekit-extensions-math.js.map +1 -0
- 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.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 +1 -1
- 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 +1 -1
- package/dist/prosekit-extensions-table.d.ts.map +1 -1
- package/dist/prosekit-extensions-table.js +1 -1
- 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 +2 -2
- 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.map +1 -1
- package/dist/shiki-highlighter-chunk.d.ts +19 -2
- package/dist/shiki-highlighter-chunk.d.ts.map +1 -0
- package/dist/shiki-highlighter-chunk.js.map +1 -1
- package/dist/{table-BRDh_9mG.js → table-UJVYsrB7.js} +2 -2
- package/dist/table-UJVYsrB7.js.map +1 -0
- package/package.json +42 -17
- package/src/autocomplete/autocomplete-helpers.ts +1 -5
- package/src/autocomplete/autocomplete-plugin.ts +3 -13
- package/src/autocomplete/autocomplete.spec.ts +4 -19
- package/src/autocomplete/autocomplete.ts +1 -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 +1 -5
- package/src/blockquote/blockquote-keymap.ts +1 -6
- 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 +6 -35
- 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 +18 -200
- 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 +1 -5
- 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 +1 -5
- package/src/heading/heading-keymap.ts +1 -8
- 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 +1 -5
- 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 +1 -5
- 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/loro/index.ts +3 -13
- package/src/loro/loro-commands.ts +2 -8
- package/src/loro/loro-cursor-plugin.ts +3 -13
- package/src/loro/loro-keymap.ts +2 -10
- package/src/loro/loro-sync-plugin.ts +2 -8
- package/src/loro/loro-undo-plugin.ts +2 -8
- package/src/loro/loro.ts +2 -11
- 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/math/index.ts +22 -0
- package/src/math/math-block.ts +89 -0
- package/src/math/math-inline.ts +89 -0
- package/src/math/math-plugin.ts +8 -0
- package/src/math/math.ts +39 -0
- 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 +1 -4
- 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 +3 -16
- package/src/readonly/index.ts +2 -8
- package/src/search/index.ts +1 -6
- 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 +10 -12
- package/src/testing/katex.ts +9 -0
- package/src/text/index.ts +1 -4
- package/src/text-align/index.ts +2 -2
- 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 +2 -10
- package/src/yjs/yjs-sync-plugin.ts +1 -4
- package/src/yjs/yjs-types.ts +8 -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 +0 -96
- 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 +0 -90
- 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 +0 -19
- 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
|
@@ -52,7 +52,7 @@ function defineLoroUndoPlugin(options) {
|
|
|
52
52
|
* @public
|
|
53
53
|
*/
|
|
54
54
|
function defineLoro(options) {
|
|
55
|
-
const { doc, awareness, presence, sync, undo
|
|
55
|
+
const { doc, awareness, presence, sync, undo, cursor } = options;
|
|
56
56
|
return withPriority(union([
|
|
57
57
|
defineLoroKeymap(),
|
|
58
58
|
defineLoroCommands(),
|
|
@@ -62,7 +62,7 @@ function defineLoro(options) {
|
|
|
62
62
|
presence
|
|
63
63
|
}),
|
|
64
64
|
defineLoroUndoPlugin({
|
|
65
|
-
...undo
|
|
65
|
+
...undo,
|
|
66
66
|
doc
|
|
67
67
|
}),
|
|
68
68
|
defineLoroSyncPlugin({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-loro.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-loro.js","names":[],"sources":["../src/loro/loro-commands.ts","../src/loro/loro-cursor-plugin.ts","../src/loro/loro-keymap.ts","../src/loro/loro-sync-plugin.ts","../src/loro/loro-undo-plugin.ts","../src/loro/loro.ts"],"sourcesContent":["import { defineCommands, type Extension } from '@prosekit/core'\nimport { redo, undo } from 'loro-prosemirror'\n\nconst commands = {\n undo: () => undo,\n redo: () => redo,\n} as const\n\n/**\n * @internal\n */\nexport type LoroCommandsExtension = Extension<{\n Commands: {\n undo: []\n redo: []\n }\n}>\n\nexport function defineLoroCommands(): LoroCommandsExtension {\n return defineCommands(commands)\n}\n","import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport type { Plugin } from '@prosekit/pm/state'\nimport type { CursorAwareness, CursorEphemeralStore, CursorPluginOptions } from 'loro-prosemirror'\nimport { LoroCursorPlugin, LoroEphemeralCursorPlugin } from 'loro-prosemirror'\n\nexport interface LoroCursorOptions extends CursorPluginOptions {\n awareness?: CursorAwareness\n presence?: CursorEphemeralStore\n}\n\nexport function defineLoroCursorPlugin(\n options: LoroCursorOptions,\n): PlainExtension {\n return definePlugin(createLoroCursorPlugin(options))\n}\n\nfunction createLoroCursorPlugin(options: LoroCursorOptions): Plugin {\n const { awareness, presence, ...rest } = options\n if (awareness && presence) {\n throw new Error('Only one of awareness and presence can be provided')\n } else if (awareness) {\n return LoroCursorPlugin(awareness, rest)\n } else if (presence) {\n return LoroEphemeralCursorPlugin(presence, rest)\n } else {\n throw new Error('Either awareness or presence must be provided')\n }\n}\n","import { defineKeymap, isApple, type Keymap, type PlainExtension } from '@prosekit/core'\nimport { redo, undo } from 'loro-prosemirror'\n\nconst keymap: Keymap = {\n 'Mod-z': undo,\n 'Mod-Z': redo,\n}\n\nif (!isApple) {\n keymap['Mod-y'] = redo\n}\n\nexport function defineLoroKeymap(): PlainExtension {\n return defineKeymap(keymap)\n}\n","import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport { LoroSyncPlugin, type LoroSyncPluginProps } from 'loro-prosemirror'\n\nexport function defineLoroSyncPlugin(\n options: LoroSyncPluginProps,\n): PlainExtension {\n return definePlugin(LoroSyncPlugin(options))\n}\n","import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport { LoroUndoPlugin, type LoroUndoPluginProps } from 'loro-prosemirror'\n\nexport function defineLoroUndoPlugin(options: LoroUndoPluginProps): PlainExtension {\n return definePlugin(LoroUndoPlugin(options))\n}\n","import { Priority, union, withPriority, type PlainExtension, type Union } from '@prosekit/core'\nimport type {\n CursorAwareness,\n CursorEphemeralStore,\n CursorPluginOptions,\n LoroDocType,\n LoroSyncPluginProps,\n LoroUndoPluginProps,\n} from 'loro-prosemirror'\n\nimport { defineLoroCommands, type LoroCommandsExtension } from './loro-commands'\nimport { defineLoroCursorPlugin } from './loro-cursor-plugin'\nimport { defineLoroKeymap } from './loro-keymap'\nimport { defineLoroSyncPlugin } from './loro-sync-plugin'\nimport { defineLoroUndoPlugin } from './loro-undo-plugin'\n\nexport interface LoroOptions {\n /**\n * The Loro instance handles the state of shared data.\n */\n doc: LoroDocType\n\n /**\n * The (legacy) Awareness instance. One of `awareness` or `presence` must be provided.\n */\n awareness?: CursorAwareness\n\n /**\n * The CursorEphemeralStore instance. One of `awareness` or `presence` must be provided.\n */\n presence?: CursorEphemeralStore\n\n /**\n * Extra options for `LoroSyncPlugin`.\n */\n sync?: Omit<LoroSyncPluginProps, 'doc'>\n\n /**\n * Extra options for the `LoroUndoPlugin`.\n */\n undo?: Omit<LoroUndoPluginProps, 'doc'>\n\n /**\n * Extra options for `LoroCursorPlugin` or `LoroEphemeralCursorPlugin`.\n */\n cursor?: CursorPluginOptions\n}\n\n/**\n * @internal\n */\nexport type LoroExtension = Union<[LoroCommandsExtension, PlainExtension]>\n\n/**\n * @public\n */\nexport function defineLoro(options: LoroOptions): LoroExtension {\n const { doc, awareness, presence, sync, undo, cursor } = options\n\n return withPriority(\n union([\n defineLoroKeymap(),\n defineLoroCommands(),\n defineLoroCursorPlugin({ ...cursor, awareness, presence }),\n defineLoroUndoPlugin({ ...undo, doc }),\n defineLoroSyncPlugin({ ...sync, doc }),\n ]),\n Priority.high,\n )\n}\n"],"mappings":";;;;AAGA,MAAM,WAAW;CACf,YAAY;CACZ,YAAY;CACb;AAYD,SAAgB,qBAA4C;AAC1D,QAAO,eAAe,SAAS;;;;;ACTjC,SAAgB,uBACd,SACgB;AAChB,QAAO,aAAa,uBAAuB,QAAQ,CAAC;;AAGtD,SAAS,uBAAuB,SAAoC;CAClE,MAAM,EAAE,WAAW,UAAU,GAAG,SAAS;AACzC,KAAI,aAAa,SACf,OAAM,IAAI,MAAM,qDAAqD;UAC5D,UACT,QAAO,iBAAiB,WAAW,KAAK;UAC/B,SACT,QAAO,0BAA0B,UAAU,KAAK;KAEhD,OAAM,IAAI,MAAM,gDAAgD;;;;;ACtBpE,MAAM,SAAiB;CACrB,SAAS;CACT,SAAS;CACV;AAED,IAAI,CAAC,QACH,QAAO,WAAW;AAGpB,SAAgB,mBAAmC;AACjD,QAAO,aAAa,OAAO;;;;;ACV7B,SAAgB,qBACd,SACgB;AAChB,QAAO,aAAa,eAAe,QAAQ,CAAC;;;;;ACH9C,SAAgB,qBAAqB,SAA8C;AACjF,QAAO,aAAa,eAAe,QAAQ,CAAC;;;;;;;;ACoD9C,SAAgB,WAAW,SAAqC;CAC9D,MAAM,EAAE,KAAK,WAAW,UAAU,MAAM,MAAM,WAAW;AAEzD,QAAO,aACL,MAAM;EACJ,kBAAkB;EAClB,oBAAoB;EACpB,uBAAuB;GAAE,GAAG;GAAQ;GAAW;GAAU,CAAC;EAC1D,qBAAqB;GAAE,GAAG;GAAM;GAAK,CAAC;EACtC,qBAAqB;GAAE,GAAG;GAAM;GAAK,CAAC;EACvC,CAAC,EACF,SAAS,KACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mark-rule.d.ts","names":[],"sources":["../src/mark-rule/types.ts","../src/mark-rule/mark-rule.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mark-rule.d.ts","names":[],"sources":["../src/mark-rule/types.ts","../src/mark-rule/mark-rule.ts"],"mappings":";;;;;;;AAOA;;UAAiB,eAAA;EAKR;;;;EAAP,KAAA,EAAO,MAAA;EAamD;;;EAR1D,IAAA,WAAe,QAAA;EAAf;;;;;;EAQA,KAAA,GAAQ,KAAA,YAAiB,KAAA,EAAO,gBAAA,KAAqB,KAAA;AAAA;;;;;AAlBvD;;iBCGgB,cAAA,CAAe,OAAA,EAAS,eAAA,GAAkB,cAAA"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Extension, PlainExtension, Union } from "@prosekit/core";
|
|
2
|
+
import { Attrs } from "@prosekit/pm/model";
|
|
3
|
+
import { RenderMathBlock, RenderMathInline } from "prosemirror-math";
|
|
4
|
+
|
|
5
|
+
//#region src/math/math-block.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
type MathBlockSpecExtension = Extension<{
|
|
10
|
+
Nodes: {
|
|
11
|
+
mathBlock: Attrs;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
declare function defineMathBlockSpec(): MathBlockSpecExtension;
|
|
18
|
+
/**
|
|
19
|
+
* Options for {@link defineMathBlockView}.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
interface MathBlockViewOptions {
|
|
24
|
+
/**
|
|
25
|
+
* The function to render the math block.
|
|
26
|
+
*/
|
|
27
|
+
render: RenderMathBlock;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Defines an extension that renders a math block using a custom node view.
|
|
31
|
+
*
|
|
32
|
+
* @param options
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
declare function defineMathBlockView({
|
|
36
|
+
render
|
|
37
|
+
}: MathBlockViewOptions): Extension;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
declare function defineMathBlockEnterRule(): PlainExtension;
|
|
42
|
+
/**
|
|
43
|
+
* Options for {@link defineMathBlock}.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
interface MathBlockOptions {
|
|
48
|
+
/**
|
|
49
|
+
* The function to render the math block.
|
|
50
|
+
*/
|
|
51
|
+
render: RenderMathBlock;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
type MathBlockExtension = Union<[MathBlockSpecExtension]>;
|
|
57
|
+
/**
|
|
58
|
+
* Defines node `mathBlock` and related functionalities.
|
|
59
|
+
*
|
|
60
|
+
* @param options
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
declare function defineMathBlock(options: MathBlockOptions): MathBlockExtension;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/math/math-inline.d.ts
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
type MathInlineSpecExtension = Extension<{
|
|
70
|
+
Nodes: {
|
|
71
|
+
mathInline: Attrs;
|
|
72
|
+
};
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
declare function defineMathInlineSpec(): MathInlineSpecExtension;
|
|
78
|
+
/**
|
|
79
|
+
* Options for {@link defineMathInlineView}.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
interface MathInlineViewOptions {
|
|
84
|
+
/**
|
|
85
|
+
* The function to render the math inline.
|
|
86
|
+
*/
|
|
87
|
+
render: RenderMathInline;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Defines an extension that renders a math inline using a custom node view.
|
|
91
|
+
*
|
|
92
|
+
* @param options
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
declare function defineMathInlineView({
|
|
96
|
+
render
|
|
97
|
+
}: MathInlineViewOptions): Extension;
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
declare function defineMathInlineInputRule(): PlainExtension;
|
|
102
|
+
/**
|
|
103
|
+
* Options for {@link defineMathInline}.
|
|
104
|
+
*
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
interface MathInlineOptions {
|
|
108
|
+
/**
|
|
109
|
+
* The function to render the math inline.
|
|
110
|
+
*/
|
|
111
|
+
render: RenderMathInline;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
type MathInlineExtension = Union<[MathInlineSpecExtension]>;
|
|
117
|
+
/**
|
|
118
|
+
* Defines node `mathInline` and related functionalities.
|
|
119
|
+
*
|
|
120
|
+
* @param options
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
declare function defineMathInline(options: MathInlineOptions): MathInlineExtension;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/math/math.d.ts
|
|
126
|
+
/**
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
type MathExtension = Union<[MathInlineExtension, MathBlockExtension]>;
|
|
130
|
+
/**
|
|
131
|
+
* Options for {@link defineMath}.
|
|
132
|
+
*
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
interface MathOptions {
|
|
136
|
+
/**
|
|
137
|
+
* The function to render the math block.
|
|
138
|
+
*/
|
|
139
|
+
renderMathBlock: RenderMathBlock;
|
|
140
|
+
/**
|
|
141
|
+
* The function to render the math inline.
|
|
142
|
+
*/
|
|
143
|
+
renderMathInline: RenderMathInline;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
declare function defineMath(options: MathOptions): MathExtension;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/math/math-plugin.d.ts
|
|
151
|
+
declare function defineMathPlugin(): PlainExtension;
|
|
152
|
+
//#endregion
|
|
153
|
+
export { type MathBlockExtension, type MathBlockOptions, type MathBlockSpecExtension, type MathBlockViewOptions, type MathExtension, type MathInlineExtension, type MathInlineOptions, type MathInlineSpecExtension, type MathInlineViewOptions, type MathOptions, defineMath, defineMathBlock, defineMathBlockEnterRule, defineMathBlockSpec, defineMathBlockView, defineMathInline, defineMathInlineInputRule, defineMathInlineSpec, defineMathInlineView, defineMathPlugin };
|
|
154
|
+
//# sourceMappingURL=prosekit-extensions-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-math.d.ts","names":[],"sources":["../src/math/math-block.ts","../src/math/math-inline.ts","../src/math/math.ts","../src/math/math-plugin.ts"],"mappings":";;;;;;;AASA;KAAY,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,KAAA;EAAA;AAAA;;;;iBAOC,mBAAA,CAAA,GAAuB,sBAAA;AAAvC;;;;;AAAA,UAYiB,oBAAA;EAAoB;;;EAInC,MAAA,EAAQ,eAAA;AAAA;;;;;;;iBASM,mBAAA,CAAA;EAAsB;AAAA,GAAU,oBAAA,GAAuB,SAAA;;;;iBAYvD,wBAAA,CAAA,GAA4B,cAAA;;;AAA5C;;;UASiB,gBAAA;EATyC;AAS1D;;EAIE,MAAA,EAAQ,eAAA;AAAA;;AAMV;;KAAY,kBAAA,GAAqB,KAAA,EAAO,sBAAA;;;AAQxC;;;;iBAAgB,eAAA,CAAgB,OAAA,EAAS,gBAAA,GAAmB,kBAAA;;;;;AAzE5D;KCAY,uBAAA,GAA0B,SAAA;EACpC,KAAA;IACE,UAAA,EAAY,KAAA;EAAA;AAAA;;;;iBAOA,oBAAA,CAAA,GAAwB,uBAAA;ADAxC;;;;;AAAA,UCYiB,qBAAA;EDAoB;;;ECInC,MAAA,EAAQ,gBAAA;AAAA;;;;;;;iBASM,oBAAA,CAAA;EAAuB;AAAA,GAAU,qBAAA,GAAwB,SAAA;;;;iBAYzD,yBAAA,CAAA,GAA6B,cAAA;;;ADA7C;;;UCSiB,iBAAA;EDTyC;AAS1D;;ECIE,MAAA,EAAQ,gBAAA;AAAA;;ADMV;;KCAY,mBAAA,GAAsB,KAAA,EAAO,uBAAA;;;ADQzC;;;;iBCAgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAoB,mBAAA;;;;ADzE9D;;KECY,aAAA,GAAgB,KAAA,EAAO,mBAAA,EAAqB,kBAAA;;;;;;UAOvC,WAAA;EFNG;AAOpB;;EEGE,eAAA,EAAiB,eAAA;EFHoB;;AAYvC;EEJE,gBAAA,EAAkB,gBAAA;AAAA;;;AFiBpB;iBEXgB,UAAA,CAAW,OAAA,EAAS,WAAA,GAAc,aAAA;;;iBC7BlC,gBAAA,CAAA,GAAoB,cAAA"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { defineInputRule } from "./prosekit-extensions-input-rule.js";
|
|
2
|
+
import { defineEnterRule } from "./prosekit-extensions-enter-rule.js";
|
|
3
|
+
import { defineNodeSpec, defineNodeView, definePlugin, union } from "@prosekit/core";
|
|
4
|
+
import { createCursorInsidePlugin, createMathBlockView, createMathInlineInputRule, createMathInlineView, mathBlockEnterRule, mathBlockSpec, mathInlineSpec } from "prosemirror-math";
|
|
5
|
+
|
|
6
|
+
//#region src/math/math-block.ts
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
function defineMathBlockSpec() {
|
|
11
|
+
return defineNodeSpec({
|
|
12
|
+
...mathBlockSpec,
|
|
13
|
+
name: "mathBlock"
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Defines an extension that renders a math block using a custom node view.
|
|
18
|
+
*
|
|
19
|
+
* @param options
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
function defineMathBlockView({ render }) {
|
|
23
|
+
return defineNodeView({
|
|
24
|
+
name: "mathBlock",
|
|
25
|
+
constructor: (node, view, getPos, decorations) => {
|
|
26
|
+
return createMathBlockView(render, node, decorations);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
function defineMathBlockEnterRule() {
|
|
34
|
+
return defineEnterRule(mathBlockEnterRule);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Defines node `mathBlock` and related functionalities.
|
|
38
|
+
*
|
|
39
|
+
* @param options
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
function defineMathBlock(options) {
|
|
43
|
+
return union(defineMathBlockSpec(), defineMathBlockView(options), defineMathBlockEnterRule());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/math/math-inline.ts
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
function defineMathInlineSpec() {
|
|
52
|
+
return defineNodeSpec({
|
|
53
|
+
...mathInlineSpec,
|
|
54
|
+
name: "mathInline"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Defines an extension that renders a math inline using a custom node view.
|
|
59
|
+
*
|
|
60
|
+
* @param options
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
function defineMathInlineView({ render }) {
|
|
64
|
+
return defineNodeView({
|
|
65
|
+
name: "mathInline",
|
|
66
|
+
constructor: (node, view, getPos, decorations) => {
|
|
67
|
+
return createMathInlineView(render, node, decorations);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
function defineMathInlineInputRule() {
|
|
75
|
+
return defineInputRule(createMathInlineInputRule("mathInline"));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Defines node `mathInline` and related functionalities.
|
|
79
|
+
*
|
|
80
|
+
* @param options
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
function defineMathInline(options) {
|
|
84
|
+
return union(defineMathInlineSpec(), defineMathInlineView(options), defineMathInlineInputRule());
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/math/math-plugin.ts
|
|
89
|
+
function defineMathPlugin() {
|
|
90
|
+
return definePlugin(createCursorInsidePlugin());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/math/math.ts
|
|
95
|
+
/**
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
function defineMath(options) {
|
|
99
|
+
return union(defineMathBlock({ render: options.renderMathBlock }), defineMathInline({ render: options.renderMathInline }), defineMathPlugin());
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
export { defineMath, defineMathBlock, defineMathBlockEnterRule, defineMathBlockSpec, defineMathBlockView, defineMathInline, defineMathInlineInputRule, defineMathInlineSpec, defineMathInlineView, defineMathPlugin };
|
|
104
|
+
//# sourceMappingURL=prosekit-extensions-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-math.js","names":[],"sources":["../src/math/math-block.ts","../src/math/math-inline.ts","../src/math/math-plugin.ts","../src/math/math.ts"],"sourcesContent":["import { defineNodeSpec, defineNodeView, union, type Extension, type PlainExtension, type Union } from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\nimport { createMathBlockView, mathBlockEnterRule, mathBlockSpec, type RenderMathBlock } from 'prosemirror-math'\n\nimport { defineEnterRule } from '../enter-rule'\n\n/**\n * @internal\n */\nexport type MathBlockSpecExtension = Extension<{\n Nodes: {\n mathBlock: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineMathBlockSpec(): MathBlockSpecExtension {\n return defineNodeSpec<'mathBlock', Attrs>({\n ...mathBlockSpec,\n name: 'mathBlock',\n })\n}\n\n/**\n * Options for {@link defineMathBlockView}.\n *\n * @internal\n */\nexport interface MathBlockViewOptions {\n /**\n * The function to render the math block.\n */\n render: RenderMathBlock\n}\n\n/**\n * Defines an extension that renders a math block using a custom node view.\n *\n * @param options\n * @internal\n */\nexport function defineMathBlockView({ render }: MathBlockViewOptions): Extension {\n return defineNodeView({\n name: 'mathBlock',\n constructor: (node, view, getPos, decorations) => {\n return createMathBlockView(render, node, decorations)\n },\n })\n}\n\n/**\n * @internal\n */\nexport function defineMathBlockEnterRule(): PlainExtension {\n return defineEnterRule(mathBlockEnterRule)\n}\n\n/**\n * Options for {@link defineMathBlock}.\n *\n * @internal\n */\nexport interface MathBlockOptions {\n /**\n * The function to render the math block.\n */\n render: RenderMathBlock\n}\n\n/**\n * @internal\n */\nexport type MathBlockExtension = Union<[MathBlockSpecExtension]>\n\n/**\n * Defines node `mathBlock` and related functionalities.\n *\n * @param options\n * @public\n */\nexport function defineMathBlock(options: MathBlockOptions): MathBlockExtension {\n return union(\n defineMathBlockSpec(),\n defineMathBlockView(options),\n defineMathBlockEnterRule(),\n )\n}\n","import { defineNodeSpec, defineNodeView, union, type Extension, type PlainExtension, type Union } from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\nimport { createMathInlineInputRule, createMathInlineView, mathInlineSpec, type RenderMathInline } from 'prosemirror-math'\n\nimport { defineInputRule } from '../input-rule'\n\n/**\n * @internal\n */\nexport type MathInlineSpecExtension = Extension<{\n Nodes: {\n mathInline: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineMathInlineSpec(): MathInlineSpecExtension {\n return defineNodeSpec<'mathInline', Attrs>({\n ...mathInlineSpec,\n name: 'mathInline',\n })\n}\n\n/**\n * Options for {@link defineMathInlineView}.\n *\n * @internal\n */\nexport interface MathInlineViewOptions {\n /**\n * The function to render the math inline.\n */\n render: RenderMathInline\n}\n\n/**\n * Defines an extension that renders a math inline using a custom node view.\n *\n * @param options\n * @internal\n */\nexport function defineMathInlineView({ render }: MathInlineViewOptions): Extension {\n return defineNodeView({\n name: 'mathInline',\n constructor: (node, view, getPos, decorations) => {\n return createMathInlineView(render, node, decorations)\n },\n })\n}\n\n/**\n * @internal\n */\nexport function defineMathInlineInputRule(): PlainExtension {\n return defineInputRule(createMathInlineInputRule('mathInline'))\n}\n\n/**\n * Options for {@link defineMathInline}.\n *\n * @internal\n */\nexport interface MathInlineOptions {\n /**\n * The function to render the math inline.\n */\n render: RenderMathInline\n}\n\n/**\n * @internal\n */\nexport type MathInlineExtension = Union<[MathInlineSpecExtension]>\n\n/**\n * Defines node `mathInline` and related functionalities.\n *\n * @param options\n * @public\n */\nexport function defineMathInline(options: MathInlineOptions): MathInlineExtension {\n return union(\n defineMathInlineSpec(),\n defineMathInlineView(options),\n defineMathInlineInputRule(),\n )\n}\n","import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport { createCursorInsidePlugin } from 'prosemirror-math'\n\nexport function defineMathPlugin(): PlainExtension {\n return definePlugin(\n createCursorInsidePlugin(),\n )\n}\n","import { union, type Union } from '@prosekit/core'\nimport type { RenderMathBlock, RenderMathInline } from 'prosemirror-math'\n\nimport { defineMathBlock, type MathBlockExtension } from './math-block'\nimport { defineMathInline, type MathInlineExtension } from './math-inline'\nimport { defineMathPlugin } from './math-plugin'\n\n/**\n * @public\n */\nexport type MathExtension = Union<[MathInlineExtension, MathBlockExtension]>\n\n/**\n * Options for {@link defineMath}.\n *\n * @public\n */\nexport interface MathOptions {\n /**\n * The function to render the math block.\n */\n renderMathBlock: RenderMathBlock\n\n /**\n * The function to render the math inline.\n */\n renderMathInline: RenderMathInline\n}\n\n/**\n * @public\n */\nexport function defineMath(options: MathOptions): MathExtension {\n return union(\n defineMathBlock({ render: options.renderMathBlock }),\n defineMathInline({ render: options.renderMathInline }),\n defineMathPlugin(),\n )\n}\n"],"mappings":";;;;;;;;;AAkBA,SAAgB,sBAA8C;AAC5D,QAAO,eAAmC;EACxC,GAAG;EACH,MAAM;EACP,CAAC;;;;;;;;AAqBJ,SAAgB,oBAAoB,EAAE,UAA2C;AAC/E,QAAO,eAAe;EACpB,MAAM;EACN,cAAc,MAAM,MAAM,QAAQ,gBAAgB;AAChD,UAAO,oBAAoB,QAAQ,MAAM,YAAY;;EAExD,CAAC;;;;;AAMJ,SAAgB,2BAA2C;AACzD,QAAO,gBAAgB,mBAAmB;;;;;;;;AA0B5C,SAAgB,gBAAgB,SAA+C;AAC7E,QAAO,MACL,qBAAqB,EACrB,oBAAoB,QAAQ,EAC5B,0BAA0B,CAC3B;;;;;;;;ACrEH,SAAgB,uBAAgD;AAC9D,QAAO,eAAoC;EACzC,GAAG;EACH,MAAM;EACP,CAAC;;;;;;;;AAqBJ,SAAgB,qBAAqB,EAAE,UAA4C;AACjF,QAAO,eAAe;EACpB,MAAM;EACN,cAAc,MAAM,MAAM,QAAQ,gBAAgB;AAChD,UAAO,qBAAqB,QAAQ,MAAM,YAAY;;EAEzD,CAAC;;;;;AAMJ,SAAgB,4BAA4C;AAC1D,QAAO,gBAAgB,0BAA0B,aAAa,CAAC;;;;;;;;AA0BjE,SAAgB,iBAAiB,SAAiD;AAChF,QAAO,MACL,sBAAsB,EACtB,qBAAqB,QAAQ,EAC7B,2BAA2B,CAC5B;;;;;ACpFH,SAAgB,mBAAmC;AACjD,QAAO,aACL,0BAA0B,CAC3B;;;;;;;;AC0BH,SAAgB,WAAW,SAAqC;AAC9D,QAAO,MACL,gBAAgB,EAAE,QAAQ,QAAQ,iBAAiB,CAAC,EACpD,iBAAiB,EAAE,QAAQ,QAAQ,kBAAkB,CAAC,EACtD,kBAAkB,CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mention.d.ts","names":[],"sources":["../src/mention/index.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mention.d.ts","names":[],"sources":["../src/mention/index.ts"],"mappings":";;;UAEiB,YAAA;EACf,EAAA;EACA,KAAA;EACA,IAAA;AAAA;;;;KAMU,oBAAA,GAAuB,SAAA;EACjC,KAAA;IACE,OAAA,EAAS,YAAA;EAAA;AAAA;;;;iBAOG,iBAAA,CAAA,GAAqB,oBAAA;;;;KAsCzB,wBAAA,GAA2B,SAAA;EACrC,QAAA;IACE,aAAA,GAAgB,KAAA,EAAO,YAAA;EAAA;AAAA;AAAA,iBAIX,qBAAA,CAAA,GAAyB,wBAAA;AANzC;;;AAAA,KAiBY,gBAAA,GAAmB,KAAA,EAAO,oBAAA,EAAsB,wBAAA;;;;iBAK5C,aAAA,CAAA,GAAiB,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mention.js","names":[],"sources":["../src/mention/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mention.js","names":[],"sources":["../src/mention/index.ts"],"sourcesContent":["import { defineCommands, defineNodeSpec, insertNode, union, type Extension, type Union } from '@prosekit/core'\n\nexport interface MentionAttrs {\n id: string\n value: string\n kind: string\n}\n\n/**\n * @internal\n */\nexport type MentionSpecExtension = Extension<{\n Nodes: {\n mention: MentionAttrs\n }\n}>\n\n/**\n * @public\n */\nexport function defineMentionSpec(): MentionSpecExtension {\n return defineNodeSpec<'mention', MentionAttrs>({\n name: 'mention',\n atom: true,\n group: 'inline',\n attrs: {\n id: { validate: 'string' },\n value: { validate: 'string' },\n kind: { default: '', validate: 'string' },\n },\n inline: true,\n leafText: (node) => (node.attrs as MentionAttrs).value.toString(),\n parseDOM: [\n {\n tag: `span[data-mention]`,\n getAttrs: (dom: HTMLElement): MentionAttrs => ({\n id: dom.getAttribute('data-id') || '',\n kind: dom.getAttribute('data-mention') || '',\n value: dom.textContent || '',\n }),\n },\n ],\n toDOM(node) {\n return [\n 'span',\n {\n 'data-id': (node.attrs as MentionAttrs).id.toString(),\n 'data-mention': (node.attrs as MentionAttrs).kind.toString(),\n },\n (node.attrs as MentionAttrs).value.toString(),\n ]\n },\n })\n}\n\n/**\n * @internal\n */\nexport type MentionCommandsExtension = Extension<{\n Commands: {\n insertMention: [attrs: MentionAttrs]\n }\n}>\n\nexport function defineMentionCommands(): MentionCommandsExtension {\n return defineCommands({\n insertMention: (attrs: MentionAttrs) => {\n return insertNode({ type: 'mention', attrs })\n },\n })\n}\n\n/**\n * @internal\n */\nexport type MentionExtension = Union<[MentionSpecExtension, MentionCommandsExtension]>\n\n/**\n * @public\n */\nexport function defineMention(): MentionExtension {\n return union(defineMentionSpec(), defineMentionCommands())\n}\n"],"mappings":";;;;;;AAoBA,SAAgB,oBAA0C;AACxD,QAAO,eAAwC;EAC7C,MAAM;EACN,MAAM;EACN,OAAO;EACP,OAAO;GACL,IAAI,EAAE,UAAU,UAAU;GAC1B,OAAO,EAAE,UAAU,UAAU;GAC7B,MAAM;IAAE,SAAS;IAAI,UAAU;IAAU;GAC1C;EACD,QAAQ;EACR,WAAW,SAAU,KAAK,MAAuB,MAAM,UAAU;EACjE,UAAU,CACR;GACE,KAAK;GACL,WAAW,SAAoC;IAC7C,IAAI,IAAI,aAAa,UAAU,IAAI;IACnC,MAAM,IAAI,aAAa,eAAe,IAAI;IAC1C,OAAO,IAAI,eAAe;IAC3B;GACF,CACF;EACD,MAAM,MAAM;AACV,UAAO;IACL;IACA;KACE,WAAY,KAAK,MAAuB,GAAG,UAAU;KACrD,gBAAiB,KAAK,MAAuB,KAAK,UAAU;KAC7D;IACA,KAAK,MAAuB,MAAM,UAAU;IAC9C;;EAEJ,CAAC;;AAYJ,SAAgB,wBAAkD;AAChE,QAAO,eAAe,EACpB,gBAAgB,UAAwB;AACtC,SAAO,WAAW;GAAE,MAAM;GAAW;GAAO,CAAC;IAEhD,CAAC;;;;;AAWJ,SAAgB,gBAAkC;AAChD,QAAO,MAAM,mBAAmB,EAAE,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mod-click-prevention.d.ts","names":[],"sources":["../src/mod-click-prevention/index.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mod-click-prevention.d.ts","names":[],"sources":["../src/mod-click-prevention/index.ts"],"mappings":";;;;;AAOA;KAAY,2BAAA,GAA8B,cAAA;;;;AAQ1C;;;iBAAgB,wBAAA,CAAA,GAA4B,2BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-mod-click-prevention.js","names":[
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-mod-click-prevention.js","names":[],"sources":["../src/mod-click-prevention/index.ts"],"sourcesContent":["import { definePlugin, isApple, type PlainExtension } from '@prosekit/core'\nimport { Plugin, PluginKey } from '@prosekit/pm/state'\nimport type { EditorView } from '@prosekit/pm/view'\n\n/**\n * @internal\n */\nexport type ModClickPreventionExtension = PlainExtension\n\n/**\n * By default, clicking a node while holding the mod key will select the node. This\n * extension disables that behavior.\n *\n * @public\n */\nexport function defineModClickPrevention(): ModClickPreventionExtension {\n return definePlugin(new Plugin({ key, props: { handleClick } }))\n}\n\nconst key = new PluginKey('prosekit-mod-click-prevention')\n\nfunction handleClick(_view: EditorView, _pos: number, event: MouseEvent) {\n return !!event[selectNodeModifier]\n}\n\nconst selectNodeModifier: 'metaKey' | 'ctrlKey' = isApple\n ? 'metaKey'\n : 'ctrlKey'\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,2BAAwD;AACtE,QAAO,aAAa,IAAI,OAAO;EAAE;EAAK,OAAO,EAAE,aAAa;EAAE,CAAC,CAAC;;AAGlE,MAAM,MAAM,IAAI,UAAU,gCAAgC;AAE1D,SAAS,YAAY,OAAmB,MAAc,OAAmB;AACvE,QAAO,CAAC,CAAC,MAAM;;AAGjB,MAAM,qBAA4C,UAC9C,YACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-paragraph.d.ts","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts","../src/paragraph/paragraph-keymap.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-paragraph.d.ts","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts","../src/paragraph/paragraph-keymap.ts"],"mappings":";;;;;;;;KAMY,0BAAA,GAA6B,SAAA;EACvC,QAAA;IACE,YAAA;EAAA;AAAA;AAcJ;;;AAAA,iBAAgB,uBAAA,CAAA,GAA2B,0BAAA;;;;;;KChB/B,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,KAAA;EAAA;AAAA;;;;;ADcf;iBCLgB,mBAAA,CAAA,GAAuB,sBAAA;;;;;ADXvC;KEGY,kBAAA,GAAqB,KAAA,EAAO,sBAAA,EAAwB,0BAAA;;;;;;;;AFahE;iBEHgB,eAAA,CAAA,GAAmB,kBAAA;;;;;;iBCZnB,qBAAA,CAAA,GAAyB,cAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-paragraph.js","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-keymap.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-paragraph.js","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-keymap.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts"],"sourcesContent":["import { defineCommands, setBlockType, type Extension } from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\n/**\n * @internal\n */\nexport type ParagraphCommandsExtension = Extension<{\n Commands: {\n setParagraph: []\n }\n}>\n\n/**\n * @internal\n */\nexport function setParagraph(): Command {\n return setBlockType({ type: 'paragraph' })\n}\n\n/**\n * @internal\n */\nexport function defineParagraphCommands(): ParagraphCommandsExtension {\n return defineCommands({ setParagraph })\n}\n","import { defineKeymap, type PlainExtension } from '@prosekit/core'\n\nimport { setParagraph } from './paragraph-commands'\n\n/**\n * @internal\n */\nexport function defineParagraphKeymap(): PlainExtension {\n return defineKeymap({\n 'Mod-Alt-0': setParagraph(),\n })\n}\n","import { defineNodeSpec, type Extension } from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type ParagraphSpecExtension = Extension<{\n Nodes: {\n paragraph: Attrs\n }\n}>\n\n/**\n * @internal\n *\n * Defines a paragraph node spec.\n */\nexport function defineParagraphSpec(): ParagraphSpecExtension {\n return defineNodeSpec({\n name: 'paragraph',\n content: 'inline*',\n group: 'block',\n parseDOM: [{ tag: 'p' }],\n toDOM() {\n return ['p', 0]\n },\n })\n}\n","import { Priority, union, withPriority, type Union } from '@prosekit/core'\n\nimport { defineParagraphCommands, type ParagraphCommandsExtension } from './paragraph-commands'\nimport { defineParagraphKeymap } from './paragraph-keymap'\nimport { defineParagraphSpec, type ParagraphSpecExtension } from './paragraph-spec'\n\n/**\n * @internal\n */\nexport type ParagraphExtension = Union<[ParagraphSpecExtension, ParagraphCommandsExtension]>\n\n/**\n * @public\n *\n * Defines a paragraph node.\n *\n * The paragraph node spec has the highest priority, because it should be the\n * default block node for most cases.\n */\nexport function defineParagraph(): ParagraphExtension {\n return union(\n withPriority(defineParagraphSpec(), Priority.highest),\n defineParagraphCommands(),\n defineParagraphKeymap(),\n )\n}\n"],"mappings":";;;;;;AAeA,SAAgB,eAAwB;AACtC,QAAO,aAAa,EAAE,MAAM,aAAa,CAAC;;;;;AAM5C,SAAgB,0BAAsD;AACpE,QAAO,eAAe,EAAE,cAAc,CAAC;;;;;;;;AChBzC,SAAgB,wBAAwC;AACtD,QAAO,aAAa,EAClB,aAAa,cAAc,EAC5B,CAAC;;;;;;;;;;ACOJ,SAAgB,sBAA8C;AAC5D,QAAO,eAAe;EACpB,MAAM;EACN,SAAS;EACT,OAAO;EACP,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC;EACxB,QAAQ;AACN,UAAO,CAAC,KAAK,EAAE;;EAElB,CAAC;;;;;;;;;;;;;ACPJ,SAAgB,kBAAsC;AACpD,QAAO,MACL,aAAa,qBAAqB,EAAE,SAAS,QAAQ,EACrD,yBAAyB,EACzB,uBAAuB,CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-paste-rule.d.ts","names":[],"sources":["../src/paste-rule/mark-paste-rule.ts","../src/paste-rule/paste-rule.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-paste-rule.d.ts","names":[],"sources":["../src/paste-rule/mark-paste-rule.ts","../src/paste-rule/paste-rule.ts"],"mappings":";;;;;;;;AAYA;;UAAiB,oBAAA;EAKR;;;;EAAP,KAAA,EAAO,MAAA;EAmB4B;;;EAdnC,IAAA,WAAe,QAAA;EAAf;;;;;;EAQA,QAAA,IAAY,KAAA,EAAO,eAAA,KAAoB,KAAA;EAMnB;;;;EAApB,UAAA,IAAc,IAAA,EAAM,eAAA;AAAA;;;;;;iBAQN,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAuB,cAAA;;;;;AAhCpE;;;UCDiB,uBAAA;EDWA;;;ECPf,KAAA,EAAO,KAAA;EDqB4B;;;EChBnC,IAAA,EAAM,UAAA;EDEN;;;;ECIA,KAAA;AAAA;;;;;;ADkBF;KCTY,gBAAA,IAAoB,OAAA,EAAS,uBAAA,KAA4B,KAAA;;;;;;UAOpD,gBAAA;EDEiE;;;ECEhF,OAAA,EAAS,gBAAA;AAAA;;;;;;;;;iBAWK,eAAA,CAAA;EAAkB;AAAA,GAAW,gBAAA,GAAmB,cAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-placeholder.d.ts","names":[],"sources":["../src/placeholder/index.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-placeholder.d.ts","names":[],"sources":["../src/placeholder/index.ts"],"mappings":";;;;UAOiB,kBAAA;;AAAjB;;;EAKE,WAAA,aAAwB,KAAA,EAAO,WAAA;EAA/B;;;;;;;;AAuBF;;;;;;EAPE,QAAA,uBAA+B,KAAA,EAAO,WAAA;AAAA;;;;;iBAOxB,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,cAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as findTable } from "./table-
|
|
1
|
+
import { p as findTable } from "./table-UJVYsrB7.js";
|
|
2
2
|
import { definePlugin, isInCodeBlock, isTextSelection, maybeRun } from "@prosekit/core";
|
|
3
3
|
import { Plugin, PluginKey } from "@prosekit/pm/state";
|
|
4
4
|
import { Decoration, DecorationSet } from "@prosekit/pm/view";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-placeholder.js","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-placeholder.js","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":["import { definePlugin, isInCodeBlock, isTextSelection, maybeRun, type PlainExtension } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\nimport { Plugin, PluginKey, type EditorState } from '@prosekit/pm/state'\nimport { Decoration, DecorationSet } from '@prosekit/pm/view'\n\nimport { findTable } from '../table'\n\nexport interface PlaceholderOptions {\n /**\n * The placeholder to use. It can be a static string or a function that\n * receives the current editor state and returns a string.\n */\n placeholder: string | ((state: EditorState) => string)\n\n /**\n * By default, the placeholder text will be shown whenever the current text\n * cursor is in an empty text node and it's not inside a code block or a\n * table node.\n *\n * If you only want to show the placeholder when the whole doc is empty, you\n * can set this option to 'doc'.\n *\n * You can also pass a function that receives the current editor state and\n * returns a boolean value to determine whether the placeholder should be\n * shown.\n *\n * @default 'block'\n */\n strategy?: 'doc' | 'block' | ((state: EditorState) => boolean)\n}\n\n/**\n * Add a placeholder text to the editor when the current block or document is\n * empty.\n */\nexport function definePlaceholder(options: PlaceholderOptions): PlainExtension {\n return definePlugin(createPlaceholderPlugin(options))\n}\n\nfunction createPlaceholderPlugin({\n placeholder,\n strategy = 'block',\n}: PlaceholderOptions): Plugin {\n return new Plugin({\n key: new PluginKey('prosekit-placeholder'),\n props: {\n decorations: (state) => {\n const strategyFn = typeof strategy === 'function'\n ? strategy\n : strategy === 'doc'\n ? docStrategy\n : defaultStrategy\n\n if (!strategyFn(state)) {\n return null\n }\n\n const placeholderText: string = maybeRun(placeholder, state)\n const deco = createPlaceholderDecoration(state, placeholderText)\n if (!deco) {\n return null\n }\n\n return DecorationSet.create(state.doc, [deco])\n },\n },\n })\n}\n\nfunction defaultStrategy(state: EditorState): boolean {\n return !isInCodeBlock(state.selection) && !findTable(state.selection.$from)\n}\n\nfunction docStrategy(state: EditorState): boolean {\n return isDocEmpty(state.doc) && defaultStrategy(state)\n}\n\nfunction isDocEmpty(doc: ProseMirrorNode) {\n return doc.childCount <= 1 && !doc.firstChild?.content.size\n}\n\nfunction createPlaceholderDecoration(\n state: EditorState,\n placeholderText: string,\n): Decoration | null {\n if (!placeholderText) return null\n\n const { selection } = state\n if (!selection.empty || !isTextSelection(selection)) return null\n\n const $pos = selection.$anchor\n const node = $pos.parent\n if (node.content.size > 0) return null\n\n const before = $pos.before()\n\n return Decoration.node(before, before + node.nodeSize, {\n 'class': 'prosekit-placeholder',\n 'data-placeholder': placeholderText,\n })\n}\n"],"mappings":";;;;;;;;;;AAmCA,SAAgB,kBAAkB,SAA6C;AAC7E,QAAO,aAAa,wBAAwB,QAAQ,CAAC;;AAGvD,SAAS,wBAAwB,EAC/B,aACA,WAAW,WACkB;AAC7B,QAAO,IAAI,OAAO;EAChB,KAAK,IAAI,UAAU,uBAAuB;EAC1C,OAAO,EACL,cAAc,UAAU;AAOtB,OAAI,EANe,OAAO,aAAa,aACnC,WACA,aAAa,QACb,cACA,iBAEY,MAAM,CACpB,QAAO;GAIT,MAAM,OAAO,4BAA4B,OADT,SAAS,aAAa,MAAM,CACI;AAChE,OAAI,CAAC,KACH,QAAO;AAGT,UAAO,cAAc,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC;KAEjD;EACF,CAAC;;AAGJ,SAAS,gBAAgB,OAA6B;AACpD,QAAO,CAAC,cAAc,MAAM,UAAU,IAAI,CAAC,UAAU,MAAM,UAAU,MAAM;;AAG7E,SAAS,YAAY,OAA6B;AAChD,QAAO,WAAW,MAAM,IAAI,IAAI,gBAAgB,MAAM;;AAGxD,SAAS,WAAW,KAAsB;AACxC,QAAO,IAAI,cAAc,KAAK,CAAC,IAAI,YAAY,QAAQ;;AAGzD,SAAS,4BACP,OACA,iBACmB;AACnB,KAAI,CAAC,gBAAiB,QAAO;CAE7B,MAAM,EAAE,cAAc;AACtB,KAAI,CAAC,UAAU,SAAS,CAAC,gBAAgB,UAAU,CAAE,QAAO;CAE5D,MAAM,OAAO,UAAU;CACvB,MAAM,OAAO,KAAK;AAClB,KAAI,KAAK,QAAQ,OAAO,EAAG,QAAO;CAElC,MAAM,SAAS,KAAK,QAAQ;AAE5B,QAAO,WAAW,KAAK,QAAQ,SAAS,KAAK,UAAU;EACrD,SAAS;EACT,oBAAoB;EACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-readonly.d.ts","names":[],"sources":["../src/readonly/index.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-readonly.d.ts","names":[],"sources":["../src/readonly/index.ts"],"mappings":";;;;;AAMA;iBAAgB,cAAA,CAAA,GAAkB,cAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-readonly.js","names":[],"sources":["../src/readonly/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-readonly.js","names":[],"sources":["../src/readonly/index.ts"],"sourcesContent":["import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport { PluginKey, ProseMirrorPlugin } from '@prosekit/pm/state'\n\n/**\n * Make the editor read-only.\n */\nexport function defineReadonly(): PlainExtension {\n return definePlugin(plugin)\n}\n\nconst plugin = new ProseMirrorPlugin({\n key: new PluginKey('prosekey-readonly'),\n props: {\n editable: () => false,\n },\n})\n"],"mappings":";;;;;;;AAMA,SAAgB,iBAAiC;AAC/C,QAAO,aAAa,OAAO;;AAG7B,MAAM,SAAS,IAAI,kBAAkB;CACnC,KAAK,IAAI,UAAU,oBAAoB;CACvC,OAAO,EACL,gBAAgB,OACjB;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-search.d.ts","names":[],"sources":["../src/search/index.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-search.d.ts","names":[],"sources":["../src/search/index.ts"],"mappings":";;;;;AAqBA;;;UAAiB,kBAAA;EAIf;;;EAAA,MAAA;EA4BA;;;EAvBA,OAAA;EAsCc;;;;;EA/Bd,aAAA;EA+B8D;;;AAqChE;;;;EA3DE,OAAA;EA4DA;;;;;EArDA,MAAA;EA2DE;;;;;EApDF,SAAA;AAAA;;;;;;iBAQc,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,cAAA;;;;KAqCpD,uBAAA,GAA0B,SAAA;EACpC,QAAA;IACE,QAAA;IACA,QAAA;IACA,cAAA;IACA,cAAA;IACA,WAAA;IACA,iBAAA;IACA,cAAA;IACA,UAAA;EAAA;AAAA;;;;;;iBASY,oBAAA,CAAA,GAAwB,uBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-search.js","names":[],"sources":["../src/search/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-search.js","names":[],"sources":["../src/search/index.ts"],"sourcesContent":["import { defineCommands, definePlugin, type Extension, type PlainExtension } from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\nimport type { EditorView } from '@prosekit/pm/view'\nimport {\n findNext,\n findNextNoWrap,\n findPrev,\n findPrevNoWrap,\n replaceAll,\n replaceCurrent,\n replaceNext,\n replaceNextNoWrap,\n search,\n SearchQuery,\n} from 'prosemirror-search'\n\n/**\n * Options for {@link defineSearchQuery}\n *\n * @public\n */\nexport interface SearchQueryOptions {\n /**\n * The search string (or regular expression).\n */\n search: string\n\n /**\n * The replace text.\n */\n replace?: string\n\n /**\n * Indicates whether the search is case-sensitive\n *\n * @default false\n */\n caseSensitive?: boolean\n\n /**\n * By default, string search will replace `\\n`, `\\r`, and `\\t` in the query\n * with newline, return, and tab characters. When this is set to true, that\n * behavior is disabled.\n *\n * @default false\n */\n literal?: boolean\n\n /**\n * When true, the search string is interpreted as a regular expression.\n *\n * @default false\n */\n regexp?: boolean\n\n /**\n * Enable whole-word matching.\n *\n * @default false\n */\n wholeWord?: boolean\n}\n\n/**\n * Defines an extension that stores a current search query and replace string.\n *\n * @public\n */\nexport function defineSearchQuery(options: SearchQueryOptions): PlainExtension {\n const query = new SearchQuery(options)\n return definePlugin(search({ initialQuery: query }))\n}\n\n/**\n * Scrolls the active search match into view.\n */\nfunction scrollActiveIntoView(view: EditorView) {\n if (view.isDestroyed) return\n const active = view.dom.querySelector('.ProseMirror-active-search-match')\n active?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n })\n}\n\n/**\n * Wraps a command and scrolls the active search match into view when the command\n * is applied.\n */\nfunction withScrollActiveIntoView(command: Command): Command {\n return (state, dispatch, view) => {\n const result = command(state, dispatch, view)\n if (result && dispatch && view) {\n // Add a small delay because the command itself will handle scrolling if\n // the view is focused.\n setTimeout(() => scrollActiveIntoView(view), 50)\n }\n return result\n }\n}\n\n/**\n * @internal\n */\nexport type SearchCommandsExtension = Extension<{\n Commands: {\n findNext: []\n findPrev: []\n findNextNoWrap: []\n findPrevNoWrap: []\n replaceNext: []\n replaceNextNoWrap: []\n replaceCurrent: []\n replaceAll: []\n }\n}>\n\n/**\n * Defines commands for search and replace.\n *\n * @public\n */\nexport function defineSearchCommands(): SearchCommandsExtension {\n return defineCommands({\n findNext: () => withScrollActiveIntoView(findNext),\n findPrev: () => withScrollActiveIntoView(findPrev),\n findNextNoWrap: () => withScrollActiveIntoView(findNextNoWrap),\n findPrevNoWrap: () => withScrollActiveIntoView(findPrevNoWrap),\n replaceNext: () => withScrollActiveIntoView(replaceNext),\n replaceNextNoWrap: () => withScrollActiveIntoView(replaceNextNoWrap),\n replaceCurrent: () => withScrollActiveIntoView(replaceCurrent),\n replaceAll: () => withScrollActiveIntoView(replaceAll),\n })\n}\n"],"mappings":";;;;;;;;;AAoEA,SAAgB,kBAAkB,SAA6C;AAE7E,QAAO,aAAa,OAAO,EAAE,cADf,IAAI,YAAY,QAAQ,EACY,CAAC,CAAC;;;;;AAMtD,SAAS,qBAAqB,MAAkB;AAC9C,KAAI,KAAK,YAAa;AAEtB,CADe,KAAK,IAAI,cAAc,mCAAmC,EACjE,eAAe;EACrB,OAAO;EACP,QAAQ;EACR,UAAU;EACX,CAAC;;;;;;AAOJ,SAAS,yBAAyB,SAA2B;AAC3D,SAAQ,OAAO,UAAU,SAAS;EAChC,MAAM,SAAS,QAAQ,OAAO,UAAU,KAAK;AAC7C,MAAI,UAAU,YAAY,KAGxB,kBAAiB,qBAAqB,KAAK,EAAE,GAAG;AAElD,SAAO;;;;;;;;AAyBX,SAAgB,uBAAgD;AAC9D,QAAO,eAAe;EACpB,gBAAgB,yBAAyB,SAAS;EAClD,gBAAgB,yBAAyB,SAAS;EAClD,sBAAsB,yBAAyB,eAAe;EAC9D,sBAAsB,yBAAyB,eAAe;EAC9D,mBAAmB,yBAAyB,YAAY;EACxD,yBAAyB,yBAAyB,kBAAkB;EACpE,sBAAsB,yBAAyB,eAAe;EAC9D,kBAAkB,yBAAyB,WAAW;EACvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-strike.d.ts","names":[],"sources":["../src/strike/index.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-strike.d.ts","names":[],"sources":["../src/strike/index.ts"],"mappings":";;;;;;AAkBA;KAAY,mBAAA,GAAsB,SAAA;EAChC,KAAA;IACE,MAAA,EAAQ,KAAA;EAAA;AAAA;;;;iBAOI,gBAAA,CAAA,GAAoB,mBAAA;AAApC;;;AAAA,KAmBY,uBAAA,GAA0B,SAAA;EACpC,QAAA;IACE,YAAA;EAAA;AAAA;;;;iBAOY,oBAAA,CAAA,GAAwB,uBAAA;;;AAAxC;iBASgB,kBAAA,CAAA,GAAsB,cAAA;;;;iBAUtB,qBAAA,CAAA,GAAyB,cAAA;;;;KAY7B,eAAA,GAAkB,KAAA,EAC3B,mBAAA,EAAqB,uBAAA;;;AADxB;iBAOgB,YAAA,CAAA,GAAgB,eAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineMarkInputRule } from "./prosekit-extensions-input-rule.js";
|
|
2
2
|
import { canUseRegexLookbehind, defineCommands, defineKeymap, defineMarkSpec, toggleMark, union } from "@prosekit/core";
|
|
3
3
|
|
|
4
4
|
//#region src/strike/index.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"mappings":";;;;;;;;;UA2CiB,kBAAA;;AAAjB;;EAIE,GAAA;EAJiC;;;EASjC,GAAA;EAOM;;AAWR;;;EAXE,MAAA;AAAA;;;;;;;;ACnDF;iBD8DgB,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,OAAA;;;;;;UC9DzC,kBAAA;;ADmCjB;;;EC9BE,GAAA;AAAA;;;;iBAMc,WAAA,CAAY,OAAA,GAAU,kBAAA,GAAqB,OAAA;;;;;;UCX1C,sBAAA;;AFmCjB;;;EE9BE,GAAA;AAAA;;;;iBAMc,eAAA,CAAgB,OAAA,GAAU,sBAAA,GAAyB,OAAA;;;;;;UCXlD,wBAAA;;AHmCjB;;;EG9BE,MAAA;EHkCA;;;;EG5BA,IAAA;AAAA;;;;iBAMc,iBAAA,CAAkB,OAAA,GAAU,wBAAA,GAA2B,OAAA;;;;;;UCjBtD,qBAAA;;AJmCjB;;;EI9BE,MAAA;EJkCA;;;;EI5BA,IAAA;AAAA;;;;iBAMc,cAAA,CAAe,OAAA,GAAU,qBAAA,GAAwB,OAAA;;;;;;KCCrD,sBAAA,GAAyB,SAAA;EACnC,QAAA;IACE,WAAA,GAAc,OAAA,EAAS,kBAAA;IACvB,SAAA;IAEA,WAAA,GAAc,OAAA,GAAU,kBAAA;IACxB,eAAA,GAAkB,OAAA,GAAU,sBAAA;IAC5B,iBAAA,GAAoB,OAAA,GAAU,wBAAA;IAC9B,cAAA,GAAiB,OAAA,GAAU,qBAAA;IAE3B,oBAAA;IACA,mBAAA;IACA,gBAAA;IACA,gBAAA;IAEA,WAAA;IACA,iBAAA;IACA,cAAA;IACA,mBAAA;IAEA,eAAA;IACA,cAAA;IAEA,YAAA,GAAe,OAAA,EAAS,mBAAA;IACxB,eAAA,GAAkB,OAAA,EAAS,sBAAA;EAAA;AAAA;;;;;;iBASf,mBAAA,CAAA,GAAuB,sBAAA;;;;;;UClDtB,SAAA;EACf,OAAA;EACA,OAAA;EACA,QAAA;AAAA;;;;KAYU,kBAAA,GAAqB,SAAA;EAC/B,KAAA;IACE,KAAA,EAAO,KAAA;EAAA;AAAA;;;;iBAaK,eAAA,CAAA,GAAmB,kBAAA;;;;KAWvB,qBAAA,GAAwB,SAAA;EAClC,KAAA;IACE,QAAA,EAAU,KAAA;EAAA;AAAA;;;ALjCd;iBKwCgB,kBAAA,CAAA,GAAsB,qBAAA;;;;KAW1B,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,SAAA;EAAA;AAAA;;;AJhEf;iBIuEgB,mBAAA,CAAA,GAAuB,sBAAA;;;;KAW3B,4BAAA,GAA+B,SAAA;EACzC,KAAA;IACE,eAAA,EAAiB,SAAA;EAAA;AAAA;AAAA,iBAIL,yBAAA,CAAA,GAA6B,4BAAA;;;;;;KC7EjC,cAAA,GAAiB,KAAA,EAEzB,kBAAA,EACA,qBAAA,EACA,sBAAA,EACA,4BAAA,EACA,sBAAA;;;AP6CJ;iBOtCgB,WAAA,CAAA,GAAe,cAAA;;;;;;;;APW/B;cQhCa,SAAA,EAAW,OAAA;;;;;;;;ARgCxB;iBShCgB,wBAAA,CAAA,GAA4B,cAAA;;;;;;iBCL5B,kBAAA,CAAA,GAAsB,cAAA;;;;;;;AVqCtC;iBWlCgB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as insertTable, a as defineTableSpec, c as defineTableCommands, d as selectTableCell, f as selectTable, g as moveTableColumn, h as moveTableRow, i as defineTableRowSpec, l as selectTableRow, m as isCellSelection, n as defineTableCellSpec, o as defineTablePlugins, p as findTable, r as defineTableHeaderCellSpec, s as defineTableDropIndicator, t as defineTable, u as selectTableColumn, v as exitTable } from "./table-
|
|
1
|
+
import { _ as insertTable, a as defineTableSpec, c as defineTableCommands, d as selectTableCell, f as selectTable, g as moveTableColumn, h as moveTableRow, i as defineTableRowSpec, l as selectTableRow, m as isCellSelection, n as defineTableCellSpec, o as defineTablePlugins, p as findTable, r as defineTableHeaderCellSpec, s as defineTableDropIndicator, t as defineTable, u as selectTableColumn, v as exitTable } from "./table-UJVYsrB7.js";
|
|
2
2
|
|
|
3
3
|
export { defineTable, defineTableCellSpec, defineTableCommands, defineTableDropIndicator, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|