Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d2e44b
feat(locales): add TypeScript definitions for multiple locales and lo…
danni-cool Jan 22, 2025
3aa39bb
fix(workflow): update branch name from main to master in build artifa…
danni-cool Jan 22, 2025
06e93b4
chore(workflow): remove semantic commit check workflow
danni-cool Jan 22, 2025
5cb078b
feat(types): add TypeScript definitions for fs-extra and update compo…
danni-cool Jan 22, 2025
b9f7468
feat(vite): add copyLibPlugin for local development and clean up depe…
danni-cool Jan 22, 2025
082c68a
feat(build): update watch-build script for production mode and add bu…
danni-cool Jan 22, 2025
a945896
refactor(types): remove unused TypeScript definitions and update link…
danni-cool Jan 22, 2025
89ad9b5
feat(dependencies): add fs-extra and nodemon, remove unused fs-extra …
danni-cool Jan 22, 2025
1302338
fix(link): update hrefRules regex to correctly validate URLs
danni-cool Jan 22, 2025
fd9df96
fix(vite): ignore TypeScript error for regex pattern replacement in d…
danni-cool Jan 22, 2025
ee1b60d
fix(video): update regex for bilibili links to escape dots
danni-cool Jan 24, 2025
8ce2aa9
feat(locales): add TypeScript definitions for multiple languages and …
danni-cool Jan 24, 2025
654d01e
refactor: remove unused copy-lib script and build workflow; update Ti…
danni-cool Jan 24, 2025
7e8297e
feat(hooks): implement useEval hook for dynamic hrefRules evaluation;…
danni-cool Feb 5, 2025
266da42
feat(video): enhance video loading error handling and improve iframe …
danni-cool Feb 5, 2025
4ec0720
style: update CSS styles for Tiptap editor; improve image display han…
danni-cool Mar 20, 2025
76dda96
https://theplanttokyo.atlassian.net/browse/QOR5-610
danni-cool May 21, 2025
d15762e
refactor(html-view): improve overlay handling and update comments for…
danni-cool May 21, 2025
9bb9ca2
refactor(html-view): capture original editor dimensions before switch…
danni-cool May 21, 2025
26a7547
feat(extensions): add allowedAttributes option to Blockquote, Heading…
danni-cool May 23, 2025
6617b08
refactor(extensions): remove unified-attributes-demo.vue example; upd…
danni-cool May 23, 2025
533dfb1
chore(dependencies): update Tiptap extensions to version 2.24.0 and a…
danni-cool Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ runs:

