@prosekit/extensions
Advanced tools
Comparing version 0.0.0-next-20240421132240 to 0.0.0-next-20240427133255
@@ -19,2 +19,3 @@ import { Attrs } from '@prosekit/pm/model'; | ||
import { ListDOMSerializer } from 'prosemirror-flat-list'; | ||
import { MarkType } from '@prosekit/pm/model'; | ||
import { NodeRange } from 'prosemirror-model'; | ||
@@ -27,2 +28,4 @@ import { NodeType } from '@prosekit/pm/model'; | ||
import { ProseMirrorNode } from '@prosekit/pm/model'; | ||
import type { ResolvedPos } from '@prosekit/pm/model'; | ||
import type { Selection as Selection_2 } from '@prosekit/pm/state'; | ||
import type { SpecialLanguage } from 'shiki'; | ||
@@ -473,2 +476,11 @@ import { ToggleCollapsedOptions } from 'prosemirror-flat-list'; | ||
/** | ||
* A mark rule is something that can automatically apply marks to text if it matches a certain pattern, and remove them if it doesn't match anymore. | ||
* | ||
* For every transaction that changes the document, the mark rule will be applied to the changed text. | ||
* | ||
* | ||
*/ | ||
export declare function defineMarkRule(options: MarkRuleOptions): Extension<ExtensionTyping<string, string, CommandArgs>>; | ||
/** | ||
* @public | ||
@@ -764,2 +776,10 @@ */ | ||
/** | ||
* @internal | ||
*/ | ||
export declare function findChangedTextRanges(selection: Selection_2): Array<[from: number, to: number]>; | ||
/** @internal */ | ||
export declare function getAffectedRange(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): readonly [number, number]; | ||
export { getHighlighter } | ||
@@ -769,2 +789,4 @@ | ||
export declare function getSpanTextRanges($from: ResolvedPos, $to: ResolvedPos): [number, number][]; | ||
export declare function getTrMeta(tr: Transaction): PredictionPluginState; | ||
@@ -820,2 +842,19 @@ | ||
export declare interface MarkRuleOptions { | ||
/** | ||
* The regular expression to match against. It should have a `g` flag to match | ||
* all instances of the mark. | ||
*/ | ||
regex: RegExp; | ||
/** | ||
* The mark type to apply to the matched text. | ||
*/ | ||
type: string | MarkType; | ||
/** | ||
* Attributes to set on the mark. If a function is provided, it will be called | ||
* with the matched result from the regular expression. | ||
*/ | ||
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null); | ||
} | ||
declare type MatchHandler = (options: { | ||
@@ -822,0 +861,0 @@ state: EditorState; |
import { | ||
defineTextBlockEnterRule | ||
} from "./chunk-ASTUC4KT.js"; | ||
import { | ||
defineTextBlockInputRule | ||
} from "./chunk-DYFRBXUX.js"; | ||
import { | ||
defineTextBlockEnterRule | ||
} from "./chunk-ASTUC4KT.js"; | ||
@@ -8,0 +8,0 @@ // src/code-block/code-block.ts |
import { | ||
defineEnterRule | ||
} from "./chunk-ASTUC4KT.js"; | ||
import { | ||
defineInputRule | ||
} from "./chunk-DYFRBXUX.js"; | ||
import { | ||
defineEnterRule | ||
} from "./chunk-ASTUC4KT.js"; | ||
@@ -8,0 +8,0 @@ // src/link/index.ts |
{ | ||
"name": "@prosekit/extensions", | ||
"type": "module", | ||
"version": "0.0.0-next-20240421132240", | ||
"version": "0.0.0-next-20240427133255", | ||
"private": false, | ||
@@ -33,2 +33,7 @@ "author": { | ||
}, | ||
"./mark-rule": { | ||
"types": "./dist/prosekit-extensions-mark-rule.d.ts", | ||
"import": "./dist/prosekit-extensions-mark-rule.js", | ||
"default": "./dist/prosekit-extensions-mark-rule.js" | ||
}, | ||
"./autocomplete": { | ||
@@ -151,4 +156,4 @@ "types": "./dist/prosekit-extensions-autocomplete.d.ts", | ||
"dependencies": { | ||
"@prosekit/core": "0.0.0-next-20240421132240", | ||
"@prosekit/pm": "0.0.0-next-20240421132240", | ||
"@prosekit/core": "0.0.0-next-20240427133255", | ||
"@prosekit/pm": "0.0.0-next-20240427133255", | ||
"prosemirror-dropcursor": "^1.8.1", | ||
@@ -164,3 +169,3 @@ "prosemirror-flat-list": "^0.5.0", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.5.0" | ||
"vitest": "^1.5.2" | ||
}, | ||
@@ -177,2 +182,5 @@ "scripts": { | ||
], | ||
"mark-rule": [ | ||
"./dist/prosekit-extensions-mark-rule.d.ts" | ||
], | ||
"autocomplete": [ | ||
@@ -179,0 +187,0 @@ "./dist/prosekit-extensions-autocomplete.d.ts" |
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
94651
55
2774
+ Added@prosekit/core@0.0.0-next-20240427133255(transitive)
+ Added@prosekit/pm@0.0.0-next-20240427133255(transitive)
- Removed@prosekit/core@0.0.0-next-20240421132240(transitive)
- Removed@prosekit/pm@0.0.0-next-20240421132240(transitive)