Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
element-tiptap-vue3-niyuta
Advanced tools
A WYSIWYG rich-text editor using tiptap and Element Plus for Vue3
that's easy to use, friendly to developers, fully extensible and clean in design.
It' s version of alpha tiptap 2.0.1 with fixed bugs and repaire previous functionality. Also deleted most warns in console while using.
It' s final version of lib i fixed all bugs, which i saw, welcome issues if you found bugs or warnings, i will try to fix it.
I only done fix bugs and corrected some extentions and delete warnings original
if you are Russian company you can refer me job (okijhhyu@gmail.com)
English
en
, zh
, pl
, ru
, de
, ko
, es
, zh_tw
, fr
, pt_br
, nl
, he
). welcome to contribute more languagescreate
, transaction
, focus
, blur
, destroy
npm i element-tiptap-vue3-niyuta
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import ElementTiptapPlugin from 'element-tiptap-vue3-niyuta'
// import ElementTiptap's styles
import 'element-tiptap-vue3-niyuta/lib/style.css'
const app = createApp(App)
// use ElementPlus's plugin
app.use(ElementPlus)
// use this package's plugin
app.use(ElementTiptapPlugin)
// Now you register `'el-tiptap'` component globally.
app.mount('#app')
Or
<template>
<el-tiptap ...></el-tiptap>
</template>
<script setup>
import { ElementTiptap } from 'element-tiptap-vue3-niyuta'
</script>
<template>
<el-tiptap v-model:content="content" :extensions="extensions" />
</template>
<script setup>
import { ref } from 'vue'
import {
// necessary extensions
Doc,
Text,
Paragraph,
//________________________
Heading,
Bold,
Underline,
Italic,
Strike,
BulletList,
OrderedList,
} from 'element-tiptap-vue3-niyuta'
// editor extensions
// they will be added to menubar and bubble menu by the order you declare.
const extensions = [
Doc,
Text,
Paragraph,
Heading.configure({ level: 5 }),
Bold.configure({ bubble: true }), // render command-button in bubble menu.
Underline.configure({ bubble: true, menubar: false }), // render command-button in bubble menu but not in menubar.
Italic,
Strike,
BulletList,
OrderedList,
]
// editor's content
const content = ref(`
<h1>Heading</h1>
<p>This Editor is awesome!</p>
`)
</script>
Type: Array
You can use the necessary extensions. The corresponding command-buttons will be added by declaring the order of the extension.
All available extensions:
Doc
Text
Paragraph
Heading
Bold
Italic
Strike
Underline
Link
Image
Iframe
CodeBlock
Blockquote
BulletList
OrderedList
TaskList
TextAlign
Indent
LineHeight
HorizontalRule
HardBreak
History
Table
FormatClear
Color
Highlight
Print
Fullscreen
SelectAll
FontFamily
FontSize
CodeView
CodeBlockLowlight
Gapcursor
Dropcursor
Commands
You can find all extensions docs here.
Extension: Commands
Usage
import {
...
Commands,
getSuggestionItems,
renderItems
} from 'element-tiptap-vue3-niyuta';
Commands.configure({
suggestion: {
items: getSuggestionItems,
render: renderItems
}
}),
Extension: All
Custom svg for extensions
Image.configure({
buttonIcon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="16" width="16" fill="currentColor"> ... </svg>'
})
for (Indent, History) ['swg', 'swg'] for (TextAlign) ['swg', 'swg', 'swg', 'swg']
.. pull-quote:: Warning
NB: Although the buttonIcon attribute supports incoming HTML fragments, it is very dangerous to dynamically render arbitrary HTML on the website, because it is easy to cause XSS attack. Please make sure that the content of buttonIcon is trustworthy. Never assign user-submitted content to the buttonIcon attribute.
Extention: Image
Insert images with original width
Image.configure({ defaultWidth: null })
Insert images with width: 400px
Image.configure({ defaultWidth: 400 })
Dragging images (tests) adding button which allow to move images
Image.configure({ draggable: true })
Extention: Link
placeholder
Link.configure({ addLinkPlaceholder: 'add link', // placeholder for adding link editLinkPlaceholder: 'edit link' //
placeholder for editing link }), You can customize the extension. See [Custom
extensions](https://tiptap.dev/guide/custom-extensions). ### Example custom extension ```vue import CodeBlockLowlight
from '@tiptap/extension-code-block-lowlight'; import { Editor } from '@tiptap/core'; import { CommandButton } from
'element-tiptap-vue3-niyuta'; export default CodeBlockLowlight.extend({ addOptions() { return { ...this.parent?.(),
button({ editor, t }: { editor: Editor; t: (...args: any[]) => string }) { return { component: CommandButton, //
component of button which is used in menubar or bubblemenu (u can write your own component of button) componentProps: {
// props is used in component command: () => { // command on click button editor.commands.toggleCodeBlock(); }, //
WARNING buttonIcon attribute supports incoming HTML fragments, it is very dangerous to dynamically render arbitrary HTML
on the website, because it is easy to cause XSS attack. buttonIcon: '
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="16" width="16" fill="currentColor"> ... </svg>
', // your custom svg, if there is not uses default isActive: editor.isActive('codeBlock'), icon: 'code', // name of
element-tiptap icon (don't customized) tooltip: t('editor.extensions.CodeBlock.tooltip'), }, }; }, }; }, });
<el-tiptap ref="editor" />
this.$refs.editor.setContent(Content); can do reactive, but history brokes so add this function, to change content if
necessary.
Type: string
Default: ''
When editor is empty, placeholder will display.
<el-tiptap placeholder="Write something …" />
Type: object
for output json
Default: ''
Type: string
for output html
Default: ''
Editor's content
<el-tiptap :content="content" @onUpdate="onEditorUpdate" />
or Use 'v-model'
<el-tiptap v-model:content="content" />
Type: string
Default: 'html'
Output can be defined to 'html'
or 'json'
.
<el-tiptap output="json" />
further reading: prosemirror data structure
Type: boolean
Default: false
<el-tiptap readonly />
when readonly
is true
, editor is not editable.
Type: boolean
Default: false
<el-tiptap spellcheck> </el-tiptap>
Whether the content is spellcheck enabled.
Type: Object
Default: {}
<el-tiptap :editorProps="{handlePaste: ...}"> </el-tiptap>
about editorProps
Type: string | number
A string value with unit or a simple value (the default unit is px
):
<el-tiptap :width="700" height="100%"> </el-tiptap>
The above example will be converted to:
width: 700px;
height: 100%;
Type: boolean
Default: true
Enables or disables the display of the character counter.
Type: boolean
Default: true
Control if tooltips are shown when getting with mouse over the buttons from the toolbar.
Specifies the editor i18n language.
<template>
<el-tiptap :lang="en"></el-tiptap>
</template>
<script setup>
import { ElementTiptap } from 'element-tiptap-vue3-niyuta';
import en from 'element-tiptap-vue3-niyuta/lib/locales/en';
</script>
Available languages:
en
(default)zh
pl
by @FurtakMru
by @baitkulde
by @Thesicstarko
by @Hotbrainses
by @koaszh_tw
by @eric0324fr
by @LPABelgiumpt_br
by @valterleonardonl
by @Arne-Janhe
by @shovalPMSWelcome contribution.
<template>
<el-tiptap @onCreate="onCreate" />
</template>
<script setup>
/**
* the tiptap editor instance
* see https://tiptap.dev/api/editor
*/
const onCreate = ({ editor }) => {
// ...
}
</script>
The same as onCreate
Please see CONTRIBUTING for details.
FAQs
Rich-text editor build by baidu api and tiptap
The npm package element-tiptap-vue3-niyuta receives a total of 2 weekly downloads. As such, element-tiptap-vue3-niyuta popularity was classified as not popular.
We found that element-tiptap-vue3-niyuta demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.