@doist/typist 1.0.1 → 1.0.3
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,22 @@
|
|
|
1
|
+
## [1.0.3](https://github.com/Doist/typist/compare/v1.0.2...v1.0.3) (2022-12-08)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **docs:** correct the render function name ([#50](https://github.com/Doist/typist/issues/50)) ([45dd681](https://github.com/Doist/typist/commit/45dd681c761c1189df740f118d4293d30807a2f7))
|
|
6
|
+
|
|
7
|
+
## [1.0.2](https://github.com/Doist/typist/compare/v1.0.1...v1.0.2) (2022-12-02)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- `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))
|
|
12
|
+
- **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))
|
|
13
|
+
- **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))
|
|
14
|
+
- **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))
|
|
15
|
+
- **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))
|
|
16
|
+
- **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))
|
|
17
|
+
- **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))
|
|
18
|
+
- **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))
|
|
19
|
+
|
|
1
20
|
## [1.0.1](https://github.com/Doist/typist/compare/v1.0.0...v1.0.1) (2022-11-08)
|
|
2
21
|
|
|
3
22
|
### Bug Fixes
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
@@ -46,84 +46,84 @@
|
|
|
46
46
|
"validate:pre-push": "run-s test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tiptap/core": "2.0.0-beta.
|
|
50
|
-
"@tiptap/extension-blockquote": "2.0.0-beta.
|
|
51
|
-
"@tiptap/extension-bold": "2.0.0-beta.
|
|
52
|
-
"@tiptap/extension-bullet-list": "2.0.0-beta.
|
|
53
|
-
"@tiptap/extension-character-count": "2.0.0-beta.
|
|
54
|
-
"@tiptap/extension-code": "2.0.0-beta.
|
|
55
|
-
"@tiptap/extension-code-block": "2.0.0-beta.
|
|
56
|
-
"@tiptap/extension-document": "2.0.0-beta.
|
|
57
|
-
"@tiptap/extension-dropcursor": "2.0.0-beta.
|
|
58
|
-
"@tiptap/extension-gapcursor": "2.0.0-beta.
|
|
59
|
-
"@tiptap/extension-hard-break": "2.0.0-beta.
|
|
60
|
-
"@tiptap/extension-heading": "2.0.0-beta.
|
|
61
|
-
"@tiptap/extension-history": "2.0.0-beta.
|
|
62
|
-
"@tiptap/extension-horizontal-rule": "2.0.0-beta.
|
|
63
|
-
"@tiptap/extension-image": "2.0.0-beta.
|
|
64
|
-
"@tiptap/extension-italic": "2.0.0-beta.
|
|
65
|
-
"@tiptap/extension-link": "2.0.0-beta.
|
|
66
|
-
"@tiptap/extension-list-item": "2.0.0-beta.
|
|
67
|
-
"@tiptap/extension-ordered-list": "2.0.0-beta.
|
|
68
|
-
"@tiptap/extension-paragraph": "2.0.0-beta.
|
|
69
|
-
"@tiptap/extension-placeholder": "2.0.0-beta.
|
|
70
|
-
"@tiptap/extension-strike": "2.0.0-beta.
|
|
71
|
-
"@tiptap/extension-task-item": "2.0.0-beta.
|
|
72
|
-
"@tiptap/extension-task-list": "2.0.0-beta.
|
|
73
|
-
"@tiptap/extension-text": "2.0.0-beta.
|
|
74
|
-
"@tiptap/extension-typography": "2.0.0-beta.
|
|
75
|
-
"@tiptap/react": "2.0.0-beta.
|
|
76
|
-
"@tiptap/suggestion": "2.0.0-beta.
|
|
77
|
-
"prosemirror-codemark": "0.4.
|
|
78
|
-
"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",
|
|
79
79
|
"prosemirror-state": "1.4.2",
|
|
80
|
-
"prosemirror-view": "1.29.
|
|
80
|
+
"prosemirror-view": "1.29.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@doist/eslint-config": "8.
|
|
83
|
+
"@doist/eslint-config": "8.1.3",
|
|
84
84
|
"@doist/prettier-config": "3.0.5",
|
|
85
|
-
"@doist/reactist": "
|
|
85
|
+
"@doist/reactist": "16.1.0",
|
|
86
86
|
"@mdx-js/react": "2.1.5",
|
|
87
|
-
"@semantic-release/changelog": "6.0.
|
|
87
|
+
"@semantic-release/changelog": "6.0.2",
|
|
88
88
|
"@semantic-release/exec": "6.0.3",
|
|
89
89
|
"@semantic-release/git": "10.0.1",
|
|
90
|
-
"@storybook/addon-a11y": "6.5.
|
|
91
|
-
"@storybook/addon-essentials": "6.5.
|
|
92
|
-
"@storybook/addons": "6.5.
|
|
90
|
+
"@storybook/addon-a11y": "6.5.14",
|
|
91
|
+
"@storybook/addon-essentials": "6.5.14",
|
|
92
|
+
"@storybook/addons": "6.5.14",
|
|
93
93
|
"@storybook/builder-vite": "0.2.5",
|
|
94
94
|
"@storybook/mdx2-csf": "0.0.3",
|
|
95
|
-
"@storybook/react": "6.5.
|
|
95
|
+
"@storybook/react": "6.5.14",
|
|
96
96
|
"@testing-library/dom": "8.19.0",
|
|
97
97
|
"@testing-library/jest-dom": "5.16.5",
|
|
98
98
|
"@testing-library/react": "13.4.0",
|
|
99
|
-
"@types/jest": "29.2.
|
|
99
|
+
"@types/jest": "29.2.3",
|
|
100
100
|
"@types/lodash-es": "4.17.6",
|
|
101
101
|
"@types/marked": "4.0.7",
|
|
102
|
-
"@types/react": "18.0.
|
|
103
|
-
"@types/react-dom": "18.0.
|
|
102
|
+
"@types/react": "18.0.26",
|
|
103
|
+
"@types/react-dom": "18.0.9",
|
|
104
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.29.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.
|
|
125
|
-
"react-icons": "4.
|
|
126
|
-
"react-markdown": "8.0.
|
|
124
|
+
"prettier": "2.8.0",
|
|
125
|
+
"react-icons": "4.7.1",
|
|
126
|
+
"react-markdown": "8.0.4",
|
|
127
127
|
"react-syntax-highlighter": "15.5.0",
|
|
128
128
|
"rehype-raw": "6.1.1",
|
|
129
129
|
"remark-gfm": "3.0.1",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"storybook-css-modules": "1.0.8",
|
|
133
133
|
"ts-jest": "29.0.3",
|
|
134
134
|
"ts-node": "10.9.1",
|
|
135
|
-
"type-fest": "3.
|
|
135
|
+
"type-fest": "3.3.0",
|
|
136
136
|
"typescript": "4.8.4",
|
|
137
137
|
"typescript-plugin-css-modules": "3.4.0"
|
|
138
138
|
},
|