Merge branch 'main' into feature/landingpage

This commit is contained in:
Philipp Kühn
2021-01-29 15:25:51 +01:00
5 changed files with 20 additions and 19 deletions

View File

@@ -5,18 +5,16 @@
<editor-content class="editor__content" :editor="editor" /> <editor-content class="editor__content" :editor="editor" />
<div class="editor__bottom-bar"> <div class="editor__bottom-bar">
<div :class="`editor__status editor__status--${status}`"> <div :class="`editor__status editor__status--${status}`">
{{ status }}
<template v-if="status === 'connected'"> <template v-if="status === 'connected'">
as {{ currentUser.name }},
{{ users.length }} user{{ users.length === 1 ? '' : 's' }} online {{ users.length }} user{{ users.length === 1 ? '' : 's' }} online
</template> </template>
<template v-else>
offline
</template>
</div> </div>
<div class="editor__actions"> <div class="editor__name">
<button @click="setName"> <button @click="setName">
Set Name {{ currentUser.name }}
</button>
<button @click="updateCurrentUser({ name: getRandomName() })">
Random Name
</button> </button>
</div> </div>
</div> </div>
@@ -172,21 +170,20 @@ export default {
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
white-space: nowrap; white-space: nowrap;
padding: 0.25rem 0 0.25rem 0.25rem;
border-top: 1px solid rgba(black, 0.1); border-top: 1px solid rgba(black, 0.1);
font-size: 13px;
font-weight: 500;
color: rgba(black, 0.5);
white-space: nowrap;
padding: 0.25rem 0.75rem;
} }
/* Some information about the status */ /* Some information about the status */
&__status { &__status {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 13px;
font-weight: 500;
border-radius: 5px; border-radius: 5px;
margin-top: 1rem; margin-top: 1rem;
padding: 0.25rem 0.5rem;
color: rgba(black, 0.5);
white-space: nowrap;
&::before { &::before {
content: ' '; content: ' ';
@@ -200,7 +197,7 @@ export default {
} }
&--connecting::before { &--connecting::before {
background: #FD9170; background: #616161;
} }
&--connected::before { &--connected::before {
@@ -208,7 +205,7 @@ export default {
} }
} }
&__actions { &__name {
button { button {
background: none; background: none;
border: none; border: none;

View File

@@ -71,7 +71,7 @@ Both calls would return `true` if its possible to apply the commands, and `fa
In order to make that work with your custom commands, dont forget to return `true` or `false`. In order to make that work with your custom commands, dont forget to return `true` or `false`.
For some of your own commands, you probably want to work with the raw [transaction](/api/overview). To make them work with `.can()` you should check if the transaction should be dispatched. Here is how we do that within `.insertText()`: For some of your own commands, you probably want to work with the raw [transaction](/api/concept). To make them work with `.can()` you should check if the transaction should be dispatched. Here is how we do that within `.insertText()`:
```js ```js
export default (value: string): Command => ({ tr, dispatch }) => { export default (value: string): Command => ({ tr, dispatch }) => {

View File

@@ -21,7 +21,11 @@ new Editor({
}) })
``` ```
If you dont pass an element, tiptap will create an invisible `<div>`. You can use that to mount your editor after its already initiated: `yourElement.append(editor.options.element)` You can even initiate your editor before mounting it to an element. This is useful when your DOM is not yet available. Just leave out the `element`, well create one for you. Append it to your container at a later date like that:
```js
yourContainerElement.append(editor.options.element)
```
### Extensions ### Extensions
Its required to pass a list of extensions to the `extensions` property, even if you only want to allow paragraphs. Its required to pass a list of extensions to the `extensions` property, even if you only want to allow paragraphs.

View File

@@ -104,7 +104,7 @@
- title: API - title: API
items: items:
- title: Concept - title: Concept
link: /api/overview link: /api/concept
- title: Editor - title: Editor
link: /api/editor link: /api/editor
- title: Commands - title: Commands

View File

@@ -1,4 +1,4 @@
/overview / /overview /
/examples /examples/basic /examples /examples/basic
/guide /guide/get-started /guide /guide/get-started
/api /api/overview /api /api/concept