@prosekit/extensions
Advanced tools
Comparing version 0.0.0-next-20240626133927 to 0.0.0-next-20240707065442
@@ -28,2 +28,3 @@ import { Attrs } from '@prosekit/pm/model'; | ||
import { NodeBuilder } from '@prosekit/core'; | ||
import { NodeJSON } from '@prosekit/core'; | ||
import { NodeRange } from 'prosemirror-model'; | ||
@@ -38,2 +39,3 @@ import { NodeType } from '@prosekit/pm/model'; | ||
import type { SpecialLanguage } from 'shiki'; | ||
import { StepJSON } from '@prosekit/core'; | ||
import { TestEditor } from '@prosekit/core/test'; | ||
@@ -125,2 +127,40 @@ import { ToggleCollapsedOptions } from 'prosemirror-flat-list'; | ||
/** | ||
* A JSON representation of a commit. | ||
*/ | ||
export declare interface Commit { | ||
/** | ||
* The current doc node in the JSON format | ||
*/ | ||
doc: NodeJSON; | ||
/** | ||
* The parent node in the JSON format | ||
*/ | ||
parent: NodeJSON; | ||
/** | ||
* An array of steps in the JSON format that transform the parent node to the | ||
* current doc node. | ||
*/ | ||
steps: StepJSON[]; | ||
} | ||
export declare class CommitRecorder { | ||
private parent; | ||
private doc; | ||
private steps; | ||
/** | ||
* Return a commit object including all changes since the last commit. `null` | ||
* will be returned if there is no change. | ||
*/ | ||
commit(): Commit | null; | ||
/** | ||
* @internal | ||
*/ | ||
init(doc: ProseMirrorNode): void; | ||
/** | ||
* @internal | ||
*/ | ||
apply(tr: Transaction): void; | ||
} | ||
export declare function createAutocompletePlugin({ getRules, }: { | ||
@@ -334,2 +374,16 @@ getRules: () => AutocompleteRule[]; | ||
/** | ||
* Define an extension that can record the changes in the editor. | ||
*/ | ||
export declare function defineCommitRecorder(commitRecorder: CommitRecorder): Extension<ExtensionTyping<any, any, any>>; | ||
/** | ||
* Define an extension to display the changes from the given commit in the editor. | ||
*/ | ||
export declare function defineCommitViewer(commit: Commit): Extension< { | ||
Nodes: never; | ||
Marks: never; | ||
Commands: never; | ||
}>; | ||
/** | ||
* Show up a decoration at the drop position when something is dragged over the editor. | ||
@@ -336,0 +390,0 @@ * |
import { | ||
defineTextBlockEnterRule | ||
} from "./chunk-2JYT2MT7.js"; | ||
import { | ||
defineTextBlockInputRule | ||
} from "./chunk-PYT3MOTF.js"; | ||
import { | ||
defineTextBlockEnterRule | ||
} from "./chunk-2JYT2MT7.js"; | ||
@@ -8,0 +8,0 @@ // src/code-block/code-block.ts |
@@ -5,7 +5,7 @@ import { | ||
import { | ||
defineEnterRule | ||
} from "./chunk-2JYT2MT7.js"; | ||
import { | ||
defineInputRule | ||
} from "./chunk-PYT3MOTF.js"; | ||
import { | ||
defineEnterRule | ||
} from "./chunk-2JYT2MT7.js"; | ||
@@ -12,0 +12,0 @@ // src/link/index.ts |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.0.0-next-20240626133927", | ||
"version": "0.0.0-next-20240707065442", | ||
"private": false, | ||
@@ -58,2 +58,10 @@ "author": { | ||
}, | ||
"./commit": { | ||
"types": "./dist/prosekit-extensions-commit.d.ts", | ||
"import": "./dist/prosekit-extensions-commit.js", | ||
"default": "./dist/prosekit-extensions-commit.js" | ||
}, | ||
"./commit/style.css": { | ||
"default": "./dist/commit/style.css" | ||
}, | ||
"./drop-cursor": { | ||
@@ -174,16 +182,17 @@ "types": "./dist/prosekit-extensions-drop-cursor.d.ts", | ||
"dependencies": { | ||
"prosemirror-changeset": "^2.2.1", | ||
"prosemirror-dropcursor": "^1.8.1", | ||
"prosemirror-flat-list": "^0.5.0", | ||
"prosemirror-flat-list": "^0.5.1", | ||
"prosemirror-highlight": "^0.8.0", | ||
"prosemirror-search": "^0.1.0", | ||
"prosemirror-tables": "^1.3.7", | ||
"shiki": "^1.9.0", | ||
"@prosekit/pm": "^0.0.0-next-20240626133927", | ||
"@prosekit/core": "^0.0.0-next-20240626133927" | ||
"shiki": "^1.10.1", | ||
"@prosekit/core": "^0.0.0-next-20240707065442", | ||
"@prosekit/pm": "^0.0.0-next-20240707065442" | ||
}, | ||
"devDependencies": { | ||
"@vitest/browser": "^2.0.0-beta.12", | ||
"@vitest/browser": "^2.0.0-beta.13", | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.5.2", | ||
"vitest": "^2.0.0-beta.12", | ||
"typescript": "^5.5.3", | ||
"vitest": "^2.0.0-beta.13", | ||
"@prosekit/dev": "0.0.0" | ||
@@ -216,2 +225,5 @@ }, | ||
], | ||
"commit": [ | ||
"./dist/prosekit-extensions-commit.d.ts" | ||
], | ||
"drop-cursor": [ | ||
@@ -218,0 +230,0 @@ "./dist/prosekit-extensions-drop-cursor.d.ts" |
Sorry, the diff of this file is not supported yet
121934
66
3487
9
+ Addedprosemirror-changeset@^2.2.1
+ Addedprosemirror-changeset@2.2.1(transitive)
Updatedprosemirror-flat-list@^0.5.1
Updatedshiki@^1.10.1