michelson / Dante

Just another Medium wysiwyg editor clone
https://dante-editor.dev
2k stars 189 forks source link

Is that possible? Add JS dynamic charts. #269

Open OtavioRLopes opened 1 year ago

OtavioRLopes commented 1 year ago

Hey Michelson, how are you? I have done some dynamic charts JS code, and I'd like to display them in my page. Is that possible to edit the plus button and add another functionality on this?

michelson commented 1 year ago

Sure you can. check how the blocks work, I suggest that you check the code at https://github.com/michelson/Dante/tree/main/packages/dante3/src/blocks , you can add a new block and add it to the widgets prop: https://www.dante-editor.dev/posts/extensions

OtavioRLopes commented 1 year ago

Michelson, probably, it will be a real noob question.. But like the noob that I am, ok. Sorry for that. What I did so far: 1 - npx create-react-app my-app; 2 - cd my-app then -npm install dante3 3 - src/App.js: import DanteEditor from 'dante3'; import './App.css'; function App() { return (

); } export default App;

4 - The error: Attempted import error: 'dante3' does not contain a default export (imported as 'DanteEditor'). I also tried as: import { DanteEditor } from 'dante3';

Did I do something wrong?

So, sorry for my noob question, but would be amazing if you help me to start this! All I want is to create a index page, with the editor that I can write somethings and save them into my database..

Thank you!! Best regards

michelson commented 1 year ago

Hi, this codesandbox might help: https://codesandbox.io/s/dante-editor-3-tester-hzi3l

El vie, 26 may 2023 a las 13:02, Otávio R. Lopes @.***>) escribió:

Michelson, probably, it will be a real noob question.. But like the noob that I am, ok. Sorry for that. What I did so far: 1 - npx create-react-app my-app; 2 - cd my-app then -npm install dante3 3 - src/App.js: import DanteEditor from 'dante3'; import './App.css'; function App() { return (

<DanteEditor content={"Hello, world!"} />

); } export default App;

4 - The error: Attempted import error: 'dante3' does not contain a default export (imported as 'DanteEditor'). I also tried as: import { DanteEditor } from 'dante3';

Did I do something wrong?

So, sorry for my noob question, but would be amazing if you help me to start this! All I want is to create a index page, with the editor that I can write somethings and save them into my database..

Thank you!! Best regards

— Reply to this email directly, view it on GitHub https://github.com/michelson/Dante/issues/269#issuecomment-1564676637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAC5SFHJXHZPJ25RCXXEIDXIDO2BANCNFSM6AAAAAAYMN5SIQ . You are receiving this because you commented.Message ID: @.***>

OtavioRLopes commented 1 year ago

Hey Michael, unfortunately, the code box that you link, isn't initializing the editor either

OtavioRLopes commented 1 year ago

I found a lot of another ones hehehe thank you :)

michelson commented 1 year ago

I have updated the code sandboxt to the latest version and added the missing dependence, glad that it worked tho, let me know how it goes.

OtavioRLopes commented 1 year ago

I'm facing this errors.. Any sugestion, tip? I'm trying to initiate it, React app, npm start. Is that ok ? Thank you for your attention! error

michelson commented 1 year ago

https://codesandbox.io/s/dante-editor-3-tester-hzi3l

El sáb, 27 may 2023 a las 20:32, Otávio R. Lopes @.***>) escribió:

I'm facing this errors.. Any sugestion, tip? I'm trying to initiate it, React app, npm start. Is that ok ? Thank you for your attention! [image: error] https://user-images.githubusercontent.com/116897990/241455777-008f85f9-b8f2-4d6c-b1e9-1cac35792596.jpg

— Reply to this email directly, view it on GitHub https://github.com/michelson/Dante/issues/269#issuecomment-1565761868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAC5SC47VLCNN3GNTJSMRLXIKMJNANCNFSM6AAAAAAYMN5SIQ . You are receiving this because you commented.Message ID: @.***>

gitteroy commented 8 months ago

I have the same errors. Even after adding all the dependencies in https://codesandbox.io/s/dante-editor-3-tester-hzi3l. Seems like a common problem, any advice?

_ERROR in ./node_modules/dante3/package/esm/index.js 34:0-27 Module not found: Error: Can't resolve 'lowlight/lib/core' in '...\nodemodules\dante3\package\esm' Did you mean 'core.js'? BREAKING CHANGE: The request 'lowlight/lib/core' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

michelson commented 8 months ago

i'm not sure, I have the project running in several projects. Also I've tried the code sandbox and I see it working.

imageç

are you running this in nextjs project? which node version? which system?

gitteroy commented 8 months ago

I was running on Next and had those issues. However, I saw the sandbox is running very well so I started a fresh React app and copied all of your dependencies and code, but still ended up with that error above. Do u have or know any public React/JS projects that running Dante?

michelson commented 8 months ago

Use the codesandbox or check the repository itself which is a nextjs app

El sáb., 30 de diciembre de 2023 2:42 p. m., gitteroy < @.***> escribió:

I was running on Next, it had those issues so I started a fresh React app and copied all of your dependencies and code, but still ended up with that error above. Do u have or know any public React/JS projects that running Dante?

— Reply to this email directly, view it on GitHub https://github.com/michelson/Dante/issues/269#issuecomment-1872572126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAC5SFPIK2BL7J6WFT7YGLYMBHANAVCNFSM6AAAAAAYMN5SISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZSGU3TEMJSGY . You are receiving this because you commented.Message ID: @.***>

idea-notes commented 7 months ago

i'm not sure, I have the project running in several projects. Also I've tried the code sandbox and I see it working.

imageç

are you running this in nextjs project? which node version? which system?

I was running on Next and had those issues. However, I saw the sandbox is running very well so I started a fresh React app and copied all of your dependencies and code, but still ended up with that error above. Do u have or know any public React/JS projects that running Dante?

I have the same errors. Even after adding all the dependencies in https://codesandbox.io/s/dante-editor-3-tester-hzi3l. Seems like a common problem, any advice?

_ERROR in ./node_modules/dante3/package/esm/index.js 34:0-27 Module not found: Error: Can't resolve 'lowlight/lib/core' in '...\nodemodules\dante3\package\esm' Did you mean 'core.js'? BREAKING CHANGE: The request 'lowlight/lib/core' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

I have the same errors. Even after adding all the dependencies in https://codesandbox.io/s/dante-editor-3-tester-hzi3l. Seems like a common problem, any advice?

_ERROR in ./node_modules/dante3/package/esm/index.js 34:0-27 Module not found: Error: Can't resolve 'lowlight/lib/core' in '...\nodemodules\dante3\package\esm' Did you mean 'core.js'? BREAKING CHANGE: The request 'lowlight/lib/core' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

same problem, but without next js, only react js