From 2019eb6e207bce32b8d3f3c7b9cd91593648befe Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Sat, 10 Jul 2021 23:04:05 +0200 Subject: [PATCH] docs: clean up experiments, add some notes here and there --- .../src/demos/Experiments/WordBreak/index.vue | 69 ------------------ .../demos/Experiments/WordBreak/word-break.ts | 71 ------------------- docs/src/docPages/experiments.md | 13 ++-- docs/src/docPages/experiments/commands.md | 3 + docs/src/docPages/experiments/details.md | 3 + docs/src/docPages/experiments/embeds.md | 3 + docs/src/docPages/experiments/figure.md | 7 +- .../experiments/global-drag-handle.md | 3 + docs/src/docPages/experiments/linter.md | 3 + .../src/docPages/experiments/trailing-node.md | 3 + docs/src/docPages/experiments/word-break.md | 5 -- 11 files changed, 28 insertions(+), 155 deletions(-) delete mode 100644 docs/src/demos/Experiments/WordBreak/index.vue delete mode 100644 docs/src/demos/Experiments/WordBreak/word-break.ts delete mode 100644 docs/src/docPages/experiments/word-break.md diff --git a/docs/src/demos/Experiments/WordBreak/index.vue b/docs/src/demos/Experiments/WordBreak/index.vue deleted file mode 100644 index 9da901c4..00000000 --- a/docs/src/demos/Experiments/WordBreak/index.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/docs/src/demos/Experiments/WordBreak/word-break.ts b/docs/src/demos/Experiments/WordBreak/word-break.ts deleted file mode 100644 index 29b858e3..00000000 --- a/docs/src/demos/Experiments/WordBreak/word-break.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Node, mergeAttributes } from '@tiptap/core' -import { exitCode } from 'prosemirror-commands' - -export interface WordBreakOptions { - HTMLAttributes: { - [key: string]: any - }, -} - -declare module '@tiptap/core' { - interface Commands { - wordBreak: { - /** - * Add a hard break - */ - setWordBreak: () => ReturnType, - } - } -} - -export const WordBreak = Node.create({ - name: 'wordBreak', - - defaultOptions: { - HTMLAttributes: {}, - }, - - inline: true, - - group: 'inline', - - selectable: false, - - parseHTML() { - return [ - { tag: 'wbr' }, - ] - }, - - renderHTML({ HTMLAttributes }) { - return ['wbr', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)] - }, - - addCommands() { - return { - setWordBreak: () => ({ commands, state, dispatch }) => { - return commands.first([ - () => exitCode(state, dispatch), - () => { - if (dispatch) { - state.tr.replaceSelectionWith(this.type.create()).scrollIntoView() - } - - return true - }, - ]) - }, - } - }, - - addNodeView() { - return () => { - const dom = document.createElement('span') - dom.classList.add('word-break') - - return { - dom, - } - } - }, -}) diff --git a/docs/src/docPages/experiments.md b/docs/src/docPages/experiments.md index c86656de..c346b3ac 100644 --- a/docs/src/docPages/experiments.md +++ b/docs/src/docPages/experiments.md @@ -1,14 +1,15 @@ # Experiments Congratulations! You’ve found our playground with a list of experiments. Be aware that nothing here is ready to use. Feel free to play around, but please, don’t open an issue for a bug you’ve found here or send pull requests. :-) -## New +## Experimental examples * [Linter](/experiments/linter) -* [Multiple editors](/experiments/multiple-editors) +* [Content of multiple editors in a single Y.js](/experiments/multiple-editors) * [Global drag handle](/experiments/global-drag-handle) -* [@tiptap/extension-slash-command?](/experiments/commands) -* [@tiptap/extension-iframe?](/experiments/embeds) -* [@tiptap/extension-toggle-list?](/experiments/details) + +## Experimental extensions +* [@tiptap/extension-command-menu](/experiments/commands) +* [@tiptap/extension-iframe](/experiments/embeds) +* [@tiptap/extension-toggle-list](/experiments/details) * [@tiptap/extension-collaboration-annotation](/experiments/collaboration-annotation) -* [@tiptap/extension-word-break](/experiments/word-break) * [@tiptap/extension-trailing-node](/experiments/trailing-node) * [@tiptap/extension-figure](/experiments/figure) diff --git a/docs/src/docPages/experiments/commands.md b/docs/src/docPages/experiments/commands.md index f59d82ac..1fd071db 100644 --- a/docs/src/docPages/experiments/commands.md +++ b/docs/src/docPages/experiments/commands.md @@ -2,4 +2,7 @@ ⚠️ Experiment +## Issues +* It’s fine to use, just don’t send bug reports, PRs or anything else. We’ll just need some time to publish that as an official extension. + diff --git a/docs/src/docPages/experiments/details.md b/docs/src/docPages/experiments/details.md index d0edff0a..510f9219 100644 --- a/docs/src/docPages/experiments/details.md +++ b/docs/src/docPages/experiments/details.md @@ -2,4 +2,7 @@ ⚠️ Experiment +## Issues +* Nested lists cause trouble + diff --git a/docs/src/docPages/experiments/embeds.md b/docs/src/docPages/experiments/embeds.md index 1a55baea..ae00da76 100644 --- a/docs/src/docPages/experiments/embeds.md +++ b/docs/src/docPages/experiments/embeds.md @@ -2,4 +2,7 @@ ⚠️ Experiment +## Issues +* Oh man, building a really good iframe/embed extension will take some time. The best thing to speed up the development is to [sponsor our work](/sponsor) on GitHub. + diff --git a/docs/src/docPages/experiments/figure.md b/docs/src/docPages/experiments/figure.md index 8f6576c2..ef1309c5 100644 --- a/docs/src/docPages/experiments/figure.md +++ b/docs/src/docPages/experiments/figure.md @@ -2,12 +2,11 @@ ⚠️ Experiment -## Tasks -* Build commands to wrap an image into a figure + figcaption? -* Build commands to unrwap figure + figcaption to an image? - ## Related links * https://github.com/ueberdosis/tiptap/issues/573#issuecomment-730122427 * https://discuss.prosemirror.net/t/figure-and-editable-caption/462/5 +## Issues +* The current implementation works with images only. + diff --git a/docs/src/docPages/experiments/global-drag-handle.md b/docs/src/docPages/experiments/global-drag-handle.md index 505ee962..7fe24668 100644 --- a/docs/src/docPages/experiments/global-drag-handle.md +++ b/docs/src/docPages/experiments/global-drag-handle.md @@ -2,4 +2,7 @@ ⚠️ Experiment +## Issues +* We’re working on a better, more solid implementation. :) Give us some more time, and please, don’t ask when it’s ready. The best thing to speed up the development is to [sponsor our work](/sponsor) on GitHub. + diff --git a/docs/src/docPages/experiments/linter.md b/docs/src/docPages/experiments/linter.md index e85aa7de..8335903a 100644 --- a/docs/src/docPages/experiments/linter.md +++ b/docs/src/docPages/experiments/linter.md @@ -2,4 +2,7 @@ ⚠️ Experiment +## Issues +* There is no decoration API in tiptap, that’s why this is a lot of ProseMirror work. Before we’ll publish that example, we’d need to find a few ways to make it more tiptap-like. For example, it would be great to use Vue/React components for the widget. + diff --git a/docs/src/docPages/experiments/trailing-node.md b/docs/src/docPages/experiments/trailing-node.md index 36c25ea5..06970b5c 100644 --- a/docs/src/docPages/experiments/trailing-node.md +++ b/docs/src/docPages/experiments/trailing-node.md @@ -2,4 +2,7 @@ ⚠️ Experiment +## Issues +* This implementation adds an actual node. It’d be great to use a decoration for that use case, so the document isn’t modified. + diff --git a/docs/src/docPages/experiments/word-break.md b/docs/src/docPages/experiments/word-break.md deleted file mode 100644 index 2f8909ca..00000000 --- a/docs/src/docPages/experiments/word-break.md +++ /dev/null @@ -1,5 +0,0 @@ -# Word break - -⚠️ Experiment - -