Problem on upgrade an add on for javascript image editor

Hi, i have an addon for pixie image editor.

i’m upgrading the version of the editor and i’m not able to make it run.

The treviews version was a normal javascript, now i have 2 files pixie.es.js and pixie.umd.js

I tried importing them in this way :

Not sure if react is necessary, but i think is.

@NpmPackage(value = “react”, version = “18.2.0”)
@NpmPackage(value = “react-dom”, version = “18.2.0”)
@JavaScript(“./js/pixie.es.js”)
@JavaScript(“./js/pixie.umd.js”)
@JavaScript(“./js/pixieConnector.js”)
@Tag(“pixie-editor”)
public class PixieImageEditor extends Component implements HasSize, HasStyle {…

In the pixieConnector file i instantiate the editore like this.

        var pixie = new Pixie({
            // ENTER CONFIGURATION HERE
            selector: "#" + c.id,
            baseUrl: newBaseUrl,
            ui: {...........

at this point i get an error “Can’t find variable: Pixie”
Seems that the files are properly loaded into the browser, but the class Pixie is not found !

any Hint ?

Thanks

Did you import the class Pixie in your JavaScript file?

Hi Christophe, yes, the class is present into the pixie.es.js file.

at the end of the file . read

let Gn = ul;
Se(Gn, “defaultConfig”, Hf), Se(Gn, “version”, yy);
export {
Gn as Pixie
};

here the info on how to get started.

https://support.vebto.com/hc/articles/10/13/50/getting-started

there are two wais to use it, in Vanilla JS mode and in React JS

You need to import it in your JavaScript file

You mean in pixieConnector ?

Yes

Like here ( as an example) sortable-layout/sortable-layout/src/main/resources/META-INF/resources/frontend/sortableConnector.js at master · jcgueriaud1/sortable-layout · GitHub

Hi, thanks for the sample code.
Bye

Hi @faithful-emu , solved including the JS in this way.

import {Pixie} from ‘./pixie.es’;

Thanks again