@doist/typist 6.0.1 → 6.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,15 @@
|
|
|
1
|
+
## [6.0.3](https://github.com/Doist/typist/compare/v6.0.2...v6.0.3) (2024-05-13)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Check `code` mark presence instead of any mark in `canInsertSuggestion` ([#791](https://github.com/Doist/typist/issues/791)) ([2f70959](https://github.com/Doist/typist/commit/2f709597c029e1d68bf7d39fb20c8a9a17a0f800))
|
|
6
|
+
|
|
7
|
+
## [6.0.2](https://github.com/Doist/typist/compare/v6.0.1...v6.0.2) (2024-04-15)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **rich-text-link:** Change `openOnClick` default to `whenNotEditable` ([#744](https://github.com/Doist/typist/issues/744)) ([db729d4](https://github.com/Doist/typist/commit/db729d48702231b78c77313510a7069d5c36fdde))
|
|
12
|
+
|
|
1
13
|
## [6.0.1](https://github.com/Doist/typist/compare/v6.0.0...v6.0.1) (2024-04-15)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-link.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAuDzD;;;;GAIG;AACH,QAAA,MAAM,YAAY,+
|
|
1
|
+
{"version":3,"file":"rich-text-link.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAuDzD;;;;GAIG;AACH,QAAA,MAAM,YAAY,+CAoDhB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,YAAY,EAAE,WAAW,IAAI,mBAAmB,EAAE,CAAA"}
|
|
@@ -52,6 +52,12 @@ function linkPasteRule(config) {
|
|
|
52
52
|
*/
|
|
53
53
|
const RichTextLink = Link.extend({
|
|
54
54
|
inclusive: false,
|
|
55
|
+
addOptions() {
|
|
56
|
+
return {
|
|
57
|
+
...this.parent?.(),
|
|
58
|
+
openOnClick: 'whenNotEditable',
|
|
59
|
+
};
|
|
60
|
+
},
|
|
55
61
|
addAttributes() {
|
|
56
62
|
return {
|
|
57
63
|
...this.parent?.(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"can-insert-suggestion.d.ts","sourceRoot":"","sources":["../../src/utilities/can-insert-suggestion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"can-insert-suggestion.d.ts","sourceRoot":"","sources":["../../src/utilities/can-insert-suggestion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,WAsBrF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -8,7 +8,8 @@ function canInsertSuggestion({ editor, state }) {
|
|
|
8
8
|
const isInsideCodeMark = editor.isActive('code');
|
|
9
9
|
const isInsideCodeBlockNode = selection.$from.parent.type.name === 'codeBlock';
|
|
10
10
|
const wordsBeforeSelection = (selection.$from.nodeBefore?.text ?? '').split(' ');
|
|
11
|
-
const
|
|
11
|
+
const nodeBeforeSelection = selection.$from.parent.cut(selection.$from.parentOffset - wordsBeforeSelection.slice(-1)[0].length - 1, selection.$from.parentOffset - 1).content.firstChild;
|
|
12
|
+
const hasCodeMarkBefore = (nodeBeforeSelection?.marks ?? []).some((mark) => mark.type.name === 'code');
|
|
12
13
|
const isComposingInlineCode = wordsBeforeSelection.some((word) => word.startsWith('`'));
|
|
13
14
|
return (!isInsideCodeMark && !isInsideCodeBlockNode && !hasCodeMarkBefore && !isComposingInlineCode);
|
|
14
15
|
}
|
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": "6.0.
|
|
4
|
+
"version": "6.0.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
@@ -81,27 +81,27 @@
|
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@doist/eslint-config": "11.1.0",
|
|
83
83
|
"@doist/prettier-config": "4.0.0",
|
|
84
|
-
"@doist/reactist": "23.2.
|
|
84
|
+
"@doist/reactist": "23.2.2",
|
|
85
85
|
"@mdx-js/react": "3.0.1",
|
|
86
86
|
"@semantic-release/changelog": "6.0.3",
|
|
87
87
|
"@semantic-release/exec": "6.0.3",
|
|
88
88
|
"@semantic-release/git": "10.0.1",
|
|
89
|
-
"@storybook/addon-a11y": "8.0.
|
|
90
|
-
"@storybook/addon-essentials": "8.0.
|
|
91
|
-
"@storybook/blocks": "8.0.
|
|
92
|
-
"@storybook/csf": "0.1.
|
|
93
|
-
"@storybook/manager-api": "8.0.
|
|
89
|
+
"@storybook/addon-a11y": "8.0.10",
|
|
90
|
+
"@storybook/addon-essentials": "8.0.10",
|
|
91
|
+
"@storybook/blocks": "8.0.10",
|
|
92
|
+
"@storybook/csf": "0.1.7",
|
|
93
|
+
"@storybook/manager-api": "8.0.10",
|
|
94
94
|
"@storybook/mdx2-csf": "1.1.0",
|
|
95
|
-
"@storybook/react": "8.0.
|
|
96
|
-
"@storybook/react-vite": "8.0.
|
|
97
|
-
"@testing-library/dom": "10.
|
|
98
|
-
"@testing-library/jest-dom": "6.4.
|
|
99
|
-
"@testing-library/react": "
|
|
95
|
+
"@storybook/react": "8.0.10",
|
|
96
|
+
"@storybook/react-vite": "8.0.10",
|
|
97
|
+
"@testing-library/dom": "10.1.0",
|
|
98
|
+
"@testing-library/jest-dom": "6.4.5",
|
|
99
|
+
"@testing-library/react": "15.0.7",
|
|
100
100
|
"@types/hast": "3.0.4",
|
|
101
101
|
"@types/lodash-es": "4.17.12",
|
|
102
|
-
"@types/react": "18.
|
|
103
|
-
"@types/react-dom": "18.
|
|
104
|
-
"@types/react-syntax-highlighter": "15.5.
|
|
102
|
+
"@types/react": "18.3.1",
|
|
103
|
+
"@types/react-dom": "18.3.0",
|
|
104
|
+
"@types/react-syntax-highlighter": "15.5.13",
|
|
105
105
|
"@types/turndown": "5.0.4",
|
|
106
106
|
"@types/unist": "3.0.2",
|
|
107
107
|
"@vitejs/plugin-react": "4.2.1",
|
|
@@ -125,22 +125,22 @@
|
|
|
125
125
|
"lint-staged": "15.2.2",
|
|
126
126
|
"npm-run-all2": "6.1.2",
|
|
127
127
|
"prettier": "3.2.5",
|
|
128
|
-
"react": "18.
|
|
129
|
-
"react-dom": "18.
|
|
130
|
-
"react-icons": "5.
|
|
128
|
+
"react": "18.3.1",
|
|
129
|
+
"react-dom": "18.3.1",
|
|
130
|
+
"react-icons": "5.2.1",
|
|
131
131
|
"react-markdown": "9.0.1",
|
|
132
132
|
"react-syntax-highlighter": "15.5.0",
|
|
133
133
|
"rehype-raw": "7.0.0",
|
|
134
134
|
"remark-gfm": "4.0.0",
|
|
135
135
|
"rimraf": "5.0.5",
|
|
136
136
|
"semantic-release": "23.0.8",
|
|
137
|
-
"storybook": "8.0.
|
|
137
|
+
"storybook": "8.0.10",
|
|
138
138
|
"storybook-css-modules": "1.0.8",
|
|
139
139
|
"tippy.js": "6.3.7",
|
|
140
|
-
"type-fest": "4.
|
|
141
|
-
"typescript": "5.4.
|
|
140
|
+
"type-fest": "4.18.2",
|
|
141
|
+
"typescript": "5.4.5",
|
|
142
142
|
"typescript-plugin-css-modules": "5.1.0",
|
|
143
|
-
"vitest": "1.
|
|
143
|
+
"vitest": "1.6.0"
|
|
144
144
|
},
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"@react-hookz/web": "^14.2.3 || >=15.x",
|