Ehyiah / ux-quill

Bundle to use quill JS in symfony
MIT License
15 stars 4 forks source link

add custom module #31

Closed gerritwitkamp closed 4 months ago

gerritwitkamp commented 4 months ago

Hi, maybe I'm missing something; but how to add a custom module to the Quill editor? As far as I can see in the Stimulus Controller I cannot add a module to the modules object.

The only way I managed is by a work-a-round; using Quill.find to find the instances and append the module backwards (in the onload event).

Ehyiah commented 4 months ago

Hello,

Well, if you're talking about modules (like the toolbar or history modules (https://quilljs.com/docs/modules), indeed it's a missing feature, totally forget about them.

At the momet, you should probably try to override or extends the controller as for now nothing is possible inside the bundle configuration, but that can be of course a possible amelioration !

Will try to work on it ASAP.

gerritwitkamp commented 4 months ago

@Ehyiah Yeah right, I'm referring to the modules you mentioned. Would be a great addition to this bundle!

Ehyiah commented 4 months ago

HI ! I Just published the 2.0.4 tag.

You will find a way to easily add/customize some modules in a PHP-only way (like History module).

Some modules are more complicated and need custom javascript code (like Clipboard and Keyboard) to decide what behavior you want in each cases. So I implemented a way to easily extend default behavior like many other symfony UX bundles are doing. I added exemples in the updated readme for this part.

Hope you will like it ! :-)

Ehyiah commented 4 months ago

just need to release a 2.0.5 version as some files where not commited ! sorry for the inconvenience.

gerritwitkamp commented 4 months ago

@Ehyiah is it by design that my custom data-controller is placed as attribute on the quill-container AND hidden input?