@prosekit/core 0.0.15 → 0.0.16

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.
@@ -227,13 +227,26 @@ declare function defineNodeViewEffect(options: NodeViewEffectOptions): Extension
227
227
  export { defineNodeViewEffect }
228
228
  export { defineNodeViewEffect as defineNodeViewEffect_alias_1 }
229
229
 
230
- /** @public */
230
+ /**
231
+ * @public
232
+ *
233
+ * Defines a paragraph node spec as the highest priority, because it should be the default block node for most cases.
234
+ */
231
235
  declare function defineParagraph(): Extension< {
232
236
  NODES: "paragraph";
233
237
  }>;
234
238
  export { defineParagraph }
235
239
  export { defineParagraph as defineParagraph_alias_1 }
236
240
 
241
+ /**
242
+ * @public
243
+ *
244
+ * Defines a paragraph node spec.
245
+ */
246
+ export declare function defineParagraphSpec(): Extension< {
247
+ NODES: "paragraph";
248
+ }>;
249
+
237
250
  /**
238
251
  * Adds a ProseMirror plugin to the editor.
239
252
  *
@@ -979,7 +979,8 @@ var nodeSpecFacet = Facet.define({
979
979
  function defineDoc() {
980
980
  return defineNodeSpec({
981
981
  name: "doc",
982
- content: "block+"
982
+ content: "block+",
983
+ topNode: true
983
984
  });
984
985
  }
985
986
 
@@ -1220,7 +1221,7 @@ var nodeViewEffectFacet = Facet.define({
1220
1221
  });
1221
1222
 
1222
1223
  // src/extensions/paragraph.ts
1223
- function defineParagraph() {
1224
+ function defineParagraphSpec() {
1224
1225
  return defineNodeSpec({
1225
1226
  name: "paragraph",
1226
1227
  content: "inline*",
@@ -1231,6 +1232,9 @@ function defineParagraph() {
1231
1232
  }
1232
1233
  });
1233
1234
  }
1235
+ function defineParagraph() {
1236
+ return withPriority(defineParagraphSpec(), 0 /* highest */);
1237
+ }
1234
1238
 
1235
1239
  // src/extensions/text.ts
1236
1240
  function defineText() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/core",
3
3
  "type": "module",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "@prosekit/pm": "^0.0.6",
42
42
  "orderedmap": "^2.1.1",
43
- "type-fest": "^4.5.0"
43
+ "type-fest": "^4.6.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@prosekit/dev": "*",