@prosekit/extensions 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.ts +17 -4
- package/dist/prosekit-extensions-code-block.js +3 -3
- package/dist/prosekit-extensions-enter-rule.d.ts +5 -0
- package/dist/prosekit-extensions-enter-rule.js +8 -0
- package/dist/prosekit-extensions-link.js +3 -3
- package/package.json +10 -2
- /package/dist/{chunk-6DQPSMHC.js → chunk-ASTUC4KT.js} +0 -0
@@ -639,14 +639,26 @@ export declare interface DropCursorOptions {
|
|
639
639
|
* @public
|
640
640
|
*/
|
641
641
|
export declare type EnterRuleHandler = (options: {
|
642
|
+
/**
|
643
|
+
* The current editor state.
|
644
|
+
*/
|
642
645
|
state: EditorState;
|
646
|
+
/**
|
647
|
+
* The start position of the matched text.
|
648
|
+
*/
|
643
649
|
from: number;
|
650
|
+
/**
|
651
|
+
* The end position of the matched text.
|
652
|
+
*/
|
644
653
|
to: number;
|
654
|
+
/**
|
655
|
+
* The matched result from the regular expression.
|
656
|
+
*/
|
645
657
|
match: RegExpExecArray;
|
646
658
|
}) => Transaction | null;
|
647
659
|
|
648
660
|
/**
|
649
|
-
* Options for {@link
|
661
|
+
* Options for {@link defineEnterRule}.
|
650
662
|
*
|
651
663
|
* @public
|
652
664
|
*/
|
@@ -656,7 +668,7 @@ export declare type EnterRuleOptions = {
|
|
656
668
|
*/
|
657
669
|
regex: RegExp;
|
658
670
|
/**
|
659
|
-
* A
|
671
|
+
* A function to be called when an enter rule is triggered.
|
660
672
|
*/
|
661
673
|
handler: EnterRuleHandler;
|
662
674
|
/**
|
@@ -757,7 +769,7 @@ export declare interface PredictionPluginState {
|
|
757
769
|
export declare function setTrMeta(tr: Transaction, meta: PredictionPluginState): Transaction;
|
758
770
|
|
759
771
|
/**
|
760
|
-
* Options for {@link
|
772
|
+
* Options for {@link defineTextBlockEnterRule}.
|
761
773
|
*
|
762
774
|
* @public
|
763
775
|
*/
|
@@ -771,7 +783,8 @@ export declare type TextBlockEnterRuleOptions = {
|
|
771
783
|
*/
|
772
784
|
type: string | NodeType;
|
773
785
|
/**
|
774
|
-
* Attributes to set on the node.
|
786
|
+
* Attributes to set on the node. If a function is provided, it will be called
|
787
|
+
* with the matched result from the regular expression.
|
775
788
|
*/
|
776
789
|
attrs?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
|
777
790
|
/**
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
defineTextBlockEnterRule
|
3
|
-
} from "./chunk-6DQPSMHC.js";
|
4
1
|
import {
|
5
2
|
defineTextBlockInputRule
|
6
3
|
} from "./chunk-DYFRBXUX.js";
|
4
|
+
import {
|
5
|
+
defineTextBlockEnterRule
|
6
|
+
} from "./chunk-ASTUC4KT.js";
|
7
7
|
|
8
8
|
// src/code-block/code-block.ts
|
9
9
|
import { union } from "@prosekit/core";
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { defineEnterRule } from './_tsup-dts-rollup';
|
2
|
+
export { defineTextBlockEnterRule } from './_tsup-dts-rollup';
|
3
|
+
export { EnterRuleHandler } from './_tsup-dts-rollup';
|
4
|
+
export { EnterRuleOptions } from './_tsup-dts-rollup';
|
5
|
+
export { TextBlockEnterRuleOptions } from './_tsup-dts-rollup';
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/extensions",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.4.
|
4
|
+
"version": "0.4.1",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -60,6 +60,11 @@
|
|
60
60
|
"import": "./dist/prosekit-extensions-drop-cursor.js",
|
61
61
|
"default": "./dist/prosekit-extensions-drop-cursor.js"
|
62
62
|
},
|
63
|
+
"./enter-rule": {
|
64
|
+
"types": "./dist/prosekit-extensions-enter-rule.d.ts",
|
65
|
+
"import": "./dist/prosekit-extensions-enter-rule.js",
|
66
|
+
"default": "./dist/prosekit-extensions-enter-rule.js"
|
67
|
+
},
|
63
68
|
"./heading": {
|
64
69
|
"types": "./dist/prosekit-extensions-heading.d.ts",
|
65
70
|
"import": "./dist/prosekit-extensions-heading.js",
|
@@ -135,7 +140,7 @@
|
|
135
140
|
],
|
136
141
|
"dependencies": {
|
137
142
|
"@prosekit/core": "^0.4.0",
|
138
|
-
"@prosekit/pm": "^0.1.
|
143
|
+
"@prosekit/pm": "^0.1.2",
|
139
144
|
"prosemirror-dropcursor": "^1.8.1",
|
140
145
|
"prosemirror-flat-list": "^0.4.6",
|
141
146
|
"prosemirror-highlight": "^0.5.0",
|
@@ -175,6 +180,9 @@
|
|
175
180
|
"drop-cursor": [
|
176
181
|
"./dist/prosekit-extensions-drop-cursor.d.ts"
|
177
182
|
],
|
183
|
+
"enter-rule": [
|
184
|
+
"./dist/prosekit-extensions-enter-rule.d.ts"
|
185
|
+
],
|
178
186
|
"heading": [
|
179
187
|
"./dist/prosekit-extensions-heading.d.ts"
|
180
188
|
],
|
File without changes
|