@prosekit/extensions
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -293,4 +293,13 @@ import { CommandArgs } from '@prosekit/core'; | ||
NODES: "mention"; | ||
COMMAND_ARGS: { | ||
insertMention: [attrs: MentionAttrs]; | ||
}; | ||
}>; | ||
export declare function defineMentionCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
insertMention: [attrs: MentionAttrs]; | ||
}; | ||
}>; | ||
/** | ||
@@ -417,4 +426,4 @@ * @public | ||
* By default, the placeholder text will be shown whenever the current text | ||
* cursor is in an empty node. If you only want to show the placeholder when | ||
* the whole doc is empty, you can set this option to 'doc'. | ||
* cursor is in an empty text node. If you only want to show the placeholder | ||
* when the whole doc is empty, you can set this option to 'doc'. | ||
* | ||
@@ -421,0 +430,0 @@ * @default 'block' |
export { defineMentionSpec } from './_tsup-dts-rollup'; | ||
export { defineMentionCommands } from './_tsup-dts-rollup'; | ||
export { defineMention } from './_tsup-dts-rollup'; | ||
export { MentionAttrs } from './_tsup-dts-rollup'; |
// src/mention/index.ts | ||
import { defineNodeSpec, union } from "@prosekit/core"; | ||
import { | ||
defineCommands, | ||
defineNodeSpec, | ||
insertNode, | ||
union | ||
} from "@prosekit/core"; | ||
function defineMentionSpec() { | ||
@@ -37,8 +42,16 @@ return defineNodeSpec({ | ||
} | ||
function defineMentionCommands() { | ||
return defineCommands({ | ||
insertMention: (attrs) => { | ||
return insertNode({ type: "mention", attrs }); | ||
} | ||
}); | ||
} | ||
function defineMention() { | ||
return union([defineMentionSpec()]); | ||
return union([defineMentionSpec(), defineMentionCommands()]); | ||
} | ||
export { | ||
defineMention, | ||
defineMentionCommands, | ||
defineMentionSpec | ||
}; |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53882
1629