Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prosekit/extensions

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prosekit/extensions - npm Package Compare versions

Comparing version 0.0.0-next-20240715071354 to 0.0.0-next-20240724155246

dist/gap-cursor/style.css

1031

dist/_tsup-dts-rollup.d.ts
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,5 @@ 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 { GapCursor } from 'prosemirror-gapcursor';
import { getSingletonHighlighter } from 'shiki/bundle/full';

@@ -23,7 +25,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 +44,3 @@ import { NodeType } from '@prosekit/pm/model';

import { SetNodeAttrsOptions } from '@prosekit/core';
import { SimplifyDeeper } from '@prosekit/core';
import type { SpecialLanguage } from 'shiki';

@@ -45,3 +50,5 @@ import { StepJSON } from '@prosekit/core';

import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
import { ToMarkAction } from '@prosekit/core';
import { Transaction } from '@prosekit/pm/state';
import { UnionExtension } from '@prosekit/core';
import { UnsetBlockTypeOptions } from '@prosekit/core';

@@ -55,2 +62,7 @@ import { UnsetMarkOptions } 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 {

@@ -202,7 +214,9 @@ readonly regex: RegExp;

*/
export declare function defineBlockquote(): Extension< {
Nodes: "blockquote";
export declare function defineBlockquote(): UnionExtension<readonly [Extension< {
Nodes: {
blockquote: Attrs;
};
Marks: never;
Commands: never;
}>;
}>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -216,3 +230,5 @@ /**

export declare function defineBlockquoteSpec(): Extension< {
Nodes: "blockquote";
Nodes: {
blockquote: Attrs;
};
Marks: never;

@@ -225,9 +241,15 @@ Commands: never;

*/
export declare function defineBold(): Extension< {
export declare function defineBold(): UnionExtension<readonly [Extension< {
Marks: {
bold: Attrs;
};
Nodes: never;
Marks: "bold";
Commands: never;
}>, Extension< {
Commands: {
toggleBold: [];
};
}>;
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -247,3 +269,5 @@ export declare function defineBoldCommands(): Extension< {

export declare function defineBoldSpec(): Extension< {
Marks: "bold";
Marks: {
bold: Attrs;
};
Nodes: never;

@@ -256,9 +280,15 @@ Commands: never;

*/
export declare function defineCode(): Extension< {
export declare function defineCode(): UnionExtension<readonly [Extension< {
Marks: {
code: Attrs;
};
Nodes: never;
Marks: "code";
Commands: never;
}>, Extension< {
Commands: {
toggleCode: [];
};
}>;
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -276,5 +306,11 @@ /**

*/
declare function defineCodeBlock(): Extension< {
Nodes: "codeBlock";
declare function defineCodeBlock(): UnionExtension<readonly [Extension< {
Nodes: {
codeBlock: {
language: string;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
Commands: {

@@ -286,3 +322,5 @@ setCodeBlock: [attrs?: CodeBlockAttrs | undefined];

};
}>;
Nodes: never;
Marks: never;
}>]>;
export { defineCodeBlock }

@@ -361,3 +399,7 @@ export { defineCodeBlock as defineCodeBlock_alias_1 }

declare function defineCodeBlockSpec(): Extension< {
Nodes: "codeBlock";
Nodes: {
codeBlock: {
language: string;
};
};
Marks: never;

@@ -385,3 +427,5 @@ Commands: never;

export declare function defineCodeSpec(): Extension< {
Marks: "code";
Marks: {
code: Attrs;
};
Nodes: never;

@@ -399,7 +443,3 @@ Commands: never;

*/
export declare function defineCommitViewer(commit: Commit): Extension< {
Nodes: never;
Marks: never;
Commands: never;
}>;
export declare function defineCommitViewer(commit: Commit): UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -425,7 +465,29 @@ /**

/**
* Capture clicks near and arrow-key-motion past places that don't have a
* normally selectable position nearby, and create a gap cursor selection for
* them. The cursor is drawn as an element with class `ProseMirror-gapcursor`.
*
* You can either include `prosekit/extensions/gap-cursor.css` or add your own
* styles to make it visible.
*
* See
* [prosemirror-gapcursor](https://github.com/ProseMirror/prosemirror-gapcursor)
* for more information.
*
* @public
*/
export declare function defineHeading(): Extension< {
Nodes: "heading";
export declare function defineGapCursor(): Extension<ExtensionTyping<any, any, any>>;
/**
* @public
*/
export declare function defineHeading(): UnionExtension<readonly [Extension< {
Nodes: {
heading: {
level: number;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
Commands: {

@@ -436,3 +498,5 @@ setHeading: [attrs?: HeadingAttrs | undefined];

};
}>;
Nodes: never;
Marks: never;
}>]>;

@@ -464,3 +528,7 @@ declare function defineHeadingCommands(): Extension< {

declare function defineHeadingSpec(): Extension< {
Nodes: "heading";
Nodes: {
heading: {
level: number;
};
};
Marks: never;

@@ -475,9 +543,17 @@ Commands: never;

*/
export declare function defineImage(): Extension< {
Nodes: "image";
export declare function defineImage(): UnionExtension<readonly [Extension< {
Nodes: {
image: {
src: null;
};
};
Marks: never;
Commands: never;
}>, Extension< {
Commands: {
insertImage: [attrs?: ImageAttrs | undefined];
};
}>;
Nodes: never;
Marks: never;
}>]>;

@@ -493,3 +569,7 @@ export declare function defineImageCommands(): Extension< {

export declare function defineImageSpec(): Extension< {
Nodes: "image";
Nodes: {
image: {
src: null;
};
};
Marks: never;

@@ -511,9 +591,15 @@ Commands: never;

*/
export declare function defineItalic(): Extension< {
export declare function defineItalic(): UnionExtension<readonly [Extension< {
Marks: {
italic: Attrs;
};
Nodes: never;
Marks: "italic";
Commands: never;
}>, Extension< {
Commands: {
toggleItalic: [];
};
}>;
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -533,3 +619,5 @@ export declare function defineItalicCommands(): Extension< {

export declare function defineItalicSpec(): Extension< {
Marks: "italic";
Marks: {
italic: Attrs;
};
Nodes: never;

@@ -542,5 +630,9 @@ Commands: never;

*/
export declare function defineLink(): Extension< {
export declare function defineLink(): UnionExtension<readonly [Extension< {
Marks: {
link: LinkAttrs;
};
Nodes: never;
Marks: "link";
Commands: never;
}>, Extension< {
Commands: {

@@ -552,3 +644,5 @@ addLink: [attrs: LinkAttrs];

};
}>;
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -582,3 +676,5 @@ export declare function defineLinkCommands(): Extension< {

export declare function defineLinkSpec(): Extension< {
Marks: "link";
Marks: {
link: LinkAttrs;
};
Nodes: never;

@@ -591,20 +687,28 @@ 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(): UnionExtension<readonly [Extension< {
Nodes: {
list: ListAttrs;
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension< {
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];
};
Nodes: never;
Marks: never;
}>]>;
/**
* Defines list commands
* Defines list commands.
*
* @internal
*/

@@ -629,3 +733,8 @@ declare function defineListCommands(): Extension< {

export declare function defineListInputRules(): Extension;
/**
* @internal
*/
declare function defineListInputRules(): Extension;
export { defineListInputRules }
export { defineListInputRules as defineListInputRules_alias_1 }

@@ -635,3 +744,3 @@ /**

*
* @public
* @internal
*/

@@ -642,9 +751,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 }

@@ -670,9 +791,15 @@ /**

*/
export declare function defineMention(): Extension< {
Nodes: "mention";
export declare function defineMention(): UnionExtension<readonly [Extension< {
Nodes: {
mention: MentionAttrs;
};
Marks: never;
Commands: never;
}>, Extension< {
Commands: {
insertMention: [attrs: MentionAttrs];
};
}>;
Nodes: never;
Marks: never;
}>]>;

@@ -691,3 +818,5 @@ export declare function defineMentionCommands(): Extension< {

export declare function defineMentionSpec(): Extension< {
Nodes: "mention";
Nodes: {
mention: MentionAttrs;
};
Marks: never;

@@ -746,9 +875,15 @@ Commands: never;

*/
export declare function defineStrike(): Extension< {
export declare function defineStrike(): UnionExtension<readonly [Extension< {
Marks: {
strike: Attrs;
};
Nodes: never;
Marks: "strike";
Commands: never;
}>, Extension< {
Commands: {
toggleStrike: [];
};
}>;
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -768,3 +903,5 @@ export declare function defineStrikeCommands(): Extension< {

export declare function defineStrikeSpec(): Extension< {
Marks: "strike";
Marks: {
strike: Attrs;
};
Nodes: never;

@@ -777,5 +914,31 @@ Commands: never;

*/
export declare function defineTable(): Extension< {
Nodes: "table" | "tableRow" | "tableCell" | "tableHeaderCell";
export declare function defineTable(): UnionExtension<readonly [Extension< {
Nodes: {
table: Attrs;
};
Marks: never;
Commands: never;
}>, Extension< {
Nodes: {
tableRow: Attrs;
};
Marks: never;
Commands: never;
}>, Extension< {
Nodes: {
tableCell: {
[x: string]: any;
};
};
Marks: never;
Commands: never;
}>, Extension< {
Nodes: {
tableHeaderCell: {
[x: string]: any;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension< {
Commands: {

@@ -789,6 +952,12 @@ insertTable: [{

};
}>;
Nodes: never;
Marks: never;
}>]>;
declare function defineTableCellSpec(): Extension< {
Nodes: "tableCell";
Nodes: {
tableCell: {
[x: string]: any;
};
};
Marks: never;

@@ -821,3 +990,7 @@ Commands: never;

declare function defineTableHeaderCellSpec(): Extension< {
Nodes: "tableHeaderCell";
Nodes: {
tableHeaderCell: {
[x: string]: any;
};
};
Marks: never;

@@ -837,3 +1010,5 @@ Commands: never;

declare function defineTableRowSpec(): Extension< {
Nodes: "tableRow";
Nodes: {
tableRow: Attrs_2;
};
Marks: never;

@@ -846,3 +1021,5 @@ Commands: never;

declare function defineTableSpec(): Extension< {
Nodes: "table";
Nodes: {
table: Attrs_2;
};
Marks: never;

@@ -857,53 +1034,218 @@ 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";
Commands: {
insertText: [{
text: string;
from?: number;
to?: number;
}];
insertNode: [options: InsertNodeOptions];
removeNode: [options: RemoveNodeOptions];
wrap: [WrapOptions];
setBlockType: [options: SetBlockTypeOptions];
setNodeAttrs: [options: SetNodeAttrsOptions];
selectAll: [];
addMark: [options: AddMarkOptions];
removeMark: [options: RemoveMarkOptions];
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
unsetMark: [options?: UnsetMarkOptions | undefined];
readonly undo: [];
readonly redo: [];
toggleBold: [];
toggleCode: [];
setHeading: [attrs?: HeadingAttrs | undefined];
insertHeading: [attrs?: HeadingAttrs | undefined];
toggleHeading: [attrs?: HeadingAttrs | undefined];
insertImage: [attrs?: ImageAttrs | undefined];
toggleItalic: [];
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: WrapInListGetAttrs<ListAttributes>];
insertList: [attrs?: ListAttributes | undefined];
toggleStrike: [];
insertTable: [{
row: number;
col: number;
header: boolean;
}];
exitTable: [];
toggleUnderline: [];
};
}>;
export declare function defineTestExtension(): UnionExtension<readonly [Extension<{
Nodes: {
doc: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
text: Attrs;
};
Marks: never;
Commands: never;
}>, UnionExtension<readonly [Extension<{
Nodes: {
heading: {
level: number;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
setHeading: [attrs?: HeadingAttrs | undefined];
insertHeading: [attrs?: HeadingAttrs | undefined];
toggleHeading: [attrs?: HeadingAttrs | undefined];
};
Nodes: never;
Marks: never;
}>]>, UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
readonly undo: [];
readonly redo: [];
};
Nodes: never;
Marks: never;
}>]>, UnionExtension<readonly [Extension<{
Nodes: {
list: ListAttrs;
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
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];
};
Nodes: never;
Marks: never;
}>]>, UnionExtension<readonly [Extension<{
Nodes: {
blockquote: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>]>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
insertText: [{
text: string;
from?: number;
to?: number;
}];
insertNode: [options: InsertNodeOptions];
removeNode: [options: RemoveNodeOptions];
wrap: [WrapOptions];
setBlockType: [options: SetBlockTypeOptions];
setNodeAttrs: [options: SetNodeAttrsOptions];
selectAll: [];
addMark: [options: AddMarkOptions];
removeMark: [options: RemoveMarkOptions];
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
unsetMark: [options?: UnsetMarkOptions | undefined];
};
Nodes: never;
Marks: never;
}>, UnionExtension<readonly [Extension<{
Marks: {
italic: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleItalic: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
bold: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleBold: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
underline: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleUnderline: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
strike: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleStrike: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
code: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleCode: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
link: LinkAttrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
addLink: [attrs: LinkAttrs];
removeLink: [];
toggleLink: [attrs: LinkAttrs];
expandLink: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Nodes: {
image: {
src: null;
};
};
Marks: never;
Commands: never;
}>, Extension<{
Commands: {
insertImage: [attrs?: ImageAttrs | undefined];
};
Nodes: never;
Marks: never;
}>]>, Extension<{
Nodes: {
paragraph: Attrs;
};
Marks: never;
Commands: never;
}>, UnionExtension<readonly [Extension<{
Nodes: {
table: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
tableRow: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
tableCell: {
[x: string]: any;
};
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
tableHeaderCell: {
[x: string]: any;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
insertTable: [{
row: number;
col: number;
header: boolean;
}];
exitTable: [];
};
Nodes: never;
Marks: never;
}>]>]>;

@@ -916,8 +1258,10 @@ /**

*/
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;
}>;

@@ -929,7 +1273,5 @@

export declare function defineTextAlignCommands(types: string[]): Extension<{
Commands: {
setTextAlign: [value: string | null];
};
Nodes: never;
Marks: never;
Commands: TextAlignCommandTyping;
}>;

@@ -973,3 +1315,3 @@

*/
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
}): Extension;

@@ -980,9 +1322,15 @@

*/
export declare function defineUnderline(): Extension< {
export declare function defineUnderline(): UnionExtension<readonly [Extension< {
Marks: {
underline: Attrs;
};
Nodes: never;
Marks: "underline";
Commands: never;
}>, Extension< {
Commands: {
toggleUnderline: [];
};
}>;
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>]>;

@@ -1000,3 +1348,5 @@ export declare function defineUnderlineCommands(): Extension< {

export declare function defineUnderlineSpec(): Extension< {
Marks: "underline";
Marks: {
underline: Attrs;
};
Nodes: never;

@@ -1040,3 +1390,3 @@ Commands: never;

*/
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
/**

@@ -1124,2 +1474,4 @@ * By default, if there's a node with the same type above the newly wrapped

export { GapCursor }
export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;

@@ -1193,3 +1545,27 @@

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 }

@@ -1217,3 +1593,3 @@ export { ListDOMSerializer }

*/
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
}

@@ -1242,3 +1618,3 @@

*/
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
}

@@ -1261,4 +1637,4 @@ export { MarkRuleOptions }

id: string;
value: string;
kind: string;
value: string;
}

@@ -1364,55 +1740,291 @@

export declare function setupTest(): {
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: InsertNodeOptions];
removeNode: [options: RemoveNodeOptions];
wrap: [WrapOptions];
setBlockType: [options: SetBlockTypeOptions];
setNodeAttrs: [options: SetNodeAttrsOptions];
selectAll: [];
addMark: [options: AddMarkOptions];
removeMark: [options: RemoveMarkOptions];
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
unsetMark: [options?: UnsetMarkOptions | undefined];
readonly undo: [];
readonly redo: [];
toggleBold: [];
toggleCode: [];
setHeading: [attrs?: HeadingAttrs | undefined];
insertHeading: [attrs?: HeadingAttrs | undefined];
toggleHeading: [attrs?: HeadingAttrs | undefined];
insertImage: [attrs?: ImageAttrs | undefined];
toggleItalic: [];
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: WrapInListGetAttrs<ListAttributes>];
insertList: [attrs?: ListAttributes | undefined];
toggleStrike: [];
insertTable: [{
row: number;
col: number;
header: boolean;
}];
exitTable: [];
toggleUnderline: [];
};
editor: TestEditor<UnionExtension<readonly [Extension<{
Nodes: {
doc: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
text: Attrs;
};
Marks: never;
Commands: never;
}>, UnionExtension<readonly [Extension<{
Nodes: {
heading: {
level: number;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
setHeading: [attrs?: HeadingAttrs | undefined];
insertHeading: [attrs?: HeadingAttrs | undefined];
toggleHeading: [attrs?: HeadingAttrs | undefined];
};
Nodes: never;
Marks: never;
}>]>, UnionExtension<readonly [Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
readonly undo: [];
readonly redo: [];
};
Nodes: never;
Marks: never;
}>]>, UnionExtension<readonly [Extension<{
Nodes: {
list: ListAttrs;
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>, Extension<{
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];
};
Nodes: never;
Marks: never;
}>]>, UnionExtension<readonly [Extension<{
Nodes: {
blockquote: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>]>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
insertText: [{
text: string;
from?: number;
to?: number;
}];
insertNode: [options: InsertNodeOptions];
removeNode: [options: RemoveNodeOptions];
wrap: [WrapOptions];
setBlockType: [options: SetBlockTypeOptions];
setNodeAttrs: [options: SetNodeAttrsOptions];
selectAll: [];
addMark: [options: AddMarkOptions];
removeMark: [options: RemoveMarkOptions];
unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
unsetMark: [options?: UnsetMarkOptions | undefined];
};
Nodes: never;
Marks: never;
}>, UnionExtension<readonly [Extension<{
Marks: {
italic: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleItalic: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
bold: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleBold: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
underline: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleUnderline: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
strike: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleStrike: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
code: Attrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
toggleCode: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Marks: {
link: LinkAttrs;
};
Nodes: never;
Commands: never;
}>, Extension<{
Commands: {
addLink: [attrs: LinkAttrs];
removeLink: [];
toggleLink: [attrs: LinkAttrs];
expandLink: [];
};
Nodes: never;
Marks: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<ExtensionTyping<any, any, any>>]>, UnionExtension<readonly [Extension<{
Nodes: {
image: {
src: null;
};
};
Marks: never;
Commands: never;
}>, Extension<{
Commands: {
insertImage: [attrs?: ImageAttrs | undefined];
};
Nodes: never;
Marks: never;
}>]>, Extension<{
Nodes: {
paragraph: Attrs;
};
Marks: never;
Commands: never;
}>, UnionExtension<readonly [Extension<{
Nodes: {
table: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
tableRow: Attrs;
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
tableCell: {
[x: string]: any;
};
};
Marks: never;
Commands: never;
}>, Extension<{
Nodes: {
tableHeaderCell: {
[x: string]: any;
};
};
Marks: never;
Commands: never;
}>, Extension<ExtensionTyping<any, any, any>>, Extension<{
Commands: {
insertTable: [{
row: number;
col: number;
header: boolean;
}];
exitTable: [];
};
Nodes: never;
Marks: never;
}>]>]>>;
m: ToMarkAction<SimplifyDeeper< {
underline: {
readonly [x: string]: any;
};
strike: {
readonly [x: string]: any;
};
link: {
href: string;
};
italic: {
readonly [x: string]: any;
};
code: {
readonly [x: string]: any;
};
bold: {
readonly [x: string]: any;
};
}>>;
n: Record<"blockquote" | "table" | "text" | "doc" | "paragraph" | "heading" | "image" | "list" | "tableRow" | "tableCell" | "tableHeaderCell", NodeBuilder>;
m: Record<"code" | "link" | "bold" | "strike" | "italic" | "underline", MarkBuilder>;
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;
}>;
tableHeaderCell: NodeAction< {
[x: string]: any;
}>;
tableCell: NodeAction< {
[x: string]: any;
}>;
tableRow: NodeAction< {
readonly [x: string]: any;
}>;
table: NodeAction< {
readonly [x: string]: any;
}>;
list: NodeAction< {
kind?: "bullet" | "ordered" | "task" | "toggle";
order?: number | null;
checked?: boolean;
collapsed?: boolean;
}>;
image: NodeAction< {
src: null;
}>;
heading: NodeAction< {
level: number;
}>;
blockquote: NodeAction< {
readonly [x: string]: any;
}>;
text: NodeAction< {
readonly [x: string]: any;
}>;
doc: NodeAction< {
readonly [x: string]: any;
}>;
};
};

@@ -1425,7 +2037,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> {
/**

@@ -1438,3 +2057,3 @@ * The names of node to add the attribute to.

*/
types: string[];
types: NodeName[];
/**

@@ -1466,3 +2085,3 @@ * The default value for the attribute.

*/
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
attrs?: Attrs_2 | null | ((match: RegExpMatchArray) => Attrs_2 | null);
/**

@@ -1469,0 +2088,0 @@ * Whether to stop further handlers from being called if this rule is triggered.

6

dist/prosekit-extensions-link.js

@@ -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.0.0-next-20240715071354",
"version": "0.0.0-next-20240724155246",
"private": false,

@@ -76,2 +76,10 @@ "author": {

},
"./gap-cursor": {
"types": "./dist/prosekit-extensions-gap-cursor.d.ts",
"import": "./dist/prosekit-extensions-gap-cursor.js",
"default": "./dist/prosekit-extensions-gap-cursor.js"
},
"./gap-cursor/style.css": {
"default": "./dist/gap-cursor/style.css"
},
"./heading": {

@@ -184,15 +192,17 @@ "types": "./dist/prosekit-extensions-heading.d.ts",

"prosemirror-dropcursor": "^1.8.1",
"prosemirror-flat-list": "^0.5.2",
"prosemirror-flat-list": "^0.5.4",
"prosemirror-gapcursor": "^1.3.2",
"prosemirror-highlight": "^0.8.0",
"prosemirror-search": "^1.0.0",
"prosemirror-tables": "^1.3.7",
"shiki": "^1.10.3",
"@prosekit/core": "^0.0.0-next-20240715071354",
"@prosekit/pm": "^0.0.0-next-20240715071354"
"prosemirror-tables": "^1.4.0",
"shiki": "^1.11.1",
"@prosekit/pm": "^0.0.0-next-20240724155246",
"@prosekit/core": "^0.0.0-next-20240724155246"
},
"devDependencies": {
"@vitest/browser": "^2.0.2",
"tsup": "^8.1.0",
"@vitest/browser": "^2.0.4",
"tsup": "^8.2.2",
"type-fest": "^4.23.0",
"typescript": "^5.5.3",
"vitest": "^2.0.2",
"vitest": "^2.0.4",
"@prosekit/dev": "0.0.0"

@@ -234,2 +244,5 @@ },

],
"gap-cursor": [
"./dist/prosekit-extensions-gap-cursor.d.ts"
],
"heading": [

@@ -236,0 +249,0 @@ "./dist/prosekit-extensions-heading.d.ts"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc