mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 19:59:02 +08:00
Merge branch 'main' into feature/landingpage
This commit is contained in:
commit
bef8ae7ef1
@ -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;
|
||||
|
@ -71,7 +71,7 @@ Both calls would return `true` if it’s possible to apply the commands, and `fa
|
||||
|
||||
In order to make that work with your custom commands, don’t 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 }) => {
|
||||
|
@ -21,7 +21,11 @@ new Editor({
|
||||
})
|
||||
```
|
||||
|
||||
If you don’t pass an element, tiptap will create an invisible `<div>`. You can use that to mount your editor after it’s 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`, we’ll create one for you. Append it to your container at a later date like that:
|
||||
|
||||
```js
|
||||
yourContainerElement.append(editor.options.element)
|
||||
```
|
||||
|
||||
### Extensions
|
||||
It’s required to pass a list of extensions to the `extensions` property, even if you only want to allow paragraphs.
|
||||
|
@ -104,7 +104,7 @@
|
||||
- title: API
|
||||
items:
|
||||
- title: Concept
|
||||
link: /api/overview
|
||||
link: /api/concept
|
||||
- title: Editor
|
||||
link: /api/editor
|
||||
- title: Commands
|
||||
|
2
docs/static/_redirects
vendored
2
docs/static/_redirects
vendored
@ -1,4 +1,4 @@
|
||||
/overview /
|
||||
/examples /examples/basic
|
||||
/guide /guide/get-started
|
||||
/api /api/overview
|
||||
/api /api/concept
|
||||
|
Loading…
Reference in New Issue
Block a user