Skip to content

Commit

Permalink
Merge pull request #406 from Leecason/fix/duplicate-use
Browse files Browse the repository at this point in the history
Fix/duplicate use
  • Loading branch information
Leecason authored Dec 17, 2021
2 parents 111fa15 + ac098d7 commit 87a3b9a
Show file tree
Hide file tree
Showing 95 changed files with 364 additions and 365 deletions.
37 changes: 20 additions & 17 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,33 @@
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/standard",
"@vue/typescript"
],
"extends": ["plugin:vue/essential", "@vue/standard", "@vue/typescript"],
"rules": {
"comma-dangle": ["error", "only-multiline"],
"semi": ["error", "always"],
"indent": ["error", 2, {
"SwitchCase": 1,
"VariableDeclarator": {
"var": 2,
"let": 2,
"const": 3
"indent": [
"error",
2,
{
"SwitchCase": 1,
"VariableDeclarator": {
"var": 2,
"let": 2,
"const": 3
}
}
}],
],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"no-multi-spaces": ["error", {
"exceptions": {
"VariableDeclarator": true
"no-multi-spaces": [
"error",
{
"exceptions": {
"VariableDeclarator": true
}
}
}],
"space-before-function-paren": ["error", "always"],
],
"space-before-function-paren": ["error", "never"],
"no-unused-vars": "off",
"camelcase": "off",
"@typescript-eslint/no-unused-vars": "error"
Expand Down
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"useTabs": false,
"tabWidth": 2,
"semi": true
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry "https://registry.yarnpkg.com"
7 changes: 2 additions & 5 deletions examples/views/AllExtensions.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<div class="el-tiptap-editor__wrapper">
<el-tiptap
:extensions="textExtensions"
content="Text Extensions"
/>
<el-tiptap :extensions="textExtensions" content="Text Extensions" />

<el-tiptap
:extensions="paragraphExtensions"
Expand Down Expand Up @@ -70,7 +67,7 @@ import 'codemirror/addon/selection/active-line.js'; // require active-line.js
import 'codemirror/addon/edit/closetag.js'; // autoCloseTags
export default {
data () {
data() {
return {
textExtensions: [
new Doc(),
Expand Down
10 changes: 4 additions & 6 deletions examples/views/BubbleMenu.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<div class="el-tiptap-editor__wrapper">
<el-tiptap
:extensions="extensions"
:content="content"
/>
<el-tiptap :extensions="extensions" :content="content" />
</div>
</template>

Expand Down Expand Up @@ -36,7 +33,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand Down Expand Up @@ -65,7 +62,8 @@ export default {
new History(),
],
content: '<h1>Bubble Menu</h1><p>Try to select some text here. There will popup a menu for some commands.</p><p>Pass a property <code>bubble: true</code> to extension is all you need to do.</p>',
content:
'<h1>Bubble Menu</h1><p>Try to select some text here. There will popup a menu for some commands.</p><p>Pass a property <code>bubble: true</code> to extension is all you need to do.</p>',
};
},
};
Expand Down
18 changes: 7 additions & 11 deletions examples/views/CustomMenubar.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<div class="el-tiptap-editor__wrapper">
<el-tiptap
:extensions="extensions"
:content="content1"
>
<el-tiptap :extensions="extensions" :content="content1">
<template #menubar="{ commands, isActive }">
<div class="menubar">
<el-button
Expand All @@ -23,10 +20,7 @@
</template>
</el-tiptap>

<el-tiptap
:extensions="extensions"
:content="content2"
/>
<el-tiptap :extensions="extensions" :content="content2" />
</div>
</template>

Expand Down Expand Up @@ -54,7 +48,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand All @@ -78,8 +72,10 @@ export default {
new TodoList(),
],
content1: '<p>You can customize the menubar (also bubble menu) with your design.</p>',
content2: '<p>The order in which you specify the extensions affects the order of the buttons.',
content1:
'<p>You can customize the menubar (also bubble menu) with your design.</p>',
content2:
'<p>The order in which you specify the extensions affects the order of the buttons.',
};
},
};
Expand Down
26 changes: 14 additions & 12 deletions examples/views/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand All @@ -66,46 +66,48 @@ export default {
],
editorProperties: {
editorProps: { // https://prosemirror.net/docs/ref/#view.EditorProps
handleKeyDown () {
editorProps: {
// https://prosemirror.net/docs/ref/#view.EditorProps
handleKeyDown() {
console.log('🚀EditorProps: Keydown');
},
handleTextInput () {
handleTextInput() {
console.log('🚀EditorProps: TextInput');
},
},
},
content: '<p><img src="https://i.ibb.co/4pJs2Lx/undraw-static-assets-rpm6.png" width="300"></p><p>Open <strong>Console</strong>, your action on the editor will be logged.</p>',
content:
'<p><img src="https://i.ibb.co/4pJs2Lx/undraw-static-assets-rpm6.png" width="300"></p><p>Open <strong>Console</strong>, your action on the editor will be logged.</p>',
};
},
methods: {
onInitEvent () {
onInitEvent() {
console.log('🔥init');
},
onTransactionEvent () {
onTransactionEvent() {
console.log('🔥transaction');
},
onFocusEvent () {
onFocusEvent() {
console.log('🔥focus');
},
onBlurEvent () {
onBlurEvent() {
console.log('🔥blur');
},
onPasteEvent () {
onPasteEvent() {
console.log('🔥paste');
},
onDropEvent () {
onDropEvent() {
console.log('🔥drop');
},
onUpdateEvent () {
onUpdateEvent() {
console.log('🔥update');
},
},
Expand Down
7 changes: 4 additions & 3 deletions examples/views/Output.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand All @@ -68,7 +68,8 @@ export default {
new History(),
],
content: '<p>The <code>output</code> prop: <strong>HTML or JSON</strong></p>',
content:
'<p>The <code>output</code> prop: <strong>HTML or JSON</strong></p>',
output: {
json: 'Update content to see changes',
Expand All @@ -78,7 +79,7 @@ export default {
},
methods: {
onUpdate (output, options) {
onUpdate(output, options) {
const { getJSON, getHTML } = options;
this.output.json = getJSON();
Expand Down
2 changes: 1 addition & 1 deletion examples/views/Placeholder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand Down
11 changes: 4 additions & 7 deletions examples/views/Readonly.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<template>
<div class="el-tiptap-editor__wrapper">
<el-tiptap
:extensions="extensions"
:content="content"
:readonly="true"
/>
<el-tiptap :extensions="extensions" :content="content" :readonly="true" />
</div>
</template>

Expand All @@ -28,7 +24,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand All @@ -48,7 +44,8 @@ export default {
new History(),
],
content: '<p>I\' m non-editable now. 😰</p><p></p><p>pass prop <code>readonly: true</code> to the editor.</p>',
content:
'<p>I\' m non-editable now. 😰</p><p></p><p>pass prop <code>readonly: true</code> to the editor.</p>',
};
},
};
Expand Down
5 changes: 3 additions & 2 deletions examples/views/Simple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import 'codemirror/addon/selection/active-line.js'; // require active-line.js
import 'codemirror/addon/edit/closetag.js'; // autoCloseTags
export default {
data () {
data() {
return {
extensions: [
new Doc(),
Expand Down Expand Up @@ -80,7 +80,8 @@ export default {
new History(),
],
content: '<h2 style="text-align: center;">Welcome To Element Tiptap Editor Demo</h2><p>🔥 <strong>Element Tiptap Editor </strong>🔥is a WYSIWYG rich-text editor using&nbsp; <a href="https://github.com/scrumpy/tiptap" target="_blank" ref="nofollow noopener noreferrer">tiptap</a>&nbsp;and <a href="https://github.com/ElemeFE/element" target="_blank" ref="nofollow noopener noreferrer">element-ui</a>&nbsp;for Vue.js <img src="https://i.ibb.co/nbRN3S2/undraw-upload-87y9.png" alt="" title="" height="200" data-display="right"> that\'s easy to use, friendly to developers, fully extensible and clean in design.</p><p></p><p style="text-align: right;">👉Click on the image to get started image features 👉</p><p></p><p>You can switch to <strong>Code View </strong>💻 mode and toggle <strong>Fullscreen</strong> 📺 in this demo.</p><p></p><p><strong>Got questions or need help or feature request?</strong></p><p>🚀 <strong>welcome to submit an <a href="https://github.com/Leecason/element-tiptap/issues" target="_blank" ref="nofollow noopener noreferrer">issue</a></strong> 😊</p><p>I\'m continuously working to add in new features.</p><p></p><blockquote><p>This demo is simple, switch tab for more features.</p><p>All demos source code: <a href="https://github.com/Leecason/element-tiptap/blob/master/examples/views/Index.vue" target="_blank" ref="nofollow noopener noreferrer">source code 🔗</a></p></blockquote>',
content:
'<h2 style="text-align: center;">Welcome To Element Tiptap Editor Demo</h2><p>🔥 <strong>Element Tiptap Editor </strong>🔥is a WYSIWYG rich-text editor using&nbsp; <a href="https://github.com/scrumpy/tiptap" target="_blank" ref="nofollow noopener noreferrer">tiptap</a>&nbsp;and <a href="https://github.com/ElemeFE/element" target="_blank" ref="nofollow noopener noreferrer">element-ui</a>&nbsp;for Vue.js <img src="https://i.ibb.co/nbRN3S2/undraw-upload-87y9.png" alt="" title="" height="200" data-display="right"> that\'s easy to use, friendly to developers, fully extensible and clean in design.</p><p></p><p style="text-align: right;">👉Click on the image to get started image features 👉</p><p></p><p>You can switch to <strong>Code View </strong>💻 mode and toggle <strong>Fullscreen</strong> 📺 in this demo.</p><p></p><p><strong>Got questions or need help or feature request?</strong></p><p>🚀 <strong>welcome to submit an <a href="https://github.com/Leecason/element-tiptap/issues" target="_blank" ref="nofollow noopener noreferrer">issue</a></strong> 😊</p><p>I\'m continuously working to add in new features.</p><p></p><blockquote><p>This demo is simple, switch tab for more features.</p><p>All demos source code: <a href="https://github.com/Leecason/element-tiptap/blob/master/examples/views/Index.vue" target="_blank" ref="nofollow noopener noreferrer">source code 🔗</a></p></blockquote>',
};
},
};
Expand Down
7 changes: 2 additions & 5 deletions examples/views/Title.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<div class="el-tiptap-editor__wrapper">
<el-tiptap
:extensions="extensions"
:content="content"
/>
<el-tiptap :extensions="extensions" :content="content" />
</div>
</template>

Expand All @@ -27,7 +24,7 @@ import {
} from 'element-tiptap';
export default {
data () {
data() {
return {
extensions: [
new Doc({ title: true }),
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"vue": "^2.0.0"
},
"resolutions": {
"prosemirror-model": "1.9.1"
"prosemirror-model": "1.9.1",
"prosemirror-tables": "1.0.0"
},
"bugs": {
"url": "https://github.com/Leecason/element-tiptap/issues"
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default () => [
},
];

function getConfig ({
function getConfig({
file,
format,
}) {
Expand Down
Loading

0 comments on commit 87a3b9a

Please sign in to comment.