@prosekit/basic 0.2.5 → 0.3.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.
@@ -34,11 +34,13 @@ export declare const default_alias_2: {
34
34
  };
35
35
 
36
36
  /**
37
+ * A basic extension that includes some common functionality. You can copy this
38
+ * function and customize it to your needs.
37
39
  * @public
38
40
  */
39
41
  export declare function defineBasicExtension(): Extension< {
40
- NODES: "text" | "doc" | "paragraph" | "heading" | "image" | "list";
41
- MARKS: "code" | "bold" | "italic" | "link" | "strike" | "underline";
42
+ NODES: "text" | "doc" | "paragraph" | "blockquote" | "heading" | "image" | "list";
43
+ MARKS: "code" | "bold" | "link" | "strike" | "italic" | "underline";
42
44
  COMMAND_ARGS: {
43
45
  setHeading: [attrs?: HeadingAttrs | undefined];
44
46
  insertHeading: [attrs?: HeadingAttrs | undefined];
@@ -62,6 +64,7 @@ toggleCode: [];
62
64
  addLink: [attrs: LinkAttrs];
63
65
  removeLink: [];
64
66
  toggleLink: [attrs: LinkAttrs];
67
+ expandLink: [];
65
68
  insertImage: [attrs?: ImageAttrs | undefined];
66
69
  insertText: [{
67
70
  text: string;
@@ -89,6 +92,11 @@ attrs?: Attrs | null | undefined;
89
92
  from?: number | undefined;
90
93
  to?: number | undefined;
91
94
  }];
95
+ setNodeAttrs: [options: {
96
+ type: string | NodeType;
97
+ attrs: Attrs;
98
+ pos?: number | undefined;
99
+ }];
92
100
  selectAll: [];
93
101
  addMark: [options: {
94
102
  type: string | MarkType;
@@ -8,6 +8,7 @@ import {
8
8
  defineText,
9
9
  union
10
10
  } from "@prosekit/core";
11
+ import { defineBlockquote } from "@prosekit/extensions/blockquote";
11
12
  import { defineBold } from "@prosekit/extensions/bold";
12
13
  import { defineCode } from "@prosekit/extensions/code";
13
14
  import { defineDropCursor } from "@prosekit/extensions/drop-cursor";
@@ -18,6 +19,7 @@ import { defineLink } from "@prosekit/extensions/link";
18
19
  import { defineList } from "@prosekit/extensions/list";
19
20
  import { defineStrike } from "@prosekit/extensions/strike";
20
21
  import { defineUnderline } from "@prosekit/extensions/underline";
22
+ import { defineVirtualSelection } from "@prosekit/extensions/virtual-selection";
21
23
  function defineBasicExtension() {
22
24
  return union([
23
25
  defineDoc(),
@@ -25,6 +27,7 @@ function defineBasicExtension() {
25
27
  defineHeading(),
26
28
  defineHistory(),
27
29
  defineList(),
30
+ defineBlockquote(),
28
31
  defineBaseKeymap(),
29
32
  defineBaseCommands(),
30
33
  defineItalic(),
@@ -35,7 +38,8 @@ function defineBasicExtension() {
35
38
  defineLink(),
36
39
  defineImage(),
37
40
  defineParagraph(),
38
- defineDropCursor()
41
+ defineDropCursor(),
42
+ defineVirtualSelection()
39
43
  ]);
40
44
  }
41
45
  export {
package/dist/style.css CHANGED
@@ -52,7 +52,7 @@ img.ProseMirror-separator {
52
52
 
53
53
  /* ../pm/src/view/style/prosemirror.css */
54
54
 
55
- /* ../../node_modules/.pnpm/prosemirror-flat-list@0.4.5/node_modules/prosemirror-flat-list/dist/style.css */
55
+ /* ../../node_modules/.pnpm/prosemirror-flat-list@0.4.6/node_modules/prosemirror-flat-list/dist/style.css */
56
56
  .prosemirror-flat-list {
57
57
  padding: 0;
58
58
  margin-top: 0;
@@ -151,4 +151,11 @@ img.ProseMirror-separator {
151
151
  content: attr(data-placeholder);
152
152
  }
153
153
 
154
+ /* ../extensions/src/virtual-selection/style.css */
155
+ .prosekit-virtual-selection {
156
+ background-color: Highlight;
157
+ box-shadow: 0 0 0 3px Highlight;
158
+ border-radius: 2px;
159
+ }
160
+
154
161
  /* src/style.css */
@@ -45,9 +45,8 @@ div.ProseMirror pre {
45
45
  line-height: 1.5;
46
46
  }
47
47
  div.ProseMirror blockquote {
48
- padding: 0.25rem;
49
48
  padding-left: 1em;
50
- font-style: italic;
49
+ border-left: 0.25em solid hsla(0, 0%, 60%, 0.4);
51
50
  }
52
51
  div.ProseMirror h1 {
53
52
  margin: 1rem 0;
@@ -133,3 +132,6 @@ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h6)::before,
133
132
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h6) > .list-marker {
134
133
  top: -0.1em;
135
134
  }
135
+ div.ProseMirror .ProseMirror-selectednode {
136
+ z-index: calc(infinity);
137
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/basic",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.3.1",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -41,17 +41,17 @@
41
41
  "dist"
42
42
  ],
43
43
  "dependencies": {
44
- "@prosekit/core": "^0.2.4",
45
- "@prosekit/extensions": "^0.2.3",
44
+ "@prosekit/core": "^0.3.1",
45
+ "@prosekit/extensions": "^0.3.1",
46
46
  "@prosekit/pm": "^0.1.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@prosekit/dev": "*",
50
- "postcss": "^8.4.33",
50
+ "postcss": "^8.4.35",
51
51
  "postcss-nesting": "^12.0.2",
52
- "tsup": "^8.0.1",
52
+ "tsup": "^8.0.2",
53
53
  "typescript": "^5.3.3",
54
- "vitest": "^1.1.3"
54
+ "vitest": "^1.2.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build:tsup": "tsup",
package/src/index.ts DELETED
@@ -1,48 +0,0 @@
1
- import {
2
- defineBaseCommands,
3
- defineBaseKeymap,
4
- defineDoc,
5
- defineHistory,
6
- defineParagraph,
7
- defineText,
8
- union,
9
- } from '@prosekit/core'
10
- import { defineBold } from '@prosekit/extensions/bold'
11
- import { defineCode } from '@prosekit/extensions/code'
12
- import { defineDropCursor } from '@prosekit/extensions/drop-cursor'
13
- import { defineHeading } from '@prosekit/extensions/heading'
14
- import { defineImage } from '@prosekit/extensions/image'
15
- import { defineItalic } from '@prosekit/extensions/italic'
16
- import { defineLink } from '@prosekit/extensions/link'
17
- import { defineList } from '@prosekit/extensions/list'
18
- import { defineStrike } from '@prosekit/extensions/strike'
19
- import { defineUnderline } from '@prosekit/extensions/underline'
20
-
21
- /**
22
- * @public
23
- */
24
- export function defineBasicExtension() {
25
- return union([
26
- defineDoc(),
27
- defineText(),
28
- defineHeading(),
29
- defineHistory(),
30
- defineList(),
31
- defineBaseKeymap(),
32
- defineBaseCommands(),
33
- defineItalic(),
34
- defineBold(),
35
- defineUnderline(),
36
- defineStrike(),
37
- defineCode(),
38
- defineLink(),
39
- defineImage(),
40
- defineParagraph(),
41
- defineDropCursor(),
42
- ])
43
- }
44
-
45
- /**
46
- * @public
47
- */
48
- export type BasicExtension = ReturnType<typeof defineBasicExtension>