From a74453f96ca89787448ce7ac259461214cba168d Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 5 Nov 2020 21:25:03 +0100 Subject: [PATCH 1/3] add missing comman descriptions --- docs/src/docPages/api/commands.md | 50 ++++++++++++++----------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/docs/src/docPages/api/commands.md b/docs/src/docPages/api/commands.md index 83d495ad..d375dff9 100644 --- a/docs/src/docPages/api/commands.md +++ b/docs/src/docPages/api/commands.md @@ -69,33 +69,29 @@ commands.try([ Have a look at all of the core commands listed below. They should give you a good first impression of what’s possible. ### Content -| Command | Description | -| ---------------- | ----------------------------------------------------------- | -| .clearContent() | Clear the whole document. | -| .insertgetHTML() | Insert a string of HTML at the currently selected position. | -| .insertText() | Insert a string of text at the currently selected position. | -| .insertHTML() | | -| .setContent() | Replace the whole document with new content. | +| Command | Description | +| --------------- | ------------------------------------------------ | +| .clearContent() | Clear the whole document. | +| .insertHTML() | Insert a string of HTML at the current position. | +| .insertText() | Insert a string of text at the current position. | +| .setContent() | Replace the whole document with new content. | ### Nodes & Marks -| Command | Description | -| ---------------------- | ------------------------------------------ | -| .clearNodes() | | -| .removeMark() | | -| .removeMark() | Remove a mark in the current selection. | -| .removeMarks() | | -| .removeMarks() | Remove all marks in the current selection. | -| .resetNodeAttributes() | | -| .selectParentNode() | Select the parent node. | -| .setBlockType() | Replace a given range with a node. | -| .setNodeAttributes() | | -| .splitBlock() | Forks a new node from an existing node. | -| .toggleBlockType() | Toggle a node with another node. | -| .toggleMark() | | -| .toggleMark() | Toggle a mark on and off. | -| .toggleWrap() | | -| .updateMark() | | -| .updateMark() | Update a mark with new attributes. | +| Command | Description | +| ---------------------- | --------------------------------------------------------- | +| .clearNodes() | Normalize nodes to a simple paragraph. | +| .removeMark() | Remove a mark in the current selection. | +| .removeMarks() | Remove all marks in the current selection. | +| .removeMarks() | Remove all marks in the current selection. | +| .resetNodeAttributes() | Resets all node attributes to the default value. | +| .selectParentNode() | Select the parent node. | +| .setBlockType() | Replace a given range with a node. | +| .setNodeAttributes() | Update attributes of a node. | +| .splitBlock() | Forks a new node from an existing node. | +| .toggleBlockType() | Toggle a node with another node. | +| .toggleMark() | Toggle a mark on and off. | +| .toggleWrap() | Wraps nodes in another node, or removes an existing wrap. | +| .updateMark() | Update a mark with new attributes. | ### Lists | Command | Description | @@ -103,8 +99,8 @@ Have a look at all of the core commands listed below. They should give you a goo | .liftListItem() | Lift the list item into a wrapping list. | | .sinkListItem() | Sink the list item down into an inner list. | | .splitListItem() | Splits a textblock of a list item into two list items. | -| .toggleList() | Toggle between different list styles. | -| .wrapInList() | | +| .toggleList() | Toggle between different list types. | +| .wrapInList() | Wrap a node in a list. | ### Selection | Command | Description | From 810f3d6b6dc33f288ce77d86e870a62e0e8f4ce5 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 5 Nov 2020 21:39:08 +0100 Subject: [PATCH 2/3] add content to the dropcursor page --- .../demos/Extensions/Dropcursor/index.spec.js | 5 ++ .../src/demos/Extensions/Dropcursor/index.vue | 46 +++++++++++++++++++ docs/src/demos/Extensions/Gapcursor/index.vue | 32 ------------- .../src/docPages/api/extensions/dropcursor.md | 12 ++--- docs/src/links.yaml | 1 - 5 files changed, 54 insertions(+), 42 deletions(-) create mode 100644 docs/src/demos/Extensions/Dropcursor/index.spec.js create mode 100644 docs/src/demos/Extensions/Dropcursor/index.vue diff --git a/docs/src/demos/Extensions/Dropcursor/index.spec.js b/docs/src/demos/Extensions/Dropcursor/index.spec.js new file mode 100644 index 00000000..4b9ff4ee --- /dev/null +++ b/docs/src/demos/Extensions/Dropcursor/index.spec.js @@ -0,0 +1,5 @@ +context('/examples/dropcursor', () => { + before(() => { + cy.visit('/examples/dropcursor') + }) +}) diff --git a/docs/src/demos/Extensions/Dropcursor/index.vue b/docs/src/demos/Extensions/Dropcursor/index.vue new file mode 100644 index 00000000..613f754d --- /dev/null +++ b/docs/src/demos/Extensions/Dropcursor/index.vue @@ -0,0 +1,46 @@ + + + diff --git a/docs/src/demos/Extensions/Gapcursor/index.vue b/docs/src/demos/Extensions/Gapcursor/index.vue index 11d5bc99..ce5a475d 100644 --- a/docs/src/demos/Extensions/Gapcursor/index.vue +++ b/docs/src/demos/Extensions/Gapcursor/index.vue @@ -44,35 +44,3 @@ export default { }, } - - diff --git a/docs/src/docPages/api/extensions/dropcursor.md b/docs/src/docPages/api/extensions/dropcursor.md index 8759a51c..7ed60c6d 100644 --- a/docs/src/docPages/api/extensions/dropcursor.md +++ b/docs/src/docPages/api/extensions/dropcursor.md @@ -1,4 +1,7 @@ # Dropcursor +This extension loads the [ProseMirror Gapcursor plugin](https://github.com/ProseMirror/prosemirror-gapcursor) by Marijn Haverbeke, which adds a gap for the cursor in places that don’t allow regular selection. For example, after a table at the end of a document. + +Note that tiptap is renderless, but the dropcursor needs CSS for its appearance. The default CSS is added to the usage example below. ## Installation ```bash @@ -9,15 +12,6 @@ npm install @tiptap/extension-dropcursor yarn add @tiptap/extension-dropcursor ``` -## Settings -*None* - -## Commands -*None* - -## Keyboard shortcuts -*None* - ## Source code [packages/extension-dropcursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-dropcursor/) diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 00bdd456..5f63280a 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -167,7 +167,6 @@ premium: true - title: Dropcursor link: /api/extensions/dropcursor - draft: true - title: Focus link: /api/extensions/focus draft: true From f946954e916bf93804d902d67d81104f2c95de75 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 5 Nov 2020 21:57:25 +0100 Subject: [PATCH 3/3] add content to the collaboration cursor extension --- .../Extensions/CollaborationCursor/index.spec.js | 4 ++-- docs/src/demos/Extensions/Focus/index.spec.js | 4 ++-- .../docPages/api/extensions/collaboration-cursor.md | 13 ++++++++++--- docs/src/docPages/api/extensions/collaboration.md | 6 +++--- docs/src/docPages/api/extensions/dropcursor.md | 4 ++-- docs/src/docPages/api/extensions/focus.md | 3 +++ docs/src/docPages/examples/collaborative-editing.md | 4 ++-- docs/src/links.yaml | 3 --- 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/docs/src/demos/Extensions/CollaborationCursor/index.spec.js b/docs/src/demos/Extensions/CollaborationCursor/index.spec.js index cb36824e..77c2a808 100644 --- a/docs/src/demos/Extensions/CollaborationCursor/index.spec.js +++ b/docs/src/demos/Extensions/CollaborationCursor/index.spec.js @@ -1,5 +1,5 @@ -context('/api/extensions/collaboration', () => { +context('/api/extensions/collaboration-cursor', () => { before(() => { - cy.visit('/api/extensions/collaboration') + cy.visit('/api/extensions/collaboration-cursor') }) }) diff --git a/docs/src/demos/Extensions/Focus/index.spec.js b/docs/src/demos/Extensions/Focus/index.spec.js index 029eb69e..ba1f4ce3 100644 --- a/docs/src/demos/Extensions/Focus/index.spec.js +++ b/docs/src/demos/Extensions/Focus/index.spec.js @@ -1,6 +1,6 @@ -context('/examples/focus', () => { +context('/api/extensions/focus', () => { before(() => { - cy.visit('/examples/focus') + cy.visit('/api/extensions/focus') }) it('should have class', () => { diff --git a/docs/src/docPages/api/extensions/collaboration-cursor.md b/docs/src/docPages/api/extensions/collaboration-cursor.md index 8987916d..52ae2f11 100644 --- a/docs/src/docPages/api/extensions/collaboration-cursor.md +++ b/docs/src/docPages/api/extensions/collaboration-cursor.md @@ -1,7 +1,14 @@ # Collaboration Cursor +This extension adds information about all connected users (like their name and a specified color), their current cursor position and their text selection (if there’s one). -:::premium Premium Extension -Using this in production requires a **tiptap pro** license. [Read more](/sponsor) +Open this page in multiple browser windows to test it. + +:::premium 💖 Pro Extension +We kindly ask you to sponsor us, before using this extension in production. [Read more](/sponsor) +::: + +::: warning Use with Collaboration +This extension requires the [`Collaboration`](/api/extensions/collaboration) extension. ::: ## Installation @@ -31,4 +38,4 @@ yarn add @tiptap/extension-collaboration-cursor :::warning Public The content of this editor is shared with other users. ::: - + diff --git a/docs/src/docPages/api/extensions/collaboration.md b/docs/src/docPages/api/extensions/collaboration.md index 1815948b..0957ca1f 100644 --- a/docs/src/docPages/api/extensions/collaboration.md +++ b/docs/src/docPages/api/extensions/collaboration.md @@ -1,8 +1,8 @@ # Collaboration The Collaboration extension enables you to collaborate with others on one document. The implementation is based on [Y.js by Kevin Jahns](https://github.com/yjs/yjs), which is the coolest thing to [integrate collaborative editing](/guide/collaborative-editing) in your project. -:::premium Premium Extension -Using this in production requires a **tiptap pro** license. [Read more](/sponsor) +:::premium Pro Extension +We kindly ask you to sponsor us, before using this extension in production. [Read more](/sponsor) ::: ## Installation @@ -33,4 +33,4 @@ yarn add @tiptap/extension-collaboration yjs y-webrtc :::warning Public The content of this editor is shared with other users. ::: - + diff --git a/docs/src/docPages/api/extensions/dropcursor.md b/docs/src/docPages/api/extensions/dropcursor.md index 7ed60c6d..b2efb7d6 100644 --- a/docs/src/docPages/api/extensions/dropcursor.md +++ b/docs/src/docPages/api/extensions/dropcursor.md @@ -1,5 +1,5 @@ # Dropcursor -This extension loads the [ProseMirror Gapcursor plugin](https://github.com/ProseMirror/prosemirror-gapcursor) by Marijn Haverbeke, which adds a gap for the cursor in places that don’t allow regular selection. For example, after a table at the end of a document. +This extension loads the [ProseMirror Dropcursor plugin](https://github.com/ProseMirror/prosemirror-dropcursor) by Marijn Haverbeke, which shows a cursor at the drop position when something is dragged over the editor. Note that tiptap is renderless, but the dropcursor needs CSS for its appearance. The default CSS is added to the usage example below. @@ -16,4 +16,4 @@ yarn add @tiptap/extension-dropcursor [packages/extension-dropcursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-dropcursor/) ## Usage - + diff --git a/docs/src/docPages/api/extensions/focus.md b/docs/src/docPages/api/extensions/focus.md index 2d011777..ff888d6d 100644 --- a/docs/src/docPages/api/extensions/focus.md +++ b/docs/src/docPages/api/extensions/focus.md @@ -1,4 +1,7 @@ # Focus +The Focus extension adds a CSS class to focused nodes. By default it adds `.has-class`, but you can change that. + +Note that it’s only a class, the styling is totally up to you. The usage example below has some CSS for that class. ## Installation ```bash diff --git a/docs/src/docPages/examples/collaborative-editing.md b/docs/src/docPages/examples/collaborative-editing.md index 7c0f4566..ea52b29a 100644 --- a/docs/src/docPages/examples/collaborative-editing.md +++ b/docs/src/docPages/examples/collaborative-editing.md @@ -1,7 +1,7 @@ # Collaborative editing -:::premium Requires Premium Extensions -Using this example in production requires a **tiptap pro** license. [Read more](/sponsor) +:::premium Requires pro extensions +We kindly ask you to sponsor us, before using this example in production. [Read more](/sponsor) ::: This example shows how you can use tiptap to let different users collaboratively work on the same text in real-time. diff --git a/docs/src/links.yaml b/docs/src/links.yaml index 5f63280a..4d18b0b5 100644 --- a/docs/src/links.yaml +++ b/docs/src/links.yaml @@ -16,7 +16,6 @@ link: /examples/basic - title: Collaborative editing link: /examples/collaborative-editing - premium: true - title: Markdown shortcuts link: /examples/markdown-shortcuts # - title: Menu Bubble @@ -163,13 +162,11 @@ premium: true - title: CollaborationCursor link: /api/extensions/collaboration-cursor - draft: true premium: true - title: Dropcursor link: /api/extensions/dropcursor - title: Focus link: /api/extensions/focus - draft: true - title: Gapcursor link: /api/extensions/gapcursor - title: History