Merge branch 'main' into feature/landingpage

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

View File

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

View File

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