diff --git a/docs/src/demos/Examples/Savvy/SmilieReplacer.ts b/docs/src/demos/Examples/Savvy/SmilieReplacer.ts index a17cb9cb1..35fd8e2ae 100644 --- a/docs/src/demos/Examples/Savvy/SmilieReplacer.ts +++ b/docs/src/demos/Examples/Savvy/SmilieReplacer.ts @@ -6,128 +6,129 @@ export const SmilieReplacer = Extension.create({ addInputRules() { return [ - new InputRule(/-___-/, '๐Ÿ˜‘'), - new InputRule(/:'-\)/, '๐Ÿ˜‚'), - new InputRule(/':-\)/, '๐Ÿ˜…'), - new InputRule(/':-D/, '๐Ÿ˜…'), - new InputRule(/>:-\)/, '๐Ÿ˜†'), - new InputRule(/-__-/, '๐Ÿ˜‘'), - new InputRule(/':-\(/, '๐Ÿ˜“'), - new InputRule(/:'-\(/, '๐Ÿ˜ข'), - new InputRule(/>:-\(/, '๐Ÿ˜ '), - new InputRule(/O:-\)/, '๐Ÿ˜‡'), - new InputRule(/0:-3/, '๐Ÿ˜‡'), - new InputRule(/0:-\)/, '๐Ÿ˜‡'), - new InputRule(/0;\^\)/, '๐Ÿ˜‡'), - new InputRule(/O;-\)/, '๐Ÿ˜‡'), - new InputRule(/0;-\)/, '๐Ÿ˜‡'), - new InputRule(/O:-3/, '๐Ÿ˜‡'), - new InputRule(/:'\)/, '๐Ÿ˜‚'), - new InputRule(/:-D/, '๐Ÿ˜ƒ'), - new InputRule(/':\)/, '๐Ÿ˜…'), - new InputRule(/'=\)/, '๐Ÿ˜…'), - new InputRule(/':D/, '๐Ÿ˜…'), - new InputRule(/'=D/, '๐Ÿ˜…'), - new InputRule(/>:\)/, '๐Ÿ˜†'), - new InputRule(/>;\)/, '๐Ÿ˜†'), - new InputRule(/>=\)/, '๐Ÿ˜†'), - new InputRule(/;-\)/, '๐Ÿ˜‰'), - new InputRule(/\*-\)/, '๐Ÿ˜‰'), - new InputRule(/;-\]/, '๐Ÿ˜‰'), - new InputRule(/;\^\)/, '๐Ÿ˜‰'), - new InputRule(/B-\)/, '๐Ÿ˜Ž'), - new InputRule(/8-\)/, '๐Ÿ˜Ž'), - new InputRule(/B-D/, '๐Ÿ˜Ž'), - new InputRule(/8-D/, '๐Ÿ˜Ž'), - new InputRule(/:-\*/, '๐Ÿ˜˜'), - new InputRule(/:\^\*/, '๐Ÿ˜˜'), - new InputRule(/:-\)/, '๐Ÿ™‚'), - new InputRule(/-_-/, '๐Ÿ˜‘'), - new InputRule(/:-X/, '๐Ÿ˜ถ'), - new InputRule(/:-#/, '๐Ÿ˜ถ'), - new InputRule(/:-x/, '๐Ÿ˜ถ'), - new InputRule(/>.:O/, '๐Ÿ˜ฎ'), - new InputRule(/:-P/, '๐Ÿ˜›'), - new InputRule(/:-p/, '๐Ÿ˜›'), - new InputRule(/:-รž/, '๐Ÿ˜›'), - new InputRule(/:-รพ/, '๐Ÿ˜›'), - new InputRule(/:-b/, '๐Ÿ˜›'), - new InputRule(/>:P/, '๐Ÿ˜œ'), - new InputRule(/X-P/, '๐Ÿ˜œ'), - new InputRule(/x-p/, '๐Ÿ˜œ'), - new InputRule(/':\(/, '๐Ÿ˜“'), - new InputRule(/'=\(/, '๐Ÿ˜“'), - new InputRule(/>:\\/, '๐Ÿ˜•'), - new InputRule(/>:\//, '๐Ÿ˜•'), - new InputRule(/:-\//, '๐Ÿ˜•'), - new InputRule(/:-./, '๐Ÿ˜•'), - new InputRule(/>:\[/, '๐Ÿ˜ž'), - new InputRule(/:-\(/, '๐Ÿ˜ž'), - new InputRule(/:-\[/, '๐Ÿ˜ž'), - new InputRule(/:'\(/, '๐Ÿ˜ข'), - new InputRule(/;-\(/, '๐Ÿ˜ข'), - new InputRule(/#-\)/, '๐Ÿ˜ต'), - new InputRule(/%-\)/, '๐Ÿ˜ต'), - new InputRule(/X-\)/, '๐Ÿ˜ต'), - new InputRule(/>:\(/, '๐Ÿ˜ '), - new InputRule(/0:3/, '๐Ÿ˜‡'), - new InputRule(/0:\)/, '๐Ÿ˜‡'), - new InputRule(/O:\)/, '๐Ÿ˜‡'), - new InputRule(/O=\)/, '๐Ÿ˜‡'), - new InputRule(/O:3/, '๐Ÿ˜‡'), - new InputRule(/<\/3/, '๐Ÿ’”'), - new InputRule(/:D/, '๐Ÿ˜ƒ'), - new InputRule(/=D/, '๐Ÿ˜ƒ'), - new InputRule(/;\)/, '๐Ÿ˜‰'), - new InputRule(/\*\)/, '๐Ÿ˜‰'), - new InputRule(/;\]/, '๐Ÿ˜‰'), - new InputRule(/;D/, '๐Ÿ˜‰'), - new InputRule(/B\)/, '๐Ÿ˜Ž'), - new InputRule(/8\)/, '๐Ÿ˜Ž'), - new InputRule(/:\*/, '๐Ÿ˜˜'), - new InputRule(/=\*/, '๐Ÿ˜˜'), - new InputRule(/:\)/, '๐Ÿ™‚'), - new InputRule(/=\]/, '๐Ÿ™‚'), - new InputRule(/=\)/, '๐Ÿ™‚'), - new InputRule(/:\]/, '๐Ÿ™‚'), - new InputRule(/:X/, '๐Ÿ˜ถ'), - new InputRule(/:#/, '๐Ÿ˜ถ'), - new InputRule(/=X/, '๐Ÿ˜ถ'), - new InputRule(/=x/, '๐Ÿ˜ถ'), - new InputRule(/:x/, '๐Ÿ˜ถ'), - new InputRule(/=#/, '๐Ÿ˜ถ'), - new InputRule(/:O/, '๐Ÿ˜ฎ'), - new InputRule(/:o/, '๐Ÿ˜ฎ'), - new InputRule(/:P/, '๐Ÿ˜›'), - new InputRule(/=P/, '๐Ÿ˜›'), - new InputRule(/:p/, '๐Ÿ˜›'), - new InputRule(/=p/, '๐Ÿ˜›'), - new InputRule(/:รž/, '๐Ÿ˜›'), - new InputRule(/:รพ/, '๐Ÿ˜›'), - new InputRule(/:b/, '๐Ÿ˜›'), - new InputRule(/d:/, '๐Ÿ˜›'), - new InputRule(/:\//, '๐Ÿ˜•'), - new InputRule(/:\\/, '๐Ÿ˜•'), - new InputRule(/=\//, '๐Ÿ˜•'), - new InputRule(/=\\/, '๐Ÿ˜•'), - new InputRule(/:L/, '๐Ÿ˜•'), - new InputRule(/=L/, '๐Ÿ˜•'), - new InputRule(/:\(/, '๐Ÿ˜ž'), - new InputRule(/:\[/, '๐Ÿ˜ž'), - new InputRule(/=\(/, '๐Ÿ˜ž'), - new InputRule(/;\(/, '๐Ÿ˜ข'), - new InputRule(/D:/, '๐Ÿ˜จ'), - new InputRule(/:\$/, '๐Ÿ˜ณ'), - new InputRule(/=\$/, '๐Ÿ˜ณ'), - new InputRule(/#\)/, '๐Ÿ˜ต'), - new InputRule(/%\)/, '๐Ÿ˜ต'), - new InputRule(/X\)/, '๐Ÿ˜ต'), - new InputRule(/:@/, '๐Ÿ˜ '), - new InputRule(/<3/, 'โค๏ธ'), + new InputRule(/-___- /, '๐Ÿ˜‘ '), + new InputRule(/:'-\) /, '๐Ÿ˜‚ '), + new InputRule(/':-\) /, '๐Ÿ˜… '), + new InputRule(/':-D /, '๐Ÿ˜… '), + new InputRule(/>:-\) /, '๐Ÿ˜† '), + new InputRule(/-__- /, '๐Ÿ˜‘ '), + new InputRule(/':-\( /, '๐Ÿ˜“ '), + new InputRule(/:'-\( /, '๐Ÿ˜ข '), + new InputRule(/>:-\( /, '๐Ÿ˜  '), + new InputRule(/O:-\) /, '๐Ÿ˜‡ '), + new InputRule(/0:-3 /, '๐Ÿ˜‡ '), + new InputRule(/0:-\) /, '๐Ÿ˜‡ '), + new InputRule(/0;\^\) /, '๐Ÿ˜‡ '), + new InputRule(/O;-\) /, '๐Ÿ˜‡ '), + new InputRule(/0;-\) /, '๐Ÿ˜‡ '), + new InputRule(/O:-3 /, '๐Ÿ˜‡ '), + new InputRule(/:'\) /, '๐Ÿ˜‚ '), + new InputRule(/:-D /, '๐Ÿ˜ƒ '), + new InputRule(/':\) /, '๐Ÿ˜… '), + new InputRule(/'=\) /, '๐Ÿ˜… '), + new InputRule(/':D /, '๐Ÿ˜… '), + new InputRule(/'=D /, '๐Ÿ˜… '), + new InputRule(/>:\) /, '๐Ÿ˜† '), + new InputRule(/>;\) /, '๐Ÿ˜† '), + new InputRule(/>=\) /, '๐Ÿ˜† '), + new InputRule(/;-\) /, '๐Ÿ˜‰ '), + new InputRule(/\*-\) /, '๐Ÿ˜‰ '), + new InputRule(/;-\] /, '๐Ÿ˜‰ '), + new InputRule(/;\^\) /, '๐Ÿ˜‰ '), + new InputRule(/B-\) /, '๐Ÿ˜Ž '), + new InputRule(/8-\) /, '๐Ÿ˜Ž '), + new InputRule(/B-D /, '๐Ÿ˜Ž '), + new InputRule(/8-D /, '๐Ÿ˜Ž '), + new InputRule(/:-\* /, '๐Ÿ˜˜ '), + new InputRule(/:\^\* /, '๐Ÿ˜˜ '), + new InputRule(/:-\) /, '๐Ÿ™‚ '), + new InputRule(/-_- /, '๐Ÿ˜‘ '), + new InputRule(/:-X /, '๐Ÿ˜ถ '), + new InputRule(/:-# /, '๐Ÿ˜ถ '), + new InputRule(/:-x /, '๐Ÿ˜ถ '), + new InputRule(/>.< /, '๐Ÿ˜ฃ '), + new InputRule(/:-O /, '๐Ÿ˜ฎ '), + new InputRule(/:-o /, '๐Ÿ˜ฎ '), + new InputRule(/O_O /, '๐Ÿ˜ฎ '), + new InputRule(/>:O /, '๐Ÿ˜ฎ '), + new InputRule(/:-P /, '๐Ÿ˜› '), + new InputRule(/:-p /, '๐Ÿ˜› '), + new InputRule(/:-รž /, '๐Ÿ˜› '), + new InputRule(/:-รพ /, '๐Ÿ˜› '), + new InputRule(/:-b /, '๐Ÿ˜› '), + new InputRule(/>:P /, '๐Ÿ˜œ '), + new InputRule(/X-P /, '๐Ÿ˜œ '), + new InputRule(/x-p /, '๐Ÿ˜œ '), + new InputRule(/':\( /, '๐Ÿ˜“ '), + new InputRule(/'=\( /, '๐Ÿ˜“ '), + new InputRule(/>:\\ /, '๐Ÿ˜• '), + new InputRule(/>:\/ /, '๐Ÿ˜• '), + new InputRule(/:-\/ /, '๐Ÿ˜• '), + new InputRule(/:-. /, '๐Ÿ˜• '), + new InputRule(/>:\[ /, '๐Ÿ˜ž '), + new InputRule(/:-\( /, '๐Ÿ˜ž '), + new InputRule(/:-\[ /, '๐Ÿ˜ž '), + new InputRule(/:'\( /, '๐Ÿ˜ข '), + new InputRule(/;-\( /, '๐Ÿ˜ข '), + new InputRule(/#-\) /, '๐Ÿ˜ต '), + new InputRule(/%-\) /, '๐Ÿ˜ต '), + new InputRule(/X-\) /, '๐Ÿ˜ต '), + new InputRule(/>:\( /, '๐Ÿ˜  '), + new InputRule(/0:3 /, '๐Ÿ˜‡ '), + new InputRule(/0:\) /, '๐Ÿ˜‡ '), + new InputRule(/O:\) /, '๐Ÿ˜‡ '), + new InputRule(/O=\) /, '๐Ÿ˜‡ '), + new InputRule(/O:3 /, '๐Ÿ˜‡ '), + new InputRule(/<\/3 /, '๐Ÿ’” '), + new InputRule(/:D /, '๐Ÿ˜ƒ '), + new InputRule(/=D /, '๐Ÿ˜ƒ '), + new InputRule(/;\) /, '๐Ÿ˜‰ '), + new InputRule(/\*\) /, '๐Ÿ˜‰ '), + new InputRule(/;\] /, '๐Ÿ˜‰ '), + new InputRule(/;D /, '๐Ÿ˜‰ '), + new InputRule(/B\) /, '๐Ÿ˜Ž '), + new InputRule(/8\) /, '๐Ÿ˜Ž '), + new InputRule(/:\* /, '๐Ÿ˜˜ '), + new InputRule(/=\* /, '๐Ÿ˜˜ '), + new InputRule(/:\) /, '๐Ÿ™‚ '), + new InputRule(/=\] /, '๐Ÿ™‚ '), + new InputRule(/=\) /, '๐Ÿ™‚ '), + new InputRule(/:\] /, '๐Ÿ™‚ '), + new InputRule(/:X /, '๐Ÿ˜ถ '), + new InputRule(/:# /, '๐Ÿ˜ถ '), + new InputRule(/=X /, '๐Ÿ˜ถ '), + new InputRule(/=x /, '๐Ÿ˜ถ '), + new InputRule(/:x /, '๐Ÿ˜ถ '), + new InputRule(/=# /, '๐Ÿ˜ถ '), + new InputRule(/:O /, '๐Ÿ˜ฎ '), + new InputRule(/:o /, '๐Ÿ˜ฎ '), + new InputRule(/:P /, '๐Ÿ˜› '), + new InputRule(/=P /, '๐Ÿ˜› '), + new InputRule(/:p /, '๐Ÿ˜› '), + new InputRule(/=p /, '๐Ÿ˜› '), + new InputRule(/:รž /, '๐Ÿ˜› '), + new InputRule(/:รพ /, '๐Ÿ˜› '), + new InputRule(/:b /, '๐Ÿ˜› '), + new InputRule(/d: /, '๐Ÿ˜› '), + new InputRule(/:\/ /, '๐Ÿ˜• '), + new InputRule(/:\\ /, '๐Ÿ˜• '), + new InputRule(/=\/ /, '๐Ÿ˜• '), + new InputRule(/=\\ /, '๐Ÿ˜• '), + new InputRule(/:L /, '๐Ÿ˜• '), + new InputRule(/=L /, '๐Ÿ˜• '), + new InputRule(/:\( /, '๐Ÿ˜ž '), + new InputRule(/:\[ /, '๐Ÿ˜ž '), + new InputRule(/=\( /, '๐Ÿ˜ž '), + new InputRule(/;\( /, '๐Ÿ˜ข '), + new InputRule(/D: /, '๐Ÿ˜จ '), + new InputRule(/:\$ /, '๐Ÿ˜ณ '), + new InputRule(/=\$ /, '๐Ÿ˜ณ '), + new InputRule(/#\) /, '๐Ÿ˜ต '), + new InputRule(/%\) /, '๐Ÿ˜ต '), + new InputRule(/X\) /, '๐Ÿ˜ต '), + new InputRule(/:@ /, '๐Ÿ˜  '), + new InputRule(/<3 /, 'โค๏ธ '), + new InputRule(/\/shrug/, 'ยฏ\\_(ใƒ„)_/ยฏ'), ] }, }) diff --git a/docs/src/demos/Examples/Tasks/index.vue b/docs/src/demos/Examples/Tasks/index.vue index dad4df4e0..d7ca5c0b4 100644 --- a/docs/src/demos/Examples/Tasks/index.vue +++ b/docs/src/demos/Examples/Tasks/index.vue @@ -17,7 +17,7 @@ const CustomDocument = Document.extend({ }) const CustomTaskItem = TaskItem.extend({ - content: 'text*', + content: 'inline*', }) export default { diff --git a/docs/src/docPages/advanced-example.md b/docs/src/docPages/advanced-example.md deleted file mode 100644 index b5bffef8c..000000000 --- a/docs/src/docPages/advanced-example.md +++ /dev/null @@ -1,5 +0,0 @@ -# Advanced Example - -Use a custom list of extensions. - - \ No newline at end of file diff --git a/docs/src/docPages/api/editor.md b/docs/src/docPages/api/editor.md index ef527329b..55b55b169 100644 --- a/docs/src/docPages/api/editor.md +++ b/docs/src/docPages/api/editor.md @@ -182,6 +182,8 @@ new Editor({ }) ``` +You can use that to hook into event handlers and pass - for example - a custom paste handler, too. + ### Parse options Passed content is parsed by ProseMirror. To hook into the parsing, you can pass `parseOptions` which are then handled by [ProseMirror](https://prosemirror.net/docs/ref/#model.ParseOptions). diff --git a/docs/src/docPages/api/concept.md b/docs/src/docPages/api/introduction.md similarity index 78% rename from docs/src/docPages/api/concept.md rename to docs/src/docPages/api/introduction.md index d1ba2d09f..081376481 100644 --- a/docs/src/docPages/api/concept.md +++ b/docs/src/docPages/api/introduction.md @@ -1,4 +1,4 @@ -# Concept +# Introduction tiptap is a friendly wrapper around [ProseMirror](https://ProseMirror.net). Although tiptap tries to hide most of the complexity of ProseMirror, itโ€™s built on top of its APIs and we recommend you to read through the [ProseMirror Guide](https://ProseMirror.net/docs/guide/) for advanced usage. ### Structure @@ -13,14 +13,15 @@ Extensions add [nodes](/api/nodes), [marks](/api/marks) and/or [functionalities] ## Vocabulary ProseMirror has its own vocabulary and youโ€™ll stumble upon all those words now and then. Here is a short overview of the most common words we use in the documentation. -| Word | Description | -| ----------- | --------------------------------------------------------------------------------- | -| Schema | Configures the structure your content can have. | -| Document | The actual content in your editor. | -| State | Everything to describe the current content and selection of your editor. | -| Transaction | A change to the state (updated selection, content, โ€ฆ) | -| Extension | Registeres new functionality. | -| Node | Nodes are a type of content, for example a heading or a paragraph. | -| Mark | One or multiple marks can be applied to nodes, for example for inline formatting. | -| Command | Execute an action inside the editor, that somehow changes the state. | -| Decoration | Styling on top of the document, for example to highlight mistakes. | +| Word | Description | +| ----------- | ------------------------------------------------------------------------ | +| Schema | Configures the structure your content can have. | +| Document | The actual content in your editor. | +| State | Everything to describe the current content and selection of your editor. | +| Transaction | A change to the state (updated selection, content, โ€ฆ) | +| Extension | Registeres new functionality. | +| Node | A type of content, for example a heading or a paragraph. | +| Mark | Can be applied to nodes, for example for inline formatting. | +| Command | Execute an action inside the editor, that somehow changes the state. | +| Decoration | Styling on top of the document, for example to highlight mistakes. | + diff --git a/docs/src/docPages/api/nodes/emoji.md b/docs/src/docPages/api/nodes/emoji.md index 730b5ac86..60d84fee0 100644 --- a/docs/src/docPages/api/nodes/emoji.md +++ b/docs/src/docPages/api/nodes/emoji.md @@ -6,7 +6,7 @@ There is no extension or example yet, but itโ€™s definitely on our list to build If you want to give it a shot yourself, you could start altering the [`Mention`](/api/nodes/mention) node. This uses the [`Suggestion`](/api/utilities/suggestion) utility, which should help with an autocomplete and such things. :::pro Fund the development โ™ฅ -We need your support to maintain, update, support and develop tiptap 2. If youโ€™re waiting for this extension, [become a sponsor and fund our work](/sponsor). +We need your support to maintain, update, support and develop tiptap. If youโ€™re waiting for this extension, [become a sponsor and fund our work](/sponsor). ::: ## Bring your own emoji picker diff --git a/docs/src/docPages/api/nodes/hashtag.md b/docs/src/docPages/api/nodes/hashtag.md index 6099f0601..3cb264a1b 100644 --- a/docs/src/docPages/api/nodes/hashtag.md +++ b/docs/src/docPages/api/nodes/hashtag.md @@ -1,7 +1,7 @@ # Hashtag :::pro Fund the development โ™ฅ -We need your support to maintain, update, support and develop tiptap 2. If youโ€™re waiting for this extension, [become a sponsor and fund our work](/sponsor). +We need your support to maintain, update, support and develop tiptap. If youโ€™re waiting for this extension, [become a sponsor and fund our work](/sponsor). ::: TODO diff --git a/docs/src/docPages/api/nodes/mention.md b/docs/src/docPages/api/nodes/mention.md index 4682b87aa..2cd90517f 100644 --- a/docs/src/docPages/api/nodes/mention.md +++ b/docs/src/docPages/api/nodes/mention.md @@ -39,7 +39,7 @@ yarn add @tiptap/vue-2 And yes, we plan to support React, too. Meanwhile, you can roll your own `ReactRenderer`, but donโ€™t forget to share it with the community. -Itโ€™s also possible to use plain JavaScript, but that is probably a lot more work. +Itโ€™s also possible to use Vanilla JavaScript, but that is probably a lot more work. ## Settings | Option | Type | Default | Description | diff --git a/docs/src/docPages/api/nodes/task-item.md b/docs/src/docPages/api/nodes/task-item.md index 223f33c1f..dd091df77 100644 --- a/docs/src/docPages/api/nodes/task-item.md +++ b/docs/src/docPages/api/nodes/task-item.md @@ -4,7 +4,7 @@ This extension renders a task item list element, which is a `
  • ` tag with a `data-type` attribute set to `taskItem`. It also renders a checkbox inside the list element, which updates a `checked` attribute. -This extension doesnโ€™t require any JavaScript framework, itโ€™s based on plain JavaScript. +This extension doesnโ€™t require any JavaScript framework, itโ€™s based on Vanilla JavaScript. ## Installation ```bash diff --git a/docs/src/docPages/api/nodes/task-list.md b/docs/src/docPages/api/nodes/task-list.md index d59e8a494..519183169 100644 --- a/docs/src/docPages/api/nodes/task-list.md +++ b/docs/src/docPages/api/nodes/task-list.md @@ -2,7 +2,7 @@ [![Version](https://img.shields.io/npm/v/@tiptap/extension-task-list.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-task-list) [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-task-list.svg)](https://npmcharts.com/compare/@tiptap/extension-task-list?minimal=true) -This extension enables you to use task lists in the editor. They are rendered as `