Ehyiah/ux-quill

AssetMapper - question about controller.js

Closed this issue · 1 comments

Hi Matthieu,

Thanks for ux-quill, following the readme, i have some one question about AssetMapper installation.

I'm starting with AssetMapper, as i understood i needed to copy into quill-admin.js , the assets/dist/controller.js from your repository.
Is it normal to procede like that ? or normally there is a method to copy automatically controller.js into assets directory ?
Cause it worked doing like that or i missed something.

Merci encore pour la facilité d'install et d'usage. Le timing de release est top en plus 👍

Hello !
Thanks for using this bundle 🥇

I'm also quite new with AssetMapper component myself, but it seems very good !

To use it You just have to composer require to use this bundle when using AssetMapper. It is now working out of the box.

Exception is if you want to use it inside EasyAdminBundle with the QuillAdminField.
As you probably don't want to use default app entrypoint in easyadmin theming/js to avoid styling being used in easyadmin which could cause conflicts if your style is applied inside easyadmin pages.

So to use the QuillAdminField inside EasyAdminBundle :
Inside the quill-admin.js file you don't need to copy the assets/dist/controller.js it will be automatically loaded.
Simply put this inside the file as mentionned in the doc and nothing else (except if you need more custom JS or CSS to be loaded)

    // start the Stimulus application
    import './bootstrap';

And create the dedicated entry point in importmap.php

    'quill-admin' => [
        'path' => './assets/quill-admin.js',
        'entrypoint' => true,
    ],

the quill-admin.js file will be loaded if a QuillAdminField is used.

The installation process for easyadmin is not out of the box at the moment. But I will try to improve it to make it works out of the box as for the "normal" usage.

Hope this explaination is clear enough