including library for cep in bolt
Hello, I am using CEP-bolt to build react app for premiere pro
I have a component, where I am trying to import Quill ( installModules: ["quill"])
import "quill/dist/quill.snow.css";
import Quill from "quill";
import { useCallback } from "react";
var toolbarOptions = [
[
"bold",
"italic",
"underline",
"clean",
{ size: ["small", false, "large", "huge"] },
{ align: [] },
{ color: [] },
{ background: [] },
{ font: [] },
{ list: "ordered" },
{ list: "bullet" },
],
["link", "image", "video"],
];
const Main = () => {
const wrapperRef = useCallback((wrapper) => {
if (wrapper == null) return;
wrapper.innerHTML = "";
const editor = document.createElement("div");
wrapper.append(editor);
alert("alerts");
const quill = new Quill(editor, {
theme: "snow",
modules: {
toolbar: {
container: toolbarOptions,
},
},
});
alert("doesn't alert");
}, []);
return <div id="container" ref={wrapperRef}></div>;
};
export default Main;
if to change to
import Quill from "quill";
it will work fine in brower, however doesn't work in premiere CEP panel, using alerts I have figured out that
Quill is loaded:
const quill = new Quill();
alert(Quill.toString()); //it will alert
the alert() will alert the function code, so that means it is loaded, however somehow doesn't work I was tring to wrap to try catch but it doesn't produce any errors
what can be problem here?
it seems the library is loaded, but doesn't produce anything, however in brower everything works fine
