@prosekit/extensions
Advanced tools
Comparing version 0.0.0-next-20240622120010 to 0.0.0-next-20240626133927
import { Attrs } from '@prosekit/pm/model'; | ||
import { Attrs as Attrs_2 } from 'prosemirror-model'; | ||
import { BundledLanguage } from 'shiki'; | ||
@@ -10,4 +11,8 @@ import { BundledLanguageInfo } from 'shiki'; | ||
import { DedentListOptions } from 'prosemirror-flat-list'; | ||
import { config as default_alias_1 } from '@prosekit/dev/config-vitest'; | ||
import { EditorState } from '@prosekit/pm/state'; | ||
import { Extension } from '@prosekit/core'; | ||
import { ExtensionTyping } from '@prosekit/core'; | ||
import { ExtractMarks } from '@prosekit/core'; | ||
import { ExtractNodes } from '@prosekit/core'; | ||
import { getSingletonHighlighter } from 'shiki/bundle/full'; | ||
@@ -19,5 +24,10 @@ import type { Highlighter } from 'shiki'; | ||
import { ListDOMSerializer } from 'prosemirror-flat-list'; | ||
import { MarkBuilder } from '@prosekit/core'; | ||
import { MarkType } from '@prosekit/pm/model'; | ||
import { MarkType as MarkType_2 } from 'prosemirror-model'; | ||
import { Node as Node_2 } from 'prosemirror-model'; | ||
import { NodeBuilder } from '@prosekit/core'; | ||
import { NodeRange } from 'prosemirror-model'; | ||
import { NodeType } from '@prosekit/pm/model'; | ||
import { NodeType as NodeType_2 } from 'prosemirror-model'; | ||
import { Options } from 'tsup'; | ||
@@ -29,2 +39,3 @@ import { Parser } from 'prosemirror-highlight'; | ||
import type { SpecialLanguage } from 'shiki'; | ||
import { TestEditor } from '@prosekit/core/test'; | ||
import { ToggleCollapsedOptions } from 'prosemirror-flat-list'; | ||
@@ -131,7 +142,3 @@ import { Transaction } from '@prosekit/pm/state'; | ||
export declare const default_alias_1: { | ||
test: { | ||
environment: "jsdom"; | ||
}; | ||
}; | ||
export { default_alias_1 } | ||
@@ -148,7 +155,5 @@ export declare function defaultCanMatch({ state }: { | ||
export declare function defineBlockquote(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Commands: { | ||
[x: string]: any; | ||
}; | ||
Nodes: "blockquote"; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
@@ -160,3 +165,3 @@ | ||
*/ | ||
export declare function defineBlockquoteInputRule(): Extension<any>; | ||
export declare function defineBlockquoteInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -173,6 +178,6 @@ export declare function defineBlockquoteSpec(): Extension< { | ||
export declare function defineBold(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: "bold"; | ||
Commands: { | ||
[x: string]: any; | ||
toggleBold: []; | ||
}; | ||
@@ -189,5 +194,5 @@ }>; | ||
export declare function defineBoldInputRule(): Extension<any>; | ||
export declare function defineBoldInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineBoldKeymap(): Extension<any>; | ||
export declare function defineBoldKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -204,6 +209,6 @@ export declare function defineBoldSpec(): Extension< { | ||
export declare function defineCode(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: "code"; | ||
Commands: { | ||
[x: string]: any; | ||
toggleCode: []; | ||
}; | ||
@@ -224,6 +229,9 @@ }>; | ||
declare function defineCodeBlock(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: "codeBlock"; | ||
Marks: never; | ||
Commands: { | ||
[x: string]: any; | ||
setCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
insertCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
toggleCodeBlock: [attrs?: CodeBlockAttrs | undefined]; | ||
setCodeBlockAttrs: [attrs: CodeBlockAttrs]; | ||
}; | ||
@@ -257,3 +265,3 @@ }>; | ||
*/ | ||
declare function defineCodeBlockEnterRule(): Extension<any>; | ||
declare function defineCodeBlockEnterRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export { defineCodeBlockEnterRule } | ||
@@ -281,3 +289,3 @@ export { defineCodeBlockEnterRule as defineCodeBlockEnterRule_alias_1 } | ||
*/ | ||
declare function defineCodeBlockInputRule(): Extension<any>; | ||
declare function defineCodeBlockInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export { defineCodeBlockInputRule } | ||
@@ -289,3 +297,3 @@ export { defineCodeBlockInputRule as defineCodeBlockInputRule_alias_1 } | ||
*/ | ||
export declare function defineCodeBlockKeymap(): Extension<any>; | ||
export declare function defineCodeBlockKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -322,5 +330,5 @@ /** | ||
export declare function defineCodeInputRule(): Extension<any>; | ||
export declare function defineCodeInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineCodeKeymap(): Extension<any>; | ||
export declare function defineCodeKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -343,3 +351,3 @@ /** | ||
*/ | ||
export declare function defineDropCursor(options?: DropCursorOptions): Extension<any>; | ||
export declare function defineDropCursor(options?: DropCursorOptions): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -359,6 +367,8 @@ /** | ||
export declare function defineHeading(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: "heading"; | ||
Marks: never; | ||
Commands: { | ||
[x: string]: any; | ||
setHeading: [attrs?: HeadingAttrs | undefined]; | ||
insertHeading: [attrs?: HeadingAttrs | undefined]; | ||
toggleHeading: [attrs?: HeadingAttrs | undefined]; | ||
}; | ||
@@ -381,5 +391,5 @@ }>; | ||
*/ | ||
export declare function defineHeadingInputRule(): Extension<any>; | ||
export declare function defineHeadingInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineHeadingKeymap(): Extension<any>; | ||
export declare function defineHeadingKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -430,6 +440,6 @@ export declare function defineHeadingSpec(): Extension< { | ||
export declare function defineItalic(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: "italic"; | ||
Commands: { | ||
[x: string]: any; | ||
toggleItalic: []; | ||
}; | ||
@@ -446,5 +456,5 @@ }>; | ||
export declare function defineItalicInputRule(): Extension<any>; | ||
export declare function defineItalicInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineItalicKeymap(): Extension<any>; | ||
export declare function defineItalicKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -461,6 +471,9 @@ export declare function defineItalicSpec(): Extension< { | ||
export declare function defineLink(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: "link"; | ||
Commands: { | ||
[x: string]: any; | ||
addLink: [attrs: LinkAttrs]; | ||
removeLink: []; | ||
toggleLink: [attrs: LinkAttrs]; | ||
expandLink: []; | ||
}; | ||
@@ -483,3 +496,3 @@ }>; | ||
*/ | ||
export declare function defineLinkEnterRule(): Extension<any>; | ||
export declare function defineLinkEnterRule(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -489,3 +502,3 @@ /** | ||
*/ | ||
export declare function defineLinkInputRule(): Extension<any>; | ||
export declare function defineLinkInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -495,3 +508,3 @@ /** | ||
*/ | ||
export declare function defineLinkMarkRule(): Extension<any>; | ||
export declare function defineLinkMarkRule(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -508,6 +521,14 @@ export declare function defineLinkSpec(): Extension< { | ||
export declare function defineList(): Extension<{ | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: "list"; | ||
Marks: never; | ||
Commands: { | ||
[x: string]: any; | ||
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]; | ||
}; | ||
@@ -539,5 +560,5 @@ }>; | ||
*/ | ||
export declare function defineListKeymap(): Extension<any>; | ||
export declare function defineListKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineListPlugins(): Extension<any>; | ||
export declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -562,3 +583,3 @@ export declare function defineListSpec(): Extension<{ | ||
*/ | ||
declare function defineMarkRule(options: MarkRuleOptions): Extension<any>; | ||
declare function defineMarkRule(options: MarkRuleOptions): Extension<ExtensionTyping<any, any, any>>; | ||
export { defineMarkRule } | ||
@@ -607,3 +628,3 @@ export { defineMarkRule as defineMarkRule_alias_1 } | ||
*/ | ||
export declare function definePlaceholder(options: PlaceholderOptions): Extension<any>; | ||
export declare function definePlaceholder(options: PlaceholderOptions): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -613,3 +634,3 @@ /** | ||
*/ | ||
export declare function defineReadonly(): Extension<any>; | ||
export declare function defineReadonly(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -641,3 +662,3 @@ /** | ||
*/ | ||
export declare function defineSearchQuery(options: SearchQueryOptions): Extension<any>; | ||
export declare function defineSearchQuery(options: SearchQueryOptions): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -648,6 +669,6 @@ /** | ||
export declare function defineStrike(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: "strike"; | ||
Commands: { | ||
[x: string]: any; | ||
toggleStrike: []; | ||
}; | ||
@@ -664,5 +685,5 @@ }>; | ||
export declare function defineStrikeInputRule(): Extension<any>; | ||
export declare function defineStrikeInputRule(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineStrikeKeymap(): Extension<any>; | ||
export declare function defineStrikeKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -679,6 +700,11 @@ export declare function defineStrikeSpec(): Extension< { | ||
export declare function defineTable(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: "table" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
Marks: never; | ||
Commands: { | ||
[x: string]: any; | ||
insertTable: [{ | ||
row: number; | ||
col: number; | ||
header: boolean; | ||
}]; | ||
exitTable: []; | ||
}; | ||
@@ -726,3 +752,3 @@ }>; | ||
*/ | ||
declare function defineTablePlugins(): Extension<any>; | ||
declare function defineTablePlugins(): Extension<ExtensionTyping<any, any, any>>; | ||
export { defineTablePlugins } | ||
@@ -748,2 +774,90 @@ export { defineTablePlugins as defineTablePlugins_alias_1 } | ||
/** | ||
* @internal | ||
*/ | ||
export declare function defineTestExtension(): Extension<{ | ||
Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline"; | ||
Commands: { | ||
insertText: [{ | ||
text: string; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
insertNode: [options: { | ||
node: Node_2; | ||
pos?: number; | ||
type?: undefined; | ||
attrs?: undefined; | ||
} | { | ||
node?: undefined; | ||
pos?: number; | ||
type: string; | ||
attrs?: Attrs_2; | ||
}]; | ||
removeNode: [options: { | ||
type: string | NodeType_2; | ||
pos?: number; | ||
}]; | ||
wrap: [{ | ||
nodeType: NodeType_2; | ||
attrs?: Attrs_2 | null; | ||
}]; | ||
setBlockType: [options: { | ||
type: NodeType_2 | string; | ||
attrs?: Attrs_2 | null; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
setNodeAttrs: [options: { | ||
type: string | NodeType_2 | string[] | NodeType_2[]; | ||
attrs: Attrs_2; | ||
pos?: number; | ||
}]; | ||
selectAll: []; | ||
addMark: [options: { | ||
type: string | MarkType_2; | ||
attrs?: Attrs_2 | null; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
removeMark: [options: { | ||
type: string | MarkType_2; | ||
attrs?: Attrs_2 | null; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
toggleItalic: []; | ||
undo: []; | ||
redo: []; | ||
toggleBold: []; | ||
toggleCode: []; | ||
setHeading: [attrs?: HeadingAttrs | undefined]; | ||
insertHeading: [attrs?: HeadingAttrs | undefined]; | ||
toggleHeading: [attrs?: HeadingAttrs | undefined]; | ||
insertImage: [attrs?: ImageAttrs | undefined]; | ||
addLink: [attrs: LinkAttrs]; | ||
removeLink: []; | ||
toggleLink: [attrs: LinkAttrs]; | ||
expandLink: []; | ||
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]; | ||
toggleStrike: []; | ||
insertTable: [{ | ||
row: number; | ||
col: number; | ||
header: boolean; | ||
}]; | ||
exitTable: []; | ||
toggleUnderline: []; | ||
}; | ||
}>; | ||
/** | ||
* Adds a `textAlign` attribute to the specified nodes. This will be rendered as | ||
@@ -755,6 +869,6 @@ * a CSS `text-align` style. | ||
export declare function defineTextAlign(options: TextAlignOptions): Extension<{ | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: never; | ||
Commands: { | ||
[x: string]: any; | ||
setTextAlign: [value: string | null]; | ||
}; | ||
@@ -777,3 +891,3 @@ }>; | ||
*/ | ||
export declare function defineTextAlignKeymap(types: string[]): Extension<any>; | ||
export declare function defineTextAlignKeymap(types: string[]): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -818,6 +932,6 @@ /** | ||
export declare function defineUnderline(): Extension< { | ||
Nodes: any; | ||
Marks: any; | ||
Nodes: never; | ||
Marks: "underline"; | ||
Commands: { | ||
[x: string]: any; | ||
toggleUnderline: []; | ||
}; | ||
@@ -834,3 +948,3 @@ }>; | ||
export declare function defineUnderlineKeymap(): Extension<any>; | ||
export declare function defineUnderlineKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
@@ -1173,2 +1287,103 @@ export declare function defineUnderlineSpec(): Extension< { | ||
/** | ||
* @internal | ||
*/ | ||
export declare function setupDefaultTest(): { | ||
editor: TestEditor<Extension<{ | ||
Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline"; | ||
Commands: { | ||
insertText: [{ | ||
text: string; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
insertNode: [options: { | ||
node: Node_2; | ||
pos?: number; | ||
type?: undefined; | ||
attrs?: undefined; | ||
} | { | ||
node?: undefined; | ||
pos?: number; | ||
type: string; | ||
attrs?: Attrs_2; | ||
}]; | ||
removeNode: [options: { | ||
type: string | NodeType_2; | ||
pos?: number; | ||
}]; | ||
wrap: [{ | ||
nodeType: NodeType_2; | ||
attrs?: Attrs_2 | null; | ||
}]; | ||
setBlockType: [options: { | ||
type: NodeType_2 | string; | ||
attrs?: Attrs_2 | null; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
setNodeAttrs: [options: { | ||
type: string | NodeType_2 | string[] | NodeType_2[]; | ||
attrs: Attrs_2; | ||
pos?: number; | ||
}]; | ||
selectAll: []; | ||
addMark: [options: { | ||
type: string | MarkType_2; | ||
attrs?: Attrs_2 | null; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
removeMark: [options: { | ||
type: string | MarkType_2; | ||
attrs?: Attrs_2 | null; | ||
from?: number; | ||
to?: number; | ||
}]; | ||
toggleItalic: []; | ||
undo: []; | ||
redo: []; | ||
toggleBold: []; | ||
toggleCode: []; | ||
setHeading: [attrs?: HeadingAttrs | undefined]; | ||
insertHeading: [attrs?: HeadingAttrs | undefined]; | ||
toggleHeading: [attrs?: HeadingAttrs | undefined]; | ||
insertImage: [attrs?: ImageAttrs | undefined]; | ||
addLink: [attrs: LinkAttrs]; | ||
removeLink: []; | ||
toggleLink: [attrs: LinkAttrs]; | ||
expandLink: []; | ||
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]; | ||
toggleStrike: []; | ||
insertTable: [{ | ||
row: number; | ||
col: number; | ||
header: boolean; | ||
}]; | ||
exitTable: []; | ||
toggleUnderline: []; | ||
}; | ||
}>>; | ||
n: Record<"blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell", NodeBuilder>; | ||
m: Record<"code" | "link" | "bold" | "strike" | "italic" | "underline", MarkBuilder>; | ||
}; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function setupTest<E extends Extension>(extension: E): { | ||
editor: TestEditor<E>; | ||
n: Record<ExtractNodes<E>, NodeBuilder>; | ||
m: Record<ExtractMarks<E>, MarkBuilder>; | ||
}; | ||
export declare interface TextAlignOptions { | ||
@@ -1175,0 +1390,0 @@ /** |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.0.0-next-20240622120010", | ||
"version": "0.0.0-next-20240626133927", | ||
"private": false, | ||
@@ -179,9 +179,10 @@ "author": { | ||
"shiki": "^1.9.0", | ||
"@prosekit/core": "^0.0.0-next-20240622120010", | ||
"@prosekit/pm": "^0.0.0-next-20240622120010" | ||
"@prosekit/pm": "^0.0.0-next-20240626133927", | ||
"@prosekit/core": "^0.0.0-next-20240626133927" | ||
}, | ||
"devDependencies": { | ||
"@vitest/browser": "^2.0.0-beta.12", | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.5.2", | ||
"vitest": "^1.6.0", | ||
"vitest": "^2.0.0-beta.12", | ||
"@prosekit/dev": "0.0.0" | ||
@@ -188,0 +189,0 @@ }, |
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
114618
3265
5