move everything around, add more content and a first test for images
This commit is contained in:
9
docs/src/demos/Extensions/Focus/index.spec.js
Normal file
9
docs/src/demos/Extensions/Focus/index.spec.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
context('/examples/focus', () => {
|
||||||
|
before(() => {
|
||||||
|
cy.visit('/examples/focus')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should have class', () => {
|
||||||
|
cy.get('.ProseMirror p:first').should('have.class', 'has-focus')
|
||||||
|
})
|
||||||
|
})
|
||||||
59
docs/src/demos/Extensions/Focus/index.vue
Normal file
59
docs/src/demos/Extensions/Focus/index.vue
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<editor-content :editor="editor" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { Editor, EditorContent } from '@tiptap/vue-starter-kit'
|
||||||
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
import Focus from '@tiptap/extension-focus'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
EditorContent,
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
editor: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.editor = new Editor({
|
||||||
|
extensions: [
|
||||||
|
Document(),
|
||||||
|
Paragraph(),
|
||||||
|
Text(),
|
||||||
|
Focus({
|
||||||
|
className: 'has-focus',
|
||||||
|
nested: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
autoFocus: true,
|
||||||
|
content: `
|
||||||
|
<p>
|
||||||
|
The focus extension adds a class to the focused node only. That enables you to add a custom styling to just that node. By default, it’ll add <code>.has-focus</code>, even to nested nodes.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Nested elements will be focused with the default setting nested: true. Otherwise the whole item will get the focus class, even when just a single nested item is selected.
|
||||||
|
</p>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
this.editor.destroy()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.has-focus {
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 0 0 0 3px #68CEF8;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
27
docs/src/demos/Nodes/Image/index.spec.js
Normal file
27
docs/src/demos/Nodes/Image/index.spec.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
context('/api/nodes/image', () => {
|
||||||
|
before(() => {
|
||||||
|
cy.visit('/api/nodes/image')
|
||||||
|
})
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||||
|
editor.setContent('<p>Example Text</p>')
|
||||||
|
editor.selectAll()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should add an img tag with the correct URL', () => {
|
||||||
|
cy.window().then(win => {
|
||||||
|
cy.stub(win, 'prompt').returns('foobar.png')
|
||||||
|
|
||||||
|
cy.get('.demo__preview button:first')
|
||||||
|
.click()
|
||||||
|
|
||||||
|
cy.window().its('prompt').should('be.called')
|
||||||
|
|
||||||
|
cy.get('.ProseMirror')
|
||||||
|
.find('img')
|
||||||
|
.should('have.attr', 'src', 'foobar.png')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -20,10 +20,9 @@ yarn add @tiptap/extension-collaboration-cursor
|
|||||||
| type | | | |
|
| type | | | |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
*None*
|
| Command | Parameters | Description |
|
||||||
|
| ------- | ------------- | ------------------------------------------------------------------------ |
|
||||||
## Keyboard shortcuts
|
| user | name<br>color | The name of the current user.<br>The color of the current user’s cursor. |
|
||||||
*None*
|
|
||||||
|
|
||||||
## Source code
|
## Source code
|
||||||
[packages/extension-collaboration-cursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-collaboration-cursor/)
|
[packages/extension-collaboration-cursor/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-collaboration-cursor/)
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ yarn add @tiptap/extension-focus
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
*None*
|
| Option | Type | Default | Description |
|
||||||
|
| --------- | ------- | --------- | ------------------------------------------------------ |
|
||||||
|
| className | string | has-focus | The class that is applied to the focused element. |
|
||||||
|
| nested | boolean | true | When enabled nested elements get the focus class, too. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
*None*
|
*None*
|
||||||
@@ -22,4 +25,4 @@ yarn add @tiptap/extension-focus
|
|||||||
[packages/extension-focus/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-focus/)
|
[packages/extension-focus/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-focus/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Focus" highlight="" />
|
<demo name="Extensions/Focus" highlight="31-34,12" />
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ yarn add @tiptap/extension-history
|
|||||||
| newGroupDelay | number | 500 | The delay between changes after which a new group should be started (in milliseconds). When changes aren’t adjacent, a new group is always started. |
|
| newGroupDelay | number | 500 | The delay between changes after which a new group should be started (in milliseconds). When changes aren’t adjacent, a new group is always started. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | ------- | --------------------- |
|
| ------- | ------- | --------------------- |
|
||||||
| undo | — | Undo the last change. |
|
| undo | — | Undo the last change. |
|
||||||
| redo | — | Redo the last change. |
|
| redo | — | Redo the last change. |
|
||||||
|
|||||||
@@ -9,6 +9,15 @@ npm install @tiptap/extension-text-align
|
|||||||
yarn add @tiptap/extension-text-align
|
yarn add @tiptap/extension-text-align
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
*None*
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
*None*
|
||||||
|
|
||||||
|
## Keyboard shortcuts
|
||||||
|
*None*
|
||||||
|
|
||||||
## Source code
|
## Source code
|
||||||
[packages/extension-text-align/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text-align/)
|
[packages/extension-text-align/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text-align/)
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ yarn add @tiptap/extension-bold
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | ------- | --------------- |
|
| ------- | ------- | --------------- |
|
||||||
| bold | — | Mark text bold. |
|
| bold | — | Mark text bold. |
|
||||||
|
|
||||||
@@ -34,4 +34,4 @@ yarn add @tiptap/extension-bold
|
|||||||
[packages/extension-bold/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bold/)
|
[packages/extension-bold/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bold/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Bold" highlight="3-5,17,36" />
|
<demo name="Marks/Bold" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ yarn add @tiptap/extension-code
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | ------- | ------------------------- |
|
| ------- | ------- | ------------------------- |
|
||||||
| code | — | Mark text as inline code. |
|
| code | — | Mark text as inline code. |
|
||||||
|
|
||||||
@@ -29,4 +29,4 @@ yarn add @tiptap/extension-code
|
|||||||
[packages/extension-code/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code/)
|
[packages/extension-code/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Code" highlight="3-5,17,36" />
|
<demo name="Marks/Code" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ yarn add @tiptap/extension-italic
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | ------- | ----------------- |
|
| ------- | ------- | ----------------- |
|
||||||
| italic | — | Mark text italic. |
|
| italic | — | Mark text italic. |
|
||||||
|
|
||||||
@@ -34,4 +34,4 @@ yarn add @tiptap/extension-italic
|
|||||||
[packages/extension-italic/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-italic/)
|
[packages/extension-italic/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-italic/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Italic" highlight="3-5,17,36" />
|
<demo name="Marks/Italic" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -23,17 +23,17 @@ yarn add @tiptap/extension-link
|
|||||||
| target | string | _blank | Set the default `target` of links. |
|
| target | string | _blank | Set the default `target` of links. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | -------------- | ----------------------------------------------------------- |
|
| ------- | -------------- | ----------------------------------------------------------- |
|
||||||
| link | href<br>target | Link the selected text. Removes a link, if `href` is empty. |
|
| link | href<br>target | Link the selected text. Removes a link, if `href` is empty. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
:::warning Doesn’t have a keyboard shortcut
|
:::warning Doesn’t have a keyboard shortcut
|
||||||
This extension doesn’t bind a specific keyboard shortcut. You would probably open your UI on `Mod-k` though.
|
This extension doesn’t bind a specific keyboard shortcut. You would probably open your custom UI on `Mod-k` though.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## Source code
|
## Source code
|
||||||
[packages/extension-link/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-link/)
|
[packages/extension-link/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-link/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Link" highlight="3-8,19,38,55" />
|
<demo name="Marks/Link" highlight="3-8,19,38,55" />
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ yarn add @tiptap/extension-strike
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | ------- | --------------------------- |
|
| ------- | ------- | --------------------------- |
|
||||||
| strike | — | Mark text as strikethrough. |
|
| strike | — | Mark text as strikethrough. |
|
||||||
|
|
||||||
@@ -34,4 +34,4 @@ yarn add @tiptap/extension-strike
|
|||||||
[packages/extension-strike/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-strike/)
|
[packages/extension-strike/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-strike/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Strike" highlight="3-5,17,36" />
|
<demo name="Marks/Strike" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ yarn add @tiptap/extension-underline
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| --------- | ------- | ------------------------ |
|
| --------- | ---------- | ------------------------ |
|
||||||
| underline | — | Mark text as underlined. |
|
| underline | — | Mark text as underlined. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -34,4 +34,4 @@ yarn add @tiptap/extension-underline
|
|||||||
[packages/extension-underline/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-underline/)
|
[packages/extension-underline/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-underline/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Underline" highlight="3-5,17,36" />
|
<demo name="Marks/Underline" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ yarn add @tiptap/extension-blockquote
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ---------- | ------- | ----------------------------- |
|
| ---------- | ---------- | ----------------------------- |
|
||||||
| blockquote | — | Wrap content in a blockquote. |
|
| blockquote | — | Wrap content in a blockquote. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -31,4 +31,4 @@ yarn add @tiptap/extension-blockquote
|
|||||||
[packages/extension-blockquote/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-blockquote/)
|
[packages/extension-blockquote/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-blockquote/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Blockquote" highlight="3-5,17,36" />
|
<demo name="Nodes/Blockquote" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ yarn add @tiptap/extension-bullet-list @tiptap/extension-list-item
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ----------- | ------- | --------------------- |
|
| ----------- | ---------- | --------------------- |
|
||||||
| bullet_list | — | Toggle a bullet list. |
|
| bullet_list | — | Toggle a bullet list. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -33,4 +33,4 @@ yarn add @tiptap/extension-bullet-list @tiptap/extension-list-item
|
|||||||
[packages/extension-bullet-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bullet-list/)
|
[packages/extension-bullet-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-bullet-list/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/BulletList" highlight="3-5,17-18,37-38" />
|
<demo name="Nodes/BulletList" highlight="3-5,17-18,37-38" />
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ yarn add @tiptap/extension-code-block
|
|||||||
| languageClassPrefix | string | language- | Adds a prefix to language classes that are applied to code tags. |
|
| languageClassPrefix | string | language- | Adds a prefix to language classes that are applied to code tags. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| --------- | ------- | ----------------------------- |
|
| --------- | ---------- | ----------------------------- |
|
||||||
| codeBlock | — | Wrap content in a code block. |
|
| codeBlock | — | Wrap content in a code block. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -35,4 +35,4 @@ yarn add @tiptap/extension-code-block
|
|||||||
[packages/extension-code-block/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code-block/)
|
[packages/extension-code-block/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code-block/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/CodeBlock" highlight="3-5,17,36" />
|
<demo name="Nodes/CodeBlock" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ yarn add @tiptap/extension-document
|
|||||||
[packages/extension-document/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-document/)
|
[packages/extension-document/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-document/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Document" highlight="10,28" />
|
<demo name="Nodes/Document" highlight="10,28" />
|
||||||
|
|||||||
@@ -10,12 +10,9 @@ npm install @tiptap/extension-hard-break
|
|||||||
yarn add @tiptap/extension-hard-break
|
yarn add @tiptap/extension-hard-break
|
||||||
```
|
```
|
||||||
|
|
||||||
## Settings
|
|
||||||
*None*
|
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| --------- | ------- | ----------------- |
|
| --------- | ---------- | ----------------- |
|
||||||
| hardBreak | — | Add a line break. |
|
| hardBreak | — | Add a line break. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -27,4 +24,4 @@ yarn add @tiptap/extension-hard-break
|
|||||||
[packages/extension-hard-break/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-hard-break/)
|
[packages/extension-hard-break/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-hard-break/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/HardBreak" highlight="3-5,17,36" />
|
<demo name="Nodes/HardBreak" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ yarn add @tiptap/extension-heading
|
|||||||
| levels | Array | [1, 2, 3, 4, 5, 6] | Specifies which heading levels are supported. |
|
| levels | Array | [1, 2, 3, 4, 5, 6] | Specifies which heading levels are supported. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------- | ------- | ----------------------- |
|
| ------- | ---------- | ------------------------------------------------ |
|
||||||
| heading | level | Creates a heading node. |
|
| heading | level | Creates a heading node with the specified level. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
* Windows/Linux: `Control` `Alt` `1-6`
|
* Windows/Linux: `Control` `Alt` `1-6`
|
||||||
@@ -31,4 +31,4 @@ yarn add @tiptap/extension-heading
|
|||||||
[packages/extension-heading/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-heading/)
|
[packages/extension-heading/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-heading/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Heading" highlight="3-11,23,42-44" />
|
<demo name="Nodes/Heading" highlight="3-11,23,42-44" />
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ yarn add @tiptap/extension-horizontal-rule
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| --------------- | ------- | ------------------------- |
|
| -------------- | ---------- | ------------------------- |
|
||||||
| horizontalRule | — | Create a horizontal rule. |
|
| horizontalRule | — | Create a horizontal rule. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -29,4 +29,4 @@ yarn add @tiptap/extension-horizontal-rule
|
|||||||
[packages/extension-horizontal-rule/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-horizontal-rule/)
|
[packages/extension-horizontal-rule/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-horizontal-rule/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/HorizontalRule" highlight="3-5,17,36" />
|
<demo name="Nodes/HorizontalRule" highlight="3-5,17,36" />
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
# Image
|
# Image
|
||||||
|
Use this extension to render `<img>` HTML tags. By default, those images are blocks. If you want to render images in line with text set the `inline` option to `true`.
|
||||||
|
|
||||||
|
:::warning Restrictions
|
||||||
|
This extension does only the rendering of images. It doesn’t upload images to your server, that’s a whole different story.
|
||||||
|
:::
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
```bash
|
```bash
|
||||||
@@ -11,11 +16,11 @@ yarn add @tiptap/extension-image
|
|||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
| Option | Type | Default | Description |
|
| Option | Type | Default | Description |
|
||||||
| ------ | ------- | ------- | ------------------------ |
|
| ------ | ------- | ------- | ------------------------------ |
|
||||||
| inline | boolean | false | Renders the node inline. |
|
| inline | boolean | false | Renders the image node inline. |
|
||||||
|
|
||||||
## Source code
|
## Source code
|
||||||
[packages/extension-image/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-image/)
|
[packages/extension-image/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-image/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Image" />
|
<demo name="Nodes/Image" />
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ yarn add @tiptap/extension-list-item
|
|||||||
[packages/extension-list-item/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-list-item/)
|
[packages/extension-list-item/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-list-item/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/ListItem" highlight="3-8,20-22,41-43" />
|
<demo name="Nodes/ListItem" highlight="3-8,20-22,41-43" />
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ yarn add @tiptap/extension-ordered-list @tiptap/extension-list-item
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| ------------ | ------- | ---------------------- |
|
| ----------- | ---------- | ---------------------- |
|
||||||
| ordered_list | — | Toggle a ordered list. |
|
| orderedList | — | Toggle a ordered list. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
* `Control` `Shift` `9`
|
* `Control` `Shift` `9`
|
||||||
@@ -33,4 +33,4 @@ yarn add @tiptap/extension-ordered-list @tiptap/extension-list-item
|
|||||||
[packages/extension-ordered-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-ordered-list/)
|
[packages/extension-ordered-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-ordered-list/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/OrderedList" highlight="3-5,17-18,37-38" />
|
<demo name="Nodes/OrderedList" highlight="3-5,17-18,37-38" />
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ yarn add @tiptap/extension-paragraph
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| --------- | ------- | -------------------------------------------- |
|
| --------- | ---------- | -------------------------------------------- |
|
||||||
| paragraph | — | Transforms all selected nodes to paragraphs. |
|
| paragraph | — | Transforms all selected nodes to paragraphs. |
|
||||||
|
|
||||||
## Keyboard shortcuts
|
## Keyboard shortcuts
|
||||||
@@ -32,4 +32,4 @@ yarn add @tiptap/extension-paragraph
|
|||||||
[packages/extension-paragraph/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-paragraph/)
|
[packages/extension-paragraph/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-paragraph/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Paragraph" highlight="11,29" />
|
<demo name="Nodes/Paragraph" highlight="11,29" />
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ yarn add @tiptap/extension-task-list @tiptap/extension-task-item
|
|||||||
[packages/extension-task-item/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-item/)
|
[packages/extension-task-item/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-item/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/TaskItem" />
|
<demo name="Nodes/TaskItem" />
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ yarn add @tiptap/extension-task-list @tiptap/extension-task-item
|
|||||||
| class | string | – | Add a custom class to the rendered HTML tag. |
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Options | Description |
|
| Command | Parameters | Description |
|
||||||
| -------- | ------- | ------------------- |
|
| -------- | ---------- | ------------------- |
|
||||||
| taskList | — | Toggle a task list. |
|
| taskList | — | Toggle a task list. |
|
||||||
|
|
||||||
## Source code
|
## Source code
|
||||||
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)
|
[packages/extension-task-list/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-list/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/TaskList" />
|
<demo name="Nodes/TaskList" />
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ yarn add @tiptap/extension-text
|
|||||||
[packages/extension-text/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text/)
|
[packages/extension-text/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
<demo name="Extensions/Text" highlight="12,30" />
|
<demo name="Nodes/Text" highlight="12,30" />
|
||||||
|
|||||||
@@ -127,7 +127,6 @@
|
|||||||
link: /api/nodes/horizontal-rule
|
link: /api/nodes/horizontal-rule
|
||||||
- title: Image
|
- title: Image
|
||||||
link: /api/nodes/image
|
link: /api/nodes/image
|
||||||
draft: true
|
|
||||||
- title: ListItem
|
- title: ListItem
|
||||||
link: /api/nodes/list-item
|
link: /api/nodes/list-item
|
||||||
- title: OrderedList
|
- title: OrderedList
|
||||||
|
|||||||
Reference in New Issue
Block a user