@doist/typist 1.4.11 → 1.5.0

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.5.0](https://github.com/Doist/typist/compare/v1.4.12...v1.5.0) (2023-09-12)
2
+
3
+ ### Features
4
+
5
+ - Add `createParagraphEnd` command ([#438](https://github.com/Doist/typist/issues/438)) ([28484aa](https://github.com/Doist/typist/commit/28484aa4c5bdc8b5e47f12b0d03e45dacba7b533))
6
+
7
+ ## [1.4.12](https://github.com/Doist/typist/compare/v1.4.11...v1.4.12) (2023-09-08)
8
+
9
+ ### Bug Fixes
10
+
11
+ - 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))
12
+
1
13
  ## [1.4.11](https://github.com/Doist/typist/compare/v1.4.10...v1.4.11) (2023-09-08)
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 = 1000;
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, PASTE_EXTENSION_PRIORITY, SMART_MARKDOWN_TYPING_PRIORITY, SUGGESTION_EXTENSION_PRIORITY, VIEW_EVENT_HANDLERS_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,OAAO,CAAA;AAE1C;;;;GAIG;AACH,QAAA,MAAM,8BAA8B,MAAM,CAAA;AAE1C;;;;GAIG;AACH,QAAA,MAAM,wBAAwB,MAAM,CAAA;AAEpC;;;;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,wBAAwB,EACxB,8BAA8B,EAC9B,6BAA6B,EAC7B,4BAA4B,GAC/B,CAAA"}
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 = 1000;
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, PASTE_EXTENSION_PRIORITY, SMART_MARKDOWN_TYPING_PRIORITY, SUGGESTION_EXTENSION_PRIORITY, VIEW_EVENT_HANDLERS_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, };
@@ -0,0 +1,23 @@
1
+ import { RawCommands } from '@tiptap/core';
2
+ /**
3
+ * Augment the official `@tiptap/core` module with extra commands so that the compiler knows about
4
+ * them. For this to work externally, a wildcard export needs to be added to the root `index.ts`.
5
+ */
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ createParagraphEnd: {
9
+ /**
10
+ * Creates an empty paragraph at the end of the document.
11
+ */
12
+ createParagraphEnd: () => ReturnType;
13
+ };
14
+ }
15
+ }
16
+ /**
17
+ * Creates an empty paragraph at the end of the document.
18
+ *
19
+ * last node before creating the paragraph, using the build int fn
20
+ */
21
+ declare function createParagraphEnd(): ReturnType<RawCommands['createParagraphEnd']>;
22
+ export { createParagraphEnd };
23
+ //# sourceMappingURL=create-paragraph-end.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-paragraph-end.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/core/extra-editor-commands/commands/create-paragraph-end.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG1C;;;GAGG;AACH,OAAO,QAAQ,cAAc,CAAC;IAC1B,UAAU,QAAQ,CAAC,UAAU;QACzB,kBAAkB,EAAE;YAChB;;eAEG;YACH,kBAAkB,EAAE,MAAM,UAAU,CAAA;SACvC,CAAA;KACJ;CACJ;AAED;;;;GAIG;AACH,iBAAS,kBAAkB,IAAI,UAAU,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAuB3E;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { TextSelection } from '@tiptap/pm/state';
2
+ /**
3
+ * Creates an empty paragraph at the end of the document.
4
+ *
5
+ * last node before creating the paragraph, using the build int fn
6
+ */
7
+ function createParagraphEnd() {
8
+ return ({ state, tr, chain, dispatch }) => {
9
+ // Check if the transaction should be dispatched
10
+ // ref: https://tiptap.dev/api/commands#dry-run-for-commands
11
+ if (dispatch) {
12
+ return chain()
13
+ .command(() => {
14
+ tr.setSelection(TextSelection.create(tr.doc, state.doc.content.size, state.doc.content.size));
15
+ return true;
16
+ })
17
+ .createParagraphNear()
18
+ .run();
19
+ }
20
+ return true;
21
+ };
22
+ }
23
+ export { createParagraphEnd };
@@ -1 +1 @@
1
- {"version":3,"file":"extra-editor-commands.d.ts","sourceRoot":"","sources":["../../../../src/extensions/core/extra-editor-commands/extra-editor-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,qBAQvB,CAAA;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"extra-editor-commands.d.ts","sourceRoot":"","sources":["../../../../src/extensions/core/extra-editor-commands/extra-editor-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAMxC;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,qBASvB,CAAA;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { Extension } from '@tiptap/core';
2
+ import { createParagraphEnd } from './commands/create-paragraph-end';
2
3
  import { extendWordRange } from './commands/extend-word-range';
3
4
  import { insertMarkdownContent } from './commands/insert-markdown-content';
4
5
  /**
@@ -10,6 +11,7 @@ const ExtraEditorCommands = Extension.create({
10
11
  name: 'extraEditorCommands',
11
12
  addCommands() {
12
13
  return {
14
+ createParagraphEnd,
13
15
  extendWordRange,
14
16
  insertMarkdownContent,
15
17
  };
@@ -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;AAexC;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,qBA8FjB,CAAA;AAEF,OAAO,EAAE,aAAa,EAAE,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
- const isInsideCodeBlockNode = editor.state.selection.$from.parent.type.name === 'codeBlock';
50
- // Do not handle the paste event if:
51
- // * The clipboard does NOT contain plain-text
52
- // * The clipboard contains HTML but from an unknown source (like Google
53
- // Drive, Dropbox Paper, etc.)
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,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<RichTextLinkOptions, any>;
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;;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"}
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 { PASTE_EXTENSION_PRIORITY } from '../../constants/extension-priorities';
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: PASTE_EXTENSION_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,7 @@
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 { SUGGESTION_EXTENSION_PRIORITY } from './constants/extension-priorities';
3
+ export * from './constants/extension-priorities';
4
+ export * from './extensions/core/extra-editor-commands/commands/create-paragraph-end';
4
5
  export * from './extensions/core/extra-editor-commands/commands/extend-word-range';
5
6
  export * from './extensions/core/extra-editor-commands/commands/insert-markdown-content';
6
7
  export { PlainTextKit } from './extensions/plain-text/plain-text-kit';
@@ -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,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAA;AAChF,cAAc,oEAAoE,CAAA;AAClF,cAAc,0EAA0E,CAAA;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,YAAY,EACR,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,YAAY,EACR,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,GACpB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAA;AACnF,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,EACH,wBAAwB,EACxB,6BAA6B,GAChC,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,YAAY,EAAE,SAAS,EAAE,MAAM,IAAI,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACnG,OAA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,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,6 @@
1
1
  export { TypistEditor } from './components/typist-editor';
2
- export { SUGGESTION_EXTENSION_PRIORITY } from './constants/extension-priorities';
2
+ export * from './constants/extension-priorities';
3
+ export * from './extensions/core/extra-editor-commands/commands/create-paragraph-end';
3
4
  export * from './extensions/core/extra-editor-commands/commands/extend-word-range';
4
5
  export * from './extensions/core/extra-editor-commands/commands/insert-markdown-content';
5
6
  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.11",
4
+ "version": "1.5.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://typist.doist.dev/",
7
7
  "repository": "https://github.com/Doist/typist",
@@ -94,7 +94,7 @@
94
94
  "@storybook/react": "7.4.0",
95
95
  "@storybook/react-vite": "7.4.0",
96
96
  "@testing-library/dom": "9.3.1",
97
- "@testing-library/jest-dom": "6.1.2",
97
+ "@testing-library/jest-dom": "6.1.3",
98
98
  "@testing-library/react": "14.0.0",
99
99
  "@types/lodash-es": "4.17.9",
100
100
  "@types/react": "18.2.21",
@@ -124,7 +124,7 @@
124
124
  "prettier": "3.0.3",
125
125
  "react": "18.2.0",
126
126
  "react-dom": "18.2.0",
127
- "react-icons": "4.10.1",
127
+ "react-icons": "4.11.0",
128
128
  "react-markdown": "8.0.7",
129
129
  "react-syntax-highlighter": "15.5.0",
130
130
  "rimraf": "5.0.1",
@@ -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",