@doist/typist 1.0.0 → 1.0.2
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 +19 -0
- package/README.md +9 -7
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts.map +1 -1
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js +1 -4
- package/dist/extensions/rich-text/rich-text-link.js +2 -2
- package/package.json +52 -48
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## [1.0.2](https://github.com/Doist/typist/compare/v1.0.1...v1.0.2) (2022-12-02)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- `insertMarkdownContent` didn't insert Markdown correctly in plain-text documents ([#13](https://github.com/Doist/typist/issues/13)) ([74cc623](https://github.com/Doist/typist/commit/74cc6233edb0a0ffb46d3a5786b310c2b59ae3c5))
|
|
6
|
+
- **deps:** update dependency prosemirror-codemark to v0.4.2 ([#34](https://github.com/Doist/typist/issues/34)) ([58938a1](https://github.com/Doist/typist/commit/58938a170e680c4803558ad6f67c7d1f9617c42e))
|
|
7
|
+
- **deps:** update dependency prosemirror-model to v1.18.2 ([#25](https://github.com/Doist/typist/issues/25)) ([5d1fc1b](https://github.com/Doist/typist/commit/5d1fc1b7d313a6e2828992dc4a9251f8bdb9fe0c))
|
|
8
|
+
- **deps:** update dependency prosemirror-model to v1.18.3 ([#30](https://github.com/Doist/typist/issues/30)) ([54bfd56](https://github.com/Doist/typist/commit/54bfd569d2de8929da4546a411b1dfe5c9215f3a))
|
|
9
|
+
- **deps:** update dependency prosemirror-view to v1.29.1 ([#26](https://github.com/Doist/typist/issues/26)) ([9f86a5e](https://github.com/Doist/typist/commit/9f86a5e5cfe2afbe51c493a05c21306fb85d7807))
|
|
10
|
+
- **deps:** update tiptap packages to v2.0.0-beta.202 ([#9](https://github.com/Doist/typist/issues/9)) ([ce43f74](https://github.com/Doist/typist/commit/ce43f744f98b25e1dd6b28bac1baca3c4a0449c4))
|
|
11
|
+
- **deps:** update tiptap packages to v2.0.0-beta.203 ([#35](https://github.com/Doist/typist/issues/35)) ([2188bc6](https://github.com/Doist/typist/commit/2188bc60012822782b7425e5aa971381a6eeacb3))
|
|
12
|
+
- **deps:** update tiptap packages to v2.0.0-beta.204 ([#38](https://github.com/Doist/typist/issues/38)) ([cb5b359](https://github.com/Doist/typist/commit/cb5b35921dac5a5ac40e46948961079ca683eb54))
|
|
13
|
+
|
|
14
|
+
## [1.0.1](https://github.com/Doist/typist/compare/v1.0.0...v1.0.1) (2022-11-08)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
- Add support for query params in `RichTextLink` extension ([#4](https://github.com/Doist/typist/issues/4)) ([9fac158](https://github.com/Doist/typist/commit/9fac158365f1dcdac0cad8bcf76ec59f276710a8))
|
|
19
|
+
|
|
1
20
|
## 1.0.0 (2022-11-04)
|
|
2
21
|
|
|
3
22
|
### Features
|
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>
|
|
3
|
-
<
|
|
4
|
-
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcSet="https://github.com/Doist/typist/blob/main/.github/assets/logo-dark.png?raw=true" />
|
|
5
|
+
<img src="https://github.com/Doist/typist/blob/main/.github/assets/logo-light.png?raw=true" />
|
|
6
|
+
</picture>
|
|
5
7
|
</h1>
|
|
6
8
|
</div>
|
|
7
9
|
|
|
8
|
-
Typist is the mighty [Tiptap](https://tiptap.dev/)-based rich-text editor that powers Doist products, which can also be used for displaying content in a read-only fashion. Typist also supports a plain-text mode, and comes with HTML/Markdown serializers.
|
|
10
|
+
Typist is the mighty [Tiptap](https://tiptap.dev/)-based rich-text editor React component that powers Doist products, which can also be used for displaying content in a read-only fashion. Typist also supports a plain-text mode, and comes with HTML/Markdown serializers.
|
|
9
11
|
|
|
10
12
|
> **Note**
|
|
11
13
|
>
|
|
@@ -13,10 +15,10 @@ Typist is the mighty [Tiptap](https://tiptap.dev/)-based rich-text editor that p
|
|
|
13
15
|
|
|
14
16
|
<div align="center">
|
|
15
17
|
|
|
16
|
-

|
|
17
|
-

|
|
18
|
-

|
|
19
|
-

|
|
18
|
+
[](https://github.com/Doist/typist/actions/workflows/check-ci-validation.yml?query=branch%3Amain)
|
|
19
|
+
[](https://www.npmjs.com/package/@doist/typist)
|
|
20
|
+
[](https://bundlephobia.com/package/@doist/typist)
|
|
21
|
+
[](https://npmtrends.com/@doist/typist)
|
|
20
22
|
|
|
21
23
|
[](https://github.com/semantic-release/semantic-release)
|
|
22
24
|
[](CODE_OF_CONDUCT.md)
|
package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-markdown-content.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/core/extra-editor-commands/commands/insert-markdown-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"insert-markdown-content.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/core/extra-editor-commands/commands/insert-markdown-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAM1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;GAGG;AACH,OAAO,QAAQ,cAAc,CAAC;IAC1B,UAAU,QAAQ,CAAC,UAAU;QACzB,qBAAqB,EAAE;YACnB;;;;;eAKG;YACH,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,KAAK,UAAU,CAAA;SACvF,CAAA;KACJ;CACJ;AAED;;;;;GAKG;AACH,iBAAS,qBAAqB,CAC1B,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,YAAY,GAC5B,UAAU,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAkBlD;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DOMParser } from 'prosemirror-model';
|
|
2
2
|
import { parseHtmlToElement } from '../../../../helpers/dom';
|
|
3
|
-
import { isPlainTextDocument } from '../../../../helpers/schema';
|
|
4
3
|
import { createHTMLSerializer } from '../../../../serializers/html/html';
|
|
5
4
|
/**
|
|
6
5
|
* Inserts the provided Markdown as HTML into the editor.
|
|
@@ -13,9 +12,7 @@ function insertMarkdownContent(markdown, parseOptions) {
|
|
|
13
12
|
// Check if the transaction should be dispatched
|
|
14
13
|
// ref: https://tiptap.dev/api/commands#dry-run-for-commands
|
|
15
14
|
if (dispatch) {
|
|
16
|
-
const htmlContent =
|
|
17
|
-
? createHTMLSerializer(editor.schema).serialize(markdown)
|
|
18
|
-
: markdown;
|
|
15
|
+
const htmlContent = createHTMLSerializer(editor.schema).serialize(markdown);
|
|
19
16
|
// Inserts the HTML content into the editor while preserving the current selection
|
|
20
17
|
tr.replaceSelection(DOMParser.fromSchema(editor.schema).parseSlice(parseHtmlToElement(htmlContent), parseOptions));
|
|
21
18
|
}
|
|
@@ -6,14 +6,14 @@ import { Link } from '@tiptap/extension-link';
|
|
|
6
6
|
*
|
|
7
7
|
* @see https://stephenweiss.dev/regex-markdown-link
|
|
8
8
|
*/
|
|
9
|
-
const inputRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9
|
|
9
|
+
const inputRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/.-?]+)(?: ["“](.+)["”])?\)$/;
|
|
10
10
|
/**
|
|
11
11
|
* The paste regex for Markdown links with title support, and multiple quotation marks (required
|
|
12
12
|
* in case the `Typography` extension is being included).
|
|
13
13
|
*
|
|
14
14
|
* @see https://stephenweiss.dev/regex-markdown-link
|
|
15
15
|
*/
|
|
16
|
-
const pasteRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9
|
|
16
|
+
const pasteRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/.-?]+)(?: ["“](.+)["”])?\)/g;
|
|
17
17
|
/**
|
|
18
18
|
* Input rule built specifically for the `Link` extension, which ignores the auto-linked URL in
|
|
19
19
|
* parentheses (e.g., `(https://doist.dev)`).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/typist",
|
|
3
|
-
"description": "The mighty Tiptap-based rich-text editor that powers Doist products.",
|
|
4
|
-
"version": "1.0.
|
|
3
|
+
"description": "The mighty Tiptap-based rich-text editor React component that powers Doist products.",
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"npm": "^7.0.0 || ^8.0.0 || ^9.0.0"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
18
|
-
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
"access": "public"
|
|
19
18
|
},
|
|
20
19
|
"files": [
|
|
21
20
|
"CHANGELOG.md",
|
|
@@ -47,43 +46,43 @@
|
|
|
47
46
|
"validate:pre-push": "run-s test"
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"@tiptap/core": "2.0.0-beta.
|
|
51
|
-
"@tiptap/extension-blockquote": "2.0.0-beta.
|
|
52
|
-
"@tiptap/extension-bold": "2.0.0-beta.
|
|
53
|
-
"@tiptap/extension-bullet-list": "2.0.0-beta.
|
|
54
|
-
"@tiptap/extension-character-count": "2.0.0-beta.
|
|
55
|
-
"@tiptap/extension-code": "2.0.0-beta.
|
|
56
|
-
"@tiptap/extension-code-block": "2.0.0-beta.
|
|
57
|
-
"@tiptap/extension-document": "2.0.0-beta.
|
|
58
|
-
"@tiptap/extension-dropcursor": "2.0.0-beta.
|
|
59
|
-
"@tiptap/extension-gapcursor": "2.0.0-beta.
|
|
60
|
-
"@tiptap/extension-hard-break": "2.0.0-beta.
|
|
61
|
-
"@tiptap/extension-heading": "2.0.0-beta.
|
|
62
|
-
"@tiptap/extension-history": "2.0.0-beta.
|
|
63
|
-
"@tiptap/extension-horizontal-rule": "2.0.0-beta.
|
|
64
|
-
"@tiptap/extension-image": "2.0.0-beta.
|
|
65
|
-
"@tiptap/extension-italic": "2.0.0-beta.
|
|
66
|
-
"@tiptap/extension-link": "2.0.0-beta.
|
|
67
|
-
"@tiptap/extension-list-item": "2.0.0-beta.
|
|
68
|
-
"@tiptap/extension-ordered-list": "2.0.0-beta.
|
|
69
|
-
"@tiptap/extension-paragraph": "2.0.0-beta.
|
|
70
|
-
"@tiptap/extension-placeholder": "2.0.0-beta.
|
|
71
|
-
"@tiptap/extension-strike": "2.0.0-beta.
|
|
72
|
-
"@tiptap/extension-task-item": "2.0.0-beta.
|
|
73
|
-
"@tiptap/extension-task-list": "2.0.0-beta.
|
|
74
|
-
"@tiptap/extension-text": "2.0.0-beta.
|
|
75
|
-
"@tiptap/extension-typography": "2.0.0-beta.
|
|
76
|
-
"@tiptap/react": "2.0.0-beta.
|
|
77
|
-
"@tiptap/suggestion": "2.0.0-beta.
|
|
78
|
-
"prosemirror-codemark": "0.4.
|
|
79
|
-
"prosemirror-model": "1.18.
|
|
49
|
+
"@tiptap/core": "2.0.0-beta.204",
|
|
50
|
+
"@tiptap/extension-blockquote": "2.0.0-beta.204",
|
|
51
|
+
"@tiptap/extension-bold": "2.0.0-beta.204",
|
|
52
|
+
"@tiptap/extension-bullet-list": "2.0.0-beta.204",
|
|
53
|
+
"@tiptap/extension-character-count": "2.0.0-beta.204",
|
|
54
|
+
"@tiptap/extension-code": "2.0.0-beta.204",
|
|
55
|
+
"@tiptap/extension-code-block": "2.0.0-beta.204",
|
|
56
|
+
"@tiptap/extension-document": "2.0.0-beta.204",
|
|
57
|
+
"@tiptap/extension-dropcursor": "2.0.0-beta.204",
|
|
58
|
+
"@tiptap/extension-gapcursor": "2.0.0-beta.204",
|
|
59
|
+
"@tiptap/extension-hard-break": "2.0.0-beta.204",
|
|
60
|
+
"@tiptap/extension-heading": "2.0.0-beta.204",
|
|
61
|
+
"@tiptap/extension-history": "2.0.0-beta.204",
|
|
62
|
+
"@tiptap/extension-horizontal-rule": "2.0.0-beta.204",
|
|
63
|
+
"@tiptap/extension-image": "2.0.0-beta.204",
|
|
64
|
+
"@tiptap/extension-italic": "2.0.0-beta.204",
|
|
65
|
+
"@tiptap/extension-link": "2.0.0-beta.204",
|
|
66
|
+
"@tiptap/extension-list-item": "2.0.0-beta.204",
|
|
67
|
+
"@tiptap/extension-ordered-list": "2.0.0-beta.204",
|
|
68
|
+
"@tiptap/extension-paragraph": "2.0.0-beta.204",
|
|
69
|
+
"@tiptap/extension-placeholder": "2.0.0-beta.204",
|
|
70
|
+
"@tiptap/extension-strike": "2.0.0-beta.204",
|
|
71
|
+
"@tiptap/extension-task-item": "2.0.0-beta.204",
|
|
72
|
+
"@tiptap/extension-task-list": "2.0.0-beta.204",
|
|
73
|
+
"@tiptap/extension-text": "2.0.0-beta.204",
|
|
74
|
+
"@tiptap/extension-typography": "2.0.0-beta.204",
|
|
75
|
+
"@tiptap/react": "2.0.0-beta.204",
|
|
76
|
+
"@tiptap/suggestion": "2.0.0-beta.204",
|
|
77
|
+
"prosemirror-codemark": "0.4.2",
|
|
78
|
+
"prosemirror-model": "1.18.3",
|
|
80
79
|
"prosemirror-state": "1.4.2",
|
|
81
|
-
"prosemirror-view": "1.29.
|
|
80
|
+
"prosemirror-view": "1.29.1"
|
|
82
81
|
},
|
|
83
82
|
"devDependencies": {
|
|
84
|
-
"@doist/eslint-config": "8.
|
|
83
|
+
"@doist/eslint-config": "8.1.3",
|
|
85
84
|
"@doist/prettier-config": "3.0.5",
|
|
86
|
-
"@doist/reactist": "
|
|
85
|
+
"@doist/reactist": "16.1.0",
|
|
87
86
|
"@mdx-js/react": "2.1.5",
|
|
88
87
|
"@semantic-release/changelog": "6.0.1",
|
|
89
88
|
"@semantic-release/exec": "6.0.3",
|
|
@@ -97,38 +96,43 @@
|
|
|
97
96
|
"@testing-library/dom": "8.19.0",
|
|
98
97
|
"@testing-library/jest-dom": "5.16.5",
|
|
99
98
|
"@testing-library/react": "13.4.0",
|
|
100
|
-
"@types/jest": "29.2.
|
|
99
|
+
"@types/jest": "29.2.3",
|
|
101
100
|
"@types/lodash-es": "4.17.6",
|
|
102
101
|
"@types/marked": "4.0.7",
|
|
103
|
-
"@types/react": "18.0.
|
|
104
|
-
"@types/react-dom": "18.0.
|
|
102
|
+
"@types/react": "18.0.25",
|
|
103
|
+
"@types/react-dom": "18.0.9",
|
|
104
|
+
"@types/react-syntax-highlighter": "15.5.5",
|
|
105
105
|
"@types/turndown": "5.0.1",
|
|
106
106
|
"boring-avatars": "1.7.0",
|
|
107
107
|
"classnames": "2.3.2",
|
|
108
108
|
"conventional-changelog-conventionalcommits": "5.0.0",
|
|
109
109
|
"emoji-regex": "10.2.1",
|
|
110
|
-
"eslint": "8.
|
|
110
|
+
"eslint": "8.28.0",
|
|
111
111
|
"eslint-formatter-codeframe": "7.32.1",
|
|
112
112
|
"eslint-import-resolver-typescript": "3.5.2",
|
|
113
|
-
"eslint-plugin-jest": "27.1.
|
|
113
|
+
"eslint-plugin-jest": "27.1.6",
|
|
114
114
|
"eslint-plugin-simple-import-sort": "8.0.0",
|
|
115
115
|
"eslint-plugin-unicorn": "44.0.2",
|
|
116
116
|
"github-markdown-css": "5.1.0",
|
|
117
|
-
"husky": "8.0.
|
|
117
|
+
"husky": "8.0.2",
|
|
118
118
|
"ignore-sync": "6.0.2",
|
|
119
119
|
"is-ci": "3.0.1",
|
|
120
|
-
"jest": "29.
|
|
121
|
-
"jest-environment-jsdom": "29.
|
|
122
|
-
"lint-staged": "13.0.
|
|
120
|
+
"jest": "29.3.1",
|
|
121
|
+
"jest-environment-jsdom": "29.3.1",
|
|
122
|
+
"lint-staged": "13.0.4",
|
|
123
123
|
"npm-run-all": "4.1.5",
|
|
124
|
-
"prettier": "2.
|
|
124
|
+
"prettier": "2.8.0",
|
|
125
125
|
"react-icons": "4.6.0",
|
|
126
|
+
"react-markdown": "8.0.3",
|
|
127
|
+
"react-syntax-highlighter": "15.5.0",
|
|
128
|
+
"rehype-raw": "6.1.1",
|
|
129
|
+
"remark-gfm": "3.0.1",
|
|
126
130
|
"rimraf": "3.0.2",
|
|
127
131
|
"semantic-release": "19.0.5",
|
|
128
132
|
"storybook-css-modules": "1.0.8",
|
|
129
133
|
"ts-jest": "29.0.3",
|
|
130
134
|
"ts-node": "10.9.1",
|
|
131
|
-
"type-fest": "3.
|
|
135
|
+
"type-fest": "3.2.0",
|
|
132
136
|
"typescript": "4.8.4",
|
|
133
137
|
"typescript-plugin-css-modules": "3.4.0"
|
|
134
138
|
},
|