- name: Install dependencies
shell: bash
run: pnpm install
run: pnpm install
33 changes: 0 additions & 33 deletions .github/workflows/gh-pages.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/release.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/semantic_pr.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
node_modules
.DS_Store
lib
# lib
dist
dist-ssr
*.local
types/components.d.ts
types/components.d.ts
135 changes: 90 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ A WYSIWYG rich-text editor using [tiptap](https://github.com/scrumpy/tiptap) and
![LICENSE](https://img.shields.io/badge/License-MIT-yellow.svg)
[![semantic-release: vue](https://img.shields.io/badge/semantic--release-vue-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)

English | [中文](./README.zh-CN.md)
English | [中文](../../../../../../../../vuetify-pro-tiptap/README.zh-CN.md)

## Demo

👉[https://yikoyu.github.io/vuetify-pro-tiptap/](https://yikoyu.github.io/vuetify-pro-tiptap/)

👾[Stackblitz](https://stackblitz.com/~/github.com/yikoyu/vuetify-pro-tiptap-demo/tree/main)

👾[Nuxt3 Stackblitz](https://stackblitz.com/~/github.com/yikoyu/vuetify-pro-tiptap-demo/tree/nuxt)

## Features

- Use [vuetify](https://github.com/vuetifyjs/vuetify) components
- Many out of box [extension](#extensions) (welcome to submit an issue for feature request)
- Markdown support
Expand All @@ -27,10 +29,13 @@ English | [中文](./README.zh-CN.md)
- Vuetify 3.x and Vue 3.x support

## Vuetify 2.x

For Vuetify 2.x please use the latest version of [[email protected]](https://github.com/yikoyu/vuetify-pro-tiptap/tree/1.x)

## Installation

### NPM

```shell
pnpm add vuetify-pro-tiptap
# or
Expand Down Expand Up @@ -130,6 +135,7 @@ app.mount('#app')
</details>

## Global Settings

```TypeScript
import { markRaw } from 'vue'
import { VuetifyTiptap, VuetifyViewer, createVuetifyProTipTap, defaultBubbleList } from 'vuetify-pro-tiptap'
Expand Down Expand Up @@ -339,29 +345,37 @@ export default Extension.create<PreviewOptions>({
## I18n

### Setting language

You can declare when you install the plugin.

```TypeScript
import { createVuetifyProTipTap } from 'vuetify-pro-tiptap'

const VuetifyProTipTap = createVuetifyProTipTap({
lang: 'zhHans'
})
```

Or use `setLang` dynamic change

```TypeScript
import { locale } from 'vuetify-pro-tiptap'

locale.setLang('en')
```

Available languages:

- en (default)
- zhHans
- nl
- de
- it

### Use unavailable language

Loading unavailable language, use `setMessage` for Settings

```TypeScript
import { locale } from 'vuetify-pro-tiptap'

Expand All @@ -372,10 +386,28 @@ locale.setLang('zhHant')
```

## Usage

```vue
<script setup lang="ts">
import { ref } from 'vue'
import { BaseKit, Bold, Color, Fullscreen, Heading, Highlight, History, Image, Italic, Link, Strike, Table, Underline, Video, VuetifyTiptap, VuetifyViewer } from 'vuetify-pro-tiptap'
import {
BaseKit,
Bold,
Color,
Fullscreen,
Heading,
Highlight,
History,
Image,
Italic,
Link,
Strike,
Table,
Underline,
Video,
VuetifyTiptap,
VuetifyViewer
} from 'vuetify-pro-tiptap'
import 'vuetify-pro-tiptap/style.css'

const extensions = [
Expand Down Expand Up @@ -405,7 +437,15 @@ const content = ref('')
<template>
<VApp id="app">
<VContainer>
<VuetifyTiptap v-model="content" label="Title" rounded :min-height="200" :max-height="465" :max-width="900" :extensions="extensions" />
<VuetifyTiptap
v-model="content"
label="Title"
rounded
:min-height="200"
:max-height="465"
:max-width="900"
:extensions="extensions"
/>
<VuetifyViewer :value="content" />
</VContainer>
</VApp>
Expand All @@ -417,60 +457,65 @@ const content = ref('')
### VuetifyTiptap

#### Props
| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| modelValue | string \| JSONContent | '' | The input’s value |
| markdownTheme | string \| false | 'default' | Markdown theme |
| output | 'html' \| 'json' \| 'text' | 'html' | Output format |
| dark | boolean | false | Applies the dark theme variant to the component. |
| dense | boolean | false | Reduces the input height |
| outlined | boolean | true | Applies the outlined style to the input |
| flat | boolean | true | Removes the card’s elevation |
| disabled | boolean | false | Disable the input |
| label | string | undefined | Sets input label |
| hideToolbar | boolean | false | Hidden the toolbar |
| disableToolbar | boolean | false | Disable the toolbar |
| hideBubble | boolean | false | Hidden the bubble menu |
| removeDefaultWrapper | boolean | false | Default wrapper when the delete editor is empty |
| maxWidth | string \| number | undefined | Sets the maximum width for the component. |
| minHeight | string \| number | undefined | Sets the minimum height for the component. |
| maxHeight | string \| number | undefined | Sets the maximum height for the component. |
| extensions | AnyExtension[] | [] | Tiptap the extensions |
| editorClass | string \| string[] \| Record\<string, any> | undefined | Editor class |

| Name | Type | Default | Description |
| -------------------- | ------------------------------------------ | --------- | ------------------------------------------------ |
| modelValue | string \| JSONContent | '' | The input’s value |
| markdownTheme | string \| false | 'default' | Markdown theme |
| output | 'html' \| 'json' \| 'text' | 'html' | Output format |
| dark | boolean | false | Applies the dark theme variant to the component. |
| dense | boolean | false | Reduces the input height |
| outlined | boolean | true | Applies the outlined style to the input |
| flat | boolean | true | Removes the card’s elevation |
| disabled | boolean | false | Disable the input |
| label | string | undefined | Sets input label |
| hideToolbar | boolean | false | Hidden the toolbar |
| disableToolbar | boolean | false | Disable the toolbar |
| hideBubble | boolean | false | Hidden the bubble menu |
| removeDefaultWrapper | boolean | false | Default wrapper when the delete editor is empty |
| maxWidth | string \| number | undefined | Sets the maximum width for the component. |
| minHeight | string \| number | undefined | Sets the minimum height for the component. |
| maxHeight | string \| number | undefined | Sets the maximum height for the component. |
| extensions | AnyExtension[] | [] | Tiptap the extensions |
| editorClass | string \| string[] \| Record\<string, any> | undefined | Editor class |

#### Slots
| Name | Description |
| ---- | ---- |
| editor | Slot to customize editor |

| Name | Description |
| ------ | ------------------------------- |
| editor | Slot to customize editor |
| bottom | Slot to customize editor bottom |

#### Event
| Name | Type | Description |
| ---- | ---- | ---- |
| update:modelValue | string \| JSONContent | Emitted when editor onUpdate |
| update:markdownTheme | string | Emitted when change theme |
| change | { editor: Editor, output: string \| JSONContent } | Emitted when editor onUpdate |
| enter | | Keyboard enter return |

| Name | Type | Description |
| -------------------- | ------------------------------------------------- | ---------------------------- |
| update:modelValue | string \| JSONContent | Emitted when editor onUpdate |
| update:markdownTheme | string | Emitted when change theme |
| change | { editor: Editor, output: string \| JSONContent } | Emitted when editor onUpdate |
| enter | | Keyboard enter return |

### VuetifyViewer

#### Props
| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| value | string \| JSONContent | '' | The preview’s value |
| dark | boolean | false | Applies the dark theme variant to the component. |
| dense | boolean | false | Reduces the input height |
| markdownTheme | string \| false | 'default' | Markdown theme |
| xss | boolean | true | Enable xss filter |
| xssOptions | xss.IWhiteList | Default rule | Xss filter rule config |
| maxWidth | string \| number | undefined | Sets the maximum width for the component. |
| extensions | AnyExtension[] | [] | Tiptap the extensions |

| Name | Type | Default | Description |
| ------------- | --------------------- | ------------ | ------------------------------------------------ |
| value | string \| JSONContent | '' | The preview’s value |
| dark | boolean | false | Applies the dark theme variant to the component. |
| dense | boolean | false | Reduces the input height |
| markdownTheme | string \| false | 'default' | Markdown theme |
| xss | boolean | true | Enable xss filter |
| xssOptions | xss.IWhiteList | Default rule | Xss filter rule config |
| maxWidth | string \| number | undefined | Sets the maximum width for the component. |
| extensions | AnyExtension[] | [] | Tiptap the extensions |

#### Slots
| Name | Description |
| ---- | ---- |

| Name | Description |
| ------ | ------------------------- |
| before | Add content at the before |
| after | Add content at the after |
| after | Add content at the after |

## 🏗 Contributing

Expand Down
Loading
Loading