@prosekit/basic 0.0.11 → 0.0.13

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.
@@ -1,5 +1,6 @@
1
1
  import { Attrs } from 'prosemirror-model';
2
2
  import { Extension } from '@prosekit/core';
3
+ import { HeadingAttrs } from '@prosekit/extensions/heading';
3
4
  import { Node as Node_2 } from 'prosemirror-model';
4
5
  import { NodeType } from 'prosemirror-model';
5
6
  import { Options } from 'tsup';
@@ -8,9 +9,11 @@ import { UserProjectConfigExport } from 'vitest/dist/config.js';
8
9
  /** @public */
9
10
  export declare function addBasicExtension(): Extension< {
10
11
  NODES: "text" | "doc" | "paragraph" | "heading" | "list";
11
- MARKS: "italic";
12
+ MARKS: "bold" | "italic";
12
13
  COMMAND_ARGS: {
14
+ toggleHeading: [attrs?: HeadingAttrs | undefined];
13
15
  toggleItalic: [];
16
+ toggleBold: [];
14
17
  insertText: [{
15
18
  text: string;
16
19
  from?: number | undefined;
@@ -0,0 +1,114 @@
1
+ /* src/internal/preflight.css */
2
+ *,
3
+ ::before,
4
+ ::after {
5
+ border-width: 0;
6
+ border-style: solid;
7
+ }
8
+ *:has(> div.ProseMirror) {
9
+ display: flex;
10
+ flex-direction: column;
11
+ width: 100%;
12
+ box-sizing: border-box;
13
+ padding: 8px;
14
+ font-family:
15
+ ui-sans-serif,
16
+ sans-serif,
17
+ "Apple Color Emoji",
18
+ "Segoe UI Emoji",
19
+ "Segoe UI Symbol",
20
+ "Noto Color Emoji",
21
+ system-ui;
22
+ }
23
+ *:has(> div.ProseMirror) * {
24
+ box-sizing: border-box;
25
+ }
26
+ .ProseMirror p:first-of-type {
27
+ margin-top: 0;
28
+ }
29
+ .ProseMirror p:last-of-type {
30
+ margin-bottom: 0;
31
+ }
32
+ .ProseMirror h1,
33
+ .ProseMirror h2,
34
+ .ProseMirror h3,
35
+ .ProseMirror h4,
36
+ .ProseMirror h5,
37
+ .ProseMirror h6 {
38
+ font-weight: 600;
39
+ line-height: 1.25;
40
+ }
41
+ .ProseMirror a {
42
+ text-decoration: underline;
43
+ font-weight: 500;
44
+ }
45
+ .ProseMirror p,
46
+ .ProseMirror ul,
47
+ .ProseMirror ol,
48
+ .ProseMirror pre {
49
+ margin: 1em 0;
50
+ line-height: 1.5;
51
+ }
52
+ .ProseMirror blockquote {
53
+ margin: 1em 0;
54
+ padding-left: 1em;
55
+ font-style: italic;
56
+ }
57
+ .ProseMirror h1 {
58
+ margin: 1rem 0;
59
+ font-size: 2.25em;
60
+ }
61
+ .ProseMirror h2 {
62
+ margin: 1.75em 0 0.5em;
63
+ font-size: 1.75em;
64
+ }
65
+ .ProseMirror h3 {
66
+ margin: 1.5em 0 0.5em;
67
+ font-size: 1.375em;
68
+ }
69
+ .ProseMirror h4 {
70
+ margin: 1em 0;
71
+ font-size: 1.125em;
72
+ }
73
+ .ProseMirror img,
74
+ .ProseMirror video {
75
+ max-width: 100%;
76
+ }
77
+ .ProseMirror code {
78
+ font-size: 0.875em;
79
+ font-weight: 600;
80
+ }
81
+ .ProseMirror pre {
82
+ padding: 2rem 2rem;
83
+ overflow-x: auto;
84
+ border-radius: 0.375rem;
85
+ }
86
+ .ProseMirror pre,
87
+ .ProseMirror code {
88
+ white-space: pre;
89
+ word-spacing: normal;
90
+ word-break: normal;
91
+ word-wrap: normal;
92
+ tab-size: 4;
93
+ hyphens: none;
94
+ }
95
+ .ProseMirror pre code {
96
+ font-weight: inherit;
97
+ }
98
+ .ProseMirror hr {
99
+ margin: 2em 0;
100
+ }
101
+ .ProseMirror span[data-mention=user] {
102
+ border-radius: 0.5rem;
103
+ color: rgb(59 130 246);
104
+ }
105
+ .ProseMirror span[data-mention=tag] {
106
+ border-radius: 0.5rem;
107
+ padding: 0.125rem 0.25rem;
108
+ background-color: rgb(229 231 235);
109
+ }
110
+ @media (prefers-color-scheme: dark) {
111
+ .ProseMirror span[data-mention=tag] {
112
+ background-color: rgb(75 85 99);
113
+ }
114
+ }
@@ -9,6 +9,7 @@ import {
9
9
  Priority,
10
10
  withPriority
11
11
  } from "@prosekit/core";
12
+ import { addBold } from "@prosekit/extensions/bold";
12
13
  import { addHeading } from "@prosekit/extensions/heading";
13
14
  import { addItalic } from "@prosekit/extensions/italic";
14
15
  import { addList } from "@prosekit/extensions/list";
@@ -21,6 +22,7 @@ function addBasicExtension() {
21
22
  addBaseKeymap(),
22
23
  addBaseCommands(),
23
24
  addItalic(),
25
+ addBold(),
24
26
  withPriority(addParagraph(), Priority.high)
25
27
  ]);
26
28
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/basic",
3
3
  "type": "module",
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -30,8 +30,8 @@
30
30
  "import": "./dist/prosekit-basic.js",
31
31
  "default": "./dist/prosekit-basic.js"
32
32
  },
33
- "./internal/example.css": {
34
- "default": "./dist/internal/example.css"
33
+ "./internal/preflight.css": {
34
+ "default": "./dist/internal/preflight.css"
35
35
  },
36
36
  "./style.css": {
37
37
  "default": "./dist/style.css"
@@ -41,8 +41,8 @@
41
41
  "dist"
42
42
  ],
43
43
  "dependencies": {
44
- "@prosekit/core": "^0.0.9",
45
- "@prosekit/extensions": "^0.0.10"
44
+ "@prosekit/core": "^0.0.10",
45
+ "@prosekit/extensions": "^0.0.11"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@prosekit/dev": "*",
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  Priority,
9
9
  withPriority,
10
10
  } from '@prosekit/core'
11
+ import { addBold } from '@prosekit/extensions/bold'
11
12
  import { addHeading } from '@prosekit/extensions/heading'
12
13
  import { addItalic } from '@prosekit/extensions/italic'
13
14
  import { addList } from '@prosekit/extensions/list'
@@ -22,6 +23,7 @@ export function addBasicExtension() {
22
23
  addBaseKeymap(),
23
24
  addBaseCommands(),
24
25
  addItalic(),
26
+ addBold(),
25
27
  withPriority(addParagraph(), Priority.high),
26
28
  ])
27
29
  }
@@ -1,128 +0,0 @@
1
- /* src/internal/example.css */
2
- .example-editor {
3
- font-family:
4
- ui-sans-serif,
5
- system-ui,
6
- -apple-system,
7
- BlinkMacSystemFont,
8
- "Segoe UI",
9
- Roboto,
10
- "Helvetica Neue",
11
- Arial,
12
- "Noto Sans",
13
- sans-serif,
14
- "Apple Color Emoji",
15
- "Segoe UI Emoji",
16
- "Segoe UI Symbol",
17
- "Noto Color Emoji";
18
- }
19
- .example-editor p:first-of-type {
20
- margin-top: 0;
21
- }
22
- .example-editor p:last-of-type {
23
- margin-bottom: 0;
24
- }
25
- .example-editor h1,
26
- .example-editor h2,
27
- .example-editor h3,
28
- .example-editor h4,
29
- .example-editor h5,
30
- .example-editor h6 {
31
- font-weight: 600;
32
- line-height: 1.25;
33
- }
34
- .example-editor a {
35
- text-decoration: underline;
36
- font-weight: 500;
37
- }
38
- .example-editor p,
39
- .example-editor ul,
40
- .example-editor ol,
41
- .example-editor pre {
42
- margin: 1em 0;
43
- line-height: 1.5;
44
- }
45
- .example-editor blockquote {
46
- margin: 1em 0;
47
- padding-left: 1em;
48
- font-style: italic;
49
- }
50
- .example-editor h1 {
51
- margin: 1rem 0;
52
- font-size: 2.25em;
53
- }
54
- .example-editor h2 {
55
- margin: 1.75em 0 0.5em;
56
- font-size: 1.75em;
57
- }
58
- .example-editor h3 {
59
- margin: 1.5em 0 0.5em;
60
- font-size: 1.375em;
61
- }
62
- .example-editor h4 {
63
- margin: 1em 0;
64
- font-size: 1.125em;
65
- }
66
- .example-editor img,
67
- .example-editor video {
68
- max-width: 100%;
69
- }
70
- .example-editor code {
71
- font-size: 0.875em;
72
- font-weight: 600;
73
- }
74
- .example-editor pre {
75
- padding: 2rem 2rem;
76
- overflow-x: auto;
77
- border-radius: 0.375rem;
78
- }
79
- .example-editor pre,
80
- .example-editor code {
81
- white-space: pre;
82
- word-spacing: normal;
83
- word-break: normal;
84
- word-wrap: normal;
85
- -moz-tab-size: 4;
86
- -o-tab-size: 4;
87
- tab-size: 4;
88
- -webkit-hyphens: none;
89
- -moz-hyphens: none;
90
- hyphens: none;
91
- }
92
- .example-editor pre code {
93
- font-weight: inherit;
94
- }
95
- .example-editor hr {
96
- margin: 2em 0;
97
- }
98
- .example-editor span[data-mention=user] {
99
- border-radius: 0.5rem;
100
- padding: 0.125rem;
101
- color: rgb(59 130 246);
102
- }
103
- .example-editor span[data-mention=user]::before {
104
- content: "@";
105
- }
106
- .example-editor span[data-mention=tag] {
107
- border-radius: 0.5rem;
108
- background-color: rgb(229 231 235);
109
- padding-left: 0.25rem;
110
- padding-right: 0.25rem;
111
- padding-top: 0.125rem;
112
- padding-bottom: 0.125rem;
113
- }
114
- @media (prefers-color-scheme: dark) {
115
- .example-editor span[data-mention=tag] {
116
- background-color: rgb(75 85 99);
117
- }
118
- }
119
- .example-editor span[data-mention=tag]::before {
120
- content: "#";
121
- padding-right: 0.125rem;
122
- opacity: 0.4;
123
- }
124
- @media (prefers-color-scheme: dark) {
125
- .example-editor span[data-mention=tag]::before {
126
- opacity: 0.5;
127
- }
128
- }