How can I create and use unique custom_id for any element of laravel-grapesjs?

In laravel 8 app with “jd-dotlogics/laravel-grapesjs”: “^3.3.0”, I need to extend its functionality :

  1. To add new custom button at toolbar

  2. By clicking on this custom button to open JS prompt method

  3. If prompt method was closed with success to save entered value(external url) with unique id of selected
    element in db with request to server.

  4. For any element on the form I need some unique custom_id and sending saving request save unique custom_id/Entered value

Next time when editor is opened by manager request to db must be send and these Entered value created prior sessions
must be tied to any element by these unique custom_id. Can I create somehow these unique custom_id ?

Manually editing public/vendor/laravel-grapesjs/assets/editor.js file I made 3 first points(last without posting request to server).

I know usually it is supposed that this file is not edited manually, but I do not see any other way to implement it.

Unpacked version is 37 K lines of code, so I pasted it in :

Any ideas how can I create and use these unique custom_id ?


I need something like when html element is located on some element to assign unique custom_id = “parent_el_type_id=>parent_el_type_id=>this_el_type_id=>” - to be sure that this custom_id is unique

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.