Skip to main content
Hey Evgenii
Inspiring
January 7, 2024
Question

including library for cep in bolt

  • January 7, 2024
  • 1 reply
  • 541 views

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

This topic has been closed for replies.

1 reply

Mylenium
Legend
January 8, 2024

I'm pretty sure you'd need a lot more code to make this work in a CEP panel, be it just to check and remove unsave CSS and functions or even make the components speak to each other. A single unrenderable style could bomb this out or the panel not refreshing. CEP simply doesn't work like a browser or a web app. You could end up debugging every single internal function until you find the culprit, though.

 

Mylenium