@doist/typist 1.4.10 → 1.4.12
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 +12 -0
- package/dist/constants/extension-priorities.d.ts +14 -8
- package/dist/constants/extension-priorities.d.ts.map +1 -1
- package/dist/constants/extension-priorities.js +14 -8
- package/dist/extensions/rich-text/paste-markdown.d.ts.map +1 -1
- package/dist/extensions/rich-text/paste-markdown.js +24 -19
- package/dist/extensions/rich-text/rich-text-image.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-image.js +0 -4
- package/dist/extensions/rich-text/rich-text-link.d.ts +2 -6
- package/dist/extensions/rich-text/rich-text-link.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-link.js +0 -9
- package/dist/extensions/shared/paste-html-table-as-string.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.4.12](https://github.com/Doist/typist/compare/v1.4.11...v1.4.12) (2023-09-08)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Hyperlink a text selection when pasting a valid URL ([#435](https://github.com/Doist/typist/issues/435)) ([999455e](https://github.com/Doist/typist/commit/999455ee8bb55df9335ad9ca6e2d07b8833b4d41))
|
|
6
|
+
|
|
7
|
+
## [1.4.11](https://github.com/Doist/typist/compare/v1.4.10...v1.4.11) (2023-09-08)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Remove `handlePaste` escape when clipboard holds multiple types ([#434](https://github.com/Doist/typist/issues/434)) ([4395051](https://github.com/Doist/typist/commit/43950517bcfcc1fa412e4681b4d336dd3bb3ac1b))
|
|
12
|
+
|
|
1
13
|
## [1.4.10](https://github.com/Doist/typist/compare/v1.4.9...v1.4.10) (2023-09-05)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
* be higher than most extensions, so that event handlers from the dropdown render function can take
|
|
4
4
|
* precedence over all other event handlers in the chain.
|
|
5
5
|
*/
|
|
6
|
-
declare const SUGGESTION_EXTENSION_PRIORITY =
|
|
6
|
+
declare const SUGGESTION_EXTENSION_PRIORITY = 10000;
|
|
7
|
+
/**
|
|
8
|
+
* Priority for the `PasteHTMLTableAsString` extension. This needs to be higher than most paste
|
|
9
|
+
* extensions (e.g., `PasteSinglelineText`, `PasteMarkdown`, etc.), so that the extension can first
|
|
10
|
+
* parse HTML tables that might exist in the clipboard data.
|
|
11
|
+
*/
|
|
12
|
+
declare const PASTE_HTML_TABLE_AS_STRING_EXTENSION_PRIORITY = 1005;
|
|
13
|
+
/**
|
|
14
|
+
* Priority for the `PasteMarkdown` extension. This needs to be higher than the built-in and
|
|
15
|
+
* official `Link` extension (i.e. `1000`), so that the extension can first parse Markdown links
|
|
16
|
+
* correctly, without having the `Link` extension paste handlers interfering.
|
|
17
|
+
*/
|
|
18
|
+
declare const PASTE_MARKDOWN_EXTENSION_PRIORITY = 1001;
|
|
7
19
|
/**
|
|
8
20
|
* Priority for the `SmartMarkdownTyping` extension. This needs to be higher than the
|
|
9
21
|
* `ViewEventHandlers` extension, so that event handlers from the ProseMirror plugins built into the
|
|
10
22
|
* extension can take precedence over the `ViewEventHandlers` extension event handlers.
|
|
11
23
|
*/
|
|
12
24
|
declare const SMART_MARKDOWN_TYPING_PRIORITY = 110;
|
|
13
|
-
/**
|
|
14
|
-
* Priority for the `PasteHTMLTableAsString` extension. This needs to be higher than most paste
|
|
15
|
-
* extensions (e.g., `PasteSinglelineText`, `PasteMarkdown`, etc.), so that the extension can first
|
|
16
|
-
* parse HTML tables that might exist in the clipboard data.
|
|
17
|
-
*/
|
|
18
|
-
declare const PASTE_EXTENSION_PRIORITY = 105;
|
|
19
25
|
/**
|
|
20
26
|
* Priority for the `ViewEventHandlers` extension. This needs to be higher than the default for most
|
|
21
27
|
* of the built-in and official extensions (i.e. `100`), so that the event handlers from the
|
|
@@ -34,5 +40,5 @@ declare const BLOCKQUOTE_EXTENSION_PRIORITY = 101;
|
|
|
34
40
|
* the other way around (i.e. prevents `<code><em>code</em></code>` from happening).
|
|
35
41
|
*/
|
|
36
42
|
declare const CODE_EXTENSION_PRIORITY = 99;
|
|
37
|
-
export { BLOCKQUOTE_EXTENSION_PRIORITY, CODE_EXTENSION_PRIORITY,
|
|
43
|
+
export { BLOCKQUOTE_EXTENSION_PRIORITY, CODE_EXTENSION_PRIORITY, PASTE_HTML_TABLE_AS_STRING_EXTENSION_PRIORITY, PASTE_MARKDOWN_EXTENSION_PRIORITY, SMART_MARKDOWN_TYPING_PRIORITY, SUGGESTION_EXTENSION_PRIORITY, VIEW_EVENT_HANDLERS_PRIORITY, };
|
|
38
44
|
//# sourceMappingURL=extension-priorities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-priorities.d.ts","sourceRoot":"","sources":["../../src/constants/extension-priorities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"extension-priorities.d.ts","sourceRoot":"","sources":["../../src/constants/extension-priorities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,6BAA6B,QAAQ,CAAA;AAE3C;;;;GAIG;AACH,QAAA,MAAM,6CAA6C,OAAO,CAAA;AAE1D;;;;GAIG;AACH,QAAA,MAAM,iCAAiC,OAAO,CAAA;AAE9C;;;;GAIG;AACH,QAAA,MAAM,8BAA8B,MAAM,CAAA;AAE1C;;;;GAIG;AACH,QAAA,MAAM,4BAA4B,MAAM,CAAA;AAExC;;;;GAIG;AACH,QAAA,MAAM,6BAA6B,MAAM,CAAA;AAEzC;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAElC,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,6CAA6C,EAC7C,iCAAiC,EACjC,8BAA8B,EAC9B,6BAA6B,EAC7B,4BAA4B,GAC/B,CAAA"}
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
* be higher than most extensions, so that event handlers from the dropdown render function can take
|
|
4
4
|
* precedence over all other event handlers in the chain.
|
|
5
5
|
*/
|
|
6
|
-
const SUGGESTION_EXTENSION_PRIORITY =
|
|
6
|
+
const SUGGESTION_EXTENSION_PRIORITY = 10000;
|
|
7
|
+
/**
|
|
8
|
+
* Priority for the `PasteHTMLTableAsString` extension. This needs to be higher than most paste
|
|
9
|
+
* extensions (e.g., `PasteSinglelineText`, `PasteMarkdown`, etc.), so that the extension can first
|
|
10
|
+
* parse HTML tables that might exist in the clipboard data.
|
|
11
|
+
*/
|
|
12
|
+
const PASTE_HTML_TABLE_AS_STRING_EXTENSION_PRIORITY = 1005;
|
|
13
|
+
/**
|
|
14
|
+
* Priority for the `PasteMarkdown` extension. This needs to be higher than the built-in and
|
|
15
|
+
* official `Link` extension (i.e. `1000`), so that the extension can first parse Markdown links
|
|
16
|
+
* correctly, without having the `Link` extension paste handlers interfering.
|
|
17
|
+
*/
|
|
18
|
+
const PASTE_MARKDOWN_EXTENSION_PRIORITY = 1001;
|
|
7
19
|
/**
|
|
8
20
|
* Priority for the `SmartMarkdownTyping` extension. This needs to be higher than the
|
|
9
21
|
* `ViewEventHandlers` extension, so that event handlers from the ProseMirror plugins built into the
|
|
10
22
|
* extension can take precedence over the `ViewEventHandlers` extension event handlers.
|
|
11
23
|
*/
|
|
12
24
|
const SMART_MARKDOWN_TYPING_PRIORITY = 110;
|
|
13
|
-
/**
|
|
14
|
-
* Priority for the `PasteHTMLTableAsString` extension. This needs to be higher than most paste
|
|
15
|
-
* extensions (e.g., `PasteSinglelineText`, `PasteMarkdown`, etc.), so that the extension can first
|
|
16
|
-
* parse HTML tables that might exist in the clipboard data.
|
|
17
|
-
*/
|
|
18
|
-
const PASTE_EXTENSION_PRIORITY = 105;
|
|
19
25
|
/**
|
|
20
26
|
* Priority for the `ViewEventHandlers` extension. This needs to be higher than the default for most
|
|
21
27
|
* of the built-in and official extensions (i.e. `100`), so that the event handlers from the
|
|
@@ -34,4 +40,4 @@ const BLOCKQUOTE_EXTENSION_PRIORITY = 101;
|
|
|
34
40
|
* the other way around (i.e. prevents `<code><em>code</em></code>` from happening).
|
|
35
41
|
*/
|
|
36
42
|
const CODE_EXTENSION_PRIORITY = 99;
|
|
37
|
-
export { BLOCKQUOTE_EXTENSION_PRIORITY, CODE_EXTENSION_PRIORITY,
|
|
43
|
+
export { BLOCKQUOTE_EXTENSION_PRIORITY, CODE_EXTENSION_PRIORITY, PASTE_HTML_TABLE_AS_STRING_EXTENSION_PRIORITY, PASTE_MARKDOWN_EXTENSION_PRIORITY, SMART_MARKDOWN_TYPING_PRIORITY, SUGGESTION_EXTENSION_PRIORITY, VIEW_EVENT_HANDLERS_PRIORITY, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paste-markdown.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/paste-markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"paste-markdown.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/paste-markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAiBxC;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,qBAmGjB,CAAA;AAEF,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
|
+
import * as linkify from 'linkifyjs';
|
|
2
3
|
import { Fragment, Slice } from 'prosemirror-model';
|
|
3
4
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
4
5
|
import { ClipboardDataType } from '../../constants/common';
|
|
6
|
+
import { PASTE_MARKDOWN_EXTENSION_PRIORITY } from '../../constants/extension-priorities';
|
|
5
7
|
/**
|
|
6
8
|
* The `PasteMarkdown` extension adds the ability to paste Markdown as HTML into the editor,
|
|
7
9
|
* providing full rich-text support to the pasted content. The pasting behavior was inspired from
|
|
@@ -11,6 +13,7 @@ import { ClipboardDataType } from '../../constants/common';
|
|
|
11
13
|
*/
|
|
12
14
|
const PasteMarkdown = Extension.create({
|
|
13
15
|
name: 'pasteMarkdown',
|
|
16
|
+
priority: PASTE_MARKDOWN_EXTENSION_PRIORITY,
|
|
14
17
|
addProseMirrorPlugins() {
|
|
15
18
|
const { editor } = this;
|
|
16
19
|
return [
|
|
@@ -25,9 +28,24 @@ const PasteMarkdown = Extension.create({
|
|
|
25
28
|
return Slice.maxOpen(Fragment.from(editor.schema.text(text)));
|
|
26
29
|
},
|
|
27
30
|
handlePaste(_, event, slice) {
|
|
31
|
+
const isInsideCodeBlockNode = editor.state.selection.$from.parent.type.name === 'codeBlock';
|
|
28
32
|
// The clipboard contains text if the slice content size is greater than
|
|
29
33
|
// zero, otherwise it contains other data types (like files or images)
|
|
30
34
|
const clipboardContainsText = Boolean(slice.content.size);
|
|
35
|
+
// Do not handle the paste event if the user is pasting inside a code block
|
|
36
|
+
// or if the clipboard does not contain text
|
|
37
|
+
if (isInsideCodeBlockNode || !clipboardContainsText) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
// Get the clipboard text from the slice content instead of getting it from
|
|
41
|
+
// the clipboard data because the pasted content could have already been
|
|
42
|
+
// transformed by other ProseMirror plugins
|
|
43
|
+
const textContent = slice.content.textBetween(0, slice.content.size, '\n');
|
|
44
|
+
// Do not handle the paste event if the clipboard text is only a link (in
|
|
45
|
+
// this case we want the built-in handlers in Tiptap to handle the event)
|
|
46
|
+
if (linkify.test(textContent)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
31
49
|
const clipboardContainsHTML = Boolean(event.clipboardData?.types.some((type) => type === ClipboardDataType.HTML));
|
|
32
50
|
// Unfortunately, the VS Code clipboard data type is not supported by
|
|
33
51
|
// Firefox or Safari, which means that copy/paste experience from VS Code
|
|
@@ -46,29 +64,16 @@ const PasteMarkdown = Extension.create({
|
|
|
46
64
|
// set to `false`, thus returning plain-text
|
|
47
65
|
vsCodeClipboardMetadata.mode !== null &&
|
|
48
66
|
vsCodeClipboardMetadata.mode !== 'markdown';
|
|
49
|
-
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// * The clipboard contains HTML from VS Code that it's NOT plain-text or
|
|
55
|
-
// Markdown (like Python, TypeScript, JSON, etc.)
|
|
56
|
-
// * The user is pasting content inside a code block node
|
|
57
|
-
// For all the above conditions we want the default handling behaviour from
|
|
58
|
-
// ProseMirror to kick-in, otherwise we'll handle it ourselves below
|
|
59
|
-
if (!clipboardContainsText ||
|
|
60
|
-
clipboardContainsHTMLFromUnknownSource ||
|
|
61
|
-
clipboardContainsHTMLFromVSCodeOtherThanTextOrMarkdown ||
|
|
62
|
-
isInsideCodeBlockNode) {
|
|
67
|
+
// Do not handle the paste event if the clipboard contains HTML from an
|
|
68
|
+
// unknown source (e.g., Google Drive, Dropbox Paper, etc.) or from VS Code
|
|
69
|
+
// that it's NOT plain-text or Markdown (e.g., Python, TypeScript, etc.)
|
|
70
|
+
if (clipboardContainsHTMLFromUnknownSource ||
|
|
71
|
+
clipboardContainsHTMLFromVSCodeOtherThanTextOrMarkdown) {
|
|
63
72
|
return false;
|
|
64
73
|
}
|
|
65
74
|
// Send the clipboard text through the HTML serializer to convert potential
|
|
66
75
|
// Markdown into HTML, and then insert it into the editor
|
|
67
|
-
editor.commands.insertMarkdownContent(
|
|
68
|
-
// The slice content is used instead of getting the text directly from
|
|
69
|
-
// the clipboard data because the pasted content could have already
|
|
70
|
-
// been transformed by other ProseMirror plugins
|
|
71
|
-
slice.content.textBetween(0, slice.content.size, '\n'));
|
|
76
|
+
editor.commands.insertMarkdownContent(textContent);
|
|
72
77
|
// Suppress the default handling behaviour
|
|
73
78
|
return true;
|
|
74
79
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-image.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-image.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP;;WAEG;QACH,YAAY,EAAE,MAAM,CAAA;QAEpB;;WAEG;QACH,cAAc,EAAE,OAAO,CAAA;QAEvB;;WAEG;QACH,cAAc,EAAE,MAAM,CAAA;KACzB,CAAA;CACJ,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAC7B,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;AAEpD;;;GAGG;AACH,OAAO,QAAQ,cAAc,CAAC;IAC1B,UAAU,QAAQ,CAAC,UAAU;QACzB,aAAa,EAAE;YACX;;eAEG;YACH,WAAW,EAAE,CAAC,UAAU,EAAE,uBAAuB,KAAK,UAAU,CAAA;YAEhE;;eAEG;YACH,WAAW,EAAE,CACT,UAAU,EAAE,OAAO,CAAC,uBAAuB,CAAC,GACxC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC,KACtD,UAAU,CAAA;SAClB,CAAA;KACJ;CACJ;AAED;;GAEG;AACH,KAAK,oBAAoB,GAAG;IACxB;;OAEG;IACH,sBAAsB,EAAE,MAAM,EAAE,CAAA;IAEhC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAA;IAEf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;IAEtD;;OAEG;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AE,MAAM,CAAC,CAAA;IAEtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;IAEtD;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAEvC;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;CACrD,CAAA;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,yDAoHjB,CAAA;AAEF,OAAO,EAAE,aAAa,EAAE,CAAA;AAExB,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -85,10 +85,6 @@ const RichTextImage = Image.extend({
|
|
|
85
85
|
if (!onImageFilePaste) {
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
|
-
// Do not handle the event if there are multiple clipboard types
|
|
89
|
-
if ((event.clipboardData?.types || []).length > 1) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
88
|
const pastedFiles = Array.from(event.clipboardData?.files || []);
|
|
93
89
|
// Do not handle the event if no files were pasted
|
|
94
90
|
if (pastedFiles.length === 0) {
|
|
@@ -1,14 +1,10 @@
|
|
|
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'>;
|
|
6
2
|
/**
|
|
7
3
|
* Custom extension that extends the built-in `Link` extension to add additional input/paste rules
|
|
8
4
|
* for converting the Markdown link syntax (i.e. `[Doist](https://doist.com)`) into links, and also
|
|
9
5
|
* adds support for the `title` attribute.
|
|
10
6
|
*/
|
|
11
|
-
declare const RichTextLink: import("@tiptap/core").Mark<
|
|
7
|
+
declare const RichTextLink: import("@tiptap/core").Mark<LinkOptions, any>;
|
|
12
8
|
export { RichTextLink };
|
|
13
|
-
export type { RichTextLinkOptions };
|
|
9
|
+
export type { LinkOptions as RichTextLinkOptions };
|
|
14
10
|
//# 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
|
|
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"}
|
|
@@ -52,15 +52,6 @@ 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
|
-
},
|
|
64
55
|
addAttributes() {
|
|
65
56
|
return {
|
|
66
57
|
...this.parent?.(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
-
import {
|
|
3
|
+
import { PASTE_HTML_TABLE_AS_STRING_EXTENSION_PRIORITY } from '../../constants/extension-priorities';
|
|
4
4
|
import { parseHtmlToElement } from '../../helpers/dom';
|
|
5
5
|
/**
|
|
6
6
|
* The `PasteHTMLTableAsString` extension adds the ability to paste a table copied from a spreadsheet
|
|
@@ -16,7 +16,7 @@ import { parseHtmlToElement } from '../../helpers/dom';
|
|
|
16
16
|
*/
|
|
17
17
|
const PasteHTMLTableAsString = Extension.create({
|
|
18
18
|
name: 'pasteHTMLTableAsString',
|
|
19
|
-
priority:
|
|
19
|
+
priority: PASTE_HTML_TABLE_AS_STRING_EXTENSION_PRIORITY,
|
|
20
20
|
addProseMirrorPlugins() {
|
|
21
21
|
return [
|
|
22
22
|
new Plugin({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { BeforeCreateProps, BlurProps, CreateProps, DestroyProps, FocusProps, SelectionUpdateProps, TransacationProps, TypistEditorProps, TypistEditorRef, UpdateProps, } from './components/typist-editor';
|
|
2
2
|
export { TypistEditor } from './components/typist-editor';
|
|
3
|
-
export
|
|
3
|
+
export * from './constants/extension-priorities';
|
|
4
4
|
export * from './extensions/core/extra-editor-commands/commands/extend-word-range';
|
|
5
5
|
export * from './extensions/core/extra-editor-commands/commands/insert-markdown-content';
|
|
6
6
|
export { PlainTextKit } from './extensions/plain-text/plain-text-kit';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,WAAW,GACd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,iBAAiB,EACjB,SAAS,EACT,WAAW,EAC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BAAiB,EACjB,WAAW,EACX,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,eAAe,EACf,eAAe,EACf,YAAY,GACf,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9C,cAAc,mCAAmC,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/E,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC9D,YAAY,EACR,sBAAsB,EACtB,iBAAiB,IAAI,uBAAuB,GAC/C,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { TypistEditor } from './components/typist-editor';
|
|
2
|
-
export
|
|
2
|
+
export * from './constants/extension-priorities';
|
|
3
3
|
export * from './extensions/core/extra-editor-commands/commands/extend-word-range';
|
|
4
4
|
export * from './extensions/core/extra-editor-commands/commands/insert-markdown-content';
|
|
5
5
|
export { PlainTextKit } from './extensions/plain-text/plain-text-kit';
|
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.
|
|
4
|
+
"version": "1.4.12",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
"rehype-minify-whitespace": "^5.0.0",
|
|
152
152
|
"rehype-raw": "^6.1.0",
|
|
153
153
|
"rehype-stringify": "^9.0.0",
|
|
154
|
+
"linkifyjs": "^4.1.1",
|
|
154
155
|
"remark": "^14.0.0",
|
|
155
156
|
"remark-breaks": "^3.0.0",
|
|
156
157
|
"remark-gfm": "^3.0.0",
|