@doist/typist 4.0.3 → 4.0.5
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [4.0.5](https://github.com/Doist/typist/compare/v4.0.4...v4.0.5) (2024-03-06)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Prevent extra blank lines on list items ([#685](https://github.com/Doist/typist/issues/685)) ([b538ebe](https://github.com/Doist/typist/commit/b538ebef9a43d6b1af2f68efcdad445ec9e0cc17))
|
|
6
|
+
|
|
7
|
+
## [4.0.4](https://github.com/Doist/typist/compare/v4.0.3...v4.0.4) (2024-03-06)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **deps:** update tiptap packages to v2.2.4 ([#660](https://github.com/Doist/typist/issues/660)) ([b603996](https://github.com/Doist/typist/commit/b603996c64b98388f43d0e7489b3fec7629b2b7d))
|
|
12
|
+
|
|
1
13
|
## [4.0.3](https://github.com/Doist/typist/compare/v4.0.2...v4.0.3) (2024-03-06)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -2,7 +2,8 @@ import type { NodeType } from '@tiptap/pm/model';
|
|
|
2
2
|
import type Turndown from 'turndown';
|
|
3
3
|
/**
|
|
4
4
|
* A Turndown plugin which adds a custom rule for paragraphs. This custom rule is required to avoid
|
|
5
|
-
* adding unnecessary blank lines between paragraphs to plain-text documents
|
|
5
|
+
* adding unnecessary blank lines between paragraphs to plain-text documents, and to list items in
|
|
6
|
+
* rich-text documents.
|
|
6
7
|
*
|
|
7
8
|
* @param nodeType The node object that matches this rule.
|
|
8
9
|
* @param isPlainText Specifies if the schema represents a plain-text document.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/serializers/markdown/plugins/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC
|
|
1
|
+
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/serializers/markdown/plugins/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC;;;;;;;GAOG;AACH,iBAAS,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAe5E;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A Turndown plugin which adds a custom rule for paragraphs. This custom rule is required to avoid
|
|
3
|
-
* adding unnecessary blank lines between paragraphs to plain-text documents
|
|
3
|
+
* adding unnecessary blank lines between paragraphs to plain-text documents, and to list items in
|
|
4
|
+
* rich-text documents.
|
|
4
5
|
*
|
|
5
6
|
* @param nodeType The node object that matches this rule.
|
|
6
7
|
* @param isPlainText Specifies if the schema represents a plain-text document.
|
|
@@ -9,8 +10,12 @@ function paragraph(nodeType, isPlainText) {
|
|
|
9
10
|
return (turndown) => {
|
|
10
11
|
turndown.addRule(nodeType.name, {
|
|
11
12
|
filter: 'p',
|
|
12
|
-
replacement(content) {
|
|
13
|
-
|
|
13
|
+
replacement(content, node) {
|
|
14
|
+
const useSingleLineSpacing = isPlainText ||
|
|
15
|
+
// Paragraphs within list items should be wrapped with a single line feed to
|
|
16
|
+
// maintain proper list formatting in rich-text documents.
|
|
17
|
+
(!isPlainText && node.parentNode?.nodeName === 'LI');
|
|
18
|
+
return useSingleLineSpacing ? `\n${content}\n` : `\n\n${content}\n\n`;
|
|
14
19
|
},
|
|
15
20
|
});
|
|
16
21
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/typist",
|
|
3
3
|
"description": "The mighty Tiptap-based rich-text editor React component that powers Doist products.",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
8
|
-
"prettier": "@doist/prettier-config",
|
|
9
8
|
"main": "dist/index.js",
|
|
10
9
|
"types": "dist/index.d.ts",
|
|
11
10
|
"sideEffects": false,
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
"clean:storybook-static": "rimraf storybook-static/",
|
|
34
33
|
"eslint:check": "eslint --format codeframe --cache --cache-location ./.cache/.eslintcache --ext js,jsx,ts,tsx ./",
|
|
35
34
|
"format": "run-s prettier:format",
|
|
36
|
-
"prepare": "is-ci || husky
|
|
35
|
+
"prepare": "is-ci || husky",
|
|
37
36
|
"prettier:check": "prettier --check \"./**/*.{js,jsx,ts,tsx,json,css,yml,md}\"",
|
|
38
37
|
"prettier:format": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,yml,md}\"",
|
|
39
38
|
"storybook:build": "storybook build",
|
|
@@ -46,45 +45,44 @@
|
|
|
46
45
|
"validate:pre-push": "run-s test"
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@tiptap/core": "2.2.
|
|
50
|
-
"@tiptap/extension-blockquote": "2.2.
|
|
51
|
-
"@tiptap/extension-bold": "2.2.
|
|
52
|
-
"@tiptap/extension-bullet-list": "2.2.
|
|
53
|
-
"@tiptap/extension-character-count": "2.2.
|
|
54
|
-
"@tiptap/extension-code": "2.2.
|
|
55
|
-
"@tiptap/extension-code-block": "2.2.
|
|
56
|
-
"@tiptap/extension-document": "2.2.
|
|
57
|
-
"@tiptap/extension-dropcursor": "2.2.
|
|
58
|
-
"@tiptap/extension-gapcursor": "2.2.
|
|
59
|
-
"@tiptap/extension-hard-break": "2.2.
|
|
60
|
-
"@tiptap/extension-heading": "2.2.
|
|
61
|
-
"@tiptap/extension-history": "2.2.
|
|
62
|
-
"@tiptap/extension-horizontal-rule": "2.2.
|
|
63
|
-
"@tiptap/extension-image": "2.2.
|
|
64
|
-
"@tiptap/extension-italic": "2.2.
|
|
65
|
-
"@tiptap/extension-link": "2.2.
|
|
66
|
-
"@tiptap/extension-list-item": "2.2.
|
|
67
|
-
"@tiptap/extension-list-keymap": "2.2.
|
|
68
|
-
"@tiptap/extension-ordered-list": "2.2.
|
|
69
|
-
"@tiptap/extension-paragraph": "2.2.
|
|
70
|
-
"@tiptap/extension-placeholder": "2.2.
|
|
71
|
-
"@tiptap/extension-strike": "2.2.
|
|
72
|
-
"@tiptap/extension-task-item": "2.2.
|
|
73
|
-
"@tiptap/extension-task-list": "2.2.
|
|
74
|
-
"@tiptap/extension-text": "2.2.
|
|
75
|
-
"@tiptap/extension-text-style": "2.2.
|
|
76
|
-
"@tiptap/extension-typography": "2.2.
|
|
77
|
-
"@tiptap/pm": "2.2.
|
|
78
|
-
"@tiptap/react": "2.2.
|
|
79
|
-
"@tiptap/suggestion": "2.2.
|
|
48
|
+
"@tiptap/core": "2.2.4",
|
|
49
|
+
"@tiptap/extension-blockquote": "2.2.4",
|
|
50
|
+
"@tiptap/extension-bold": "2.2.4",
|
|
51
|
+
"@tiptap/extension-bullet-list": "2.2.4",
|
|
52
|
+
"@tiptap/extension-character-count": "2.2.4",
|
|
53
|
+
"@tiptap/extension-code": "2.2.4",
|
|
54
|
+
"@tiptap/extension-code-block": "2.2.4",
|
|
55
|
+
"@tiptap/extension-document": "2.2.4",
|
|
56
|
+
"@tiptap/extension-dropcursor": "2.2.4",
|
|
57
|
+
"@tiptap/extension-gapcursor": "2.2.4",
|
|
58
|
+
"@tiptap/extension-hard-break": "2.2.4",
|
|
59
|
+
"@tiptap/extension-heading": "2.2.4",
|
|
60
|
+
"@tiptap/extension-history": "2.2.4",
|
|
61
|
+
"@tiptap/extension-horizontal-rule": "2.2.4",
|
|
62
|
+
"@tiptap/extension-image": "2.2.4",
|
|
63
|
+
"@tiptap/extension-italic": "2.2.4",
|
|
64
|
+
"@tiptap/extension-link": "2.2.4",
|
|
65
|
+
"@tiptap/extension-list-item": "2.2.4",
|
|
66
|
+
"@tiptap/extension-list-keymap": "2.2.4",
|
|
67
|
+
"@tiptap/extension-ordered-list": "2.2.4",
|
|
68
|
+
"@tiptap/extension-paragraph": "2.2.4",
|
|
69
|
+
"@tiptap/extension-placeholder": "2.2.4",
|
|
70
|
+
"@tiptap/extension-strike": "2.2.4",
|
|
71
|
+
"@tiptap/extension-task-item": "2.2.4",
|
|
72
|
+
"@tiptap/extension-task-list": "2.2.4",
|
|
73
|
+
"@tiptap/extension-text": "2.2.4",
|
|
74
|
+
"@tiptap/extension-text-style": "2.2.4",
|
|
75
|
+
"@tiptap/extension-typography": "2.2.4",
|
|
76
|
+
"@tiptap/pm": "2.2.4",
|
|
77
|
+
"@tiptap/react": "2.2.4",
|
|
78
|
+
"@tiptap/suggestion": "2.2.4",
|
|
80
79
|
"prosemirror-codemark": "0.4.2"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
|
-
"@doist/eslint-config": "11.
|
|
82
|
+
"@doist/eslint-config": "11.1.0",
|
|
84
83
|
"@doist/prettier-config": "4.0.0",
|
|
85
84
|
"@doist/reactist": "23.2.0",
|
|
86
85
|
"@mdx-js/react": "3.0.1",
|
|
87
|
-
"@rollup/rollup-linux-x64-gnu": "4.12.0",
|
|
88
86
|
"@semantic-release/changelog": "6.0.3",
|
|
89
87
|
"@semantic-release/exec": "6.0.3",
|
|
90
88
|
"@semantic-release/git": "10.0.1",
|
|
@@ -100,7 +98,7 @@
|
|
|
100
98
|
"@testing-library/react": "14.2.1",
|
|
101
99
|
"@types/hast": "3.0.4",
|
|
102
100
|
"@types/lodash-es": "4.17.12",
|
|
103
|
-
"@types/react": "18.2.
|
|
101
|
+
"@types/react": "18.2.61",
|
|
104
102
|
"@types/react-dom": "18.2.19",
|
|
105
103
|
"@types/react-syntax-highlighter": "15.5.11",
|
|
106
104
|
"@types/turndown": "5.0.4",
|
|
@@ -110,22 +108,22 @@
|
|
|
110
108
|
"classnames": "2.5.1",
|
|
111
109
|
"conventional-changelog-conventionalcommits": "7.0.2",
|
|
112
110
|
"emoji-regex": "10.3.0",
|
|
113
|
-
"eslint": "8.
|
|
111
|
+
"eslint": "8.57.0",
|
|
114
112
|
"eslint-formatter-codeframe": "7.32.1",
|
|
115
113
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
116
|
-
"eslint-plugin-simple-import-sort": "
|
|
117
|
-
"eslint-plugin-storybook": "0.
|
|
114
|
+
"eslint-plugin-simple-import-sort": "12.0.0",
|
|
115
|
+
"eslint-plugin-storybook": "0.8.0",
|
|
118
116
|
"eslint-plugin-unicorn": "51.0.1",
|
|
119
|
-
"eslint-plugin-vitest": "0.3.
|
|
117
|
+
"eslint-plugin-vitest": "0.3.22",
|
|
120
118
|
"eslint-plugin-vitest-globals": "1.4.0",
|
|
121
119
|
"github-markdown-css": "5.5.1",
|
|
122
|
-
"husky": "
|
|
120
|
+
"husky": "9.0.11",
|
|
123
121
|
"ignore-sync": "7.0.1",
|
|
124
122
|
"is-ci": "3.0.1",
|
|
125
123
|
"jsdom": "24.0.0",
|
|
126
124
|
"lint-staged": "15.2.2",
|
|
127
125
|
"npm-run-all2": "6.1.2",
|
|
128
|
-
"prettier": "3.2.
|
|
126
|
+
"prettier": "3.2.5",
|
|
129
127
|
"react": "18.2.0",
|
|
130
128
|
"react-dom": "18.2.0",
|
|
131
129
|
"react-icons": "5.0.1",
|
|
@@ -135,9 +133,9 @@
|
|
|
135
133
|
"remark-gfm": "4.0.0",
|
|
136
134
|
"rimraf": "5.0.5",
|
|
137
135
|
"semantic-release": "23.0.2",
|
|
138
|
-
"tippy.js": "6.3.7",
|
|
139
136
|
"storybook": "7.6.17",
|
|
140
137
|
"storybook-css-modules": "1.0.8",
|
|
138
|
+
"tippy.js": "6.3.7",
|
|
141
139
|
"type-fest": "4.10.3",
|
|
142
140
|
"typescript": "5.3.3",
|
|
143
141
|
"typescript-plugin-css-modules": "5.1.0",
|