@prosekit/extensions
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -9,7 +9,5 @@ import { Attrs } from '@prosekit/pm/model'; | ||
import { Command } from '@prosekit/pm/state'; | ||
import { CommandArgs } from '@prosekit/core'; | ||
import { DedentListOptions } from 'prosemirror-flat-list'; | ||
import { EditorState } from '@prosekit/pm/state'; | ||
import { Extension } from '@prosekit/core'; | ||
import { ExtensionTyping } from '@prosekit/core'; | ||
import { getHighlighter } from 'shiki/bundle/full'; | ||
@@ -145,3 +143,7 @@ import { IndentListOptions } from 'prosemirror-flat-list'; | ||
export declare function defineBlockquote(): Extension< { | ||
NODES: "blockquote"; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
}>; | ||
@@ -153,6 +155,8 @@ | ||
*/ | ||
export declare function defineBlockquoteInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineBlockquoteInputRule(): Extension<any>; | ||
export declare function defineBlockquoteSpec(): Extension< { | ||
NODES: "blockquote"; | ||
Nodes: "blockquote"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -164,5 +168,6 @@ | ||
export declare function defineBold(): Extension< { | ||
MARKS: "bold"; | ||
COMMAND_ARGS: { | ||
toggleBold: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -172,13 +177,17 @@ }>; | ||
export declare function defineBoldCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
toggleBold: []; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
export declare function defineBoldInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineBoldInputRule(): Extension<any>; | ||
export declare function defineBoldKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineBoldKeymap(): Extension<any>; | ||
export declare function defineBoldSpec(): Extension< { | ||
MARKS: "bold"; | ||
Marks: "bold"; | ||
Nodes: never; | ||
Commands: never; | ||
}>; | ||
@@ -190,5 +199,6 @@ | ||
export declare function defineCode(): Extension< { | ||
MARKS: "code"; | ||
COMMAND_ARGS: { | ||
toggleCode: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -209,8 +219,6 @@ }>; | ||
declare function defineCodeBlock(): Extension< { | ||
NODES: "codeBlock"; | ||
COMMAND_ARGS: { | ||
setCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
insertCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
setCodeBlockAttrs: [attrs: CodeBlockAttrs]; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -227,3 +235,3 @@ }>; | ||
declare function defineCodeBlockCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
setCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
@@ -234,2 +242,4 @@ insertCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -244,3 +254,3 @@ export { defineCodeBlockCommands } | ||
*/ | ||
declare function defineCodeBlockEnterRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
declare function defineCodeBlockEnterRule(): Extension<any>; | ||
export { defineCodeBlockEnterRule } | ||
@@ -268,3 +278,3 @@ export { defineCodeBlockEnterRule as defineCodeBlockEnterRule_alias_1 } | ||
*/ | ||
declare function defineCodeBlockInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
declare function defineCodeBlockInputRule(): Extension<any>; | ||
export { defineCodeBlockInputRule } | ||
@@ -276,3 +286,3 @@ export { defineCodeBlockInputRule as defineCodeBlockInputRule_alias_1 } | ||
*/ | ||
export declare function defineCodeBlockKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineCodeBlockKeymap(): Extension<any>; | ||
@@ -294,3 +304,5 @@ /** | ||
declare function defineCodeBlockSpec(): Extension< { | ||
NODES: "codeBlock"; | ||
Nodes: "codeBlock"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -301,10 +313,12 @@ export { defineCodeBlockSpec } | ||
export declare function defineCodeCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
toggleCode: []; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
export declare function defineCodeInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineCodeInputRule(): Extension<any>; | ||
export declare function defineCodeKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineCodeKeymap(): Extension<any>; | ||
@@ -315,3 +329,5 @@ /** | ||
export declare function defineCodeSpec(): Extension< { | ||
MARKS: "code"; | ||
Marks: "code"; | ||
Nodes: never; | ||
Commands: never; | ||
}>; | ||
@@ -326,3 +342,3 @@ | ||
*/ | ||
export declare function defineDropCursor(options?: DropCursorOptions): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineDropCursor(options?: DropCursorOptions): Extension<any>; | ||
@@ -342,7 +358,6 @@ /** | ||
export declare function defineHeading(): Extension< { | ||
NODES: "heading"; | ||
COMMAND_ARGS: { | ||
setHeading: [attrs?: HeadingAttrs | undefined]; | ||
insertHeading: [attrs?: HeadingAttrs | undefined]; | ||
toggleHeading: [attrs?: HeadingAttrs | undefined]; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -352,3 +367,3 @@ }>; | ||
export declare function defineHeadingCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
setHeading: [attrs?: HeadingAttrs | undefined]; | ||
@@ -358,2 +373,4 @@ insertHeading: [attrs?: HeadingAttrs | undefined]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -365,8 +382,10 @@ | ||
*/ | ||
export declare function defineHeadingInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineHeadingInputRule(): Extension<any>; | ||
export declare function defineHeadingKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineHeadingKeymap(): Extension<any>; | ||
export declare function defineHeadingSpec(): Extension< { | ||
NODES: "heading"; | ||
Nodes: "heading"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -378,4 +397,5 @@ | ||
export declare function defineImage(): Extension< { | ||
NODES: "image"; | ||
COMMAND_ARGS: { | ||
Nodes: "image"; | ||
Marks: never; | ||
Commands: { | ||
insertImage: [attrs?: ImageAttrs | undefined]; | ||
@@ -386,9 +406,13 @@ }; | ||
export declare function defineImageCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
insertImage: [attrs?: ImageAttrs | undefined]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
export declare function defineImageSpec(): Extension< { | ||
NODES: "image"; | ||
Nodes: "image"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -409,5 +433,6 @@ | ||
export declare function defineItalic(): Extension< { | ||
MARKS: "italic"; | ||
COMMAND_ARGS: { | ||
toggleItalic: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -417,13 +442,17 @@ }>; | ||
export declare function defineItalicCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
toggleItalic: []; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
export declare function defineItalicInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineItalicInputRule(): Extension<any>; | ||
export declare function defineItalicKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineItalicKeymap(): Extension<any>; | ||
export declare function defineItalicSpec(): Extension< { | ||
MARKS: "italic"; | ||
Marks: "italic"; | ||
Nodes: never; | ||
Commands: never; | ||
}>; | ||
@@ -435,8 +464,6 @@ | ||
export declare function defineLink(): Extension< { | ||
MARKS: "link"; | ||
COMMAND_ARGS: { | ||
addLink: [attrs: LinkAttrs]; | ||
removeLink: []; | ||
toggleLink: [attrs: LinkAttrs]; | ||
expandLink: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -446,3 +473,3 @@ }>; | ||
export declare function defineLinkCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
addLink: [attrs: LinkAttrs]; | ||
@@ -453,2 +480,4 @@ removeLink: []; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -459,3 +488,3 @@ | ||
*/ | ||
export declare function defineLinkEnterRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineLinkEnterRule(): Extension<any>; | ||
@@ -465,3 +494,3 @@ /** | ||
*/ | ||
export declare function defineLinkInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineLinkInputRule(): Extension<any>; | ||
@@ -471,6 +500,8 @@ /** | ||
*/ | ||
export declare function defineLinkMarkRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineLinkMarkRule(): Extension<any>; | ||
export declare function defineLinkSpec(): Extension< { | ||
MARKS: "link"; | ||
Marks: "link"; | ||
Nodes: never; | ||
Commands: never; | ||
}>; | ||
@@ -482,13 +513,6 @@ | ||
export declare function defineList(): Extension<{ | ||
NODES: "list"; | ||
COMMAND_ARGS: { | ||
dedentList: [options?: DedentListOptions | undefined]; | ||
indentList: [options?: IndentListOptions | undefined]; | ||
moveList: [direction: "up" | "down"]; | ||
splitList: []; | ||
toggleCollapsed: [(ToggleCollapsedOptions | undefined)?]; | ||
toggleList: [attrs: ListAttributes]; | ||
unwrapList: [options?: UnwrapListOptions | undefined]; | ||
wrapInList: [getAttrs: ListAttributes | ((range: NodeRange) => ListAttributes | null)]; | ||
insertList: [attrs?: ListAttributes | undefined]; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -498,3 +522,3 @@ }>; | ||
export declare function defineListCommands(): Extension<{ | ||
COMMAND_ARGS: { | ||
Commands: { | ||
dedentList: [options?: DedentListOptions | undefined]; | ||
@@ -510,2 +534,4 @@ indentList: [options?: IndentListOptions | undefined]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -520,8 +546,10 @@ | ||
*/ | ||
export declare function defineListKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineListKeymap(): Extension<any>; | ||
export declare function defineListPlugins(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineListPlugins(): Extension<any>; | ||
export declare function defineListSpec(): Extension<{ | ||
NODES: "list"; | ||
Nodes: "list"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -541,3 +569,3 @@ | ||
*/ | ||
declare function defineMarkRule(options: MarkRuleOptions): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
declare function defineMarkRule(options: MarkRuleOptions): Extension<any>; | ||
export { defineMarkRule } | ||
@@ -550,4 +578,5 @@ export { defineMarkRule as defineMarkRule_alias_1 } | ||
export declare function defineMention(): Extension< { | ||
NODES: "mention"; | ||
COMMAND_ARGS: { | ||
Nodes: "mention"; | ||
Marks: never; | ||
Commands: { | ||
insertMention: [attrs: MentionAttrs]; | ||
@@ -558,5 +587,7 @@ }; | ||
export declare function defineMentionCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
insertMention: [attrs: MentionAttrs]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -568,3 +599,5 @@ | ||
export declare function defineMentionSpec(): Extension< { | ||
NODES: "mention"; | ||
Nodes: "mention"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -584,3 +617,3 @@ | ||
*/ | ||
export declare function definePlaceholder(options: PlaceholderOptions): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function definePlaceholder(options: PlaceholderOptions): Extension<any>; | ||
@@ -590,3 +623,3 @@ /** | ||
*/ | ||
export declare function defineReadonly(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineReadonly(): Extension<any>; | ||
@@ -597,5 +630,6 @@ /** | ||
export declare function defineStrike(): Extension< { | ||
MARKS: "strike"; | ||
COMMAND_ARGS: { | ||
toggleStrike: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -605,13 +639,17 @@ }>; | ||
export declare function defineStrikeCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
toggleStrike: []; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
export declare function defineStrikeInputRule(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineStrikeInputRule(): Extension<any>; | ||
export declare function defineStrikeKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineStrikeKeymap(): Extension<any>; | ||
export declare function defineStrikeSpec(): Extension< { | ||
MARKS: "strike"; | ||
Marks: "strike"; | ||
Nodes: never; | ||
Commands: never; | ||
}>; | ||
@@ -623,10 +661,6 @@ | ||
export declare function defineTable(): Extension< { | ||
NODES: "table" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
COMMAND_ARGS: { | ||
insertTable: [{ | ||
row: number; | ||
col: number; | ||
header: boolean; | ||
}]; | ||
exitTable: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -636,3 +670,5 @@ }>; | ||
declare function defineTableCellSpec(): Extension< { | ||
NODES: "tableCell"; | ||
Nodes: "tableCell"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -648,3 +684,3 @@ export { defineTableCellSpec } | ||
declare function defineTableCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
insertTable: [{ | ||
@@ -657,2 +693,4 @@ row: number; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -663,3 +701,5 @@ export { defineTableCommands } | ||
declare function defineTableHeaderCellSpec(): Extension< { | ||
NODES: "tableHeaderCell"; | ||
Nodes: "tableHeaderCell"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -672,3 +712,3 @@ export { defineTableHeaderCellSpec } | ||
*/ | ||
declare function defineTablePlugins(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
declare function defineTablePlugins(): Extension<any>; | ||
export { defineTablePlugins } | ||
@@ -678,3 +718,5 @@ export { defineTablePlugins as defineTablePlugins_alias_1 } | ||
declare function defineTableRowSpec(): Extension< { | ||
NODES: "tableRow"; | ||
Nodes: "tableRow"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -685,3 +727,5 @@ export { defineTableRowSpec } | ||
declare function defineTableSpec(): Extension< { | ||
NODES: "table"; | ||
Nodes: "table"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -698,4 +742,6 @@ export { defineTableSpec } | ||
export declare function defineTextAlign(options: TextAlignOptions): Extension<{ | ||
COMMAND_ARGS: { | ||
setTextAlign: [value: string | null]; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -708,5 +754,7 @@ }>; | ||
export declare function defineTextAlignCommands(types: string[]): Extension<{ | ||
COMMAND_ARGS: { | ||
Commands: { | ||
setTextAlign: [value: string | null]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
@@ -717,3 +765,3 @@ | ||
*/ | ||
export declare function defineTextAlignKeymap(types: string[]): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineTextAlignKeymap(types: string[]): Extension<any>; | ||
@@ -758,5 +806,6 @@ /** | ||
export declare function defineUnderline(): Extension< { | ||
MARKS: "underline"; | ||
COMMAND_ARGS: { | ||
toggleUnderline: []; | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
@@ -766,11 +815,15 @@ }>; | ||
export declare function defineUnderlineCommands(): Extension< { | ||
COMMAND_ARGS: { | ||
Commands: { | ||
toggleUnderline: []; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
}>; | ||
export declare function defineUnderlineKeymap(): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
export declare function defineUnderlineKeymap(): Extension<any>; | ||
export declare function defineUnderlineSpec(): Extension< { | ||
MARKS: "underline"; | ||
Marks: "underline"; | ||
Nodes: never; | ||
Commands: never; | ||
}>; | ||
@@ -938,7 +991,2 @@ | ||
/** | ||
* @deprecated Use `isApple` from `@prosekit/core` | ||
*/ | ||
export declare const isApple: boolean; | ||
export declare const LINK_ENTER_RE: RegExp; | ||
@@ -945,0 +993,0 @@ |
// src/mod-click-prevention/index.ts | ||
import { definePlugin } from "@prosekit/core"; | ||
import { definePlugin, isApple } from "@prosekit/core"; | ||
import { Plugin, PluginKey } from "@prosekit/pm/state"; | ||
// src/mod-click-prevention/env.ts | ||
var isApple = typeof navigator !== "undefined" ? /Mac|iP(hone|[ao]d)/.test(navigator.platform) : false; | ||
// src/mod-click-prevention/index.ts | ||
function defineModClickPrevention() { | ||
@@ -10,0 +5,0 @@ return definePlugin(new Plugin({ key, props: { handleClick } })); |
@@ -11,3 +11,3 @@ // src/placeholder/index.ts | ||
return new Plugin({ | ||
key: placeholderPluginKey, | ||
key: new PluginKey("prosekit-placeholder"), | ||
props: { | ||
@@ -31,3 +31,2 @@ decorations: (state) => { | ||
} | ||
var placeholderPluginKey = new PluginKey("prosekit-placeholder"); | ||
function isDocEmpty(doc) { | ||
@@ -34,0 +33,0 @@ var _a; |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"private": false, | ||
@@ -165,15 +165,15 @@ "author": { | ||
"dependencies": { | ||
"@prosekit/core": "^0.5.0", | ||
"@prosekit/pm": "^0.1.3", | ||
"@prosekit/core": "^0.5.2", | ||
"@prosekit/pm": "^0.1.4", | ||
"prosemirror-dropcursor": "^1.8.1", | ||
"prosemirror-flat-list": "^0.5.0", | ||
"prosemirror-highlight": "^0.5.0", | ||
"prosemirror-highlight": "^0.6.0", | ||
"prosemirror-tables": "^1.3.7", | ||
"shiki": "^1.4.0" | ||
"shiki": "^1.6.1" | ||
}, | ||
"devDependencies": { | ||
"@prosekit/dev": "*", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
"vitest": "^1.6.0", | ||
"@prosekit/dev": "0.0.0" | ||
}, | ||
@@ -180,0 +180,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
3147
103381
+ Addedprosemirror-highlight@0.6.0(transitive)
- Removedprosemirror-highlight@0.5.0(transitive)
Updated@prosekit/core@^0.5.2
Updated@prosekit/pm@^0.1.4
Updatedprosemirror-highlight@^0.6.0
Updatedshiki@^1.6.1