Giter VIP home page Giter VIP logo

vuejs-medium-editor's Introduction

Hi, I'm Magak

I am a Software Developer with over 6 years of experience. I love Technology, Creativity, and Innovation, and I am interested in building solutions to solve real user problems. I love Communities and I'm a contributor to Open Source projects.

Experience

6+ Years JavaScript, Vue, Nuxt, Node, SQL
4+ Years React, TypeScript, Next, GraphQL, AWS, MongoDB
6+ Years PHP, Laravel
2+ Years Elixir, Phoenix, Adonis

vuejs-medium-editor's People

Contributors

azizelmadini avatar manuelgeek avatar teuunn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vuejs-medium-editor's Issues

v-model binding problem

prefill for default data is difference with v-model and i think this is very bad idea that v-model is not two way data binding specially when bind data on api calling
is any way to use v-model to two way binding?

Webpack: These relative modules were not found

* ../../assets/icons/image-align-expand-active.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44fd2dcf-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuejs-medium-editor/src/libs/Embed/ImagePosition.vue?vue&type=template&id=e1bd8472&
* ../../assets/icons/image-align-expand.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44fd2dcf-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuejs-medium-editor/src/libs/Embed/ImagePosition.vue?vue&type=template&id=e1bd8472&
* ../../assets/icons/image-align-full-active.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44fd2dcf-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuejs-medium-editor/src/libs/Embed/ImagePosition.vue?vue&type=template&id=e1bd8472&
* ../../assets/icons/image-align-full.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44fd2dcf-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuejs-medium-editor/src/libs/Embed/ImagePosition.vue?vue&type=template&id=e1bd8472&
* ../../assets/icons/image-align-normal-active.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44fd2dcf-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuejs-medium-editor/src/libs/Embed/ImagePosition.vue?vue&type=template&id=e1bd8472&
* ../../assets/icons/image-align-normal.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"44fd2dcf-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuejs-medium-editor/src/libs/Embed/ImagePosition.vue?vue&type=template&id=e1bd8472&

Insert image as first thing fails

Whenever an image is inserted as the first item, I get this error:

TypeError: Cannot read property 'getBoundingClientRect' of null
    at VueComponent.addImage (InsertImage.vue?8e1b:83)
    at VueComponent.inputFile (InsertImage.vue?8e1b:133)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at VueComponent.invoker (vue.runtime.esm.js?2b0e:2179)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at VueComponent.Vue.$emit (vue.runtime.esm.js?2b0e:3888)
    at VueComponent.emitFile (vue-upload-component.js?8019:1343)
    at VueComponent.update (vue-upload-component.js?8019:1323)
    at eval (vue-upload-component.js?8019:1355)

It looks like this line is the issue:

const currentPos = this.currentImg.getBoundingClientRect();

I got error when using package - vue3

Hi, thank you for providing this package.

I have set up all the configurations, but when running the app, I encountered an error that says
runtime-dom.esm-bundler.js:36 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'nextSibling')
along with many warnings.

Is there any specific configuration that needs to be set up for using this package with Vue3?

Also, do you have any sandbox or example that uses this package with Vue3?

Nice wrapper, but it seems to be broken.

After following all the installation steps, it seems to be working, but in the console, I got a lot of strange errors.

Right after loading the page:
image

Lead to this part:
image

When I type something inside the editor, I get another error.
image

This one leads me to this:
image

Inside this component, I have a button with this code:

back() {
    Inertia.get(route('articles.index'))
}

If I click, another error:
image

Leads to this:
image

here is the code:

import MediumEditor from 'vuejs-medium-editor'
import 'medium-editor/dist/css/medium-editor.css'
import 'vuejs-medium-editor/src/themes/default.css'

# template
<MediumEditor :options='options' v-model="form.content" :prefill='form.defaultValue' :hide-gist="false" :hideImage="false" :onChange="onChange" />
<button @click="back">Back</button>
# inside data(){}
coverPreview: null,
form: {
	content: null,
	defaultValue: `<h1><br /></h1>`,
},
options: {
	uploadUrl: "https://api.imgur.com/3/image",
	uploadUrlHeader: { 'Authorization': 'Client-ID a3tw6ve4wss3c' },
	file_input_name: "image",
	file_size: 1024 * 1024 * 10,
	imgur: true,
	buttonLabels: 'fontawesome',
	targetBlank: true,
	placeholder: {
		hideOnClick: false,
	},
	toolbar: {
		buttons: ["bold", "italic", "underline", "strikethrough", "h1", "h2", 'unorderedlist', 'orderedlist', "indent", "outdent", 'anchor', {
			name: 'image',
			action: 'image',
			aria: 'insert image from url',
			tagNames: ['img'],
			contentDefault: '<b>image</b>',
			contentFA: '<i class="fa fa-picture-o"></i>'
		}]
	},
}
I am using Laravel 8 with Inertia and Vue 3:

