calumk / editorjs-codecup

editorjs-codecup
9 stars 3 forks source link

Can't select language, alert appear #6

Closed belankus closed 2 months ago

belankus commented 5 months ago

I've installed codecup for editorJS using bun bun i @calumk/editorjs-codecup. this is my import line:

import editorjsCodecup from "@calumk/editorjs-codecup";

window.EJModules = {
    editorjsCodecup,
};

and on my editorJS instance i write the code as below:

const editor = new EditorJS({

    holder: "editorjs",
    // ...
    tools: {
         // ...
        code: EJModules.editorjsCodecup,
    },
   // ...
});

the appearance of tune block does not have selection language. when i clicked on plain on the tune block, it triggers alert

Screenshot from 2024-05-19 00-24-27

click on plain triggers an alert

alert

when i click OK it causes 502 bad gateway

bad gateway

i tried to search on block tune and find nothing

notfound

my console and networks tab is seems normal

Screenshot from 2024-05-19 00-52-22

it works fine with other tools, what things i've mistaken?

calumk commented 5 months ago

Hi Not sure why this is failing.

There is no longer a language select, because now a cdn is used to download the required language,

I just tested the repo and have no issues.

git clone https://github.com/calumk/editorjs-codecup.git

bun i

bunx serve

look at the examples/example.html

Does the example work without bugs?

keertyverma commented 2 months ago

I've encountered a similar issue with the @calumk/editorjs-codecup npm package. After integrating it into my Editor.js instance, the language selector list is missing from the tune block and the web editor's styles seem to be off.

image image

I have tested the example from the repository as suggested by @calumk

image

CDN Issue -> I cannot see the list of required languages downloaded by the CDN in my setup. It seems the CDN is not providing the necessary language files or they are not being accessed correctly.

Could you please provide guidance on how to resolve this issue or suggest any additional steps to troubleshoot it?

Also please update the demo video to include an example of Editor.js code block. This will better showcase the functionality of the plugin.

Thank you for your help!

calumk commented 2 months ago

Hi sorry for neglecting to update the documentation.

You should just type the language you want into the alert box. The languages are downloaded dynamically from the server, so if you type in "JavaScript" then it will download and use the JavaScript syntax.

Please see if this works, I will update the documentation and the video to make it clearer

I might try to make the text entry more visually appealing than the confirm entry if that is required

belankus commented 2 months ago

Thank you for your response, as per my problem solved, i close this issue.

calumk commented 2 months ago

@keertyverma Moved to issue #7