@doist/typist 1.4.7 → 1.4.9

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
+ ## [1.4.9](https://github.com/Doist/typist/compare/v1.4.8...v1.4.9) (2023-09-05)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **rich-text-kit:** Allow the `ListKeymap` extension to be configured ([#426](https://github.com/Doist/typist/issues/426)) ([7d789bb](https://github.com/Doist/typist/commit/7d789bb8a0a4a4c55c219606e0f0c95e3698ebc7))
6
+
7
+ ## [1.4.8](https://github.com/Doist/typist/compare/v1.4.7...v1.4.8) (2023-08-28)
8
+
9
+ ### Bug Fixes
10
+
11
+ - **rich-text-link:** Markdown pasting broken with conflicting `linkOnPaste` option ([#411](https://github.com/Doist/typist/issues/411)) ([2df2ba9](https://github.com/Doist/typist/commit/2df2ba94208357cbeaa3a9ac482503ac843e9b06))
12
+
1
13
  ## [1.4.7](https://github.com/Doist/typist/compare/v1.4.6...v1.4.7) (2023-08-24)
2
14
 
3
15
  ### Bug Fixes
@@ -116,7 +116,7 @@ const RichTextKit = Extension.create({
116
116
  extensions.push(ListItem.configure(this.options?.listItem));
117
117
  }
118
118
  if (this.options.listKeymap !== false) {
119
- extensions.push(ListKeymap);
119
+ extensions.push(ListKeymap.configure(this.options?.listKeymap));
120
120
  }
121
121
  if (this.options.orderedList !== false) {
122
122
  extensions.push(OrderedList.configure(this.options?.orderedList));
@@ -1,10 +1,14 @@
1
1
  import type { LinkOptions } from '@tiptap/extension-link';
2
+ /**
3
+ * The options available to customize the `RichTextLink` extension.
4
+ */
5
+ type RichTextLinkOptions = Omit<LinkOptions, 'linkOnPaste'>;
2
6
  /**
3
7
  * Custom extension that extends the built-in `Link` extension to add additional input/paste rules
4
8
  * for converting the Markdown link syntax (i.e. `[Doist](https://doist.com)`) into links, and also
5
9
  * adds support for the `title` attribute.
6
10
  */
7
- declare const RichTextLink: import("@tiptap/core").Mark<LinkOptions, any>;
11
+ declare const RichTextLink: import("@tiptap/core").Mark<RichTextLinkOptions, any>;
8
12
  export { RichTextLink };
9
- export type { LinkOptions as RichTextLinkOptions };
13
+ export type { RichTextLinkOptions };
10
14
  //# sourceMappingURL=rich-text-link.d.ts.map
@@ -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,+CA8ChB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,YAAY,EAAE,WAAW,IAAI,mBAAmB,EAAE,CAAA"}
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;;GAEG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC3B,WAAW,EAGX,aAAa,CAChB,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,YAAY,uDAuDhB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,YAAY,EAAE,mBAAmB,EAAE,CAAA"}
@@ -35,12 +35,12 @@ function linkInputRule(config) {
35
35
  * @see https://github.com/ueberdosis/tiptap/discussions/1865
36
36
  */
37
37
  function linkPasteRule(config) {
38
- const defaultMarkInputRule = markPasteRule(config);
38
+ const defaultMarkPasteRule = markPasteRule(config);
39
39
  return new PasteRule({
40
40
  find: config.find,
41
41
  handler(props) {
42
42
  const { tr } = props.state;
43
- defaultMarkInputRule.handler(props);
43
+ defaultMarkPasteRule.handler(props);
44
44
  tr.setMeta('preventAutolink', true);
45
45
  },
46
46
  });
@@ -52,6 +52,15 @@ function linkPasteRule(config) {
52
52
  */
53
53
  const RichTextLink = Link.extend({
54
54
  inclusive: false,
55
+ addOptions() {
56
+ return {
57
+ ...this.parent?.(),
58
+ // Disable the built-in auto-linking feature for pasted URLs, since we're using our own
59
+ // paste rules to handle Markdown syntax (on top of that, the `PasteMarkdown` extension
60
+ // takes precedence, and will handle auto-linking for pasted URLs anyway)
61
+ linkOnPaste: false,
62
+ };
63
+ },
55
64
  addAttributes() {
56
65
  return {
57
66
  ...this.parent?.(),
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.4.7",
4
+ "version": "1.4.9",
5
5
  "license": "MIT",
6
6
  "homepage": "https://typist.doist.dev/",
7
7
  "repository": "https://github.com/Doist/typist",
@@ -86,17 +86,17 @@
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": "7.3.2",
90
- "@storybook/addon-essentials": "7.3.2",
91
- "@storybook/addons": "7.3.2",
89
+ "@storybook/addon-a11y": "7.4.0",
90
+ "@storybook/addon-essentials": "7.4.0",
91
+ "@storybook/addons": "7.4.0",
92
92
  "@storybook/csf": "0.1.1",
93
93
  "@storybook/mdx2-csf": "1.1.0",
94
- "@storybook/react": "7.3.2",
95
- "@storybook/react-vite": "7.3.2",
94
+ "@storybook/react": "7.4.0",
95
+ "@storybook/react-vite": "7.4.0",
96
96
  "@testing-library/dom": "9.3.1",
97
97
  "@testing-library/jest-dom": "6.1.2",
98
98
  "@testing-library/react": "14.0.0",
99
- "@types/lodash-es": "4.17.8",
99
+ "@types/lodash-es": "4.17.9",
100
100
  "@types/react": "18.2.21",
101
101
  "@types/react-dom": "18.2.7",
102
102
  "@types/react-syntax-highlighter": "15.5.7",
@@ -106,13 +106,13 @@
106
106
  "classnames": "2.3.2",
107
107
  "conventional-changelog-conventionalcommits": "6.1.0",
108
108
  "emoji-regex": "10.2.1",
109
- "eslint": "8.47.0",
109
+ "eslint": "8.48.0",
110
110
  "eslint-formatter-codeframe": "7.32.1",
111
111
  "eslint-import-resolver-typescript": "3.6.0",
112
112
  "eslint-plugin-simple-import-sort": "10.0.0",
113
113
  "eslint-plugin-storybook": "0.6.13",
114
114
  "eslint-plugin-unicorn": "48.0.1",
115
- "eslint-plugin-vitest": "0.2.8",
115
+ "eslint-plugin-vitest": "0.3.1",
116
116
  "eslint-plugin-vitest-globals": "1.4.0",
117
117
  "github-markdown-css": "5.2.0",
118
118
  "husky": "8.0.3",
@@ -121,20 +121,20 @@
121
121
  "jsdom": "22.1.0",
122
122
  "lint-staged": "14.0.1",
123
123
  "npm-run-all": "4.1.5",
124
- "prettier": "3.0.2",
124
+ "prettier": "3.0.3",
125
125
  "react": "18.2.0",
126
126
  "react-dom": "18.2.0",
127
127
  "react-icons": "4.10.1",
128
128
  "react-markdown": "8.0.7",
129
129
  "react-syntax-highlighter": "15.5.0",
130
130
  "rimraf": "5.0.1",
131
- "semantic-release": "21.0.9",
132
- "storybook": "7.3.2",
131
+ "semantic-release": "21.1.1",
132
+ "storybook": "7.4.0",
133
133
  "storybook-css-modules": "1.0.8",
134
- "type-fest": "4.2.0",
135
- "typescript": "5.1.6",
134
+ "type-fest": "4.3.1",
135
+ "typescript": "5.2.2",
136
136
  "typescript-plugin-css-modules": "5.0.1",
137
- "vitest": "0.34.2"
137
+ "vitest": "0.34.3"
138
138
  },
139
139
  "peerDependencies": {
140
140
  "@react-hookz/web": "^14.2.3 || >=15.x",