@prosekit/extensions
Advanced tools
Comparing version 0.7.3 to 0.7.4
import { AddMarkOptions } from '@prosekit/core'; | ||
import { Attrs } from '@prosekit/pm/model'; | ||
import { Attrs } from 'prosemirror-model'; | ||
import { Attrs as Attrs_2 } from '@prosekit/pm/model'; | ||
import { BundledLanguage } from 'shiki'; | ||
@@ -15,4 +16,4 @@ import { BundledLanguageInfo } from 'shiki'; | ||
import { ExtensionTyping } from '@prosekit/core'; | ||
import { ExtractMarks } from '@prosekit/core'; | ||
import { ExtractNodes } from '@prosekit/core'; | ||
import { ExtractMarkActions } from '@prosekit/core'; | ||
import { ExtractNodeActions } from '@prosekit/core'; | ||
import { getSingletonHighlighter } from 'shiki/bundle/full'; | ||
@@ -23,7 +24,9 @@ import type { Highlighter } from 'shiki'; | ||
import { InsertNodeOptions } from '@prosekit/core'; | ||
import type { IsEqual } from 'type-fest'; | ||
import { ListAttributes } from 'prosemirror-flat-list'; | ||
import { ListDOMSerializer } from 'prosemirror-flat-list'; | ||
import { MarkBuilder } from '@prosekit/core'; | ||
import { MarkType } from '@prosekit/pm/model'; | ||
import { NodeBuilder } from '@prosekit/core'; | ||
import { Node as Node_2 } from 'prosemirror-model'; | ||
import { NodeAction } from '@prosekit/core'; | ||
import { NodeChild } from '@prosekit/core'; | ||
import { NodeJSON } from '@prosekit/core'; | ||
@@ -40,2 +43,3 @@ import { NodeType } from '@prosekit/pm/model'; | ||
import { SetNodeAttrsOptions } from '@prosekit/core'; | ||
import { SimplifyDeeper } from '@prosekit/core'; | ||
import type { SpecialLanguage } from 'shiki'; | ||
@@ -45,2 +49,3 @@ import { StepJSON } from '@prosekit/core'; | ||
import { ToggleCollapsedOptions } from 'prosemirror-flat-list'; | ||
import { ToMarkAction } from '@prosekit/core'; | ||
import { Transaction } from '@prosekit/pm/state'; | ||
@@ -55,2 +60,7 @@ import { UnsetBlockTypeOptions } from '@prosekit/core'; | ||
/** | ||
* Utility function assert that two types are equal in tests. | ||
*/ | ||
export declare function assertTypeEqual<T, U>(_val: IsEqual<T, U>): void; | ||
declare class AutocompleteRule { | ||
@@ -203,3 +213,5 @@ readonly regex: RegExp; | ||
export declare function defineBlockquote(): Extension< { | ||
Nodes: "blockquote"; | ||
Nodes: SimplifyDeeper< { | ||
blockquote: Attrs; | ||
}>; | ||
Marks: never; | ||
@@ -216,3 +228,5 @@ Commands: never; | ||
export declare function defineBlockquoteSpec(): Extension< { | ||
Nodes: "blockquote"; | ||
Nodes: { | ||
blockquote: Attrs; | ||
}; | ||
Marks: never; | ||
@@ -227,3 +241,5 @@ Commands: never; | ||
Nodes: never; | ||
Marks: "bold"; | ||
Marks: SimplifyDeeper< { | ||
bold: Attrs; | ||
}>; | ||
Commands: { | ||
@@ -247,3 +263,5 @@ toggleBold: []; | ||
export declare function defineBoldSpec(): Extension< { | ||
Marks: "bold"; | ||
Marks: { | ||
bold: Attrs; | ||
}; | ||
Nodes: never; | ||
@@ -258,3 +276,5 @@ Commands: never; | ||
Nodes: never; | ||
Marks: "code"; | ||
Marks: SimplifyDeeper< { | ||
code: Attrs; | ||
}>; | ||
Commands: { | ||
@@ -277,3 +297,7 @@ toggleCode: []; | ||
declare function defineCodeBlock(): Extension< { | ||
Nodes: "codeBlock"; | ||
Nodes: SimplifyDeeper< { | ||
codeBlock: { | ||
language: string; | ||
}; | ||
}>; | ||
Marks: never; | ||
@@ -360,3 +384,7 @@ Commands: { | ||
declare function defineCodeBlockSpec(): Extension< { | ||
Nodes: "codeBlock"; | ||
Nodes: { | ||
codeBlock: { | ||
language: string; | ||
}; | ||
}; | ||
Marks: never; | ||
@@ -384,3 +412,5 @@ Commands: never; | ||
export declare function defineCodeSpec(): Extension< { | ||
Marks: "code"; | ||
Marks: { | ||
code: Attrs; | ||
}; | ||
Nodes: never; | ||
@@ -426,3 +456,7 @@ Commands: never; | ||
export declare function defineHeading(): Extension< { | ||
Nodes: "heading"; | ||
Nodes: SimplifyDeeper< { | ||
heading: { | ||
level: number; | ||
}; | ||
}>; | ||
Marks: never; | ||
@@ -461,3 +495,7 @@ Commands: { | ||
declare function defineHeadingSpec(): Extension< { | ||
Nodes: "heading"; | ||
Nodes: { | ||
heading: { | ||
level: number; | ||
}; | ||
}; | ||
Marks: never; | ||
@@ -473,3 +511,7 @@ Commands: never; | ||
export declare function defineImage(): Extension< { | ||
Nodes: "image"; | ||
Nodes: SimplifyDeeper< { | ||
image: { | ||
src: null; | ||
}; | ||
}>; | ||
Marks: never; | ||
@@ -490,3 +532,7 @@ Commands: { | ||
export declare function defineImageSpec(): Extension< { | ||
Nodes: "image"; | ||
Nodes: { | ||
image: { | ||
src: null; | ||
}; | ||
}; | ||
Marks: never; | ||
@@ -510,3 +556,5 @@ Commands: never; | ||
Nodes: never; | ||
Marks: "italic"; | ||
Marks: SimplifyDeeper< { | ||
italic: Attrs; | ||
}>; | ||
Commands: { | ||
@@ -530,3 +578,5 @@ toggleItalic: []; | ||
export declare function defineItalicSpec(): Extension< { | ||
Marks: "italic"; | ||
Marks: { | ||
italic: Attrs; | ||
}; | ||
Nodes: never; | ||
@@ -541,3 +591,5 @@ Commands: never; | ||
Nodes: never; | ||
Marks: "link"; | ||
Marks: SimplifyDeeper< { | ||
link: LinkAttrs; | ||
}>; | ||
Commands: { | ||
@@ -578,3 +630,5 @@ addLink: [attrs: LinkAttrs]; | ||
export declare function defineLinkSpec(): Extension< { | ||
Marks: "link"; | ||
Marks: { | ||
link: LinkAttrs; | ||
}; | ||
Nodes: never; | ||
@@ -587,20 +641,24 @@ Commands: never; | ||
*/ | ||
export declare function defineList(): Extension<{ | ||
Nodes: "list"; | ||
Marks: never; | ||
Commands: { | ||
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: WrapInListGetAttrs<ListAttributes>]; | ||
insertList: [attrs?: ListAttributes | undefined]; | ||
}; | ||
export declare function defineList(): Extension< { | ||
Nodes: SimplifyDeeper< { | ||
list: ListAttrs; | ||
}>; | ||
Marks: never; | ||
Commands: { | ||
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: WrapInListGetAttrs<ListAttributes>]; | ||
insertList: [attrs?: ListAttributes | undefined]; | ||
}; | ||
}>; | ||
/** | ||
* Defines list commands | ||
* Defines list commands. | ||
* | ||
* @internal | ||
*/ | ||
@@ -625,3 +683,8 @@ declare function defineListCommands(): Extension< { | ||
export declare function defineListInputRules(): Extension; | ||
/** | ||
* @internal | ||
*/ | ||
declare function defineListInputRules(): Extension; | ||
export { defineListInputRules } | ||
export { defineListInputRules as defineListInputRules_alias_1 } | ||
@@ -631,3 +694,3 @@ /** | ||
* | ||
* @public | ||
* @internal | ||
*/ | ||
@@ -638,9 +701,21 @@ declare function defineListKeymap(): Extension<ExtensionTyping<any, any, any>>; | ||
export declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>; | ||
/** | ||
* @internal | ||
*/ | ||
declare function defineListPlugins(): Extension<ExtensionTyping<any, any, any>>; | ||
export { defineListPlugins } | ||
export { defineListPlugins as defineListPlugins_alias_1 } | ||
export declare function defineListSpec(): Extension<{ | ||
Nodes: "list"; | ||
Marks: never; | ||
Commands: never; | ||
/** | ||
* @internal | ||
*/ | ||
declare function defineListSpec(): Extension< { | ||
Nodes: { | ||
list: ListAttrs; | ||
}; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
export { defineListSpec } | ||
export { defineListSpec as defineListSpec_alias_1 } | ||
@@ -667,3 +742,5 @@ /** | ||
export declare function defineMention(): Extension< { | ||
Nodes: "mention"; | ||
Nodes: SimplifyDeeper< { | ||
mention: MentionAttrs; | ||
}>; | ||
Marks: never; | ||
@@ -687,3 +764,5 @@ Commands: { | ||
export declare function defineMentionSpec(): Extension< { | ||
Nodes: "mention"; | ||
Nodes: { | ||
mention: MentionAttrs; | ||
}; | ||
Marks: never; | ||
@@ -744,3 +823,5 @@ Commands: never; | ||
Nodes: never; | ||
Marks: "strike"; | ||
Marks: SimplifyDeeper< { | ||
strike: Attrs; | ||
}>; | ||
Commands: { | ||
@@ -764,3 +845,5 @@ toggleStrike: []; | ||
export declare function defineStrikeSpec(): Extension< { | ||
Marks: "strike"; | ||
Marks: { | ||
strike: Attrs; | ||
}; | ||
Nodes: never; | ||
@@ -774,3 +857,12 @@ Commands: never; | ||
export declare function defineTable(): Extension< { | ||
Nodes: "table" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
Nodes: SimplifyDeeper< { | ||
table: Attrs; | ||
tableRow: Attrs; | ||
tableCell: { | ||
[x: string]: any; | ||
}; | ||
tableHeaderCell: { | ||
[x: string]: any; | ||
}; | ||
}>; | ||
Marks: never; | ||
@@ -788,3 +880,7 @@ Commands: { | ||
declare function defineTableCellSpec(): Extension< { | ||
Nodes: "tableCell"; | ||
Nodes: { | ||
tableCell: { | ||
[x: string]: any; | ||
}; | ||
}; | ||
Marks: never; | ||
@@ -817,3 +913,7 @@ Commands: never; | ||
declare function defineTableHeaderCellSpec(): Extension< { | ||
Nodes: "tableHeaderCell"; | ||
Nodes: { | ||
tableHeaderCell: { | ||
[x: string]: any; | ||
}; | ||
}; | ||
Marks: never; | ||
@@ -833,3 +933,5 @@ Commands: never; | ||
declare function defineTableRowSpec(): Extension< { | ||
Nodes: "tableRow"; | ||
Nodes: { | ||
tableRow: Attrs_2; | ||
}; | ||
Marks: never; | ||
@@ -842,3 +944,5 @@ Commands: never; | ||
declare function defineTableSpec(): Extension< { | ||
Nodes: "table"; | ||
Nodes: { | ||
table: Attrs_2; | ||
}; | ||
Marks: never; | ||
@@ -854,4 +958,54 @@ Commands: never; | ||
export declare function defineTestExtension(): Extension<{ | ||
Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline"; | ||
Nodes: SimplifyDeeper< { | ||
paragraph: Attrs; | ||
doc: Attrs; | ||
text: Attrs; | ||
blockquote: { | ||
readonly [x: string]: any; | ||
}; | ||
heading: { | ||
level: number; | ||
}; | ||
image: { | ||
src: null; | ||
}; | ||
list: { | ||
kind?: "bullet" | "ordered" | "task" | "toggle"; | ||
order?: number | null; | ||
checked?: boolean; | ||
collapsed?: boolean; | ||
}; | ||
table: { | ||
readonly [x: string]: any; | ||
}; | ||
tableRow: { | ||
readonly [x: string]: any; | ||
}; | ||
tableCell: { | ||
[x: string]: any; | ||
}; | ||
tableHeaderCell: { | ||
[x: string]: any; | ||
}; | ||
}>; | ||
Marks: SimplifyDeeper< { | ||
bold: { | ||
readonly [x: string]: any; | ||
}; | ||
code: { | ||
readonly [x: string]: any; | ||
}; | ||
italic: { | ||
readonly [x: string]: any; | ||
}; | ||
link: { | ||
href: string; | ||
}; | ||
strike: { | ||
readonly [x: string]: any; | ||
}; | ||
underline: { | ||
readonly [x: string]: any; | ||
}; | ||
}>; | ||
Commands: { | ||
@@ -912,8 +1066,10 @@ insertText: [{ | ||
*/ | ||
export declare function defineTextAlign(options: TextAlignOptions): Extension<{ | ||
Nodes: never; | ||
export declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): Extension<{ | ||
Nodes: { | ||
[K in NodeName]: { | ||
textAlign: string | null; | ||
}; | ||
}; | ||
Marks: never; | ||
Commands: { | ||
setTextAlign: [value: string | null]; | ||
}; | ||
Commands: TextAlignCommandTyping; | ||
}>; | ||
@@ -925,7 +1081,5 @@ | ||
export declare function defineTextAlignCommands(types: string[]): Extension<{ | ||
Commands: { | ||
setTextAlign: [value: string | null]; | ||
}; | ||
Nodes: never; | ||
Marks: never; | ||
Commands: TextAlignCommandTyping; | ||
}>; | ||
@@ -969,3 +1123,3 @@ | ||
*/ | ||
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null); | ||
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null); | ||
}): Extension; | ||
@@ -978,3 +1132,5 @@ | ||
Nodes: never; | ||
Marks: "underline"; | ||
Marks: SimplifyDeeper< { | ||
underline: Attrs; | ||
}>; | ||
Commands: { | ||
@@ -996,3 +1152,5 @@ toggleUnderline: []; | ||
export declare function defineUnderlineSpec(): Extension< { | ||
Marks: "underline"; | ||
Marks: { | ||
underline: Attrs; | ||
}; | ||
Nodes: never; | ||
@@ -1036,3 +1194,3 @@ Commands: never; | ||
*/ | ||
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null); | ||
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null); | ||
/** | ||
@@ -1188,3 +1346,27 @@ * By default, if there's a node with the same type above the newly wrapped | ||
export { ListAttributes } | ||
/** | ||
* The attributes of a list node. | ||
* | ||
* @public | ||
*/ | ||
declare interface ListAttrs { | ||
/** | ||
* The kind of list node. | ||
*/ | ||
kind?: 'bullet' | 'ordered' | 'task' | 'toggle'; | ||
/** | ||
* The optional order of the list node. | ||
*/ | ||
order?: number | null; | ||
/** | ||
* Whether the list node is checked if its `kind` is `"task"`. | ||
*/ | ||
checked?: boolean; | ||
/** | ||
* Whether the list node is collapsed if its `kind` is `"toggle"`. | ||
*/ | ||
collapsed?: boolean; | ||
} | ||
export { ListAttrs } | ||
export { ListAttrs as ListAttrs_alias_1 } | ||
@@ -1212,3 +1394,3 @@ export { ListDOMSerializer } | ||
*/ | ||
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null); | ||
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null); | ||
} | ||
@@ -1237,3 +1419,3 @@ | ||
*/ | ||
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null); | ||
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null); | ||
} | ||
@@ -1256,4 +1438,4 @@ export { MarkRuleOptions } | ||
id: string; | ||
value: string; | ||
kind: string; | ||
value: string; | ||
} | ||
@@ -1360,4 +1542,54 @@ | ||
editor: TestEditor<Extension<{ | ||
Nodes: "blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell"; | ||
Marks: "code" | "link" | "bold" | "strike" | "italic" | "underline"; | ||
Nodes: SimplifyDeeper< { | ||
paragraph: Attrs; | ||
doc: Attrs; | ||
text: Attrs; | ||
blockquote: { | ||
readonly [x: string]: any; | ||
}; | ||
heading: { | ||
level: number; | ||
}; | ||
image: { | ||
src: null; | ||
}; | ||
list: { | ||
kind?: "bullet" | "ordered" | "task" | "toggle"; | ||
order?: number | null; | ||
checked?: boolean; | ||
collapsed?: boolean; | ||
}; | ||
table: { | ||
readonly [x: string]: any; | ||
}; | ||
tableRow: { | ||
readonly [x: string]: any; | ||
}; | ||
tableCell: { | ||
[x: string]: any; | ||
}; | ||
tableHeaderCell: { | ||
[x: string]: any; | ||
}; | ||
}>; | ||
Marks: SimplifyDeeper< { | ||
bold: { | ||
readonly [x: string]: any; | ||
}; | ||
code: { | ||
readonly [x: string]: any; | ||
}; | ||
italic: { | ||
readonly [x: string]: any; | ||
}; | ||
link: { | ||
href: string; | ||
}; | ||
strike: { | ||
readonly [x: string]: any; | ||
}; | ||
underline: { | ||
readonly [x: string]: any; | ||
}; | ||
}>; | ||
Commands: { | ||
@@ -1411,4 +1643,75 @@ insertText: [{ | ||
}>>; | ||
n: Record<"blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell", NodeBuilder>; | ||
m: Record<"code" | "link" | "bold" | "strike" | "italic" | "underline", MarkBuilder>; | ||
m: ToMarkAction<SimplifyDeeper< { | ||
bold: { | ||
readonly [x: string]: any; | ||
}; | ||
code: { | ||
readonly [x: string]: any; | ||
}; | ||
italic: { | ||
readonly [x: string]: any; | ||
}; | ||
link: { | ||
href: string; | ||
}; | ||
strike: { | ||
readonly [x: string]: any; | ||
}; | ||
underline: { | ||
readonly [x: string]: any; | ||
}; | ||
}>>; | ||
n: { | ||
p: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
h1: (...children: NodeChild[]) => Node_2; | ||
h2: (...children: NodeChild[]) => Node_2; | ||
h3: (...children: NodeChild[]) => Node_2; | ||
h4: (...children: NodeChild[]) => Node_2; | ||
h5: (...children: NodeChild[]) => Node_2; | ||
h6: (...children: NodeChild[]) => Node_2; | ||
bullet: (...children: NodeChild[]) => Node_2; | ||
ordered: (...children: NodeChild[]) => Node_2; | ||
checked: (...children: NodeChild[]) => Node_2; | ||
unchecked: (...children: NodeChild[]) => Node_2; | ||
collapsed: (...children: NodeChild[]) => Node_2; | ||
expanded: (...children: NodeChild[]) => Node_2; | ||
paragraph: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
doc: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
text: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
blockquote: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
heading: NodeAction< { | ||
level: number; | ||
}>; | ||
image: NodeAction< { | ||
src: null; | ||
}>; | ||
list: NodeAction< { | ||
kind?: "bullet" | "ordered" | "task" | "toggle"; | ||
order?: number | null; | ||
checked?: boolean; | ||
collapsed?: boolean; | ||
}>; | ||
table: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
tableRow: NodeAction< { | ||
readonly [x: string]: any; | ||
}>; | ||
tableCell: NodeAction< { | ||
[x: string]: any; | ||
}>; | ||
tableHeaderCell: NodeAction< { | ||
[x: string]: any; | ||
}>; | ||
}; | ||
}; | ||
@@ -1421,7 +1724,14 @@ | ||
editor: TestEditor<E>; | ||
n: Record<ExtractNodes<E>, NodeBuilder>; | ||
m: Record<ExtractMarks<E>, MarkBuilder>; | ||
n: ExtractNodeActions<E>; | ||
m: ExtractMarkActions<E>; | ||
}; | ||
export declare interface TextAlignOptions { | ||
/** | ||
* @internal | ||
*/ | ||
export declare type TextAlignCommandTyping = { | ||
setTextAlign: [value: string | null]; | ||
}; | ||
export declare interface TextAlignOptions<NodeName extends string = string> { | ||
/** | ||
@@ -1434,3 +1744,3 @@ * The names of node to add the attribute to. | ||
*/ | ||
types: string[]; | ||
types: NodeName[]; | ||
/** | ||
@@ -1462,3 +1772,3 @@ * The default value for the attribute. | ||
*/ | ||
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null); | ||
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null); | ||
/** | ||
@@ -1465,0 +1775,0 @@ * Whether to stop further handlers from being called if this rule is triggered. |
@@ -44,2 +44,5 @@ import { | ||
inclusive: false, | ||
attrs: { | ||
href: {} | ||
}, | ||
parseDOM: [ | ||
@@ -55,5 +58,2 @@ { | ||
], | ||
attrs: { | ||
href: {} | ||
}, | ||
toDOM(node) { | ||
@@ -60,0 +60,0 @@ const { href } = node.attrs; |
@@ -1,4 +0,1 @@ | ||
export { defineListSpec } from './_tsup-dts-rollup'; | ||
export { defineListPlugins } from './_tsup-dts-rollup'; | ||
export { defineListInputRules } from './_tsup-dts-rollup'; | ||
export { defineList } from './_tsup-dts-rollup'; | ||
@@ -8,3 +5,2 @@ export { ListDOMSerializer } from './_tsup-dts-rollup'; | ||
export { IndentListOptions } from './_tsup-dts-rollup'; | ||
export { ListAttributes } from './_tsup-dts-rollup'; | ||
export { ToggleCollapsedOptions } from './_tsup-dts-rollup'; | ||
@@ -14,2 +10,6 @@ export { UnwrapListOptions } from './_tsup-dts-rollup'; | ||
export { defineListCommands_alias_1 as defineListCommands } from './_tsup-dts-rollup'; | ||
export { defineListInputRules } from './_tsup-dts-rollup'; | ||
export { defineListKeymap } from './_tsup-dts-rollup'; | ||
export { defineListPlugins } from './_tsup-dts-rollup'; | ||
export { defineListSpec } from './_tsup-dts-rollup'; | ||
export { ListAttrs } from './_tsup-dts-rollup'; |
@@ -6,12 +6,3 @@ import { | ||
// src/list/index.ts | ||
import { | ||
defineNodeSpec, | ||
definePlugin, | ||
union | ||
} from "@prosekit/core"; | ||
import { | ||
createListPlugins, | ||
createListSpec, | ||
listInputRules | ||
} from "prosemirror-flat-list"; | ||
import { union as union2 } from "@prosekit/core"; | ||
@@ -47,2 +38,9 @@ // src/list/commands.ts | ||
// src/list/input-rules.ts | ||
import { union } from "@prosekit/core"; | ||
import { listInputRules } from "prosemirror-flat-list"; | ||
function defineListInputRules() { | ||
return union(listInputRules.map(defineInputRule)); | ||
} | ||
// src/list/keymap.ts | ||
@@ -66,2 +64,4 @@ import { defineKeymap } from "@prosekit/core"; | ||
); | ||
var dedentListCommand = createDedentListCommand(); | ||
var indentListCommand = createIndentListCommand(); | ||
var listKeymap = { | ||
@@ -71,4 +71,6 @@ Enter: enterCommand, | ||
Delete: deleteCommand, | ||
"Mod-[": createDedentListCommand(), | ||
"Mod-]": createIndentListCommand() | ||
"Mod-]": indentListCommand, | ||
"Mod-[": dedentListCommand, | ||
Tab: indentListCommand, | ||
"Shift-Tab": dedentListCommand | ||
}; | ||
@@ -79,15 +81,23 @@ function defineListKeymap() { | ||
// src/list/index.ts | ||
import { ListDOMSerializer } from "prosemirror-flat-list"; | ||
function defineListSpec() { | ||
return defineNodeSpec({ ...createListSpec(), name: "list" }); | ||
} | ||
// src/list/plugins.ts | ||
import { definePlugin } from "@prosekit/core"; | ||
import { createListPlugins } from "prosemirror-flat-list"; | ||
function defineListPlugins() { | ||
return definePlugin(({ schema }) => createListPlugins({ schema })); | ||
} | ||
function defineListInputRules() { | ||
return union(listInputRules.map(defineInputRule)); | ||
// src/list/spec.ts | ||
import { defineNodeSpec } from "@prosekit/core"; | ||
import { createListSpec } from "prosemirror-flat-list"; | ||
function defineListSpec() { | ||
return defineNodeSpec({ | ||
...createListSpec(), | ||
name: "list" | ||
}); | ||
} | ||
// src/list/index.ts | ||
import { ListDOMSerializer } from "prosemirror-flat-list"; | ||
function defineList() { | ||
return union([ | ||
return union2([ | ||
defineListSpec(), | ||
@@ -94,0 +104,0 @@ defineListPlugins(), |
@@ -93,3 +93,2 @@ // src/table/index.ts | ||
import { defineNodeSpec } from "@prosekit/core"; | ||
import "prosemirror-tables"; | ||
var cellAttrs = { | ||
@@ -96,0 +95,0 @@ colspan: { default: 1 }, |
@@ -6,1 +6,2 @@ export { setTextAlign } from './_tsup-dts-rollup'; | ||
export { TextAlignOptions } from './_tsup-dts-rollup'; | ||
export { TextAlignCommandTyping } from './_tsup-dts-rollup'; |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"private": false, | ||
@@ -183,3 +183,3 @@ "author": { | ||
"prosemirror-dropcursor": "^1.8.1", | ||
"prosemirror-flat-list": "^0.5.2", | ||
"prosemirror-flat-list": "^0.5.3", | ||
"prosemirror-highlight": "^0.8.0", | ||
@@ -189,10 +189,11 @@ "prosemirror-search": "^1.0.0", | ||
"shiki": "^1.10.3", | ||
"@prosekit/core": "^0.7.3", | ||
"@prosekit/core": "^0.7.4", | ||
"@prosekit/pm": "^0.1.6" | ||
}, | ||
"devDependencies": { | ||
"@vitest/browser": "^2.0.2", | ||
"tsup": "^8.1.0", | ||
"@vitest/browser": "^2.0.3", | ||
"tsup": "^8.1.2", | ||
"type-fest": "^4.22.1", | ||
"typescript": "^5.5.3", | ||
"vitest": "^2.0.2", | ||
"vitest": "^2.0.3", | ||
"@prosekit/dev": "0.0.0" | ||
@@ -199,0 +200,0 @@ }, |
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
132273
4104
6
Updated@prosekit/core@^0.7.4
Updatedprosemirror-flat-list@^0.5.3