"vue-loader": "^17.0.1",
"@vue/compiler-sfc": "^3.2.45",
"@vuelidate/core": "^2.0.0",
"@inertiajs/inertia": "^0.11.0",
"@inertiajs/inertia-vue3": "^0.6.0",
"vue": "^3.2.31"
"vuejs-medium-editor": "^1.2.6"

Did anyone manage to use it? Every help is welcome 🧑🏾‍💻

Double click to edit

Hi i have trouble when i click in the writing section i have to double click to write inside and i get an error
image

BTW my prefill content is rtl blocked how can i solve this ?

ability to have a callback function to upload an image

It would be great if there was a way to have a callback function that could handle uploading the images instead of just a URL to post to. This way you could handle custom upload scenarios, like uploading to S3, where you can't just give a url to post to.

Slow

I attempted to play around with the the demo at https://manuelgeek.github.io/vuejs-medium-editor/

However, when I type fast or press delete/control-delete in freezes and starts cranking up my processor (fan turns on immidiately).

Also, following the setup example doesn't guide in the readme produces something vastly different to what's in the demo. Could you provide the code for the demo as an example?

Thanks for making this!

Feature request: add ability to embed videos

I wanted to suggest a feature request for the plugin: the ability to embed videos, whether embedded from YouTube or from a public folder. Right now, we can embed images, but I think having the ability to embed videos would be a great addition.

This feature would make the editor more versatile and user-friendly, allowing users to easily include video content in their text, regardless of the source. It would be a big win for anyone looking to create content-rich experiences with your plugin,

Thanks for your work on this plugin!

Add color option

First of all i would to thank the team for the great job,
So the question is there a way to add a color option

Image Not Loading?

Hey

Am I misunderstanding the instructions?
when I click the image icon here
image
I choose a picture from my local directory but nothing is rendered and the uploaded call back isn't triggered?


<template>
    <div>
        <medium-editor 
            v-model="content" 
            :options="options" 
            :onChange="onChange" 
            @uploaded="uploadCallback"
            :hideGist ="true"
             />
    </div>
</template>

<script>
import Editor from 'vuejs-medium-editor'

export default {
    name: 'ArticleWrite',
    data() {
        return {
            content: '',
            options: {
                toolbar: {
                    buttons: [
                        'bold',
                        'italic',
                        'underline',
                        'quote',
                        'h1',
                        'h2',
                        'h3',
                        //'pre',
                        'unorderedlist',
                        'orderedlist',
                        'justifyLeft',
                        'justifyCenter',
                        'justifyRight',
                        'anchor',
                        {
                                name: "image",
                                action: "image",
                                aria: "insert image from url",
                                tagNames: ["img"],
                                contentDefault: "<b>image</b>",
                                contentFA: '<i class="fa fa-picture-o"></i>'
                            }
                    ]
                },
            }
        }
    },
    components: {
        'medium-editor': Editor,
    },
    methods: {
        onChange() {
            console.log(this.content)
        },
        uploadCallback(url) {
            console.log('uploaded url', url)
        },
    },
}
</script>

<style scoped></style>

thanks in advance for any guidance

How to bind content in Nuxt.js properly?

Hi,

I use this plugin in Nuxt.js, and it works. But the problem I met is content binding is not correct.

<script>
export default {
  data() {
    return {
      content: "Hello, world!",
      editorOptions: {
        toolbar: {
          buttons: [
            "bold",
            "italic",
            "underline",
            "quote",
            "h1",
            "h2",
            "h3",
            "h4",
            "h5",
            "unorderedlist",
          ],
        },
      },
    };
  },
};
</script>

<template>
  <medium-editor
    :content="content"
    :options="editorOptions"
  />
</template>

According to the official sample, if I use :content="content" to bind, it doesn't work, which means Hello, world! won't show up on the web page, and content won't be changed according to my input. I tried :value="content", it's the same. So I have to try v-modal="content", a little better, content could be changed according to my input, but Hello, world! still won't show up when this page is just loaded.

Restore text after editing

I use medium editor in vue2 component.
<medium-editor :prefill="text2"
v-model="content"
:options="options"
:hideImage="true"
:hideGist ="true"
:hideVideo ="true"
:onChange="onChange"/>
where:
text = props,
text2 = text.

I need to cleaer and restore text by button click to 'text'.
When I try to make this.content = this.text or this.content = '' the 'content' still not refresh.
How can I do this.

insert image preview

I think it would be great if a preview of an image showed while uploading, maybe with a spinner to indicate that it was uploading?

Delete included content <p><br></p>

Hello
When you delete all content there are always these html tags left <p><br></p>.
Is there any way that when you delete everything, the content is completely empty?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.